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

Subversion Repositories cfft

[/] [cfft/] [trunk/] [src/] [blockdram.vhd] - Blame information for rev 14

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 sradio
---------------------------------------------------------------------------------------------------
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:  integer;
28
        Dwidth: integer;
29
        Awidth: integer
30
);
31
port(
32
        addra: IN std_logic_VECTOR(Awidth-1 downto 0);
33
        clka: IN std_logic;
34
        addrb: IN std_logic_VECTOR(Awidth-1 downto 0);
35
        clkb: IN std_logic;
36
        dia: IN std_logic_VECTOR(Dwidth-1 downto 0);
37
        wea: IN std_logic;
38
        dob: OUT std_logic_VECTOR(Dwidth-1 downto 0));
39
end blockdram;
40
 
41
architecture arch_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( clka )
52
        begin
53
                if rising_edge(clka) then
54
                        if wea = '1' then
55
                                mem(conv_integer(addra)) <= dia;
56
                        end if;
57
                end if;
58
        end process wr;
59
 
60
        rd: process( clkb )
61
        begin
62
                if rising_edge(clkb) then
63
                        addrb_reg <= addrb;
64
                end if;
65
    end process rd;
66
        dob <= mem(conv_integer(addrb_reg));
67
end arch_blockdram;
68
 

powered by: WebSVN 2.1.0

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