📄 tech_atc35.vhd
字号:
end;architecture behav of DPRAMRWRW_168X32 issignal wen : std_logic;begin wen <= not wenb; dp0 : generic_dpram_ss_dn generic map (abits => 8, dbits => 32, words => 168) port map ( dib, adda, addb, wen, mea, meb, doa);end;-------------------------------------------------------------------- sync ram generator ---------------------------------------------------------------------------------------------------------------- pragma translate_onlibrary IEEE;use IEEE.std_logic_1164.all;entity atc35_syncram is generic ( abits : integer := 10; dbits : integer := 8 ); port ( address : in std_logic_vector(abits -1 downto 0); clk : in std_logic; 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 atc35_syncram is-- Atmel ram cells component RAM_256x26 port ( add : in std_logic_vector(7 downto 0); di : in std_logic_vector(25 downto 0); do : out std_logic_vector(25 downto 0); me : in std_logic; wen : in std_logic); end component; component RAM_1024x32 port ( add : in std_logic_vector(9 downto 0); di : in std_logic_vector(31 downto 0); do : out std_logic_vector(31 downto 0); me : in std_logic; wen : in std_logic); end component; component RAM_2048x32 port ( add : in std_logic_vector(10 downto 0); di : in std_logic_vector(31 downto 0); do : out std_logic_vector(31 downto 0); me : in std_logic; wen : in std_logic); end component; signal wr : std_logic; signal a : std_logic_vector(19 downto 0); signal d, q : std_logic_vector(34 downto 0);begin wr <= not write; a(abits -1 downto 0) <= address; a(abits+1 downto abits) <= "00"; d(dbits -1 downto 0) <= datain; d(dbits+1 downto dbits) <= "00"; 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, wr); end generate; a10d32 : if (abits > 8) and (abits <= 10) and (dbits <= 32) generate id0 : RAM_1024X32 port map ( a(9 downto 0), d(31 downto 0), q(31 downto 0), clk, wr); 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, wr); end generate;end rtl;-------------------------------------------------------------------- regfile generator --------------------------------------------------------------------------------------------------------------LIBRARY ieee;use IEEE.std_logic_1164.all;use IEEE.std_logic_arith.all;entity atc35_regfile_ss_dn is generic ( abits : integer := 8; dbits : integer := 32; words : integer := 128 ); port ( clk : in std_logic; datain : in std_logic_vector (dbits -1 downto 0); raddr1 : in std_logic_vector (abits -1 downto 0); raddr2 : in std_logic_vector (abits -1 downto 0); waddr : in std_logic_vector (abits -1 downto 0); enable : in std_logic; write : in std_logic; dataout1 : out std_logic_vector (dbits -1 downto 0); dataout2 : out std_logic_vector (dbits -1 downto 0) );end;architecture rtl of atc35_regfile_ss_dn iscomponent DPRAMRWRW_16X32 port ( ADDA : in std_logic_vector(3 downto 0); ADDB : in std_logic_vector(3 downto 0); DIA : in std_logic_vector(31 downto 0); DIB : in std_logic_vector(31 downto 0); DOA : out std_logic_vector(31 downto 0); DOB : out std_logic_vector(31 downto 0); MEA : in std_logic; MEB : in std_logic; WENA : in std_logic; WENB : in std_logic );end component;component DPRAMRWRW_136X32 port ( ADDA : in std_logic_vector(7 downto 0); ADDB : in std_logic_vector(7 downto 0); DIA : in std_logic_vector(31 downto 0); DIB : in std_logic_vector(31 downto 0); DOA : out std_logic_vector(31 downto 0); DOB : out std_logic_vector(31 downto 0); MEA : in std_logic; MEB : in std_logic; WENA : in std_logic; WENB : in std_logic );end component;component DPRAMRWRW_168X32 port ( ADDA : in std_logic_vector(7 downto 0); ADDB : in std_logic_vector(7 downto 0); DIA : in std_logic_vector(31 downto 0); DIB : in std_logic_vector(31 downto 0); DOA : out std_logic_vector(31 downto 0); DOB : out std_logic_vector(31 downto 0); MEA : in std_logic; MEB : in std_logic; WENA : in std_logic; WENB : in std_logic );end component;signal din, dx, qq1, qq2, qx1, qx2 : std_logic_vector(31 downto 0);signal vcc, wen : std_logic;signal ra1, ra2, wa : std_logic_vector(12 downto 0);begin wen <= not write; dx <= (others => '0'); vcc <= '1'; din(dbits-1 downto 0) <= datain; ra1(abits-1 downto 0) <= raddr1; ra1(12 downto abits) <= (others => '0'); ra2(abits-1 downto 0) <= raddr2; ra2(12 downto abits) <= (others => '0'); wa(abits-1 downto 0) <= waddr; wa(12 downto abits) <= (others => '0'); dataout1 <= qq1(dbits-1 downto 0); dataout2 <= qq2(dbits-1 downto 0); dp16x32 : if (words = 16) and (dbits = 32) generate u0: DPRAMRWRW_16X32 port map (ra1(3 downto 0), wa(3 downto 0), dx(31 downto 0), din(31 downto 0), qq1(31 downto 0), qx1(31 downto 0), clk, clk, vcc, wen); u1: DPRAMRWRW_16X32 port map (ra2(3 downto 0), wa(3 downto 0), dx(31 downto 0), din(31 downto 0), qq2(31 downto 0), qx2(31 downto 0), clk, clk, vcc, wen); end generate; dp136x32 : if (words = 136) and (dbits = 32) generate u0: DPRAMRWRW_136X32 port map (ra1(7 downto 0), wa(7 downto 0), dx(31 downto 0), din(31 downto 0), qq1(31 downto 0), qx1(31 downto 0), clk, clk, vcc, wen); u1: DPRAMRWRW_136X32 port map (ra2(7 downto 0), wa(7 downto 0), dx(31 downto 0), din(31 downto 0), qq2(31 downto 0), qx2(31 downto 0), clk, clk, vcc, wen); end generate; dp168x32 : if (words = 168) and (dbits = 32) generate u0: DPRAMRWRW_168X32 port map (ra1(7 downto 0), wa(7 downto 0), dx(31 downto 0), din(31 downto 0), qq1(31 downto 0), qx1(31 downto 0), clk, clk, vcc, wen); u1: DPRAMRWRW_168X32 port map (ra2(7 downto 0), wa(7 downto 0), dx(31 downto 0), din(31 downto 0), qq2(31 downto 0), qx2(31 downto 0), clk, clk, vcc, wen); end generate;end;LIBRARY ieee;use IEEE.std_logic_1164.all;use IEEE.std_logic_arith.all;use work.tech_atc35.all;entity atc35_regfile_ss is generic ( abits : integer := 8; dbits : integer := 32; words : integer := 128 ); port ( clk : in std_logic; datain : in std_logic_vector (dbits -1 downto 0); raddr1 : in std_logic_vector (abits -1 downto 0); raddr2 : in std_logic_vector (abits -1 downto 0); waddr : in std_logic_vector (abits -1 downto 0); enable : in std_logic; write : in std_logic; dataout1 : out std_logic_vector (dbits -1 downto 0); dataout2 : out std_logic_vector (dbits -1 downto 0) );end;architecture rtl of atc35_regfile_ss issignal dlat : std_logic_vector(dbits -1 downto 0);signal vcc : std_logic;begin vcc <= '1'; lat : process(datain, clk) begin if (clk = '0') then dlat <= datain; end if; end process; u0 : atc35_regfile_ss_dn generic map (abits, dbits, words) port map (clk, dlat, raddr1, raddr2, waddr, vcc, write, dataout1, dataout2); end;-------------------------------------------------------------------- behavioural pad models ---------------------------------------------------------------------------------------------------------------- pragma translate_off-- input padlibrary IEEE;use IEEE.std_logic_1164.all;entity pc3d01 is port (pad : in std_logic; cin : out std_logic); end; architecture rtl of pc3d01 is begin cin <= to_x01(pad) after 1 ns; end;-- input schmitt padlibrary IEEE;use IEEE.std_logic_1164.all;entity pc3d21 is port (pad : in std_logic; cin : out std_logic); end; architecture rtl of pc3d21 is begin cin <= to_x01(pad) after 1 ns; end;-- output padslibrary IEEE;use IEEE.std_logic_1164.all;entity pt3o01 is port (i : in std_logic; pad : out std_logic); end; architecture rtl of pt3o01 is begin pad <= to_x01(i) after 2 ns; end;library IEEE;use IEEE.std_logic_1164.all;entity pt3o02 is port (i : in std_logic; pad : out std_logic); end; architecture rtl of pt3o02 is begin pad <= to_x01(i) after 2 ns; end;library IEEE;use IEEE.std_logic_1164.all;entity pt3o03 is port (i : in std_logic; pad : out std_logic); end; architecture rtl of pt3o03 is begin pad <= to_x01(i) after 2 ns; end;-- output tri-state padslibrary IEEE;use IEEE.std_logic_1164.all;entity pc3t01u is port (i, oen : in std_logic; pad : out std_logic); end; architecture rtl of pc3t01u isbegin pad <= to_x01(i) after 2 ns when oen = '0' else 'Z' after 2 ns; end; library IEEE;use IEEE.std_logic_1164.all;entity pc3t02u is port (i, oen : in std_logic; pad : out std_logic); end; architecture rtl of pc3t02u isbegin pad <= to_x01(i) after 2 ns when oen = '0' else 'Z' after 2 ns; end; library IEEE;use IEEE.std_logic_1164.all;entity pc3t03u is port (i, oen : in std_logic; pad : out std_logic); end; architecture rtl of pc3t03u isbegin pad <= to_x01(i) after 2 ns when oen = '0' else 'Z' after 2 ns; end; -- bidirectional padlibrary IEEE;use IEEE.std_logic_1164.all;entity pt3b01 is port ( i, oen : in std_logic; cin : out std_logic; pad : inout std_logic);end; architecture rtl of pt3b01 isbegin pad <= to_x01(i) after 2 ns when oen = '0' else 'Z' after 2 ns; cin <= to_x01(pad) after 2 ns;end;library IEEE;use IEEE.std_logic_1164.all;entity pt3b02 is port ( i, oen : in std_logic; cin : out std_logic; pad : inout std_logic);end; architecture rtl of pt3b02 isbegin pad <= to_x01(i) after 2 ns when oen = '0' else 'Z' after 2 ns; cin <= to_x01(pad) after 2 ns;end;library IEEE;use IEEE.std_logic_1164.all;entity pt3b03 is port ( i, oen : in std_logic; cin : out std_logic; pad : inout std_logic);end; architecture rtl of pt3b03 isbegin pad <= to_x01(i) after 2 ns when oen = '0' else 'Z' after 2 ns; cin <= to_x01(pad) after 2 ns;end;-- pragma translate_on
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -