OpenCores
URL https://opencores.org/ocsvn/astron_ram/astron_ram/trunk

Subversion Repositories astron_ram

[/] [astron_ram/] [trunk/] [common_paged_ram_r_w.vhd] - Blame information for rev 2

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
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_r_w 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_wr_start_page   : NATURAL := 0;
43
    g_rd_start_page   : NATURAL := 0;
44
    g_rd_latency      : NATURAL := 1
45
  );
46
  PORT (
47
    rst          : IN  STD_LOGIC;
48
    clk          : IN  STD_LOGIC;
49
    clken        : IN  STD_LOGIC := '1';
50
    wr_next_page : IN  STD_LOGIC;
51
    wr_adr       : IN  STD_LOGIC_VECTOR(ceil_log2(g_page_sz)-1 DOWNTO 0) := (OTHERS=>'0');
52
    wr_en        : IN  STD_LOGIC := '0';
53
    wr_dat       : IN  STD_LOGIC_VECTOR(g_data_w-1 DOWNTO 0) := (OTHERS=>'0');
54
    rd_next_page : IN  STD_LOGIC;
55
    rd_adr       : IN  STD_LOGIC_VECTOR(ceil_log2(g_page_sz)-1 DOWNTO 0) := (OTHERS=>'0');
56
    rd_en        : IN  STD_LOGIC := '1';
57
    rd_dat       : OUT STD_LOGIC_VECTOR(g_data_w-1 DOWNTO 0);
58
    rd_val       : OUT STD_LOGIC
59
  );
60
END common_paged_ram_r_w;
61
 
62
 
63
ARCHITECTURE str OF common_paged_ram_r_w IS
64
 
65
BEGIN
66
 
67
  u_rw_rw : ENTITY work.common_paged_ram_rw_rw
68
  GENERIC MAP (
69
    g_technology     => g_technology,
70
    g_str            => g_str,
71
    g_data_w         => g_data_w,
72
    g_nof_pages      => g_nof_pages,
73
    g_page_sz        => g_page_sz,
74
    g_start_page_a   => g_wr_start_page,
75
    g_start_page_b   => g_rd_start_page,
76
    g_rd_latency     => g_rd_latency,
77
    g_true_dual_port => FALSE
78
  )
79
  PORT MAP (
80
    rst         => rst,
81
    clk         => clk,
82
    clken       => clken,
83
    next_page_a => wr_next_page,
84
    adr_a       => wr_adr,
85
    wr_en_a     => wr_en,
86
    wr_dat_a    => wr_dat,
87
    rd_en_a     => '0',
88
    rd_dat_a    => OPEN,
89
    rd_val_a    => OPEN,
90
    next_page_b => rd_next_page,
91
    adr_b       => rd_adr,
92
    wr_en_b     => '0',
93
    wr_dat_b    => (OTHERS=>'0'),
94
    rd_en_b     => rd_en,
95
    rd_dat_b    => rd_dat,
96
    rd_val_b    => rd_val
97
  );
98
 
99
END str;

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.