1 |
2 |
danv |
-------------------------------------------------------------------------------
|
2 |
|
|
--
|
3 |
|
|
-- Copyright (C) 2011
|
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 |
|
|
-- Purpose: Multi page memory
|
23 |
|
|
-- Description:
|
24 |
|
|
-- When next_page_* pulses then the next access will occur in the next page.
|
25 |
|
|
-- Remarks:
|
26 |
|
|
-- . See common_paged_ram_crw_crw for details.
|
27 |
|
|
|
28 |
|
|
LIBRARY IEEE, technology_lib;
|
29 |
|
|
USE IEEE.std_logic_1164.ALL;
|
30 |
|
|
USE IEEE.numeric_std.ALL;
|
31 |
|
|
LIBRARY common_pkg_lib;
|
32 |
|
|
USE common_pkg_lib.common_pkg.ALL;
|
33 |
|
|
USE technology_lib.technology_select_pkg.ALL;
|
34 |
|
|
|
35 |
|
|
ENTITY common_paged_ram_rw_rw IS
|
36 |
|
|
GENERIC (
|
37 |
|
|
g_technology : NATURAL := c_tech_select_default;
|
38 |
|
|
g_str : STRING := "use_adr";
|
39 |
|
|
g_data_w : NATURAL;
|
40 |
|
|
g_nof_pages : NATURAL := 2; -- >= 2
|
41 |
|
|
g_page_sz : NATURAL;
|
42 |
|
|
g_start_page_a : NATURAL := 0;
|
43 |
|
|
g_start_page_b : NATURAL := 0;
|
44 |
|
|
g_rd_latency : NATURAL := 1;
|
45 |
|
|
g_true_dual_port : BOOLEAN := TRUE
|
46 |
|
|
);
|
47 |
|
|
PORT (
|
48 |
|
|
rst : IN STD_LOGIC;
|
49 |
|
|
clk : IN STD_LOGIC;
|
50 |
|
|
clken : IN STD_LOGIC := '1';
|
51 |
|
|
next_page_a : IN STD_LOGIC;
|
52 |
|
|
adr_a : IN STD_LOGIC_VECTOR(ceil_log2(g_page_sz)-1 DOWNTO 0) := (OTHERS=>'0');
|
53 |
|
|
wr_en_a : IN STD_LOGIC := '0';
|
54 |
|
|
wr_dat_a : IN STD_LOGIC_VECTOR(g_data_w-1 DOWNTO 0) := (OTHERS=>'0');
|
55 |
|
|
rd_en_a : IN STD_LOGIC := '1';
|
56 |
|
|
rd_dat_a : OUT STD_LOGIC_VECTOR(g_data_w-1 DOWNTO 0);
|
57 |
|
|
rd_val_a : OUT STD_LOGIC;
|
58 |
|
|
next_page_b : IN STD_LOGIC;
|
59 |
|
|
adr_b : IN STD_LOGIC_VECTOR(ceil_log2(g_page_sz)-1 DOWNTO 0) := (OTHERS=>'0');
|
60 |
|
|
wr_en_b : IN STD_LOGIC := '0';
|
61 |
|
|
wr_dat_b : IN STD_LOGIC_VECTOR(g_data_w-1 DOWNTO 0) := (OTHERS=>'0');
|
62 |
|
|
rd_en_b : IN STD_LOGIC := '1';
|
63 |
|
|
rd_dat_b : OUT STD_LOGIC_VECTOR(g_data_w-1 DOWNTO 0);
|
64 |
|
|
rd_val_b : OUT STD_LOGIC
|
65 |
|
|
);
|
66 |
|
|
END common_paged_ram_rw_rw;
|
67 |
|
|
|
68 |
|
|
|
69 |
|
|
ARCHITECTURE str OF common_paged_ram_rw_rw IS
|
70 |
|
|
|
71 |
|
|
BEGIN
|
72 |
|
|
|
73 |
|
|
u_crw_crw : ENTITY work.common_paged_ram_crw_crw
|
74 |
|
|
GENERIC MAP (
|
75 |
|
|
g_technology => g_technology,
|
76 |
|
|
g_str => g_str,
|
77 |
|
|
g_data_w => g_data_w,
|
78 |
|
|
g_nof_pages => g_nof_pages,
|
79 |
|
|
g_page_sz => g_page_sz,
|
80 |
|
|
g_start_page_a => g_start_page_a,
|
81 |
|
|
g_start_page_b => g_start_page_b,
|
82 |
|
|
g_rd_latency => g_rd_latency,
|
83 |
|
|
g_true_dual_port => g_true_dual_port
|
84 |
|
|
)
|
85 |
|
|
PORT MAP (
|
86 |
|
|
rst_a => rst,
|
87 |
|
|
rst_b => rst,
|
88 |
|
|
clk_a => clk,
|
89 |
|
|
clk_b => clk,
|
90 |
|
|
clken_a => clken,
|
91 |
|
|
clken_b => clken,
|
92 |
|
|
next_page_a => next_page_a,
|
93 |
|
|
adr_a => adr_a,
|
94 |
|
|
wr_en_a => wr_en_a,
|
95 |
|
|
wr_dat_a => wr_dat_a,
|
96 |
|
|
rd_en_a => rd_en_a,
|
97 |
|
|
rd_dat_a => rd_dat_a,
|
98 |
|
|
rd_val_a => rd_val_a,
|
99 |
|
|
next_page_b => next_page_b,
|
100 |
|
|
adr_b => adr_b,
|
101 |
|
|
wr_en_b => wr_en_b,
|
102 |
|
|
wr_dat_b => wr_dat_b,
|
103 |
|
|
rd_en_b => rd_en_b,
|
104 |
|
|
rd_dat_b => rd_dat_b,
|
105 |
|
|
rd_val_b => rd_val_b
|
106 |
|
|
);
|
107 |
|
|
|
108 |
|
|
END str;
|