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

Subversion Repositories memory_cores

[/] [memory_cores/] [trunk/] [dpmem/] [dpmem2clk/] [dpmem2clk.vhd] - Blame information for rev 25

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 16 khatib
-------------------------------------------------------------------------------
2
-- Title      : Genereic synchronous Dual port memory
3
-- Project    : Memory Cores
4
-------------------------------------------------------------------------------
5
-- File        : DPMEM2CLK.VHD
6
-- Author      : Jamil Khatib  <khatib@ieee.org>
7
-- Organization: OpenIPCore Project
8
-- Created     : 2000/03/29
9
-- Last update : 2000/03/29
10
-- Platform    : 
11
-- Simulators  : Modelsim 5.2EE / Windows98 & Xilinx modelsim 5.3a XE
12
-- Synthesizers: Leonardo / WindowsNT & Xilinx webfitter
13
-- Target      : Flex10KE
14
-- Dependency  : 
15
-------------------------------------------------------------------------------
16
-- Description: Genereic synchronous Dual port memory
17
--                        : Seperate read and write clocks
18
-------------------------------------------------------------------------------
19
-- Copyright (c) 2000 Jamil Khatib
20
-- 
21
-- This VHDL design file is an open design; you can redistribute it and/or
22
-- modify it and/or implement it under the terms of the Openip General Public
23
-- License as it is going to be published by the OpenIPCore Organization and
24
-- any coming versions of this license.
25
-- You can check the draft license at
26
-- http://www.openip.org/oc/license.html
27
 
28
-------------------------------------------------------------------------------
29
-- Revisions  :
30
-- Revision Number : 1
31
-- Version              :   1.0
32
-- Date             :   29th Mar 2000
33
-- Modifier     :   Jamil Khatib (khatib@ieee.org)
34
-- Desccription :       Created
35
--
36
-------------------------------------------------------------------------------
37
 
38
 
39
library ieee;
40
use ieee.std_logic_1164.all;
41
use ieee.std_logic_unsigned.all;
42
 
43
-------------------------------------------------------------------------------
44
-- Synchronous Dual Port Memory
45
-------------------------------------------------------------------------------
46
entity Dpmem2clk is
47
 
48
  generic (
49
    ADD_WIDTH         :     integer   := 4;  -- Address width
50
    WIDTH             :     integer   := 8;  -- Word Width
51
    coretype          :     integer   := 0);  -- memory bulding block type
52
 
53
  port (
54
    Wclk              : in  std_logic;  -- write clock
55
    Wen               : in  std_logic;  -- Write Enable
56
    Wadd              : in  std_logic_vector(ADD_WIDTH -1 downto 0);  -- Write Address
57
    Datain            : in  std_logic_vector(WIDTH -1 downto 0);  -- Input Data
58
    Rclk              : in  std_logic;  -- Read clock
59
    Ren               : in  std_logic;  -- Read Enable
60
    Radd              : in  std_logic_vector(ADD_WIDTH -1 downto 0);  -- Read Address
61
    Dataout           : out std_logic_vector(WIDTH -1 downto 0));  -- Output data
62
 
63
end Dpmem2clk;
64
 
65
architecture dpmem_arch of Dpmem2clk is
66
 
67
  type DATA_ARRAY is array (integer range <>) of std_logic_vector(WIDTH -1 downto 0);
68
                                        -- Memory Type
69
  signal   data       :     DATA_ARRAY(0 to (2**ADD_WIDTH) -1);  -- Local data
70
  constant IDELOUTPUT :     std_logic := 'Z';  -- IDEL state output
71
 
72
begin  -- dpmem_arch
73
 
74
  -- purpose: Read process
75
  -- type   : sequential
76
  -- inputs : Rclk
77
  -- outputs: 
78
  ReProc              :     process (Rclk)
79
  begin  -- process ReProc
80
 
81
    if Rclk'event and Rclk = '1' then   -- rising clock edge
82
      if Ren = '1' then
83
        Dataout                       <= data(conv_integer(Radd));
84
      else
85
        Dataout                       <= (others => IDELOUTPUT);
86
      end if;
87
 
88
    end if;
89
  end process ReProc;
90
 
91
  -- purpose: Write process
92
  -- type   : sequential
93
  -- inputs : Wclk
94
  -- outputs: 
95
  WrProc              :     process (Wclk)
96
  begin  -- process WrProc
97
 
98
    if Wclk'event and Wclk = '1' then   -- rising clock edge
99
      if Wen = '1' then
100
 
101
        data(conv_integer(Wadd))      <= Datain;
102
      end if;
103
 
104
    end if;
105
  end process WrProc;
106
 
107
end dpmem_arch;
108
 
109
 
110
 
111
 
112
 
113
 
114
 

powered by: WebSVN 2.1.0

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