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

Subversion Repositories spdif_interface

[/] [spdif_interface/] [trunk/] [rtl/] [vhdl/] [dpram_altera.vhd] - Blame information for rev 73

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 27 gedra
----------------------------------------------------------------------
2
----                                                              ----
3
---- WISHBONE SPDIF IP Core                                       ----
4
----                                                              ----
5
---- This file is part of the SPDIF project                       ----
6
---- http://www.opencores.org/cores/spdif_interface/              ----
7
----                                                              ----
8
---- Description                                                  ----
9
---- Dual port ram. This version is specific for Altera FPGA's,   ----
10
---- and uses Altera library to instantiate block ram.            ----
11
----                                                              ----
12
----                                                              ----
13
---- To Do:                                                       ----
14
---- -                                                            ----
15
----                                                              ----
16
---- Author(s):                                                   ----
17
---- - Geir Drange, gedra@opencores.org                           ----
18
----                                                              ----
19
----------------------------------------------------------------------
20
----                                                              ----
21
---- Copyright (C) 2004 Authors and OPENCORES.ORG                 ----
22
----                                                              ----
23
---- This source file may be used and distributed without         ----
24
---- restriction provided that this copyright statement is not    ----
25
---- removed from the file and that any derivative work contains  ----
26
---- the original copyright notice and the associated disclaimer. ----
27
----                                                              ----
28
---- This source file is free software; you can redistribute it   ----
29
---- and/or modify it under the terms of the GNU Lesser General   ----
30
---- Public License as published by the Free Software Foundation; ----
31
---- either version 2.1 of the License, or (at your option) any   ----
32
---- later version.                                               ----
33
----                                                              ----
34
---- This source is distributed in the hope that it will be       ----
35
---- useful, but WITHOUT ANY WARRANTY; without even the implied   ----
36
---- warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR      ----
37
---- PURPOSE. See the GNU Lesser General Public License for more  ----
38
---- details.                                                     ----
39
----                                                              ----
40
---- You should have received a copy of the GNU Lesser General    ----
41
---- Public License along with this source; if not, download it   ----
42
---- from http://www.opencores.org/lgpl.shtml                     ----
43
----                                                              ----
44
----------------------------------------------------------------------
45
--
46
-- CVS Revision History
47
--
48 28 gedra
-- $Log: not supported by cvs2svn $
49 72 gedra
-- Revision 1.3  2004/06/26 14:14:46  gedra
50
-- Converted to numeric_std and fixed a few bugs.
51
--
52 37 gedra
-- Revision 1.2  2004/06/19 09:55:19  gedra
53
-- Delint'ed and changed name of architecture.
54
--
55 28 gedra
-- Revision 1.1  2004/06/18 18:40:04  gedra
56
-- Alternate dual port memory implementation for Altera FPGA's.
57
-- 
58 27 gedra
--
59
 
60
library ieee;
61 72 gedra
use ieee.std_logic_1164.all;
62 37 gedra
 
63 28 gedra
library lpm;
64
use lpm.lpm_components.all;
65 27 gedra
 
66
entity dpram is
67 72 gedra
   generic (DATA_WIDTH : positive;
68
            RAM_WIDTH  : positive);
69
   port (
70
      clk     : in  std_logic;
71
      rst     : in  std_logic;          -- reset is optional, not used here
72
      din     : in  std_logic_vector(DATA_WIDTH - 1 downto 0);
73
      wr_en   : in  std_logic;
74
      rd_en   : in  std_logic;
75
      wr_addr : in  std_logic_vector(RAM_WIDTH - 1 downto 0);
76
      rd_addr : in  std_logic_vector(RAM_WIDTH - 1 downto 0);
77
      dout    : out std_logic_vector(DATA_WIDTH - 1 downto 0));
78
end dpram;
79 27 gedra
 
80 28 gedra
architecture altera of dpram is
81 72 gedra
 
82
   component lpm_ram_dp
83
      generic (LPM_WIDTH              : positive;
84
                LPM_WIDTHAD           : positive;
85
                LPM_NUMWORDS          : natural := 0;
86
                LPM_INDATA            : string  := "REGISTERED";
87
                LPM_OUTDATA           : string  := "REGISTERED";
88
                LPM_RDADDRESS_CONTROL : string  := "REGISTERED";
89
                LPM_WRADDRESS_CONTROL : string  := "REGISTERED";
90
                LPM_FILE              : string  := "UNUSED";
91
                LPM_TYPE              : string  := "LPM_RAM_DP";
92
                LPM_HINT              : string  := "UNUSED");
93
      port (data                    : in  std_logic_vector(LPM_WIDTH-1 downto 0);
94
             rdaddress, wraddress   : in  std_logic_vector(LPM_WIDTHAD-1 downto 0);
95
             rdclock, wrclock       : in  std_logic := '0';
96
             rden, rdclken, wrclken : in  std_logic := '1';
97
             wren                   : in  std_logic;
98
             q                      : out std_logic_vector(LPM_WIDTH-1 downto 0));
99
   end component;
100 27 gedra
 
101 72 gedra
   signal one : std_logic;
102 27 gedra
 
103
begin
104
 
105 72 gedra
   one <= '1';
106 27 gedra
 
107 72 gedra
   ram : lpm_ram_dp
108
      generic map(LPM_WIDTH    => DATA_WIDTH,
109
                  LPM_WIDTHAD  => RAM_WIDTH,
110
                  LPM_NUMWORDS => 2**RAM_WIDTH)
111
      port map (data      => din,
112
                rdaddress => rd_addr,
113
                wraddress => wr_addr,
114
                rdclock   => clk,
115
                wrclock   => clk,
116
                rden      => rd_en,
117
                rdclken   => one,
118
                wrclken   => one,
119
                wren      => wr_en,
120
                q         => dout);
121
 
122 28 gedra
end altera;

powered by: WebSVN 2.1.0

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