📄 tech_atc25.vhd
字号:
signal w1, w2, o1, o2 : std_logic;begin d1 <= di1 after 1 ns; d2 <= di2 after 1 ns; aa1 <= a1 after 1 ns; aa2 <= a2 after 1 ns; w1 <= re1 or we1; w2 <= re2 or we2; o1 <= oe1 and we1 and not re1; o2 <= oe2 and we2 and not re2; rp : process(w1, w2, aa1, aa2, d1, d2, o1, o2) subtype dword is std_logic_vector(dbits -1 downto 0); type dregtype is array (0 to words - 1) of DWord; variable rfd : dregtype; begin if w1 = '0' then rfd(conv_integer(unsigned(aa1)) mod words) := d1; end if; if w2 = '0' then rfd(conv_integer(unsigned(aa2)) mod words) := d2; end if; if o1 = '1' then if not (is_x (aa1) or ((aa1 = aa2) and (w1 = '0'))) then -- no write-through ! do1 <= rfd(conv_integer(unsigned(aa1)) mod words); else do1 <= (others => 'X'); end if; else do1 <= (others => 'Z'); end if; if o2 = '1' then if not (is_x (aa2) or ((aa2 = aa1) and (w2 = '0'))) then -- no write-through ! do2 <= rfd(conv_integer(unsigned(aa2)) mod words); else do2 <= (others => 'X'); end if; else do2 <= (others => 'Z'); end if; end process;end;-- package with common ram simulation modelsLIBRARY ieee;use IEEE.std_logic_1164.all;use work.leon_iface.all;package tech_atc25_sim is-- clocked address + enable, unlatched data and writecomponent atc25_syncram_sim generic ( abits : integer := 10; dbits : integer := 8 ); port ( a : in std_logic_vector((abits -1) downto 0); ce : in std_logic; i : in std_logic_vector((dbits -1) downto 0); o : out std_logic_vector((dbits -1) downto 0); csb : in std_logic; web : in std_logic; oeb : in std_logic ); end component;-- asynchronous 2-port ramcomponent atc25_2pram generic ( abits : integer := 8; dbits : integer := 32; words : integer := 256 ); port ( ra : in std_logic_vector (abits -1 downto 0); wa : in std_logic_vector (abits -1 downto 0); di : in std_logic_vector (dbits -1 downto 0); do : out std_logic_vector (dbits -1 downto 0); re : in std_logic; oe : in std_logic; we : in std_logic );end component;component atc25_dpram_sim generic ( abits : integer := 8; dbits : integer := 32; words : integer := 256 ); port ( a1 : in std_logic_vector (abits -1 downto 0); a2 : in std_logic_vector (abits -1 downto 0); di1 : in std_logic_vector (dbits -1 downto 0); di2 : in std_logic_vector (dbits -1 downto 0); do1 : out std_logic_vector (dbits -1 downto 0); do2 : out std_logic_vector (dbits -1 downto 0); re1 : in std_logic; re2 : in std_logic; oe1 : in std_logic; oe2 : in std_logic; we1 : in std_logic; we2 : in std_logic );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_atc25_sim.all;entity RAM_256x26 is port ( a : in std_logic_vector(7 downto 0); i : in std_logic_vector(25 downto 0); o : out std_logic_vector(25 downto 0); ce, csb, oeb, web : in std_logic );end;architecture behavioral of RAM_256x26 isbegin syncram0 : atc25_syncram_sim generic map ( abits => 8, dbits => 26) port map ( a, ce, i, o, csb, web, oeb);end behavioral;library ieee;use IEEE.std_logic_1164.all;use work.tech_atc25_sim.all;entity RAM_256x28 is port ( a : in std_logic_vector(7 downto 0); i : in std_logic_vector(27 downto 0); o : out std_logic_vector(27 downto 0); ce, csb, oeb, web : in std_logic );end;architecture behavioral of RAM_256x28 isbegin syncram0 : atc25_syncram_sim generic map ( abits => 8, dbits => 28) port map ( a, ce, i, o, csb, web, oeb);end behavioral;library ieee;use IEEE.std_logic_1164.all;use work.tech_atc25_sim.all;entity RAM_256x30 is port ( a : in std_logic_vector(7 downto 0); i : in std_logic_vector(29 downto 0); o : out std_logic_vector(29 downto 0); ce, csb, oeb, web : in std_logic );end;architecture behavioral of RAM_256x30 isbegin syncram0 : atc25_syncram_sim generic map ( abits => 8, dbits => 30) port map ( a, ce, i, o, csb, web, oeb);end behavioral;library ieee;use IEEE.std_logic_1164.all;use work.tech_atc25_sim.all;entity RAM_512x28 is port ( a : in std_logic_vector(8 downto 0); i : in std_logic_vector(27 downto 0); o : out std_logic_vector(27 downto 0); ce, csb, oeb, web : in std_logic );end;architecture behavioral of RAM_512x28 isbegin syncram0 : atc25_syncram_sim generic map ( abits => 9, dbits => 28) port map ( a, ce, i, o, csb, web, oeb);end behavioral;library ieee;use IEEE.std_logic_1164.all;use work.tech_atc25_sim.all;entity RAM_512x30 is port ( a : in std_logic_vector(8 downto 0); i : in std_logic_vector(29 downto 0); o : out std_logic_vector(29 downto 0); ce, csb, oeb, web : in std_logic );end;architecture behavioral of RAM_512x30 isbegin syncram0 : atc25_syncram_sim generic map ( abits => 9, dbits => 30) port map ( a, ce, i, o, csb, web, oeb);end behavioral;library ieee;use IEEE.std_logic_1164.all;use work.tech_atc25_sim.all;entity RAM_512x32 is port ( a : in std_logic_vector(8 downto 0); i : in std_logic_vector(31 downto 0); o : out std_logic_vector(31 downto 0); ce, csb, oeb, web : in std_logic );end;architecture behavioral of RAM_512x32 isbegin syncram0 : atc25_syncram_sim generic map ( abits => 9, dbits => 32) port map ( a, ce, i, o, csb, web, oeb);end behavioral;library ieee;use IEEE.std_logic_1164.all;use work.tech_atc25_sim.all;entity RAM_1024x32 is port ( a : in std_logic_vector(9 downto 0); i : in std_logic_vector(31 downto 0); o : out std_logic_vector(31 downto 0); ce, csb, oeb, web : in std_logic );end;architecture behavioral of RAM_1024x32 isbegin syncram0 : atc25_syncram_sim generic map ( abits => 10, dbits => 32) port map ( a, ce, i, o, csb, web, oeb);end behavioral;library ieee;use IEEE.std_logic_1164.all;use work.tech_atc25_sim.all;entity RAM_2048x32 is port ( a : in std_logic_vector(10 downto 0); i : in std_logic_vector(31 downto 0); o : out std_logic_vector(31 downto 0); ce, csb, oeb, web : in std_logic );end;architecture behavioral of RAM_2048x32 isbegin syncram0 : atc25_syncram_sim generic map ( abits => 11, dbits => 32) port map ( a, ce, i, o, csb, web, oeb);end behavioral;LIBRARY ieee;use IEEE.std_logic_1164.all;use work.tech_atc25_sim.all;entity RAM2P_16X32 is port ( RA, WA : in std_logic_vector(3 downto 0); DI : in std_logic_vector(31 downto 0); DO : out std_logic_vector(31 downto 0); REB, OEB, WEB : in std_logic );end;architecture behav of RAM2P_16X32 isbegin dp0 : atc25_2pram generic map (abits => 4, dbits => 32, words => 16) port map (ra, wa, di, do, reb, oeb, web);end;LIBRARY ieee;use IEEE.std_logic_1164.all;use work.tech_atc25_sim.all;entity RAM2P_136X32 is port ( RA, WA : in std_logic_vector(7 downto 0); DI : in std_logic_vector(31 downto 0); DO : out std_logic_vector(31 downto 0); REB, OEB, WEB : in std_logic );end;architecture behav of RAM2P_136X32 isbegin dp0 : atc25_2pram generic map (abits => 8, dbits => 32, words => 136) port map (ra, wa, di, do, reb, oeb, web);end;LIBRARY ieee;use IEEE.std_logic_1164.all;use work.tech_atc25_sim.all;entity RAM2P_168X32 is port ( RA, WA : in std_logic_vector(7 downto 0); DI : in std_logic_vector(31 downto 0); DO : out std_logic_vector(31 downto 0); REB, OEB, WEB : in std_logic );end;architecture behav of RAM2P_168X32 isbegin dp0 : atc25_2pram generic map (abits => 8, dbits => 32, words => 168) port map (ra, wa, di, do, reb, oeb, web);end;LIBRARY ieee;use IEEE.std_logic_1164.all;use work.tech_atc25_sim.all;entity DPRAM_256x26 is port (A1 : IN std_logic_vector(7 DOWNTO 0); A2 : IN std_logic_vector(7 DOWNTO 0); CSB1 : IN std_logic; CSB2 : IN std_logic; WEB1 : IN std_logic; WEB2 : IN std_logic; OE1 : IN std_logic; OE2 : IN std_logic; I1 : IN std_logic_vector(25 downto 0); I2 : IN std_logic_vector(25 downto 0); O1 : OUT std_logic_vector(25 downto 0); O2 : OUT std_logic_vector(25 downto 0));end;architecture behav of DPRAM_256x26 isbegin dp0 : atc25_dpram_sim generic map (abits => 8, dbits => 26, words => 256) port map (a1, a2, i1, i2, o1, o2, csb1, csb2, oe1, oe2, web1, web2);end;LIBRARY ieee;use IEEE.std_logic_1164.all;use work.tech_atc25_sim.all;entity DPRAM_256x28 is port (A1 : IN std_logic_vector(7 DOWNTO 0); A2 : IN std_logic_vector(7 DOWNTO 0); CSB1 : IN std_logic; CSB2 : IN std_logic; WEB1 : IN std_logic; WEB2 : IN std_logic; OE1 : IN std_logic; OE2 : IN std_logic; I1 : IN std_logic_vector(27 downto 0); I2 : IN std_logic_vector(27 downto 0); O1 : OUT std_logic_vector(27 downto 0); O2 : OUT std_logic_vector(27 downto 0));end;architecture behav of DPRAM_256x28 isbegin dp0 : atc25_dpram_sim generic map (abits => 8, dbits => 28, words => 256) port map (a1, a2, i1, i2, o1, o2, csb1, csb2, oe1, oe2, web1, web2);end;LIBRARY ieee;use IEEE.std_logic_1164.all;use work.tech_atc25_sim.all;entity DPRAM_256x30 is port (A1 : IN std_logic_vector(7 DOWNTO 0); A2 : IN std_logic_vector(7 DOWNTO 0); CSB1 : IN std_logic; CSB2 : IN std_logic; WEB1 : IN std_logic; WEB2 : IN std_logic; OE1 : IN std_logic; OE2 : IN std_logic; I1 : IN std_logic_vector(29 downto 0); I2 : IN std_logic_vector(29 downto 0); O1 : OUT std_logic_vector(29 downto 0); O2 : OUT std_logic_vector(29 downto 0));end;architecture behav of DPRAM_256x30 isbegin dp0 : atc25_dpram_sim generic map (abits => 8, dbits => 30, words => 256) port map (a1, a2, i1, i2, o1, o2, csb1, csb2, oe1, oe2, web1, web2);end;LIBRARY ieee;use IEEE.std_logic_1164.all;use work.tech_atc25_sim.all;entity DPRAM_256x32 is port (A1 : IN std_logic_vector(7 DOWNTO 0); A2 : IN std_logic_vector(7 DOWNTO 0); CSB1 : IN std_logic; CSB2 : IN std_logic; WEB1 : IN std_logic; WEB2 : IN std_logic; OE1 : IN std_logic; OE2 : IN std_logic; I1 : IN std_logic_vector(31 downto 0); I2 : IN std_logic_vector(31 downto 0); O1 : OUT std_logic_vector(31 downto 0); O2 : OUT std_logic_vector(31 downto 0));end;architecture behav of DPRAM_256x32 isbegin dp0 : atc25_dpram_sim generic map (abits => 8, dbits => 32, words => 256) port map (a1, a2, i1, i2, o1, o2, csb1, csb2, oe1, oe2, web1, web2);end;LIBRARY ieee;use IEEE.std_logic_1164.all;use work.tech_atc25_sim.all;entity DPRAM_512x28 is port (A1 : IN std_logic_vector(8 DOWNTO 0); A2 : IN std_logic_vector(8 DOWNTO 0); CSB1 : IN std_logic; CSB2 : IN std_logic; WEB1 : IN std_logic; WEB2 : IN std_logic; OE1 : IN std_logic; OE2 : IN std_logic; I1 : IN std_logic_vector(27 downto 0); I2 : IN std_logic_vector(27 downto 0); O1 : OUT std_logic_vector(27 downto 0); O2 : OUT std_logic_vector(27 downto 0));end;architecture behav of DPRAM_512x28 isbegin dp0 : atc25_dpram_sim generic map (abits => 9, dbits => 28, words => 512) port map (a1, a2, i1, i2, o1, o2, csb1, csb2, oe1, oe2, web1, web2);end;LIBRARY ieee;use IEEE.std_logic_1164.all;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -