📄 tech_atc35.vhd
字号:
------------------------------------------------------------------------------ This file is a part of the LEON VHDL model-- Copyright (C) 1999 European Space Agency (ESA)---- This library is free software; you can redistribute it and/or-- modify it under the terms of the GNU Lesser General Public-- License as published by the Free Software Foundation; either-- version 2 of the License, or (at your option) any later version.---- See the file COPYING.LGPL for the full details of the license.------------------------------------------------------------------------------- Entity: tech_atc35-- File: tech_atc35.vhd-- Author: Jiri Gaisler - ESA/ESTEC-- Description: Contains Atmel ATC35 specific pads and ram generators------------------------------------------------------------------------------LIBRARY ieee;use IEEE.std_logic_1164.all;use work.leon_iface.all;package tech_atc35 is-- sync ram generator component atc35_syncram 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 component;-- regfile generator component atc35_regfile generic ( 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 component; component atc35_regfile_cp 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 component;-- pads component atc35_inpad port (pad : in std_logic; q : out std_logic); end component; component atc35_smpad port (pad : in std_logic; q : out std_logic); end component; component atc35_outpad generic (drive : integer := 1); port (d : in std_logic; pad : out std_logic); end component; component atc35_toutpadu generic (drive : integer := 1); port (d, en : in std_logic; pad : out std_logic); end component; component atc35_iopad generic (drive : integer := 1); port ( d, en : in std_logic; q : out std_logic; pad : inout std_logic); end component; component atc35_iopadu generic (drive : integer := 1); port ( d, en : in std_logic; q : out std_logic; pad : inout std_logic); end component; component atc35_iodpad generic (drive : integer := 1); port ( d : in std_logic; q : out std_logic; pad : inout std_logic); end component; component atc35_odpad generic (drive : integer := 1); port ( d : in std_logic; pad : out std_logic); end component;end;-------------------------------------------------------------------- behavioural pad models ---------------------------------------------------------------------------------------------------------------- Only needed for simulation, not synthesis.-- 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;-------------------------------------------------------------------- behavioural ram models ------------------------------------------------------------------------------------------------------------ Address and control latched on rising clka, data latched on falling clkb. LIBRARY ieee;use IEEE.std_logic_1164.all;use IEEE.std_logic_arith.all;entity atc35_dpram_ss_dn is generic ( abits : integer := 8; dbits : integer := 32; words : integer := 256 ); port ( data: in std_logic_vector (dbits -1 downto 0); rdaddress: in std_logic_vector (abits -1 downto 0); wraddress: in std_logic_vector (abits -1 downto 0); wren : in std_logic; clka, clkb : in std_logic; q: out std_logic_vector (dbits -1 downto 0) );end;architecture behav of atc35_dpram_ss_dn issignal dr : std_logic_vector (dbits -1 downto 0);signal ra,wa : std_logic_vector (abits -1 downto 0);signal wer : std_logic;begin rp : process(clka, clkb, rdaddress, wren, wraddress, data, wa, ra, wer) 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 falling_edge(clkb) and (wer = '1') then if not is_x (wa) then rfd(conv_integer(unsigned(wa)) mod words) := data; end if; end if; if rising_edge(clka) then ra <= rdaddress; wa <= wraddress; wer <= wren; end if; if not (is_x (ra) or ((wer = '1') and (ra = wa))) then q <= rfd(conv_integer(unsigned(ra)) mod words); else q <= (others => 'X'); end if; end process;end;LIBRARY ieee;use IEEE.std_logic_1164.all;package tech_atc35_sim is-- syncronous dpram with data latched on falling edgecomponent atc35_dpram_ss_dn generic ( abits : integer := 8; dbits : integer := 32; words : integer := 256 ); port ( data: in std_logic_vector (dbits -1 downto 0); rdaddress: in std_logic_vector (abits -1 downto 0); wraddress: in std_logic_vector (abits -1 downto 0); wren : in std_logic; clka, clkb : in std_logic; q: 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_generic.all;entity ATC35_RAM_256x26 is 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;architecture behavioral of ATC35_RAM_256x26 issignal we, vcc : std_logic;begin vcc <= '1'; we <= not wen; syncram0 : generic_syncram generic map ( abits => 8, dbits => 26) port map ( add, me, di, do, vcc, we);end behavioral;library ieee;use IEEE.std_logic_1164.all;use work.tech_generic.all;entity ATC35_RAM_1024x32 is 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;architecture behavioral of ATC35_RAM_1024x32 issignal we, vcc : std_logic;begin vcc <= '1'; we <= not wen; syncram0 : generic_syncram generic map ( abits => 10, dbits => 32) port map ( add, me, di, do, vcc, we);end behavioral;library ieee;use IEEE.std_logic_1164.all;use work.tech_generic.all;entity ATC35_RAM_2048x32 is 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;architecture behavioral of ATC35_RAM_2048x32 issignal we, vcc : std_logic;begin vcc <= '1'; we <= not wen; syncram0 : generic_syncram generic map ( abits => 11, dbits => 32) port map ( add, me, di, do, vcc, we);end behavioral;library ieee;use IEEE.std_logic_1164.all;use work.tech_generic.all;entity ATC35_RAM_256x28 is port ( add : in std_logic_vector(7 downto 0); di : in std_logic_vector(27 downto 0); do : out std_logic_vector(27 downto 0); me : in std_logic; wen : in std_logic );end;architecture behavioral of ATC35_RAM_256x28 issignal we, vcc : std_logic;begin vcc <= '1'; we <= not wen; syncram0 : generic_syncram generic map ( abits => 8, dbits => 28) port map ( add, me, di, do, vcc, we);end behavioral;library ieee;use IEEE.std_logic_1164.all;use work.tech_generic.all;entity ATC35_RAM_1024x34 is port ( add : in std_logic_vector(9 downto 0); di : in std_logic_vector(33 downto 0); do : out std_logic_vector(33 downto 0); me : in std_logic; wen : in std_logic );end;architecture behavioral of ATC35_RAM_1024x34 issignal we, vcc : std_logic;begin vcc <= '1'; we <= not wen; syncram0 : generic_syncram generic map ( abits => 10, dbits => 34) port map ( add, me, di, do, vcc, we);end behavioral;library ieee;use IEEE.std_logic_1164.all;use work.tech_generic.all;entity ATC35_RAM_2048x34 is port ( add : in std_logic_vector(10 downto 0); di : in std_logic_vector(33 downto 0); do : out std_logic_vector(33 downto 0); me : in std_logic; wen : in std_logic );end;architecture behavioral of ATC35_RAM_2048x34 issignal we, vcc : std_logic;begin vcc <= '1'; we <= not wen; syncram0 : generic_syncram generic map ( abits => 11, dbits => 34) port map ( add, me, di, do, vcc, we);end behavioral;LIBRARY ieee;use IEEE.std_logic_1164.all;use work.tech_atc35_sim.all;entity DPRAMRWRW_16X32 is 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;architecture behav of DPRAMRWRW_16X32 issignal wen : std_logic;begin wen <= not wenb; dp0 : atc35_dpram_ss_dn generic map (abits => 4, dbits => 32, words => 16) port map ( dib, adda, addb, wen, mea, meb, doa);end;LIBRARY ieee;use IEEE.std_logic_1164.all;use work.tech_atc35_sim.all;entity DPRAMRWRW_136X32 is 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;architecture behav of DPRAMRWRW_136X32 issignal wen : std_logic;begin wen <= not wenb; dp0 : atc35_dpram_ss_dn generic map (abits => 8, dbits => 32, words => 136) port map ( dib, adda, addb, wen, mea, meb, doa);end;LIBRARY ieee;use IEEE.std_logic_1164.all;use work.tech_atc35_sim.all;entity DPRAMRWRW_168X32 is 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
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -