📄 xilinx_simprims.vhd
字号:
WE : in std_ulogic; SSR : in std_ulogic );end;architecture behav of ramb16_sx isbegin rp : process(clk) subtype dword is std_logic_vector(dbits-1 downto 0); type dregtype is array (0 to 2**abits -1) of DWord; variable rfd : dregtype; begin if rising_edge(clk) and not is_x (addr) then if en = '1' then do <= rfd(to_integer(unsigned(addr))); if we = '1' then rfd(to_integer(unsigned(addr))) := di; end if; end if; end if; end process;end;library ieee;use ieee.std_logic_1164.all;use ieee.numeric_std.all;entity ram16_sx_sx is generic ( abits : integer := 10; dbits : integer := 8 ); port ( DOA : out std_logic_vector (dbits-1 downto 0); DOB : out std_logic_vector (dbits-1 downto 0); ADDRA : in std_logic_vector (abits-1 downto 0); CLKA : in std_ulogic; DIA : in std_logic_vector (dbits-1 downto 0); ENA : in std_ulogic; WEA : in std_ulogic; ADDRB : in std_logic_vector (abits-1 downto 0); CLKB : in std_ulogic; DIB : in std_logic_vector (dbits-1 downto 0); ENB : in std_ulogic; WEB : in std_ulogic );end;architecture behav of ram16_sx_sx is signal async : std_ulogic := '0';begin ramproc : process(clka, clkb) subtype dword is std_logic_vector(dbits-1 downto 0); type dregtype is array (0 to 2**abits -1) of DWord; variable rfd : dregtype; begin if rising_edge(clka) and not is_x (addra) then if ena = '1' then if wea = '1' then rfd(to_integer(unsigned(addra))) := dia; end if; doa <= rfd(to_integer(unsigned(addra))); end if; end if; if rising_edge(clkb) and not is_x (addrb) then if enb = '1' then if web = '1' then rfd(to_integer(unsigned(addrb))) := dib; end if; dob <= rfd(to_integer(unsigned(addrb))); end if; end if; end process; end;library ieee;use ieee.std_logic_1164.all;entity BSCAN_VIRTEX is port (CAPTURE : out STD_ULOGIC; DRCK1 : out STD_ULOGIC; DRCK2 : out STD_ULOGIC; RESET : out STD_ULOGIC; SEL1 : out STD_ULOGIC; SEL2 : out STD_ULOGIC; SHIFT : out STD_ULOGIC; TDI : out STD_ULOGIC; UPDATE : out STD_ULOGIC; TDO1 : in STD_ULOGIC; TDO2 : in STD_ULOGIC);end;architecture behav of BSCAN_VIRTEX isbegin CAPTURE <= '0'; DRCK1 <= '0'; DRCK2 <= '0'; RESET <= '0'; SEL1 <= '0'; SEL2 <= '0'; SHIFT <= '0'; TDI <= '0'; UPDATE <= '0';end;library ieee;use ieee.std_logic_1164.all;entity BSCAN_VIRTEX2 is port (CAPTURE : out STD_ULOGIC; DRCK1 : out STD_ULOGIC; DRCK2 : out STD_ULOGIC; RESET : out STD_ULOGIC; SEL1 : out STD_ULOGIC; SEL2 : out STD_ULOGIC; SHIFT : out STD_ULOGIC; TDI : out STD_ULOGIC; UPDATE : out STD_ULOGIC; TDO1 : in STD_ULOGIC; TDO2 : in STD_ULOGIC);end;architecture behav of BSCAN_VIRTEX2 isbegin CAPTURE <= '0'; DRCK1 <= '0'; DRCK2 <= '0'; RESET <= '0'; SEL1 <= '0'; SEL2 <= '0'; SHIFT <= '0'; TDI <= '0'; UPDATE <= '0';end;library ieee;use ieee.std_logic_1164.all;entity BSCAN_VIRTEX4 is generic( JTAG_CHAIN : integer := 1 ); port( CAPTURE : out std_ulogic ; DRCK : out std_ulogic ; RESET : out std_ulogic ; SEL : out std_ulogic ; SHIFT : out std_ulogic ; TDI : out std_ulogic ; UPDATE : out std_ulogic ; TDO : in std_ulogic );end BSCAN_VIRTEX4;architecture behav of BSCAN_VIRTEX4 isbegin CAPTURE <= '0'; DRCK <= '0'; RESET <= '0'; SEL <= '0'; SHIFT <= '0'; TDI <= '0'; UPDATE <= '0';end;library ieee;use ieee.std_logic_1164.all;entity BSCAN_VIRTEX5 is generic( JTAG_CHAIN : integer := 1 ); port( CAPTURE : out std_ulogic ; DRCK : out std_ulogic ; RESET : out std_ulogic ; SEL : out std_ulogic ; SHIFT : out std_ulogic ; TDI : out std_ulogic ; UPDATE : out std_ulogic ; TDO : in std_ulogic );end BSCAN_VIRTEX5;architecture behav of BSCAN_VIRTEX5 isbegin CAPTURE <= '0'; DRCK <= '0'; RESET <= '0'; SEL <= '0'; SHIFT <= '0'; TDI <= '0'; UPDATE <= '0';end;library ieee;use ieee.std_logic_1164.all;entity BSCAN_SPARTAN3 is port (CAPTURE : out STD_ULOGIC; DRCK1 : out STD_ULOGIC; DRCK2 : out STD_ULOGIC; RESET : out STD_ULOGIC; SEL1 : out STD_ULOGIC; SEL2 : out STD_ULOGIC; SHIFT : out STD_ULOGIC; TDI : out STD_ULOGIC; UPDATE : out STD_ULOGIC; TDO1 : in STD_ULOGIC; TDO2 : in STD_ULOGIC);end;architecture behav of BSCAN_SPARTAN3 isbegin CAPTURE <= '0'; DRCK1 <= '0'; DRCK2 <= '0'; RESET <= '0'; SEL1 <= '0'; SEL2 <= '0'; SHIFT <= '0'; TDI <= '0'; UPDATE <= '0';end;library ieee; use ieee.std_logic_1164.all;entity BUFGMUX is port (O : out std_logic; I0, I1, S : in std_logic); end;architecture beh of BUFGMUX isbegin o <= to_X01(I0) when to_X01(S) = '0' else I1; end;library ieee; use ieee.std_logic_1164.all;entity BUFG is port (O : out std_logic; I : in std_logic); end;architecture beh of BUFG is begin o <= to_X01(i); end;library ieee; use ieee.std_logic_1164.all;entity BUFGP is port (O : out std_logic; I : in std_logic); end;architecture beh of BUFGP is begin o <= to_X01(i); end;library ieee; use ieee.std_logic_1164.all;entity BUFGDLL is port (O : out std_logic; I : in std_logic); end;architecture beh of BUFGDLL is begin o <= to_X01(i); end;library ieee; use ieee.std_logic_1164.all;entity IBUFG is generic ( CAPACITANCE : string := "DONT_CARE"; IOSTANDARD : string := "LVCMOS25"); port (O : out std_logic; I : in std_logic); end;architecture beh of IBUFG is begin o <= to_X01(i) after 1 ns; end;library ieee; use ieee.std_logic_1164.all;entity IBUF is generic ( CAPACITANCE : string := "DONT_CARE"; IOSTANDARD : string := "LVCMOS25"); port (O : out std_logic; I : in std_logic); end;architecture beh of IBUF is begin o <= to_X01(i) after 1 ns; end;library ieee;use ieee.std_logic_1164.all;entity OBUF is generic ( CAPACITANCE : string := "DONT_CARE"; DRIVE : integer := 12; IOSTANDARD : string := "LVCMOS25"; SLEW : string := "SLOW"); port (O : out std_ulogic; I : in std_ulogic); end;architecture beh of OBUF isbegin o <= to_X01(i) after 2 ns when slew = "SLOW" else to_X01(i) after 1 ns; end;library ieee;use ieee.std_logic_1164.all;entity IOBUF is generic ( CAPACITANCE : string := "DONT_CARE"; DRIVE : integer := 12; IOSTANDARD : string := "LVCMOS25"; SLEW : string := "SLOW"); port ( O : out std_ulogic; IO : inout std_logic; I, T : in std_ulogic);end;architecture beh of IOBUF isbegin io <= 'X' after 2 ns when to_X01(t) = 'X' else I after 2 ns when (to_X01(t) = '0') else 'Z' after 2 ns when to_X01(t) = '1'; o <= to_X01(io) after 1 ns;end;library ieee;use ieee.std_logic_1164.all;entity OBUFT is generic ( CAPACITANCE : string := "DONT_CARE"; DRIVE : integer := 12; IOSTANDARD : string := "LVCMOS25"; SLEW : string := "SLOW"); port ( O : out std_ulogic; I, T : in std_ulogic);end;architecture beh of OBUFT isbegin o <= I after 2 ns when to_X01(t) = '0' else 'Z' after 2 ns when to_X01(t) = '1' else 'X' after 2 ns ;end;library ieee; use ieee.std_logic_1164.all;entity IBUFDS is generic ( CAPACITANCE : string := "DONT_CARE"; DIFF_TERM : boolean := FALSE; IBUF_DELAY_VALUE : string := "0"; IFD_DELAY_VALUE : string := "AUTO"; IOSTANDARD : string := "DEFAULT"); port (O : out std_logic; I, IB : in std_logic); end;architecture beh of IBUFDS issignal old : std_ulogic;begin old <= '1' after 1 ns when (to_X01(I) = '1') and (to_X01(IB) = '0') else '0' after 1 ns when (to_X01(I) = '0') and (to_X01(IB) = '1') else old; o <= old;end;library ieee; use ieee.std_logic_1164.all;entity IBUFDS_LVDS_25 is port (O : out std_logic; I, IB : in std_logic); end;architecture beh of IBUFDS_LVDS_25 issignal old : std_ulogic;begin old <= '1' after 1 ns when (to_X01(I) = '1') and (to_X01(IB) = '0') else '0' after 1 ns when (to_X01(I) = '0') and (to_X01(IB) = '1') else old; o <= old;end;library ieee; use ieee.std_logic_1164.all;entity IBUFDS_LVDS_33 is port (O : out std_logic; I, IB : in std_logic); end;architecture beh of IBUFDS_LVDS_33 issignal old : std_ulogic;begin old <= '1' after 1 ns when (to_X01(I) = '1') and (to_X01(IB) = '0') else '0' after 1 ns when (to_X01(I) = '0') and (to_X01(IB) = '1') else old; o <= old;end;library ieee; use ieee.std_logic_1164.all;entity IBUFGDS_LVDS_25 is port (O : out std_logic; I, IB : in std_logic); end;architecture beh of IBUFGDS_LVDS_25 issignal old : std_ulogic;begin old <= '1' after 1 ns when (to_X01(I) = '1') and (to_X01(IB) = '0') else '0' after 1 ns when (to_X01(I) = '0') and (to_X01(IB) = '1') else old; o <= old;end;library ieee; use ieee.std_logic_1164.all;entity IBUFGDS_LVDS_33 is port (O : out std_logic; I, IB : in std_logic); end;architecture beh of IBUFGDS_LVDS_33 issignal old : std_ulogic;begin old <= '1' after 1 ns when (to_X01(I) = '1') and (to_X01(IB) = '0') else '0' after 1 ns when (to_X01(I) = '0') and (to_X01(IB) = '1') else old; o <= old;end;library ieee; use ieee.std_logic_1164.all;entity IBUFGDS is generic( CAPACITANCE : string := "DONT_CARE"; DIFF_TERM : boolean := FALSE; IBUF_DELAY_VALUE : string := "0"; IOSTANDARD : string := "DEFAULT"); port (O : out std_logic; I, IB : in std_logic); end;architecture beh of IBUFGDS issignal old : std_ulogic;begin old <= '1' after 1 ns when (to_X01(I) = '1') and (to_X01(IB) = '0') else '0' after 1 ns when (to_X01(I) = '0') and (to_X01(IB) = '1') else old; o <= old;end;library ieee; use ieee.std_logic_1164.all;entity OBUFDS_LVDS_25 is port (O, OB : out std_ulogic; I : in std_ulogic); end;architecture beh of OBUFDS_LVDS_25 isbegin o <= to_X01(i) after 1 ns; ob <= not to_X01(i) after 1 ns;end;library ieee; use ieee.std_logic_1164.all;entity OBUFDS_LVDS_33 is port (O, OB : out std_ulogic; I : in std_ulogic); end;architecture beh of OBUFDS_LVDS_33 isbegin o <= to_X01(i) after 1 ns; ob <= not to_X01(i) after 1 ns;end;----- CELL BUFGCE -----library IEEE;use IEEE.STD_LOGIC_1164.all;--library UNISIM;--use UNISIM.VCOMPONENTS.all;entity BUFGCE is port( O : out STD_ULOGIC; CE: in STD_ULOGIC; I : in STD_ULOGIC );end BUFGCE;architecture BUFGCE_V of BUFGCE is signal NCE : STD_ULOGIC := 'X'; signal GND : STD_ULOGIC := '0';component BUFGMUX port (O : out std_logic; I0, I1, S : in std_logic); end component; begin B1 : BUFGMUX port map ( I0 => I, I1 => GND, O =>O, s =>NCE);-- I1 : INV-- port map (-- I => CE,-- O => NCE); nCE <= not CE; end BUFGCE_V;----- CELL DCM ---------- dcm_clock_divide_by_2 -----library IEEE;use IEEE.STD_LOGIC_1164.all;entity dcm_clock_divide_by_2 is port( clock_out : out std_ulogic := '0'; clock : in std_ulogic; clock_type : in integer; rst : in std_ulogic );end dcm_clock_divide_by_2;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -