📄 tech_umc18.vhd
字号:
WEN : in std_logic; CEN : in std_logic; OEN : in std_logic ); end; architecture behavioral of umc18_syncram_ss is type mem is array(0 to (2**abits -1)) of std_logic_vector((dbits -1) downto 0); signal memarr : mem; attribute syn_ramstyle : string; attribute syn_ramstyle of memarr: signal is "block_ram"; signal ADR_l : std_logic_vector((abits -1) downto 0); signal DI_l : std_logic_vector((dbits -1) downto 0); signal WEN_l : std_logic; signal CEN_l : std_logic; signal DOUT_l : std_logic_vector((dbits -1) downto 0);begin input_latch : process(CK) begin if rising_edge(CK) then ADR_l <= ADR; DI_l <= DI; WEN_l <= WEN; CEN_l <= CEN; end if; end process; ram : process(ADR_l,DI_l,WEN_l,CEN_l,memarr) begin if CEN_l = '0' then if WEN_l = '0' then if not is_x(ADR_l) then memarr(conv_integer(unsigned(ADR_l))) <= DI_l; end if; end if; if not is_x(ADR_l) then DOUT_l <= memarr(conv_integer(unsigned(ADR_l))); else DOUT_l <= (others => 'X'); end if; end if; end process; DOUT <= DOUT_l when OEN = '0' else (others => 'Z');end;-- syncronous umc18 sramLIBRARY ieee;use IEEE.std_logic_1164.all;package tech_umc18_sim iscomponent umc18_syncram_ss generic ( abits : integer := 10; dbits : integer := 8 ); port ( ADR : in std_logic_vector((abits -1) downto 0); DI : in std_logic_vector((dbits -1) downto 0); DOUT : out std_logic_vector((dbits -1) downto 0); CK : in std_logic; WEN : in std_logic; CEN : in std_logic; OEN : in std_logic ); end component; -- syncronous umc18 dpramcomponent umc18_dpram_ss generic ( abits : integer := 8; dbits : integer := 32; words : integer := 256 ); port ( DI: in std_logic_vector (dbits -1 downto 0); RADR: in std_logic_vector (abits -1 downto 0); WADR: in std_logic_vector (abits -1 downto 0); REN,WEN : in std_logic; RCK,WCK : in std_logic; DOUT: out std_logic_vector (dbits -1 downto 0) );end component;end;-- Address, control and data signals latched on rising ME. -- Write enable (WEN) active low.library ieee;use IEEE.std_logic_1164.all;use work.tech_umc18_sim.all;entity R256X24M4 is port ( ADR : in std_logic_vector(7 downto 0); DI : in std_logic_vector(23 downto 0); DOUT : out std_logic_vector(23 downto 0); CK : in std_logic; WEN : in std_logic; CEN : in std_logic; OEN : in std_logic );end;architecture behavioral of R256X24M4 isbegin syncram0 : umc18_syncram_ss generic map ( abits => 8, dbits => 24) port map ( ADR => ADR, DI => DI, DOUT => DOUT, CK => CK, WEN => WEN, CEN => CEN, OEN => OEN);end behavioral;library ieee;use IEEE.std_logic_1164.all;use work.tech_umc18_sim.all;entity R256X25M4 is port ( ADR : in std_logic_vector(7 downto 0); DI : in std_logic_vector(24 downto 0); DOUT : out std_logic_vector(24 downto 0); CK : in std_logic; WEN : in std_logic; CEN : in std_logic; OEN : in std_logic );end;architecture behavioral of R256X25M4 isbegin syncram0 : umc18_syncram_ss generic map ( abits => 8, dbits => 25) port map ( ADR => ADR, DI => DI, DOUT => DOUT, CK => CK, WEN => WEN, CEN => CEN, OEN => OEN);end behavioral;library ieee;use IEEE.std_logic_1164.all;use work.tech_umc18_sim.all;entity R256X26M4 is port ( ADR : in std_logic_vector(7 downto 0); DI : in std_logic_vector(25 downto 0); DOUT : out std_logic_vector(25 downto 0); CK : in std_logic; WEN : in std_logic; CEN : in std_logic; OEN : in std_logic );end;architecture behavioral of R256X26M4 isbegin syncram0 : umc18_syncram_ss generic map ( abits => 8, dbits => 26) port map ( ADR => ADR, DI => DI, DOUT => DOUT, CK => CK, WEN => WEN, CEN => CEN, OEN => OEN);end behavioral;library ieee;use IEEE.std_logic_1164.all;use work.tech_umc18_sim.all;entity R1024X32M4 is port ( ADR : in std_logic_vector(9 downto 0); DI : in std_logic_vector(31 downto 0); DOUT : out std_logic_vector(31 downto 0); CK : in std_logic; WEN : in std_logic; CEN : in std_logic; OEN : in std_logic );end;architecture behavioral of R1024X32M4 isbegin syncram0 : umc18_syncram_ss generic map ( abits => 10, dbits => 32) port map ( ADR => ADR, DI => DI, DOUT => DOUT, CK => CK, WEN => WEN, CEN => CEN, OEN => OEN);end behavioral;library ieee;use IEEE.std_logic_1164.all;use work.tech_umc18_sim.all;entity R2048X32M8 is port ( ADR : in std_logic_vector(10 downto 0); DI : in std_logic_vector(31 downto 0); DOUT : out std_logic_vector(31 downto 0); CK : in std_logic; WEN : in std_logic; CEN : in std_logic; OEN : in std_logic );end;architecture behavioral of R2048X32M8 isbegin syncram0 : umc18_syncram_ss generic map ( abits => 11, dbits => 32) port map ( ADR => ADR, DI => DI, DOUT => DOUT, CK => CK, WEN => WEN, CEN => CEN, OEN => OEN);end behavioral;library ieee;use IEEE.std_logic_1164.all;use work.tech_umc18_sim.all;entity R256X28M4 is port ( ADR : in std_logic_vector(7 downto 0); DI : in std_logic_vector(27 downto 0); DOUT : out std_logic_vector(27 downto 0); CK : in std_logic; WEN : in std_logic; CEN : in std_logic; OEN : in std_logic );end;architecture behavioral of R256X28M4 isbegin syncram0 : umc18_syncram_ss generic map ( abits => 8, dbits => 28) port map ( ADR => ADR, DI => DI, DOUT => DOUT, CK => CK, WEN => WEN, CEN => CEN, OEN => OEN);end behavioral;LIBRARY ieee;use IEEE.std_logic_1164.all;use work.tech_umc18_sim.all;entity RF136X32M1 is port ( RCK : in std_logic; REN : in std_logic; RADR : in std_logic_vector(7 downto 0); WCK : in std_logic; WEN : in std_logic; WADR : in std_logic_vector(7 downto 0); DI : in std_logic_vector(31 downto 0); DOUT : out std_logic_vector(31 downto 0) ); end;architecture behav of RF136X32M1 isbegin dp0 : umc18_dpram_ss generic map (abits => 8, dbits => 32, words => 136) port map ( DI => DI, RADR => RADR, WADR => WADR, WEN => WEN, REN => REN, RCK => RCK, WCK => WCK, DOUT => DOUT);end;LIBRARY ieee;use IEEE.std_logic_1164.all;use work.tech_umc18_sim.all;entity RF168X32M1 is port ( RCK : in std_logic; REN : in std_logic; RADR : in std_logic_vector(7 downto 0); WCK : in std_logic; WEN : in std_logic; WADR : in std_logic_vector(7 downto 0); DI : in std_logic_vector(31 downto 0); DOUT : out std_logic_vector(31 downto 0) ); end;architecture behav of RF168X32M1 isbegin dp0 : umc18_dpram_ss generic map (abits => 8, dbits => 32, words => 168) port map ( DI => DI, RADR => RADR, WADR => WADR, WEN => WEN, REN => REN, RCK => RCK, WCK => WCK, DOUT => DOUT);end;-- simple gate modelslibrary IEEE;use IEEE.std_logic_1164.all;entity INVDL is port( A : in std_logic; Z : out std_logic); end;architecture rtl of INVDL is begin Z <= not A; end;library IEEE;use IEEE.std_logic_1164.all;entity AND2DL is port( A1, A2 : in std_logic; Z : out std_logic); end;architecture rtl of AND2DL is begin Z <= A1 and A2; end;library IEEE;use IEEE.std_logic_1164.all;entity OR2DL is port( A1, A2 : in std_logic; Z : out std_logic); end;architecture rtl of OR2DL is begin Z <= A1 or A2; end;library IEEE;use IEEE.std_logic_1164.all;entity EXOR2DL is port( A1, A2 : in std_logic; Z : out std_logic); end;architecture rtl of EXOR2DL is begin Z <= A1 xor A2; end;-- pragma translate_on-- component declarations from true tech libraryLIBRARY ieee;use IEEE.std_logic_1164.all;package tech_umc18_syn is component RF136X32M1 port ( RCK : in std_logic; REN : in std_logic; RADR : in std_logic_vector(7 downto 0); WCK : in std_logic; WEN : in std_logic; WADR : in std_logic_vector(7 downto 0); DI : in std_logic_vector(31 downto 0); DOUT : out std_logic_vector(31 downto 0) ); end component; component RF168X32M1 port ( RCK : in std_logic; REN : in std_logic; RADR : in std_logic_vector(7 downto 0); WCK : in std_logic; WEN : in std_logic; WADR : in std_logic_vector(7 downto 0); DI : in std_logic_vector(31 downto 0); DOUT : out std_logic_vector(31 downto 0) ); end component; component R256X24M4 port ( ADR : in std_logic_vector(7 downto 0); DI : in std_logic_vector(23 downto 0); DOUT : out std_logic_vector(23 downto 0); CK : in std_logic; WEN : in std_logic; CEN : in std_logic; OEN : in std_logic ); end component; component R256X25M4 port ( ADR : in std_logic_vector(7 downto 0); DI : in std_logic_vector(25 downto 0); DOUT : out std_logic_vector(25 downto 0); CK : in std_logic; WEN : in std_logic; CEN : in std_logic; OEN : in std_logic ); end component; component R256X26M4 port ( ADR : in std_logic_vector(7 downto 0); DI : in std_logic_vector(25 downto 0); DOUT : out std_logic_vector(25 downto 0); CK : in std_logic; WEN : in std_logic; CEN : in std_logic; OEN : in std_logic ); end component; component R1024X32M4 port ( ADR : in std_logic_vector(9 downto 0); DI : in std_logic_vector(31 downto 0); DOUT : out std_logic_vector(31 downto 0); CK : in std_logic;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -