-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
--
|
--
|
-- Copyright 2020
|
-- Copyright 2020
|
-- ASTRON (Netherlands Institute for Radio Astronomy) <http://www.astron.nl/>
|
-- ASTRON (Netherlands Institute for Radio Astronomy) <http://www.astron.nl/>
|
-- P.O.Box 2, 7990 AA Dwingeloo, The Netherlands
|
-- P.O.Box 2, 7990 AA Dwingeloo, The Netherlands
|
--
|
--
|
-- Licensed under the Apache License, Version 2.0 (the "License");
|
-- Licensed under the Apache License, Version 2.0 (the "License");
|
-- you may not use this file except in compliance with the License.
|
-- you may not use this file except in compliance with the License.
|
-- You may obtain a copy of the License at
|
-- You may obtain a copy of the License at
|
--
|
--
|
-- http://www.apache.org/licenses/LICENSE-2.0
|
-- http://www.apache.org/licenses/LICENSE-2.0
|
--
|
--
|
-- Unless required by applicable law or agreed to in writing, software
|
-- Unless required by applicable law or agreed to in writing, software
|
-- distributed under the License is distributed on an "AS IS" BASIS,
|
-- distributed under the License is distributed on an "AS IS" BASIS,
|
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
-- See the License for the specific language governing permissions and
|
-- See the License for the specific language governing permissions and
|
-- limitations under the License.
|
-- limitations under the License.
|
--
|
--
|
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
|
|
LIBRARY ieee, technology_lib;
|
LIBRARY ieee;
|
USE ieee.std_logic_1164.all;
|
USE ieee.std_logic_1164.all;
|
USE work.tech_memory_component_pkg.ALL;
|
USE work.tech_memory_component_pkg.ALL;
|
USE technology_lib.technology_pkg.ALL;
|
--USE technology_lib.technology_pkg.ALL;
|
USE technology_lib.technology_select_pkg.ALL;
|
--USE technology_lib.technology_select_pkg.ALL;
|
|
|
-- Declare IP libraries to ensure default binding in simulation. The IP library clause is ignored by synthesis.
|
-- Declare IP libraries to ensure default binding in simulation. The IP library clause is ignored by synthesis.
|
LIBRARY ip_stratixiv_ram_lib;
|
--LIBRARY ip_stratixiv_ram_lib;
|
--LIBRARY ip_arria10_ram_lib;
|
--LIBRARY ip_arria10_ram_lib;
|
--LIBRARY ip_arria10_e3sge3_ram_lib;
|
--LIBRARY ip_arria10_e3sge3_ram_lib;
|
--LIBRARY ip_arria10_e1sg_ram_lib;
|
--LIBRARY ip_arria10_e1sg_ram_lib;
|
|
|
ENTITY tech_memory_ram_cr_cw IS
|
ENTITY tech_memory_ram_cr_cw IS
|
GENERIC (
|
GENERIC (
|
g_technology : NATURAL := c_tech_select_default;
|
g_technology : NATURAL := 0; --c_tech_select_default;
|
g_adr_w : NATURAL := 5;
|
g_adr_w : NATURAL := 5;
|
g_dat_w : NATURAL := 8;
|
g_dat_w : NATURAL := 8;
|
g_nof_words : NATURAL := 2**5;
|
g_nof_words : NATURAL := 2**5;
|
g_rd_latency : NATURAL := 2; -- choose 1 or 2
|
g_rd_latency : NATURAL := 2; -- choose 1 or 2
|
g_init_file : STRING := "UNUSED"
|
g_init_file : STRING := "UNUSED"
|
);
|
);
|
PORT
|
PORT
|
(
|
(
|
data : IN STD_LOGIC_VECTOR (g_dat_w-1 DOWNTO 0);
|
data : IN STD_LOGIC_VECTOR (g_dat_w-1 DOWNTO 0);
|
rdaddress : IN STD_LOGIC_VECTOR (g_adr_w-1 DOWNTO 0);
|
rdaddress : IN STD_LOGIC_VECTOR (g_adr_w-1 DOWNTO 0);
|
rdclock : IN STD_LOGIC ;
|
rdclock : IN STD_LOGIC ;
|
rdclocken : IN STD_LOGIC := '1';
|
rdclocken : IN STD_LOGIC := '1';
|
wraddress : IN STD_LOGIC_VECTOR (g_adr_w-1 DOWNTO 0);
|
wraddress : IN STD_LOGIC_VECTOR (g_adr_w-1 DOWNTO 0);
|
wrclock : IN STD_LOGIC := '1';
|
wrclock : IN STD_LOGIC := '1';
|
wrclocken : IN STD_LOGIC := '1';
|
wrclocken : IN STD_LOGIC := '1';
|
wren : IN STD_LOGIC := '0';
|
wren : IN STD_LOGIC := '0';
|
q : OUT STD_LOGIC_VECTOR (g_dat_w-1 DOWNTO 0)
|
q : OUT STD_LOGIC_VECTOR (g_dat_w-1 DOWNTO 0)
|
);
|
);
|
END tech_memory_ram_cr_cw;
|
END tech_memory_ram_cr_cw;
|
|
|
ARCHITECTURE str OF tech_memory_ram_cr_cw IS
|
ARCHITECTURE str OF tech_memory_ram_cr_cw IS
|
BEGIN
|
BEGIN
|
|
|
gen_ip_stratixiv : IF g_technology=c_tech_stratixiv GENERATE
|
gen_ip_stratixiv : IF g_technology=0 GENERATE
|
u0 : ip_stratixiv_ram_cr_cw
|
u0 : ip_stratixiv_ram_cr_cw
|
GENERIC MAP (g_adr_w, g_dat_w, g_nof_words, g_rd_latency, g_init_file)
|
GENERIC MAP (g_adr_w, g_dat_w, g_nof_words, g_rd_latency, g_init_file)
|
PORT MAP (data, rdaddress, rdclock, rdclocken, wraddress, wrclock, wrclocken, wren, q);
|
PORT MAP (data, rdaddress, rdclock, rdclocken, wraddress, wrclock, wrclocken, wren, q);
|
END GENERATE;
|
END GENERATE;
|
|
|
-- gen_ip_arria10 : IF g_technology=c_tech_arria10 GENERATE
|
-- gen_ip_arria10 : IF g_technology=c_tech_arria10 GENERATE
|
-- u0 : ip_arria10_ram_cr_cw
|
-- u0 : ip_arria10_ram_cr_cw
|
-- GENERIC MAP (FALSE, g_adr_w, g_dat_w, g_nof_words, g_rd_latency, g_init_file)
|
-- GENERIC MAP (FALSE, g_adr_w, g_dat_w, g_nof_words, g_rd_latency, g_init_file)
|
-- PORT MAP (data, rdaddress, rdclock, wraddress, wrclock, wren, q);
|
-- PORT MAP (data, rdaddress, rdclock, wraddress, wrclock, wren, q);
|
-- END GENERATE;
|
-- END GENERATE;
|
--
|
--
|
-- gen_ip_arria10_e3sge3 : IF g_technology=c_tech_arria10_e3sge3 GENERATE
|
-- gen_ip_arria10_e3sge3 : IF g_technology=c_tech_arria10_e3sge3 GENERATE
|
-- u0 : ip_arria10_e3sge3_ram_cr_cw
|
-- u0 : ip_arria10_e3sge3_ram_cr_cw
|
-- GENERIC MAP (FALSE, g_adr_w, g_dat_w, g_nof_words, g_rd_latency, g_init_file)
|
-- GENERIC MAP (FALSE, g_adr_w, g_dat_w, g_nof_words, g_rd_latency, g_init_file)
|
-- PORT MAP (data, rdaddress, rdclock, wraddress, wrclock, wren, q);
|
-- PORT MAP (data, rdaddress, rdclock, wraddress, wrclock, wren, q);
|
-- END GENERATE;
|
-- END GENERATE;
|
--
|
--
|
-- gen_ip_arria10_e1sg : IF g_technology=c_tech_arria10_e1sg GENERATE
|
-- gen_ip_arria10_e1sg : IF g_technology=c_tech_arria10_e1sg GENERATE
|
-- u0 : ip_arria10_e1sg_ram_cr_cw
|
-- u0 : ip_arria10_e1sg_ram_cr_cw
|
-- GENERIC MAP (FALSE, g_adr_w, g_dat_w, g_nof_words, g_rd_latency, g_init_file)
|
-- GENERIC MAP (FALSE, g_adr_w, g_dat_w, g_nof_words, g_rd_latency, g_init_file)
|
-- PORT MAP (data, rdaddress, rdclock, wraddress, wrclock, wren, q);
|
-- PORT MAP (data, rdaddress, rdclock, wraddress, wrclock, wren, q);
|
-- END GENERATE;
|
-- END GENERATE;
|
|
|
END ARCHITECTURE;
|
END ARCHITECTURE;
|
|
|