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

Subversion Repositories ofdm

[/] [ofdm/] [branches/] [avendor/] [blockdram.vhd] - Blame information for rev 13

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 4 tmsiqueira
---------------------------------------------------------------------------------------------------
2
--
3
-- Title       : blockram
4
-- Design      : cfft
5
-- Author      : MENG Lin
6
-- email        : 
7
--
8
---------------------------------------------------------------------------------------------------
9
--
10
-- File        : blockram.vhd
11
-- Generated   : unknown
12
--
13
---------------------------------------------------------------------------------------------------
14
--
15
-- Description : Dual port ram
16
--
17
---------------------------------------------------------------------------------------------------
18
library ieee;
19
use ieee.std_logic_1164.all;
20
use ieee.std_logic_arith.all;
21
use ieee.std_logic_unsigned.all;
22
--library synplify;
23
--use synplify.attributes.all;
24
 
25
entity blockdram is
26
generic(
27
        depth: natural;
28
        Dwidth: natural;
29
        Awidth: natural
30
);
31
      port (
32
        clkin   : in  std_logic;
33
        wen     : in  std_logic;
34
        addrin  : in  std_logic_vector(Awidth-1 downto 0);
35
        din     : in  std_logic_vector(Dwidth-1 downto 0);
36
        clkout  : in  std_logic;
37
        addrout : in  std_logic_vector(Awidth-1 downto 0);
38
        dout    : out std_logic_vector(Dwidth-1 downto 0));
39
end blockdram;
40
 
41
architecture blockdram of blockdram is
42
 
43
type ram_memtype is array (depth-1 downto 0) of std_logic_vector
44
        (Dwidth-1 downto 0);
45
signal mem : ram_memtype := (others => (others => '0'));
46
--attribute syn_ramstyle of mem : signal is "block_ram";
47
 
48
signal addrb_reg: std_logic_vector(Awidth-1 downto 0);
49
 
50
begin
51
        wr: process( clkin )
52
        begin
53
                if rising_edge(clkin) then
54
                        if wen = '1' then
55
                                mem(conv_integer(addrin)) <= din;
56
                        end if;
57
                end if;
58
        end process wr;
59
 
60
        rd: process( clkout )
61
        begin
62
                if rising_edge(clkout) then
63
                        addrb_reg <= addrout;
64
                end if;
65
    end process rd;
66
        dout <= mem(conv_integer(addrb_reg));
67
end blockdram;
68
 

powered by: WebSVN 2.1.0

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