📄 mem_ec_gen.vhd
字号:
-------------------------------------------------------------------------------- This file is a part of the GRLIB VHDL IP LIBRARY-- Copyright (C) 2003, Gaisler Research---- This program is free software; you can redistribute it and/or modify-- it under the terms of the GNU General Public License as published by-- the Free Software Foundation; either version 2 of the License, or-- (at your option) any later version.---- This program is distributed in the hope that it will be useful,-- but WITHOUT ANY WARRANTY; without even the implied warranty of-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the-- GNU General Public License for more details.---- You should have received a copy of the GNU General Public License-- along with this program; if not, write to the Free Software-- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ------------------------------------------------------------------------------- Entity: various-- File: mem_ec_gen.vhd-- Author: Jiri Gaisler - Gaisler Research-- Description: Memory generators for Lattice XP/EC/ECP RAM blocks------------------------------------------------------------------------------library ieee;use ieee.std_logic_1164.all;-- pragma translate_offlibrary ec;use ec.dp8ka;-- pragma translate_onentity EC_RAMB8_S1_S1 is port ( DataInA: in std_logic_vector(0 downto 0); DataInB: in std_logic_vector(0 downto 0); AddressA: in std_logic_vector(12 downto 0); AddressB: in std_logic_vector(12 downto 0); ClockA: in std_logic; ClockB: in std_logic; ClockEnA: in std_logic; ClockEnB: in std_logic; WrA: in std_logic; WrB: in std_logic; QA: out std_logic_vector(0 downto 0); QB: out std_logic_vector(0 downto 0));end;architecture Structure of EC_RAMB8_S1_S1 is COMPONENT dp8ka GENERIC( DATA_WIDTH_A : in Integer := 18; DATA_WIDTH_B : in Integer := 18; REGMODE_A : String := "NOREG"; REGMODE_B : String := "NOREG"; RESETMODE : String := "ASYNC"; CSDECODE_A : String := "000"; CSDECODE_B : String := "000"; WRITEMODE_A : String := "NORMAL"; WRITEMODE_B : String := "NORMAL"; GSR : String := "ENABLED"; initval_00 : string := "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000"; initval_01 : string := "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000"; initval_02 : string := "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000"; initval_03 : string := "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000"; initval_04 : string := "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000"; initval_05 : string := "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000"; initval_06 : string := "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000"; initval_07 : string := "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000"; initval_08 : string := "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000"; initval_09 : string := "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000"; initval_0a : string := "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000"; initval_0b : string := "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000"; initval_0c : string := "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000"; initval_0d : string := "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000"; initval_0e : string := "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000"; initval_0f : string := "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000"; initval_10 : string := "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000"; initval_11 : string := "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000"; initval_12 : string := "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000"; initval_13 : string := "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000"; initval_14 : string := "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000"; initval_15 : string := "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000"; initval_16 : string := "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000"; initval_17 : string := "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000"; initval_18 : string := "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000"; initval_19 : string := "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000"; initval_1a : string := "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000"; initval_1b : string := "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000"; initval_1c : string := "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000"; initval_1d : string := "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000"; initval_1e : string := "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000"; initval_1f : string := "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000" ); PORT( dia0, dia1, dia2, dia3, dia4, dia5, dia6, dia7, dia8 : in std_logic := 'X'; dia9, dia10, dia11, dia12, dia13, dia14, dia15, dia16, dia17 : in std_logic := 'X'; ada0, ada1, ada2, ada3, ada4, ada5, ada6, ada7, ada8 : in std_logic := 'X'; ada9, ada10, ada11, ada12 : in std_logic := 'X'; cea, clka, wea, csa0, csa1, csa2, rsta : in std_logic := 'X'; dib0, dib1, dib2, dib3, dib4, dib5, dib6, dib7, dib8 : in std_logic := 'X'; dib9, dib10, dib11, dib12, dib13, dib14, dib15, dib16, dib17 : in std_logic := 'X'; adb0, adb1, adb2, adb3, adb4, adb5, adb6, adb7, adb8 : in std_logic := 'X'; adb9, adb10, adb11, adb12 : in std_logic := 'X'; ceb, clkb, web, csb0, csb1, csb2, rstb : in std_logic := 'X'; doa0, doa1, doa2, doa3, doa4, doa5, doa6, doa7, doa8 : out std_logic := 'X'; doa9, doa10, doa11, doa12, doa13, doa14, doa15, doa16, doa17 : out std_logic := 'X'; dob0, dob1, dob2, dob3, dob4, dob5, dob6, dob7, dob8 : out std_logic := 'X'; dob9, dob10, dob11, dob12, dob13, dob14, dob15, dob16, dob17 : out std_logic := 'X' ); END COMPONENT;signal vcc, gnd : std_ulogic;begin vcc <= '1'; gnd <= '0'; u0: DP8KA generic map (CSDECODE_B=>"000", CSDECODE_A=>"000", WRITEMODE_B=>"NORMAL", WRITEMODE_A=>"NORMAL", GSR=>"DISABLED", RESETMODE=>"ASYNC", REGMODE_B=>"NOREG", REGMODE_A=>"NOREG", DATA_WIDTH_B=> 1, DATA_WIDTH_A=> 1) port map (CEA=>ClockEnA, CLKA=>ClockA, WEA=>WrA, CSA0=>gnd, CSA1=>gnd, CSA2=>gnd, RSTA=>gnd, CEB=>ClockEnB, CLKB=>ClockB, WEB=>WrB, CSB0=>gnd, CSB1=>gnd, CSB2=>gnd, RSTB=>gnd, DIA0=>gnd, DIA1=>gnd, DIA2=>gnd, DIA3=>gnd, DIA4=>gnd, DIA5=>gnd, DIA6=>gnd, DIA7=>gnd, DIA8=>gnd, DIA9=>gnd, DIA10=>gnd, DIA11=>DataInA(0), DIA12=>gnd, DIA13=>gnd, DIA14=>gnd, DIA15=>gnd, DIA16=>gnd, DIA17=>gnd, ADA0=>AddressA(0), ADA1=>AddressA(1), ADA2=>AddressA(2), ADA3=>AddressA(3), ADA4=>AddressA(4), ADA5=>AddressA(5), ADA6=>AddressA(6), ADA7=>AddressA(7), ADA8=>AddressA(8), ADA9=>AddressA(9), ADA10=>AddressA(10), ADA11=>AddressA(11), ADA12=>AddressA(12), DIB0=>gnd, DIB1=>gnd, DIB2=>gnd, DIB3=>gnd, DIB4=>gnd, DIB5=>gnd, DIB6=>gnd, DIB7=>gnd, DIB8=>gnd, DIB9=>gnd, DIB10=>gnd, DIB11=>DataInB(0), DIB12=>gnd, DIB13=>gnd, DIB14=>gnd, DIB15=>gnd, DIB16=>gnd, DIB17=>gnd, ADB0=>AddressB(0), ADB1=>AddressB(1), ADB2=>AddressB(2), ADB3=>AddressB(3), ADB4=>AddressB(4), ADB5=>AddressB(5), ADB6=>AddressB(6), ADB7=>AddressB(7), ADB8=>AddressB(8), ADB9=>AddressB(9), ADB10=>AddressB(10), ADB11=>AddressB(11), ADB12=>AddressB(12), DOA0=>QA(0), DOA1=>open, DOA2=>open, DOA3=>open, DOA4=>open, DOA5=>open, DOA6=>open, DOA7=>open, DOA8=>open, DOA9=>open, DOA10=>open, DOA11=>open, DOA12=>open, DOA13=>open, DOA14=>open, DOA15=>open, DOA16=>open, DOA17=>open, DOB0=>QB(0), DOB1=>open, DOB2=>open, DOB3=>open, DOB4=>open, DOB5=>open, DOB6=>open, DOB7=>open, DOB8=>open, DOB9=>open, DOB10=>open, DOB11=>open, DOB12=>open, DOB13=>open, DOB14=>open, DOB15=>open, DOB16=>open, DOB17=>open);end;library ieee;use ieee.std_logic_1164.all;-- pragma translate_offlibrary ec;use ec.dp8ka;-- pragma translate_onentity EC_RAMB8_S2_S2 is port ( DataInA: in std_logic_vector(1 downto 0); DataInB: in std_logic_vector(1 downto 0); AddressA: in std_logic_vector(11 downto 0); AddressB: in std_logic_vector(11 downto 0); ClockA: in std_logic; ClockB: in std_logic; ClockEnA: in std_logic; ClockEnB: in std_logic; WrA: in std_logic; WrB: in std_logic; QA: out std_logic_vector(1 downto 0); QB: out std_logic_vector(1 downto 0));end;architecture Structure of EC_RAMB8_S2_S2 is COMPONENT dp8ka GENERIC( DATA_WIDTH_A : in Integer := 18; DATA_WIDTH_B : in Integer := 18; REGMODE_A : String := "NOREG"; REGMODE_B : String := "NOREG"; RESETMODE : String := "ASYNC"; CSDECODE_A : String := "000"; CSDECODE_B : String := "000"; WRITEMODE_A : String := "NORMAL"; WRITEMODE_B : String := "NORMAL"; GSR : String := "ENABLED"; initval_00 : string := "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000"; initval_01 : string := "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000"; initval_02 : string := "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000"; initval_03 : string := "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000"; initval_04 : string := "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000"; initval_05 : string := "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000"; initval_06 : string := "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000"; initval_07 : string := "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000"; initval_08 : string := "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000";
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -