including components, i.e. SRL16

Hi,

when I want to use a SRL16, I have to "include" the component in my entity like this:

component SRL16 port ( Q : out std_logic; -- SRL data output A0: in std_logic; -- Select[0] input A1 : in std_logic; -- Select[1] input A2 : in std_logic; -- Select[2] input A3 : in std_logic; -- Select[3] input CLK : in std_logic; -- Clock input D : in std_logic -- SRL data input ); end component;

Can I find templates for these component declarations somewhere? In the lib.pdf I can find only instantiation templates. Besides that, I can not use the generic map (INIT => X"0000")... How do I do it properly? Are there any include files for all the design elements?

regards, Benjamin

Reply to
Benjamin Menküc
Loading thread data ...

Uncomment the following lines which ISE should insert in the beginning of any VHDL file it creates when you ask it to create a new "VHDL module":

library UNISIM; use UNISIM.VComponents.all;

This should allow you to use all the primitives defined in the Libraries Guide.

-Jim

Reply to
Jim George

Benjamin,

You can simply include the UNISIM library which contains the component declarations and attributes (black box attributes) for all of our supported components. I have included a simple example below that shows the instantiation of two SRLC16E's and a MUXF5 to produce a dynamic addressed,

32-tap shift register. Also notice that I have included the generic map for INIT in my instantiation. This will be forwarded onto the PAR tools to initialize your SRLC16E primitives. This code was compiled by XST so I am unsure how other tools support passing the INIT attribute. Also note that for SRL16E's, you can generally infer them in your HDL much easier than instancing them.

Cheers... Mark Xilinx FAE

------------------------------------------------------------- library IEEE; use IEEE.STD_LOGIC_1164.ALL; use IEEE.STD_LOGIC_ARITH.ALL; use IEEE.STD_LOGIC_UNSIGNED.ALL;

library UNISIM; use UNISIM.VComponents.all;

entity srl16e_instance is PORT ( clk : in std_logic; ce : in std_logic; din : in std_logic; addr : in std_logic_vector(4 downto 0); dout : out std_logic ); end srl16e_instance;

architecture Behavioral of srl16e_instance is

signal srla : std_logic; -- output from U_SRL_LOW signal srlb : std_logic; -- output from U_SRL_HIGH signal srl_cascade : std_logic; -- cascade between LOW and HIGH

begin

u_SRL_LOW : SRLC16E generic map ( INIT => X"DEAD" ) port map ( CLK => clk, CE => ce, D => din, A0 => addr(0), A1 => addr(1), A2 => addr(2), A3 => addr(3), Q => srla, Q15 => srl_cascade );

u_SRL_HIGH : SRLC16E generic map ( INIT => X"BEEF" ) port map ( CLK => clk, CE => ce, D => srl_cascade, A0 => addr(0), A1 => addr(1), A2 => addr(2), A3 => addr(3), Q => srlb, Q15 => open );

mymux : MUXF5 port map ( I0 => srla, I1 => srlb, S => addr(4), O => dout );

end Behavioral;

Reply to
Mark Sasten

Libraries Guide is always a good place to start for component instantiation. There are some component templates also available in ISE under the little light style button.

If you want a simple shift then doing it in VHDL or Verilog is also easy. If write your code as the following style (VHDL shown), i.e. without a reset, most synthesisers will turn it into SRL16 based logic.

process(clk) begin if clk'event and clk='1' then

shift1 when I want to use a SRL16, I have to "include" the component in my entity

Reply to
John Adair

Hi Jim,

Thanks, that was it.

regards, Benjamin

Reply to
Benjamin Menküc

Yikes! I guess I don't know why you would write a shift register that way.

signal shift : std_logic_vector(n downto 0);

process(clk) begin if rising_edge(clk) then shift

Reply to
Duane Clark

I do when it's buses I am shifting. It is a single bit then I do use assignment and concatination.

John Adair Enterpo>> Libraries Guide is always a good place to start for component

Reply to
John Adair

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.