📄 tech_atc25.vhd
字号:
use work.tech_atc25_sim.all;entity DPRAM_512x30 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(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_512x30 isbegin dp0 : atc25_dpram_sim generic map (abits => 9, dbits => 30, 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;use work.tech_atc25_sim.all;entity DPRAM_512x32 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(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_512x32 isbegin dp0 : atc25_dpram_sim generic map (abits => 9, dbits => 32, words => 512) port map (a1, a2, i1, i2, o1, o2, csb1, csb2, oe1, oe2, web1, web2);end;-- pragma translate_on-- component declarations from true tech libraryLIBRARY ieee;use IEEE.std_logic_1164.all;package tech_atc25_syn is -- various two-port rams (used for regfile) component RAM2P_16X32 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 component; component RAM2P_136X32 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 component; component RAM2P_168X32 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 component; -- various single-port synchronous ram cells (used for caches) component RAM_256x26 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 component; component RAM_256x28 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 component; component RAM_256x30 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 component; component RAM_512x28 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 component; component RAM_512x30 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 component; component RAM_512x32 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 component; component RAM_1024x32 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 component; component RAM_2048x32 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 component;-- dpram for tags when snooping is enabled or DSU trace buffer component DPRAM_256x26 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 component; component DPRAM_256x28 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 component; component DPRAM_256x30 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 component; component DPRAM_256x32 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 component; component DPRAM_512x28 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 component; component DPRAM_512x30 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(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 component; component DPRAM_512x32 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(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 component; -- input pad component pt33d00 port (pad : in std_logic; cin : out std_logic); end component; -- input pad with pull-up component pt33d00u port (pad : in std_logic; cin : out std_logic); end component; -- schmitt input pad component pt33d20 port (pad : in std_logic; cin : out std_logic); end component; -- schmitt input pad with pull-up component pt33d20u port (pad : inout std_logic; cin : out std_logic); end component; -- output pads component pt33o01 port (i : in std_logic; pad : out std_logic); end component; component pt33o02 port (i : in std_logic; pad : out std_logic); end component; component pt33o03 port (i : in std_logic; pad : out std_logic); end component; component pt33o04 port (i : in std_logic; pad : out std_logic); end component; -- tri-state output pads with pull-up component pt33t01u port (i, oen : in std_logic; pad : out std_logic); end component; component pt33t02u port (i, oen : in std_logic; pad : out std_logic); end component; component pt33t03u port (i, oen : in std_logic; pad : out std_logic); end component; component pt33t04u port (i, oen : in std_logic; pad : out std_logic); end component; -- bidirectional pads component pt33b01 port (i, oen : in std_logic; cin : out std_logic; pad : inout std_logic); end component; component pt33b02 port (i, oen : in std_logic; cin : out std_logic; pad : inout std_logic); end component; component pt33b03 port (i, oen : in std_logic; cin : out std_logic; pad : inout std_logic); end component; component pt33b04 port (i, oen : in std_logic; cin : out std_logic; pad : inout std_logic); end component; -- bidirectional pads with pull-up component pt33b01u port (i, oen : in std_logic; cin : out std_logic; pad : inout std_logic); end component; component pt33b02u port (i, oen : in std_logic; cin : out std_logic; pad : inout std_logic); end component; component pt33b03u port (i, oen : in std_logic; cin : out std_logic; pad : inout std_logic); end component; component pt33b04u port (i, oen : in std_logic; cin : out std_logic; pad : inout std_logic); end component; --PCI pads component pp33o01 port (i : in std_logic; pad : out std_logic); end component; component pp33b015vt port ( i, oen : in std_logic; cin : out std_logic; pad : inout std_logic); end component; component pp33t015vt port (i, oen : in std_logic; pad : out std_logic); end component;end;-------------------------------------------------------------------- sync ram generator --------------------------------------------------------------------------------------------------------------library IEEE;use IEEE.std_logic_1164.all;use work.tech_atc25_syn.all;use work.leon_iface.all;entity atc25_syncram is generic ( abits : integer := 10; dbits : integer := 8 ); port ( address : in std_logic_vector(abits -1 downto 0); clk : in clk_type; datain : in std_logic_vector(dbits -1 downto 0); dataout : out std_logic_vector(dbits -1 downto 0); enable : in std_logic; write : in std_logic );end;architecture rtl of atc25_syncram is signal wen, wel, gnd : std_logic; signal d, q : std_logic_vector(35 downto 0); signal a : std_logic_vector(17 downto 0); constant synopsys_bug : std_logic_vector(37 downto 0) := (others => '0');begin lat : process(clk, datain, write) begin if clk = '0' then d(dbits -1 downto 0) <= datain; wel <= write; end if; end process; gnd <= '0'; wen <= not wel; a(abits -1 downto 0) <= address; a(abits+1 downto abits) <= synopsys_bug(abits+1 downto abits); d(dbits+1 downto dbits) <= synopsys_bug(dbits+1 downto dbits); dataout <= q(dbits -1 downto 0); a8d26 : if (abits <= 8) and (dbits <= 26) generate id0 : RAM_256x26 port map (a(7 downto 0), d(25 downto 0), q(25 downto 0), clk, gnd, gnd, wen); end generate; a8d28 : if (abits <= 8) and (dbits > 26) and (dbits <= 28) generate id0 : RAM_256x28 port map (a(7 downto 0), d(27 downto 0), q(27 downto 0), clk, gnd, gnd, wen); end generate; a8d30 : if (abits <= 8) and (dbits > 28) and (dbits <= 30) generate id0 : RAM_256x30 port map (a(7 downto 0), d(29 downto 0), q(29 downto 0), clk, gnd, gnd, wen); end generate; a9d28 : if (abits = 9) and (dbits <= 28) generate id0 : RAM_512x28 port map (a(8 downto 0), d(27 downto 0), q(27 downto 0), clk, gnd, gnd, wen); end generate; a9d30 : if (abits = 9) and (dbits > 28) and (dbits <= 30) generate id0 : RAM_512x30 port map (a(8 downto 0), d(29 downto 0), q(29 downto 0), clk, gnd, gnd, wen); end generate; a9d32 : if ((abits = 9) and (dbits > 29) and (dbits <= 32)) or ((abits <= 9) and (dbits = 32)) generate id0 : RAM_512X32 port map (a(8 downto 0), d(31 downto 0), q(31 downto 0), clk, gnd, gnd, wen); end generate; a10d32 : if ((abits = 10) and (dbits <= 32)) generate id0 : RAM_1024X32 port map (a(9 downto 0), d(31 downto 0), q(31 downto 0), clk, gnd, gnd, wen); end generate; a11d32 : if (abits = 11) and (dbits <= 32) generate id0 : RAM_2048X32 port map (a(10 downto 0), d(31 downto 0), q(31 downto 0), clk, gnd, gnd, wen); end generate;end rtl;-------------------------------------------------------------------- sync dpram generator --------------------------------------------------------------------------------------------------------------library IEEE;use IEEE.std_logic_1164.all;use work.tech_atc25_syn.all;use work.leon_iface.all;entity atc25_dpram is generic ( abits : integer := 10; dbits : integer := 8 ); port ( address1 : in std_logic_vector((abits -1) downto 0); clk : in clk_type; datain1 : in std_logic_vector((dbits -1) downto 0); dataout1 : out std_logic_vector((dbits -1) downto 0); enable1 : in std_logic; write1 : in std_logic; address2 : in std_logic_vector((abits -1) downto 0); datain2 : in std_logic_vector((dbits -1) downto 0); dataout2 : out std_logic_vector((dbits -1) downto 0); enable2 : in std_logic; write2 : in std_logic ); end;architecture rtl of atc25_dpram is signal web1, web2, csb1, csb2, vcc : std_logic; signal web1n, web2n, csb1n, csb2n : std_logic; signal web1nc, web2nc : std_logic; signal i1, i2, a1, a2, i11, i22, a11, a22, o1, o2 : std_logic_vector(35 downto 0);begin vcc <= '1'; i11(35 downto dbits) <= (others => '0'); i22(35 downto dbits) <= (others => '0'); a11(35 downto abits) <= (others => '0'); a22(35 downto abits) <= (others => '0'); -- add delay or address/data will not be valid during write
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -