📄 tech_atc25.vhd
字号:
a1 <= a11; a2 <= a22; i1 <= i11; i2 <= i22; csb1n <= not enable1; csb2n <= not enable2; web1n <= not write1; web2n <= not write2; web1nc <= web1 or clk; web2nc <= web2 or clk; r : process (clk) begin if rising_edge(clk) then a11(abits-1 downto 0) <= address1; a22(abits-1 downto 0) <= address2; i11(dbits-1 downto 0) <= datain1; i22(dbits-1 downto 0) <= datain2; csb1 <= csb1n; csb2 <= csb2n; web1 <= web1n; web2 <= web2n; end if; end process; dp256x26 : if (abits <= 8) and (dbits <= 26) generate dp0 : DPRAM_256x26 port map ( a1(7 downto 0), a2(7 downto 0), csb1, csb2, web1nc, web2nc, vcc, web2, i1(25 downto 0), i2(25 downto 0), o1(25 downto 0), o2(25 downto 0)); end generate; dp256x28 : if (abits <= 8) and (dbits <= 28) and (dbits >= 27) generate dp0 : DPRAM_256x28 port map ( a1(7 downto 0), a2(7 downto 0), csb1, csb2, web1nc, web2nc, vcc, web2, i1(27 downto 0), i2(27 downto 0), o1(27 downto 0), o2(27 downto 0)); end generate; dp256x30 : if (abits <= 8) and (dbits <= 30) and (dbits >= 29) generate dp0 : DPRAM_256x30 port map ( a1(7 downto 0), a2(7 downto 0), csb1, csb2, web1nc, web2nc, vcc, web2, i1(29 downto 0), i2(29 downto 0), o1(29 downto 0), o2(29 downto 0)); end generate; dp256x32 : if (abits <= 8) and (dbits <= 32) and (dbits >= 31) generate dp0 : DPRAM_256x32 port map ( a1(7 downto 0), a2(7 downto 0), csb1, csb2, web1nc, web2nc, vcc, web2, i1(31 downto 0), i2(31 downto 0), o1(31 downto 0), o2(31 downto 0)); end generate; dp512x28 : if (abits = 9) and (dbits <= 28) generate dp0 : DPRAM_512x28 port map ( a1(8 downto 0), a2(8 downto 0), csb1, csb2, web1nc, web2nc, vcc, web2, i1(27 downto 0), i2(27 downto 0), o1(27 downto 0), o2(27 downto 0)); end generate; dp512x30 : if (abits = 9) and (dbits <= 30) and (dbits >= 29) generate dp0 : DPRAM_512x30 port map ( a1(8 downto 0), a2(8 downto 0), csb1, csb2, web1nc, web2nc, vcc, web2, i1(29 downto 0), i2(29 downto 0), o1(29 downto 0), o2(29 downto 0)); end generate; dp512x32 : if (abits = 9) and (dbits <= 32) and (dbits >= 31) generate dp0 : DPRAM_512x32 port map ( a1(8 downto 0), a2(8 downto 0), csb1, csb2, web1nc, web2nc, vcc, web2, i1(31 downto 0), i2(31 downto 0), o1(31 downto 0), o2(31 downto 0)); end generate; dataout1 <= o1(dbits-1 downto 0); dataout2 <= o2(dbits-1 downto 0);end;-------------------------------------------------------------------- regfile generator --------------------------------------------------------------------------------------------------------------LIBRARY ieee;use IEEE.std_logic_1164.all;use IEEE.std_logic_arith.all;use work.tech_generic.all;use work.tech_atc25_syn.all;use work.leon_iface.all;use work.leon_config.all;entity atc25_regfile_iu is generic ( rftype : integer := 1; abits : integer := 8; dbits : integer := 32; words : integer := 128 ); port ( rst : in std_logic; clk : in clk_type; clkn : in clk_type; rfi : in rf_in_type; rfo : out rf_out_type);end;architecture rtl of atc25_regfile_iu issignal din1, din2, qq1, qq2 : std_logic_vector(39 downto 0);signal vcc, gnd, we, wen, ren1, ren2 : std_logic;signal ra1, ra2, wa : std_logic_vector(12 downto 0);begin rf2 : if rftype = 2 generate r : process (clkn, rfi) begin if clkn = '1' then din2(dbits-1 downto 0) <= rfi.wrdata; din1(dbits-1 downto 0) <= rfi.wrdata; wa(abits-1 downto 0) <= rfi.wraddr(abits -1 downto 0); we <= rfi.wren; end if; end process; wen <= not (clk and we); end generate; rf1 : if rftype = 1 generate wa(abits-1 downto 0) <= rfi.wraddr(abits -1 downto 0); din1(dbits-1 downto 0) <= rfi.wrdata; din2(dbits-1 downto 0) <= rfi.wrdata; wen <= clk or not rfi.wren; end generate; vcc <= '1'; gnd <= '0'; ren1 <= not rfi.ren1; ren2 <= not rfi.ren2; ra1(12 downto abits) <= (others => '0'); ra2(12 downto abits) <= (others => '0'); ra1(abits-1 downto 0) <= rfi.rd1addr(abits -1 downto 0); ra2(abits-1 downto 0) <= rfi.rd2addr(abits -1 downto 0); wa(12 downto abits) <= (others => '0'); din1(39 downto dbits) <= (others => '0'); din2(39 downto dbits) <= (others => '0'); dp136x32 : if (words = 136) and (dbits = 32) generate u0: RAM2P_136X32 port map (ra1(7 downto 0), wa(7 downto 0), din1(31 downto 0), qq1(31 downto 0), ren1, gnd, wen); u1: RAM2P_136X32 port map (ra2(7 downto 0), wa(7 downto 0), din2(31 downto 0), qq2(31 downto 0), ren2, gnd, wen); end generate; dp168x32 : if (words = 168) and (dbits = 32) generate u0: RAM2P_168X32 port map (ra1(7 downto 0), wa(7 downto 0), din1(31 downto 0), qq1(31 downto 0), ren1, gnd, wen); u1: RAM2P_168X32 port map (ra2(7 downto 0), wa(7 downto 0), din2(31 downto 0), qq2(31 downto 0), ren2, gnd, wen); end generate; rfo.data1(dbits-1 downto 0) <= qq1(dbits-1 downto 0); rfo.data2(dbits-1 downto 0) <= qq2(dbits-1 downto 0);end;LIBRARY ieee;use IEEE.std_logic_1164.all;use IEEE.std_logic_arith.all;use work.tech_generic.all;use work.tech_atc25_syn.all;use work.leon_iface.all;entity atc25_regfile_cp is generic ( abits : integer := 4; dbits : integer := 32; words : integer := 16 ); port ( rst : in std_logic; clk : in clk_type; rfi : in rf_cp_in_type; rfo : out rf_cp_out_type);end;architecture rtl of atc25_regfile_cp istype reg_type is record raddr1 : std_logic_vector(abits-1 downto 0); raddr2 : std_logic_vector(abits-1 downto 0); wraddr : std_logic_vector(abits-1 downto 0); wrdata : std_logic_vector(dbits-1 downto 0); wren : std_logic;end record;signal r, rin : reg_type;signal din1, qq1, qq2 : std_logic_vector(39 downto 0);signal wa : std_logic_vector(abits-1 downto 0);signal vcc, gnd, wen : std_logic;begin vcc <= '1'; gnd <= '0'; wen <= clk or not r.wren; din1(dbits-1 downto 0) <= r.wrdata; din1(39 downto dbits) <= (others => '0'); wa <= r.wraddr; dp16x32 : if (words = 16) and (dbits = 32) generate u0: RAM2P_16X32 port map (r.raddr1(3 downto 0), wa(3 downto 0), din1(dbits-1 downto 0), qq1(31 downto 0), gnd, gnd, wen); u1: RAM2P_16X32 port map (r.raddr2(3 downto 0), wa(3 downto 0), din1(dbits-1 downto 0), qq2(31 downto 0), gnd, gnd, wen); end generate; adr_reg : process(clk) begin if rising_edge(clk) then r.raddr1 <= rfi.rd1addr(abits -1 downto 0); r.raddr2 <= rfi.rd2addr(abits -1 downto 0); r.wraddr <= rfi.wraddr(abits -1 downto 0); r.wrdata <= rfi.wrdata; r.wren <= rfi.wren; end if; end process; rfo.data1(dbits-1 downto 0) <= qq1(dbits-1 downto 0); rfo.data2(dbits-1 downto 0) <= qq2(dbits-1 downto 0);end;-------------------------------------------------------------------- mapping generic pads on tech pads ----------------------------------------------------------------------------------------------------- input padlibrary IEEE; use IEEE.std_logic_1164.all; use work.tech_atc25_syn.all;entity atc25_inpad is port (pad : in std_logic; q : out std_logic); end; architecture syn of atc25_inpad is begin i0 : pt33d00 port map (pad => pad, cin => q); end;-- input schmitt padlibrary IEEE; use IEEE.std_logic_1164.all; use work.tech_atc25_syn.all;entity atc25_smpad is port (pad : in std_logic; q : out std_logic); end; architecture syn of atc25_smpad is begin i0 : pt33d20 port map (pad => pad, cin => q); end;-- output padlibrary IEEE; use IEEE.std_logic_1164.all; use work.tech_atc25_syn.all;entity atc25_outpad is generic (drive : integer := 1); port (d : in std_logic; pad : out std_logic);end; architecture syn of atc25_outpad is begin d1 : if drive = 1 generate i0 : pt33o01 port map (pad => pad, i => d); end generate; d2 : if drive = 2 generate i0 : pt33o02 port map (pad => pad, i => d); end generate; d3 : if drive > 2 generate i0 : pt33o03 port map (pad => pad, i => d); end generate;end; -- tri-state output pads with pull-up, oen active lowlibrary IEEE; use IEEE.std_logic_1164.all; use work.tech_atc25_syn.all;entity atc25_toutpadu is generic (drive : integer := 1); port (d, en : in std_logic; pad : out std_logic);end; architecture syn of atc25_toutpadu is begin d1 : if drive = 1 generate i0 : pt33t01u port map (pad => pad, i => d, oen => en); end generate; d2 : if drive = 2 generate i0 : pt33t02u port map (pad => pad, i => d, oen => en); end generate; d3 : if drive > 3 generate i0 : pt33t03u port map (pad => pad, i => d, oen => en); end generate;end;-- bidirectional pad, oen active lowlibrary IEEE; use IEEE.std_logic_1164.all; use work.tech_atc25_syn.all;entity atc25_iopad is generic (drive : integer := 1); port ( d, en : in std_logic; q : out std_logic; pad : inout std_logic);end;architecture syn of atc25_iopad is begin d1 : if drive = 1 generate i0 : pt33b01 port map (pad => pad, i => d, oen => en, cin => q); end generate; d2 : if drive = 2 generate i0 : pt33b02 port map (pad => pad, i => d, oen => en, cin => q); end generate; d3 : if drive > 2 generate i0 : pt33b03 port map (pad => pad, i => d, oen => en, cin => q); end generate;end;-- bidirectional pad with pull-up, oen active lowlibrary IEEE; use IEEE.std_logic_1164.all; use work.tech_atc25_syn.all;entity atc25_iopadu is generic (drive : integer := 1); port ( d, en : in std_logic; q : out std_logic; pad : inout std_logic);end;architecture syn of atc25_iopadu is begin d1 : if drive = 1 generate i0 : pt33b01u port map (pad => pad, i => d, oen => en, cin => q); end generate; d2 : if drive = 2 generate i0 : pt33b02u port map (pad => pad, i => d, oen => en, cin => q); end generate; d3 : if drive > 2 generate i0 : pt33b03u port map (pad => pad, i => d, oen => en, cin => q); end generate;end;-- bidirectional pad with open-drainlibrary IEEE; use IEEE.std_logic_1164.all; use work.tech_atc25_syn.all;entity atc25_iodpad is generic (drive : integer := 1); port ( d : in std_logic; q : out std_logic; pad : inout std_logic);end;architecture syn of atc25_iodpad is signal gnd : std_logic;begin gnd <= '0'; d1 : if drive = 1 generate i0 : pt33b01u port map (pad => pad, i => gnd, oen => d, cin => q); end generate; d2 : if drive = 2 generate i0 : pt33b02u port map (pad => pad, i => gnd, oen => d, cin => q); end generate; d3 : if drive > 2 generate i0 : pt33b03u port map (pad => pad, i => gnd, oen => d, cin => q); end generate;end;-- output pad with open-drainlibrary IEEE; use IEEE.std_logic_1164.all; use work.tech_atc25_syn.all;entity atc25_odpad is generic (drive : integer := 1); port (d : in std_logic; pad : out std_logic);end;architecture syn of atc25_odpad is signal gnd : std_logic;begin gnd <= '0'; d1 : if drive = 1 generate i0 : pt33t01u port map (pad => pad, i => gnd, oen => d); end generate; d2 : if drive = 2 generate i0 : pt33t02u port map (pad => pad, i => gnd, oen => d); end generate; d3 : if drive > 2 generate i0 : pt33t03u port map (pad => pad, i => gnd, oen => d); end generate;end;-- PCI output padlibrary IEEE; use IEEE.std_logic_1164.all; use work.tech_atc25_syn.all;entity atc25_pcioutpad is port (d : in std_logic; pad : out std_logic); end; architecture syn of atc25_pcioutpad is begin i0 : pp33o01 port map (pad => pad, i => d);end;-- PCI tristate output padlibrary IEEE; use IEEE.std_logic_1164.all; use work.tech_atc25_syn.all;entity atc25_pcitoutpad is port (d, en : in std_logic; pad : out std_logic); end; architecture syn of atc25_pcitoutpad is begin i0 : pp33t015vt port map (pad => pad, i => d, oen => en);end;-- PCI bidirectional pad, oen active lowlibrary IEEE; use IEEE.std_logic_1164.all; use work.tech_atc25_syn.all;entity atc25_pciiopad is port ( d, en : in std_logic; q : out std_logic; pad : inout std_logic);end;architecture syn of atc25_pciiopad is begin i0 : pp33b015vt port map (pad => pad, i => d, oen => en, cin => q);end;-- bidirectional pad with open-drainlibrary IEEE; use IEEE.std_logic_1164.all; use work.tech_atc25_syn.all;entity atc25_pciiodpad is port ( d : in std_logic; q : out std_logic; pad : inout std_logic);end;architecture syn of atc25_pciiodpad is signal gnd : std_logic;begin gnd <= '0'; i0 : pp33b015vt port map (pad => pad, i => gnd, oen => d, cin => q);end;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -