1 ------------------------------------------------------------------------------- 2 -- File : QuadPortRam.vhd 3 -- Company : SLAC National Accelerator Laboratory 4 -- Created : 2013-12-18 5 -- Last update: 2016-04-19 6 ------------------------------------------------------------------------------- 7 -- Description: This module infers a Quad Port RAM as distributed RAM 8 ------------------------------------------------------------------------------- 9 -- This file is part of 'SLAC Firmware Standard Library'. 10 -- It is subject to the license terms in the LICENSE.txt file found in the 11 -- top-level directory of this distribution and at: 12 -- https://confluence.slac.stanford.edu/display/ppareg/LICENSE.html. 13 -- No part of 'SLAC Firmware Standard Library', including this file, 14 -- may be copied, modified, propagated, or distributed except according to 15 -- the terms contained in the LICENSE.txt file. 16 ------------------------------------------------------------------------------- 19 use ieee.std_logic_1164.
all;
20 use ieee.std_logic_arith.
all;
21 use ieee.std_logic_unsigned.
all;
39 -- Port A (Read/Write) 72 constant FULL_DATA_WIDTH_C : := NUM_BYTES_C*BYTE_WIDTH_G;
79 signal mem : mem_type := (others => INIT_C);
83 -- Attribute for XST (Xilinx Synthesis) 84 attribute ram_style : ;
85 attribute ram_style of mem : signal is "distributed";
87 attribute ram_extract : ;
88 attribute ram_extract of mem : signal is "TRUE";
90 -- Attribute for Synplicity Synthesizer 91 attribute syn_ramstyle : ;
92 attribute syn_ramstyle of mem : signal is "distributed";
94 attribute syn_keep : ;
95 attribute syn_keep of mem : signal is "TRUE";
102 report "MODE_G must be either no-change, read-first, or write-first" 108 PORT_A_NOT_REG : if (REG_EN_G = false) generate 112 if rising_edge(clka) then 114 for i in NUM_BYTES_C-1 downto 0 loop 115 if (weaByteInt(i) = '1') then 129 PORT_A_REG : if (REG_EN_G = true) generate 131 NO_CHANGE_MODE : if MODE_G = "no-change" generate 134 if rising_edge(clka) then 136 for i in NUM_BYTES_C-1 downto 0 loop 137 if (weaByteInt(i) = '1') then 148 if rising_edge(clka) then 149 if (en_a = '1' and weaByteInt = 0) then 160 READ_FIRST_MODE : if MODE_G = "read-first" generate 163 if rising_edge(clka) then 166 for i in 0 to NUM_BYTES_C-1 loop 167 if (weaByteInt(i) = '1') then 180 WRITE_FIRST_MODE : if MODE_G = "write-first" generate 183 if rising_edge(clka) then 185 for i in NUM_BYTES_C-1 downto 0 loop 186 if (weaByteInt(i) = '1') then 204 PORT_B_REG : if (REG_EN_G = true) generate 207 if rising_edge(clkb) then 210 elsif en_b = '1' then 217 PORT_B_NOT_REG : if (REG_EN_G = false) generate 222 PORT_C_REG : if (REG_EN_G = true) generate 225 if rising_edge(clkc) then 228 elsif en_c = '1' then 235 PORT_C_NOT_REG : if (REG_EN_G = false) generate 240 PORT_D_REG : if (REG_EN_G = true) generate 243 if rising_edge(clkd) then 246 elsif en_d = '1' then 253 PORT_D_NOT_REG : if (REG_EN_G = false) generate
in rstdsl :=not ( RST_POLARITY_G)
in dinaslv( DATA_WIDTH_G- 1 downto 0) :=( others => '0')
in weaByteslv( wordCount( DATA_WIDTH_G, BYTE_WIDTH_G)- 1 downto 0) :=( others => '0')
BYTE_WR_EN_Gboolean := false
ADDR_WIDTH_Ginteger range 1 to ( 2** 24):= 4
out doutdslv( DATA_WIDTH_G- 1 downto 0)
out doutaslv( DATA_WIDTH_G- 1 downto 0)
MODE_Gstring := "read-first"
in addraslv( ADDR_WIDTH_G- 1 downto 0) :=( others => '0')
out doutbslv( DATA_WIDTH_G- 1 downto 0)
in rstcsl :=not ( RST_POLARITY_G)
out doutcslv( DATA_WIDTH_G- 1 downto 0)
in addrcslv( ADDR_WIDTH_G- 1 downto 0) :=( others => '0')
in addrdslv( ADDR_WIDTH_G- 1 downto 0) :=( others => '0')
in addrbslv( ADDR_WIDTH_G- 1 downto 0) :=( others => '0')
in rstasl :=not ( RST_POLARITY_G)
in rstbsl :=not ( RST_POLARITY_G)
DATA_WIDTH_Ginteger range 1 to ( 2** 24):= 16