⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 mem_apa3_gen.vhd

📁 free hardware ip core about sparcv8,a soc cpu in vhdl
💻 VHD
📖 第 1 页 / 共 2 页
字号:
--------------------------------------------------------------------------------  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_apa3_gen.vhd-- Author:	Jiri Gaisler Gaisler Research-- Description:	Memory generators for Actel Proasic3 rams------------------------------------------------------------------------------library ieee;use ieee.std_logic_1164.all;-- pragma translate_offlibrary apa3;use apa3.RAM4K9;-- pragma translate_onentity proasic3_ram4k9 is  generic (abits : integer range 9 to 12 := 9; dbits : integer := 9);  port (    addra, addrb : in  std_logic_vector(abits -1 downto 0);    clka, clkb   : in  std_ulogic;    dia, dib     : in  std_logic_vector(dbits -1 downto 0);    doa, dob     : out std_logic_vector(dbits -1 downto 0);    ena, enb     : in  std_ulogic;    wea, web     : in  std_ulogic   ); end;architecture rtl of proasic3_ram4k9 is  component RAM4K9-- pragma translate_off    generic (abits : integer range 9 to 12 := 9);-- pragma translate_on    port(	ADDRA0, ADDRA1, ADDRA2, ADDRA3, ADDRA4, ADDRA5, ADDRA6, ADDRA7,	ADDRA8, ADDRA9, ADDRA10, ADDRA11 : in std_logic;	ADDRB0, ADDRB1, ADDRB2, ADDRB3, ADDRB4, ADDRB5, ADDRB6, ADDRB7,	ADDRB8, ADDRB9, ADDRB10, ADDRB11 : in std_logic;	BLKA, WENA, PIPEA, WMODEA, WIDTHA0, WIDTHA1, WENB, BLKB,	PIPEB, WMODEB, WIDTHB1, WIDTHB0 : in std_logic;	DINA0, DINA1, DINA2, DINA3, DINA4, DINA5, DINA6, DINA7, DINA8 : in std_logic;	DINB0, DINB1, DINB2, DINB3, DINB4, DINB5, DINB6, DINB7, DINB8 : in std_logic;	RESET, CLKA, CLKB : in std_logic; 	DOUTA0, DOUTA1, DOUTA2, DOUTA3, DOUTA4, DOUTA5, DOUTA6, DOUTA7, DOUTA8 : out std_logic;	DOUTB0, DOUTB1, DOUTB2, DOUTB3, DOUTB4, DOUTB5, DOUTB6, DOUTB7, DOUTB8 : out std_logic    );  end component;  attribute syn_black_box : boolean;  attribute syn_black_box of RAM4K9: component is true;  attribute syn_tco1 : string;  attribute syn_tco2 : string;  attribute syn_tco1 of RAM4K9 : component is  "CLKA->DOUTA0,DOUTA1,DOUTA2,DOUTA3,DOUTA4,DOUTA5,DOUTA6,DOUTA7,DOUTA8 = 3.0";  attribute syn_tco2 of RAM4K9 : component is  "CLKB->DOUTB0,DOUTB1,DOUTB2,DOUTB3,DOUTB4,DOUTB5,DOUTB6,DOUTB7,DOUTB8 = 3.0";	signal gnd, vcc : std_ulogic;signal aa, ab : std_logic_vector(13 downto 0);signal da, db : std_logic_vector(9 downto 0);signal qa, qb : std_logic_vector(9 downto 0);signal width : std_logic_vector(1 downto 0);begin  gnd <= '0'; vcc <= '1';  width <= "11" when abits = 9 else "10" when abits = 10 else           "01" when abits = 11 else "00";  doa <= qa(dbits-1 downto 0); dob <= qb(dbits-1 downto 0);  da(dbits-1 downto 0) <= dia; da(9 downto dbits) <= (others => '0');  db(dbits-1 downto 0) <= dib; db(9 downto dbits) <= (others => '0');  aa(abits-1 downto 0) <= addra; aa(13 downto abits) <= (others => '0');  ab(abits-1 downto 0) <= addrb; ab(13 downto abits) <= (others => '0');    u0 : RAM4K9-- pragma translate_off    generic map (abits => abits) -- pragma translate_on    port map (      ADDRA0 => aa(0), ADDRA1 => aa(1), ADDRA2 => aa(2), ADDRA3 => aa(3),      ADDRA4 => aa(4), ADDRA5 => aa(5), ADDRA6 => aa(6), ADDRA7 => aa(7),      ADDRA8 => aa(8), ADDRA9 => aa(9), ADDRA10 => aa(10), ADDRA11 => aa(11),      ADDRB0 => ab(0), ADDRB1 => ab(1), ADDRB2 => ab(2), ADDRB3 => ab(3),      ADDRB4 => ab(4), ADDRB5 => ab(5), ADDRB6 => ab(6), ADDRB7 => ab(7),      ADDRB8 => ab(8), ADDRB9 => ab(9), ADDRB10 => ab(10), ADDRB11 => ab(11),      BLKA => ena, WENA => wea, PIPEA =>gnd, WMODEA => gnd, WIDTHA0 => width(0), WIDTHA1 => width(1),       BLKB => enb, WENB => web, PIPEB =>gnd, WMODEB => gnd, WIDTHB0 => width(0), WIDTHB1 => width(1),       DINA0 => da(0), DINA1 => da(1), DINA2 => da(2), DINA3 => da(3), DINA4 => da(4),      DINA5 => da(5), DINA6 => da(6), DINA7 => da(7), DINA8 => da(8),      DINB0 => db(0), DINB1 => db(1), DINB2 => db(2), DINB3 => db(3), DINB4 => db(4),      DINB5 => db(5), DINB6 => db(6), DINB7 => db(7), DINB8 => db(8),      RESET => vcc, CLKA => clka, CLKB => clkb,      DOUTA0 => qa(0), DOUTA1 => qa(1), DOUTA2 => qa(2), DOUTA3 => qa(3), DOUTA4 => qa(4),      DOUTA5 => qa(5), DOUTA6 => qa(6), DOUTA7 => qa(7), DOUTA8 => qa(8),      DOUTB0 => qb(0), DOUTB1 => qb(1), DOUTB2 => qb(2), DOUTB3 => qb(3), DOUTB4 => qb(4),      DOUTB5 => qb(5), DOUTB6 => qb(6), DOUTB7 => qb(7), DOUTB8 => qb(8)      );end;library ieee;use ieee.std_logic_1164.all;-- pragma translate_offlibrary apa3;use apa3.RAM512X18;-- pragma translate_onentity proasic3_ram512x18 is  port (    addra, addrb : in  std_logic_vector(8 downto 0);    clka, clkb   : in  std_ulogic;    di           : in  std_logic_vector(17 downto 0);    do           : out std_logic_vector(17 downto 0);    ena, enb     : in  std_ulogic;    wea          : in  std_ulogic   ); end;architecture rtl of proasic3_ram512x18 is  component RAM512X18    port(      RADDR8, RADDR7, RADDR6, RADDR5, RADDR4, RADDR3, RADDR2, RADDR1, RADDR0 : in std_logic;      WADDR8, WADDR7, WADDR6, WADDR5, WADDR4, WADDR3, WADDR2, WADDR1, WADDR0 : in std_logic;      WD17, WD16, WD15, WD14, WD13, WD12, WD11, WD10, WD9,       WD8, WD7, WD6, WD5, WD4, WD3, WD2, WD1, WD0 : in std_logic;      REN, WEN, RESET, RW0, RW1, WW1, WW0, PIPE, RCLK, WCLK : in std_logic;      RD17, RD16, RD15, RD14, RD13, RD12, RD11, RD10, RD9,       RD8, RD7, RD6, RD5, RD4, RD3, RD2, RD1, RD0 : out std_logic    );  end component;  attribute syn_black_box : boolean;  attribute syn_tco1 : string;  attribute syn_black_box of RAM512X18: component is true;  attribute syn_tco1 of RAM512X18 : component is  "RCLK->RD17,RD16,RD15,RD14,RD13,RD12,RD11,RD10,RD9,RD8,RD7,RD6,RD5,RD4,RD3,RD2,RD1,RD0 = 3.0";signal gnd, vcc : std_ulogic;signal width : std_logic_vector(1 downto 0);begin  gnd <= '0'; vcc <= '1';  width <= "10";    u0 : RAM512X18    port map (      RADDR0 => addrb(0), RADDR1 => addrb(1), RADDR2 => addrb(2), RADDR3 => addrb(3),      RADDR4 => addrb(4), RADDR5 => addrb(5), RADDR6 => addrb(6), RADDR7 => addrb(7),      RADDR8 => addrb(8),      WADDR0 => addra(0), WADDR1 => addra(1), WADDR2 => addra(2), WADDR3 => addra(3),      WADDR4 => addra(4), WADDR5 => addra(5), WADDR6 => addra(6), WADDR7 => addra(7),      WADDR8 => addra(8),      WD17 => di(17), WD16 => di(16), WD15 => di(15), WD14 => di(14), WD13 => di(13),      WD12 => di(12), WD11 => di(11), WD10 => di(10), WD9 => di(9),      WD8 => di(8), WD7 => di(7), WD6 => di(6), WD5 => di(5), WD4 => di(4),      WD3 => di(3), WD2 => di(2), WD1 => di(1), WD0 => di(0),      WEN => ena, PIPE => gnd, WW0 => width(0), WW1 => width(1),       REN => enb, RW0 => width(0), RW1 => width(1),       RESET => vcc, WCLK => clka, RCLK => clkb,      RD17 => do(17), RD16 => do(16), RD15 => do(15), RD14 => do(14), RD13 => do(13),      RD12 => do(12), RD11 => do(11), RD10 => do(10), RD9 => do(9),      RD8 => do(8), RD7 => do(7), RD6 => do(6), RD5 => do(5), RD4 => do(4),      RD3 => do(3), RD2 => do(2), RD1 => do(1), RD0 => do(0)      );end;library ieee;use ieee.std_logic_1164.all;entity proasic3_syncram_dp is  generic ( abits : integer := 6; dbits : integer := 8 );  port (    clk1     : in std_ulogic;    address1 : in std_logic_vector((abits -1) downto 0);    datain1  : in std_logic_vector((dbits -1) downto 0);    dataout1 : out std_logic_vector((dbits -1) downto 0);    enable1  : in std_ulogic;    write1   : in std_ulogic;    clk2     : in std_ulogic;    address2 : in std_logic_vector((abits -1) downto 0);    datain2  : in std_logic_vector((dbits -1) downto 0);    dataout2 : out std_logic_vector((dbits -1) downto 0);    enable2  : in std_ulogic;    write2   : in std_ulogic   ); end;architecture rtl of proasic3_syncram_dp is  component proasic3_ram4k9  generic (abits : integer range 9 to 12 := 9; dbits : integer := 9);  port (    addra, addrb : in  std_logic_vector(abits -1 downto 0);    clka, clkb   : in  std_ulogic;    dia, dib     : in  std_logic_vector(dbits -1 downto 0);    doa, dob     : out std_logic_vector(dbits -1 downto 0);    ena, enb     : in  std_ulogic;    wea, web     : in  std_ulogic); 

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -