ni wrote:
> On Apr 4, 7:28 am, "Ben Jones" <ben.jo...@xilinx.com> wrote:
>> "ni" <nbg2...@gmail.com> wrote in message
>>
>> news:[email protected]...
>>
>>> What I dont understand is SRL16 is a simple shift reister and the
>>> output of SRL16 is just like any other flipflop output with no
>>> combinational logic at the output.
>> Wrong.
>>
>> An SRL16 *functions* just like a simple shift register, but physically it is
>> a special configuration of a LUT primitive. The setup time and clock-to-out
>> time is very different from a FF primitive in the fabric. When you are doing
>> a high-speed design, you should always try to make the last stage of your
>> shift register pipeline use a dedicated FF. Most synthesis tools will do
>> this for your automatically if you just write a straightforward shift
>> register in RTL. No need to go instantiating things.
>>
>> -Ben-
>
> So what your are implying is that its advisable to write the code in
> the following way
> ---------------------------------------------------------------------------------------------------------------------------------------------
> PROCESS(clock,reset)
> begin
> if reset = '1' then
> en4 <= '0';
> elsif clock'event and clock ='1' then
> en4 <= en3;
> end if;
> end process;
>
> SR : SRL16 generic map
> (INIT => x"0000")
> port map (Q => en3,
> A0 => '0',
> A1 => '1',
> A2 => '0',
> A3 => '0',
> CLK => clock,
> D => input);
>
> ---------------------------------------------------------------------------------------------
> instead of
>
>
>
> SR : SRL16 generic map
> (INIT => x"0000")
> port map (Q => en4,
> A0 => '1',
> A1 => '1',
> A2 => '0',
> A3 => '0',
> CLK => clock,
> D => input);
> Is that right?
No, no--he's suggesting you write behavioral code, which infers the SRL
you would don't have to instantiate it. If you use Synplify, for
example, it will make the last stage of the delay line a packed flipflop
depending upon the timing requirements. So then you needn't worry about
what primitives are being used. You shouldn't instantiate primitives
unless completely necessary. It destroys clarity, maintainability, and
portability. This is an example from the Synplify help files that shows
how to make a byte-wide 4-cycle delay line:
entity srltest is
port ( inData: std_logic_vector(7 downto 0);
clk, en : in std_logic;
outStage : in integer range 3 downto 0;
outData: out std_logic_vector(7 downto 0)
);
end srltest;
architecture rtl of srltest is
type dataAryType is array(3 downto 0) of std_logic_vector(7 downto 0);
signal regBank : dataAryType;
begin
outData <= regBank(outStage);
process(clk, inData)
begin
if (clk'event and clk = '1') then
if (en='1') then
regBank <= (regBank(2 downto 0) & inData);
end if;
end if;
end process;
end rtl;
It's cleaner in Verilog, of course.
-Kevin