1 |
2 |
danv |
-------------------------------------------------------------------------------
|
2 |
|
|
--
|
3 |
|
|
-- Copyright (C) 2014
|
4 |
|
|
-- ASTRON (Netherlands Institute for Radio Astronomy) <http://www.astron.nl/>
|
5 |
|
|
-- P.O.Box 2, 7990 AA Dwingeloo, The Netherlands
|
6 |
|
|
--
|
7 |
|
|
-- This program is free software: you can redistribute it and/or modify
|
8 |
|
|
-- it under the terms of the GNU General Public License as published by
|
9 |
|
|
-- the Free Software Foundation, either version 3 of the License, or
|
10 |
|
|
-- (at your option) any later version.
|
11 |
|
|
--
|
12 |
|
|
-- This program is distributed in the hope that it will be useful,
|
13 |
|
|
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
|
14 |
|
|
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
15 |
|
|
-- GNU General Public License for more details.
|
16 |
|
|
--
|
17 |
|
|
-- You should have received a copy of the GNU General Public License
|
18 |
|
|
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
|
19 |
|
|
--
|
20 |
|
|
-------------------------------------------------------------------------------
|
21 |
|
|
|
22 |
|
|
LIBRARY ieee, technology_lib;
|
23 |
|
|
USE ieee.std_logic_1164.all;
|
24 |
|
|
USE work.tech_memory_component_pkg.ALL;
|
25 |
|
|
USE technology_lib.technology_pkg.ALL;
|
26 |
|
|
USE technology_lib.technology_select_pkg.ALL;
|
27 |
|
|
|
28 |
|
|
-- Declare IP libraries to ensure default binding in simulation. The IP library clause is ignored by synthesis.
|
29 |
|
|
LIBRARY ip_stratixiv_ram_lib;
|
30 |
|
|
--LIBRARY ip_arria10_ram_lib;
|
31 |
|
|
--LIBRARY ip_arria10_e3sge3_ram_lib;
|
32 |
|
|
--LIBRARY ip_arria10_e1sg_ram_lib;
|
33 |
|
|
|
34 |
|
|
ENTITY tech_memory_ram_cr_cw IS
|
35 |
|
|
GENERIC (
|
36 |
|
|
g_technology : NATURAL := c_tech_select_default;
|
37 |
|
|
g_adr_w : NATURAL := 5;
|
38 |
|
|
g_dat_w : NATURAL := 8;
|
39 |
|
|
g_nof_words : NATURAL := 2**5;
|
40 |
|
|
g_rd_latency : NATURAL := 2; -- choose 1 or 2
|
41 |
|
|
g_init_file : STRING := "UNUSED"
|
42 |
|
|
);
|
43 |
|
|
PORT
|
44 |
|
|
(
|
45 |
|
|
data : IN STD_LOGIC_VECTOR (g_dat_w-1 DOWNTO 0);
|
46 |
|
|
rdaddress : IN STD_LOGIC_VECTOR (g_adr_w-1 DOWNTO 0);
|
47 |
|
|
rdclock : IN STD_LOGIC ;
|
48 |
|
|
rdclocken : IN STD_LOGIC := '1';
|
49 |
|
|
wraddress : IN STD_LOGIC_VECTOR (g_adr_w-1 DOWNTO 0);
|
50 |
|
|
wrclock : IN STD_LOGIC := '1';
|
51 |
|
|
wrclocken : IN STD_LOGIC := '1';
|
52 |
|
|
wren : IN STD_LOGIC := '0';
|
53 |
|
|
q : OUT STD_LOGIC_VECTOR (g_dat_w-1 DOWNTO 0)
|
54 |
|
|
);
|
55 |
|
|
END tech_memory_ram_cr_cw;
|
56 |
|
|
|
57 |
|
|
ARCHITECTURE str OF tech_memory_ram_cr_cw IS
|
58 |
|
|
BEGIN
|
59 |
|
|
|
60 |
|
|
gen_ip_stratixiv : IF g_technology=c_tech_stratixiv GENERATE
|
61 |
|
|
u0 : ip_stratixiv_ram_cr_cw
|
62 |
|
|
GENERIC MAP (g_adr_w, g_dat_w, g_nof_words, g_rd_latency, g_init_file)
|
63 |
|
|
PORT MAP (data, rdaddress, rdclock, rdclocken, wraddress, wrclock, wrclocken, wren, q);
|
64 |
|
|
END GENERATE;
|
65 |
|
|
|
66 |
|
|
-- gen_ip_arria10 : IF g_technology=c_tech_arria10 GENERATE
|
67 |
|
|
-- u0 : ip_arria10_ram_cr_cw
|
68 |
|
|
-- GENERIC MAP (FALSE, g_adr_w, g_dat_w, g_nof_words, g_rd_latency, g_init_file)
|
69 |
|
|
-- PORT MAP (data, rdaddress, rdclock, wraddress, wrclock, wren, q);
|
70 |
|
|
-- END GENERATE;
|
71 |
|
|
--
|
72 |
|
|
-- gen_ip_arria10_e3sge3 : IF g_technology=c_tech_arria10_e3sge3 GENERATE
|
73 |
|
|
-- u0 : ip_arria10_e3sge3_ram_cr_cw
|
74 |
|
|
-- GENERIC MAP (FALSE, g_adr_w, g_dat_w, g_nof_words, g_rd_latency, g_init_file)
|
75 |
|
|
-- PORT MAP (data, rdaddress, rdclock, wraddress, wrclock, wren, q);
|
76 |
|
|
-- END GENERATE;
|
77 |
|
|
--
|
78 |
|
|
-- gen_ip_arria10_e1sg : IF g_technology=c_tech_arria10_e1sg GENERATE
|
79 |
|
|
-- u0 : ip_arria10_e1sg_ram_cr_cw
|
80 |
|
|
-- GENERIC MAP (FALSE, g_adr_w, g_dat_w, g_nof_words, g_rd_latency, g_init_file)
|
81 |
|
|
-- PORT MAP (data, rdaddress, rdclock, wraddress, wrclock, wren, q);
|
82 |
|
|
-- END GENERATE;
|
83 |
|
|
|
84 |
|
|
END ARCHITECTURE;
|