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

Subversion Repositories funbase_ip_library

[/] [funbase_ip_library/] [trunk/] [TUT/] [ip.hwp.storage/] [fifos/] [synch_fifos/] [1.0/] [vhd/] [dual_ram_async_read.vhd] - Blame information for rev 145

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 145 lanttu
-------------------------------------------------------------------------------
2
-- Title      : Dual port RAM
3
-- Project    : 
4
-------------------------------------------------------------------------------
5
-- File       : dual_ram.vhd
6
-- Author     : 
7
-- Company    : 
8
-- Created    : 2005-05-26
9
-- Last update: 2005-05-31
10
-- Platform   : 
11
-- Standard   : VHDL'87
12
-------------------------------------------------------------------------------
13
-- Description: dual port RAM with asynchronous read for QuartusII
14
-------------------------------------------------------------------------------
15
-- Copyright (c) 2005 
16
-------------------------------------------------------------------------------
17
-- Revisions  :
18
-- Date        Version  Author  Description
19
-- 2005-05-26  1.0      penttin5        Created
20
-------------------------------------------------------------------------------
21
 
22
library ieee;
23
use ieee.std_logic_1164.all;
24
 
25
entity dual_ram_async_read is
26
 
27
  generic (
28
    ram_width : integer := 0;
29
    ram_depth : integer := 0);
30
  port
31
    (
32
      clock1        : in  std_logic;
33
      clock2        : in  std_logic;
34
      data          : in  std_logic_vector(0 to ram_width - 1);
35
      write_address : in  integer range 0 to ram_depth - 1;
36
      read_address  : in  integer range 0 to ram_depth - 1;
37
      we            : in  std_logic;
38
      q             : out std_logic_vector(0 to ram_width - 1)
39
      );
40
 
41
  type    word is array(0 to ram_width - 1) of std_logic;
42
  type    ram is array(0 to ram_depth - 1) of std_logic_vector(0 to ram_width - 1);
43
  subtype address_vector is integer range 0 to ram_depth - 1;
44
 
45
--  signal read_address_reg : address_vector;
46
 
47
end dual_ram_async_read;
48
 
49
architecture rtl of dual_ram_async_read is
50
 
51
  signal ram_block        : RAM;
52
begin
53
 
54
  process (clock1)
55
  begin
56
    if (clock1'event and clock1 = '1') then
57
      if (we = '1') then
58
        ram_block(write_address) <= data;
59
      end if;
60
    end if;
61
  end process;
62
 
63
 
64
  process (clock2)
65
  begin
66
    if (clock2'event and clock2 = '1') then
67
    --q                <= ram_block(read_address);
68
    --     read_address_reg <= read_address;
69
    end if;
70
 end process;
71
 
72
    q <= ram_block (read_address);
73
 
74
end rtl;

powered by: WebSVN 2.1.0

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