📄 tech_fs90.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_fs90-- File: tech_fs90.vhd-- Author: Jiri Gaisler - Gaisler Research-- Description: Contains UMC (Farraday Technology) FS90A/B specific pads and-- ram generators------------------------------------------------------------------------------LIBRARY ieee;use IEEE.std_logic_1164.all;use work.leon_iface.all;package tech_fs90 is-- sync ram generator component fs90_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 fs90_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 fs90_inpad port (pad : in std_logic; q : out std_logic); end component; component fs90_smpad port (pad : in std_logic; q : out std_logic); end component; component fs90_outpad generic (drive : integer := 1); port (d : in std_logic; pad : out std_logic); end component; component fs90_toutpadu generic (drive : integer := 1); port (d, en : in std_logic; pad : out std_logic); end component; component fs90_iopad generic (drive : integer := 1); port ( d, en : in std_logic; q : out std_logic; pad : inout std_logic); end component; component fs90_smiopad generic (drive : integer := 1); port ( d, en : in std_logic; q : out std_logic; pad : inout std_logic); end component; component fs90_iopadu generic (drive : integer := 1); port ( d, en : in std_logic; q : out std_logic; pad : inout std_logic); end component; component fs90_iodpad generic (drive : integer := 1); port ( d : in std_logic; q : out std_logic; pad : inout std_logic); end component; component fs90_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 uyfaa is port ( o : out std_logic; i : in std_logic; pu : in std_logic; pd : in std_logic; smt : in std_logic); end; architecture rtl of uyfaa is signal inode : std_logic;begin inode <= to_x01(i) after 1 ns; inode <= 'H' when pu = '1' else 'L' when pd = '1' else 'Z'; o <= to_x01(inode);end;-- output padlibrary IEEE;use IEEE.std_logic_1164.all;entity vyfa2gsa is port ( o : out std_logic; i : in std_logic; e : in std_logic; e2 : in std_logic; e4 : in std_logic; e8 : in std_logic; sr : in std_logic);end; architecture rtl of vyfa2gsa is begin o <= to_x01(i) after 2 ns when e = '1' else 'Z' after 2 ns;end;-- bidirectional padlibrary IEEE;use IEEE.std_logic_1164.all;entity wyfa2gsa is port ( o : out std_logic; i : in std_logic; io : inout std_logic; e : in std_logic; e2 : in std_logic; e4 : in std_logic; e8 : in std_logic; sr : in std_logic; pu : in std_logic; pd : in std_logic; smt : in std_logic); end; architecture rtl of wyfa2gsa is begin io <= to_x01(i) after 2 ns when e = '1' else 'Z' after 2 ns; io <= 'H' when pu = '1' else 'L' when pd = '1' else 'Z'; o <= to_x01(io);end;-------------------------------------------------------------------- behavioural ram models ------------------------------------------------------------------------------------------------------------ synchronous ram library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_arith.all;use work.leon_iface.all;entity fs90_syncram_sim 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); cselect : in std_logic; oenable : in std_logic; write : in std_logic ); end; architecture behavioral of fs90_syncram_sim is type mem is array(0 to (2**abits -1)) of std_logic_vector((dbits -1) downto 0); signal memarr : mem;begin main : process(clk, memarr) variable do : std_logic_vector((dbits -1) downto 0); begin if rising_edge(clk) then do := (others => 'X'); if cselect = '1' then if (write = '0') and not is_x(address) then memarr(conv_integer(unsigned(address))) <= datain; end if; if (write = '1') and not is_x(address) then do := memarr(conv_integer(unsigned(address))); end if; end if; if oenable = '1' then dataout <= do; else dataout <= (others => 'Z'); end if; end if; end process;end;-- 2-port ramLIBRARY ieee;use IEEE.std_logic_1164.all;use IEEE.std_logic_arith.all;entity fs90_dpram_ss 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; sela, selb : in std_logic; oe : in std_logic; q: out std_logic_vector (dbits -1 downto 0) );end;architecture behav of fs90_dpram_ss is type mem is array(0 to (2**abits -1)) of std_logic_vector((dbits -1) downto 0); signal memarr : mem;begin main : process(clka, clkb, memarr) variable do : std_logic_vector((dbits -1) downto 0); begin if rising_edge(clka) then do := (others => 'X'); if sela = '1' then if ((wren = '1') or (rdaddress /= wraddress)) and not is_x(rdaddress) then do := memarr(conv_integer(unsigned(rdaddress))); end if; end if; if oe = '1' then q <= do; else q <= (others => 'Z'); end if; end if; if rising_edge(clkb) then if (selb = '1') and (wren = '0') and not is_x(wraddress) then memarr(conv_integer(unsigned(wraddress))) <= data; end if; end if; end process;end;LIBRARY ieee;use IEEE.std_logic_1164.all;package tech_fs90_sim iscomponent fs90_syncram_sim 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); cselect : in std_logic; oenable : in std_logic; write : in std_logic ); end component;component fs90_dpram_ss 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; sela, selb : in std_logic; oe : in std_logic; q: out std_logic_vector (dbits -1 downto 0) );end component;end;-- Syncronous SRAM-- Address, control and data signals latched on rising CK. -- Write enable (WEB) active low.library ieee;use IEEE.std_logic_1164.all;use work.tech_fs90_sim.all;entity SA108019 is -- 128x25 port (A0, A1, A2, A3, A4, A5, A6, DI0, DI1, DI2, DI3, DI4, DI5, DI6, DI7, DI8, DI9, DI10, DI11, DI12, DI13, DI14, DI15, DI16, DI17, DI18, DI19, DI20, DI21, DI22, DI23, DI24, CK, CS, OE, WEB : in std_logic; DO0, DO1, DO2, DO3, DO4, DO5, DO6, DO7, DO8, DO9, DO10, DO11, DO12, DO13, DO14, DO15, DO16, DO17, DO18, DO19, DO20, DO21, DO22, DO23, DO24: out std_logic );end;architecture behavioral of SA108019 issignal din, dout : std_logic_vector(24 downto 0);signal addr : std_logic_vector(6 downto 0);begin addr <= a6&a5&a4&a3&a2&a1&a0; din <= di24&di23&di22&di21&di20&di19&di18&di17&di16&di15&di14&di13&di12& di11&di10&di9&di8&di7&di6&di5&di4&di3&di2&di1&di0; do24 <= dout(24); do23 <= dout(23); do22 <= dout(22); do21 <= dout(21); do20 <= dout(20); do19 <= dout(19); do18 <= dout(18); do17 <= dout(17); do16 <= dout(16); do15 <= dout(15); do14 <= dout(14); do13 <= dout(13); do12 <= dout(12); do11 <= dout(11); do10 <= dout(10); do9 <= dout(9); do8 <= dout(8); do7 <= dout(7); do6 <= dout(6); do5 <= dout(5); do4 <= dout(4); do3 <= dout(3); do2 <= dout(2); do1 <= dout(1); do0 <= dout(0); syncram0 : fs90_syncram_sim generic map ( abits => 7, dbits => 25) port map ( addr, ck, din, dout, cs, oe, web);end behavioral;library ieee;use IEEE.std_logic_1164.all;use work.tech_fs90_sim.all;entity SU004020 is -- 512x32 port (A0, A1, A2, A3, A4, A5, A6, A7, A8, DI0, DI1, DI2, DI3, DI4, DI5, DI6, DI7, DI8, DI9, DI10, DI11, DI12, DI13, DI14, DI15, DI16, DI17, DI18, DI19, DI20, DI21, DI22, DI23, DI24, DI25, DI26, DI27, DI28, DI29, DI30, DI31, CK, CS, OE, WEB : in std_logic; DO0, DO1, DO2, DO3, DO4, DO5, DO6, DO7, DO8, DO9, DO10, DO11, DO12, DO13, DO14, DO15, DO16, DO17, DO18, DO19, DO20, DO21, DO22, DO23, DO24, DO25, DO26, DO27, DO28, DO29, DO30, DO31: out std_logic );end;architecture behavioral of SU004020 issignal din, dout : std_logic_vector(31 downto 0);signal addr : std_logic_vector(8 downto 0);begin addr <= a8&a7&a6&a5&a4&a3&a2&a1&a0; din <= di31&di30&di29&di28&di27&di26&di25&di24&di23&di22&di21&di20&di19& di18&di17&di16&di15&di14&di13&di12&di11&di10&di9&di8&di7&di6&di5& di4&di3&di2&di1&di0; do31 <= dout(31); do30 <= dout(30); do29 <= dout(29); do28 <= dout(28); do27 <= dout(27); do26 <= dout(26); do25 <= dout(25); do24 <= dout(24); do23 <= dout(23); do22 <= dout(22); do21 <= dout(21); do20 <= dout(20); do19 <= dout(19); do18 <= dout(18); do17 <= dout(17); do16 <= dout(16); do15 <= dout(15); do14 <= dout(14); do13 <= dout(13); do12 <= dout(12); do11 <= dout(11); do10 <= dout(10); do9 <= dout(9); do8 <= dout(8); do7 <= dout(7); do6 <= dout(6); do5 <= dout(5); do4 <= dout(4); do3 <= dout(3); do2 <= dout(2); do1 <= dout(1); do0 <= dout(0); syncram0 : fs90_syncram_sim generic map ( abits => 9, dbits => 32) port map ( addr, ck, din, dout, cs, oe, web);end behavioral;library ieee;use IEEE.std_logic_1164.all;use work.tech_fs90_sim.all;entity SW204420 is port (A0, A1, A2, A3, A4, A5, A6, A7, B0, B1, B2, B3, B4, B5, B6, B7, DI0, DI1, DI2, DI3, DI4, DI5, DI6, DI7, DI8, DI9, DI10, DI11, DI12, DI13, DI14, DI15, DI16, DI17, DI18, DI19, DI20, DI21, DI22, DI23, DI24, DI25, DI26, DI27, DI28, DI29, DI30, DI31, CKA, CKB, CSA, CSB, OE, WEB : in std_logic; DO0, DO1, DO2, DO3, DO4, DO5, DO6, DO7, DO8, DO9, DO10, DO11, DO12, DO13, DO14, DO15, DO16, DO17, DO18, DO19, DO20, DO21, DO22, DO23, DO24, DO25, DO26, DO27, DO28, DO29, DO30, DO31: out std_logic );end;architecture behavioral of SW204420 issignal din, dout : std_logic_vector(31 downto 0);signal addra, addrb : std_logic_vector(7 downto 0);begin addra <= a7&a6&a5&a4&a3&a2&a1&a0; addrb <= b7&b6&b5&b4&b3&b2&b1&b0; din <= di31&di30&di29&di28&di27&di26&di25&di24&di23&di22&di21&di20&di19& di18&di17&di16&di15&di14&di13&di12&di11&di10&di9&di8&di7&di6&di5& di4&di3&di2&di1&di0; do31 <= dout(31); do30 <= dout(30); do29 <= dout(29); do28 <= dout(28); do27 <= dout(27); do26 <= dout(26); do25 <= dout(25); do24 <= dout(24); do23 <= dout(23); do22 <= dout(22); do21 <= dout(21); do20 <= dout(20); do19 <= dout(19); do18 <= dout(18); do17 <= dout(17); do16 <= dout(16); do15 <= dout(15); do14 <= dout(14); do13 <= dout(13); do12 <= dout(12); do11 <= dout(11); do10 <= dout(10); do9 <= dout(9); do8 <= dout(8); do7 <= dout(7); do6 <= dout(6); do5 <= dout(5); do4 <= dout(4); do3 <= dout(3); do2 <= dout(2); do1 <= dout(1); do0 <= dout(0); dpram0 : fs90_dpram_ss generic map ( abits => 8, dbits => 32) port map ( din, addra, addrb, web, cka, ckb, csa, csb, oe, dout);end;-- pragma translate_on-- component declarations from true tech libraryLIBRARY ieee;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -