📄 tech_umc18.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_umc18-- File: tech_umc18.vhd-- Author: Raijmond Keulen, Irotech-- Author: Jiri Gaisler - Gaisler Research-- Description: Contains UMC umc18 specific pads and ram generators------------------------------------------------------------------------------LIBRARY ieee;use IEEE.std_logic_1164.all;use work.leon_iface.all;package tech_umc18 is-- sync ram generator component umc18_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 umc18_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;-- pads component umc18_inpad port (pad : in std_logic; q : out std_logic); end component; component umc18_smpad port (pad : in std_logic; q : out std_logic); end component; component umc18_outpad generic (drive : integer := 1); port (d : in std_logic; pad : out std_logic); end component; component umc18_toutpadu generic (drive : integer := 1); port (d, en : in std_logic; pad : out std_logic); end component; component umc18_iopad generic (drive : integer := 1); port ( d, en : in std_logic; q : out std_logic; pad : inout std_logic); end component; component umc18_iopadu generic (drive : integer := 1); port ( d, en : in std_logic; q : out std_logic; pad : inout std_logic); end component; component umc18_iodpad generic (drive : integer := 1); port ( d : in std_logic; q : out std_logic; pad : inout std_logic); end component; component umc18_odpad generic (drive : integer := 1); port ( d : in std_logic; pad : out std_logic); end component; component umc18_smiopad generic (drive : integer := 1); port ( d, en : in std_logic; q : out std_logic; pad : inout std_logic); end component; end;-------------------------------------------------------------------- behavioural pad models ---------------------------------------------------------------------------------------------------------------- Only needed for simulation, not synthesis.-- pragma translate_off-- input pad 1xDrivelibrary IEEE;use IEEE.std_logic_1164.all;entity C3I40 is port (PAD : in std_logic; DI : out std_logic); end; architecture rtl of C3I40 is begin DI <= to_x01(PAD) after 1 ns; end;-- input schmitt pad 1xDrivelibrary IEEE;use IEEE.std_logic_1164.all;entity C3I42 is port (PAD : in std_logic; DI : out std_logic); end; architecture rtl of C3I42 is begin DI <= to_x01(PAD) after 1 ns; end;-- output pad 2mAlibrary IEEE;use IEEE.std_logic_1164.all;entity C3O10 is port (DO : in std_logic; PAD : out std_logic); end; architecture rtl of C3O10 is begin PAD <= to_x01(DO) after 2 ns; end;-- output pad 4mAlibrary IEEE;use IEEE.std_logic_1164.all;entity C3O20 is port (DO : in std_logic; PAD : out std_logic); end; architecture rtl of C3O20 is begin PAD <= to_x01(DO) after 2 ns; end;-- output pad 8mAlibrary IEEE;use IEEE.std_logic_1164.all;entity C3O40 is port (DO : in std_logic; PAD : out std_logic); end; architecture rtl of C3O40 is begin PAD <= to_x01(DO) after 2 ns; end;-- bidirectional pad pullup 2mA, used as tri-state output pad with pull-up *library IEEE;use IEEE.std_logic_1164.all;entity C3B10U is port ( DO, EN : in std_logic; DI : out std_logic; PAD : inout std_logic);end; architecture rtl of C3B10U isbegin PAD <= to_x01(DO) after 2 ns when EN = '1' else 'Z' after 2 ns; DI <= to_x01(PAD) after 2 ns;end;-- bidirectional pad pullup 4mA, used as tri-state output pad with pull-up *library IEEE;use IEEE.std_logic_1164.all;entity C3B20U is port ( DO, EN : in std_logic; DI : out std_logic; PAD : inout std_logic);end; architecture rtl of C3B20U isbegin PAD <= to_x01(DO) after 2 ns when EN = '1' else 'Z' after 2 ns; DI <= to_x01(PAD) after 2 ns;end;-- bidirectional pad pullup 8mA, used as tri-state output pad with pull-up *library IEEE;use IEEE.std_logic_1164.all;entity C3B40U is port ( DO, EN : in std_logic; DI : out std_logic; PAD : inout std_logic);end; architecture rtl of C3B40U isbegin PAD <= to_x01(DO) after 2 ns when EN = '1' else 'Z' after 2 ns; DI <= to_x01(PAD) after 2 ns;end;-- bidirectional pad 2mA *library IEEE;use IEEE.std_logic_1164.all;entity C3B10 is port ( DO, EN : in std_logic; DI : out std_logic; PAD : inout std_logic);end; architecture rtl of C3B10 isbegin PAD <= to_x01(DO) after 2 ns when EN = '1' else 'Z' after 2 ns; DI <= to_x01(PAD) after 2 ns;end;-- bidirectional pad 4mA *library IEEE;use IEEE.std_logic_1164.all;entity C3B20 is port ( DO, EN : in std_logic; DI : out std_logic; PAD : inout std_logic);end; architecture rtl of C3B20 isbegin PAD <= to_x01(DO) after 2 ns when EN = '1' else 'Z' after 2 ns; DI <= to_x01(PAD) after 2 ns;end;-- bidirectional pad 8mA *library IEEE;use IEEE.std_logic_1164.all;entity C3B40 is port ( DO, EN : in std_logic; DI : out std_logic; PAD : inout std_logic);end; architecture rtl of C3B40 isbegin PAD <= to_x01(DO) after 2 ns when EN = '1' else 'Z' after 2 ns; DI <= to_x01(PAD) after 2 ns;end;-- bidirectional pad 2mA with open drainlibrary IEEE;use IEEE.std_logic_1164.all;entity CD3B10T is port ( DO, EN : in std_logic; DI : out std_logic; PAD : inout std_logic);end; architecture rtl of CD3B10T isbegin PAD <= '0' after 2 ns when (EN and not DO) = '1' else 'Z' after 2 ns; DI <= to_x01(PAD) after 2 ns;end;-- bidirectional pad 4mA with open drainlibrary IEEE;use IEEE.std_logic_1164.all;entity CD3B20T is port ( DO, EN : in std_logic; DI : out std_logic; PAD : inout std_logic);end; architecture rtl of CD3B20T isbegin PAD <= '0' after 2 ns when (EN and not DO) = '1' else 'Z' after 2 ns; DI <= to_x01(PAD) after 2 ns;end;-- bidirectional pad 8mA with open drainlibrary IEEE;use IEEE.std_logic_1164.all;entity CD3B40T is port ( DO, EN : in std_logic; DI : out std_logic; PAD : inout std_logic);end; architecture rtl of CD3B40T isbegin PAD <= '0' after 2 ns when (EN and not DO) = '1' else 'Z' after 2 ns; DI <= to_x01(PAD) after 2 ns;end;-- output pad 2mA with open drainlibrary IEEE;use IEEE.std_logic_1164.all;entity CD3O10T is port ( DO : in std_logic; PAD : out std_logic);end; architecture rtl of CD3O10T isbegin PAD <= '0' after 2 ns when DO = '0' else 'Z' after 2 ns;end;-- output pad 4mA with open drainlibrary IEEE;use IEEE.std_logic_1164.all;entity CD3O20T is port ( DO : in std_logic; PAD : out std_logic);end; architecture rtl of CD3O20T isbegin PAD <= '0' after 2 ns when DO = '0' else 'Z' after 2 ns;end;-- output pad 8mA with open drainlibrary IEEE;use IEEE.std_logic_1164.all;entity CD3O40T is port ( DO : in std_logic; PAD : out std_logic);end; architecture rtl of CD3O40T isbegin PAD <= '0' after 2 ns when DO = '0' else 'Z' after 2 ns;end;-- bidirectional pad 8mA schmitt triggerlibrary IEEE;use IEEE.std_logic_1164.all;entity C3B42 is port ( DO, EN : in std_logic; DI : out std_logic; PAD : inout std_logic);end; architecture rtl of C3B42 isbegin PAD <= to_x01(DO) after 2 ns when EN = '1' else 'Z' after 2 ns; DI <= 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 umc18_dpram_ss is generic ( abits : integer := 8; dbits : integer := 32; words : integer := 256 ); port ( DI: in std_logic_vector (dbits -1 downto 0); RADR,WADR: in std_logic_vector (abits -1 downto 0); REN,WEN : in std_logic; RCK,WCK : in std_logic; DOUT: out std_logic_vector (dbits -1 downto 0) );end;architecture behav of umc18_dpram_ss is signal DI_l,DOUT_l : std_logic_vector (dbits -1 downto 0); signal RADR_l, WADR_l : std_logic_vector (abits -1 downto 0); signal REN_l, WEN_l : std_logic; type dregtype is array (0 to words - 1) of std_logic_vector(dbits -1 downto 0); signal data : dregtype; attribute syn_ramstyle : string; attribute syn_ramstyle of data: signal is "block_ram";begin writeport : process(WCK) begin if rising_edge(WCK) then DI_l <= DI; WEN_l <= WEN; WADR_l <= WADR; end if; end process; readport : process(RCK) begin if rising_edge(RCK) then REN_l <= REN; RADR_l <= RADR; end if; end process; ram : process(DI_l, WEN_l, WADR_l, REN_l, RADR_l, data) begin if WEN_l = '0' then if not ( is_x(WADR_l) or (conv_integer(unsigned(WADR_l)) >= words)) then data(conv_integer(unsigned(WADR_l))) <= DI_l; end if; end if; if REN_l = '0' then if not (is_x(RADR_l) or (conv_integer(unsigned(RADR_l)) >= words)) then DOUT_l <= data(conv_integer(unsigned(RADR_l))); else DOUT_l <= (others => 'X'); end if; else DOUT_l <= (others => 'Z'); end if; end process; DOUT <= DOUT_l;end;library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_arith.all;entity umc18_syncram_ss is generic ( abits : integer := 10; dbits : integer := 8 ); port ( ADR : in std_logic_vector((abits -1) downto 0); DI : in std_logic_vector((dbits -1) downto 0); DOUT : out std_logic_vector((dbits -1) downto 0); CK : in std_logic;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -