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

Subversion Repositories the_wizardry_project

[/] [the_wizardry_project/] [trunk/] [Wizardry/] [VHDL/] [Wizardry Top Level/] [Address Generation/] [JOP/] [xram.vhd] - Blame information for rev 22

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 22 mcwaccent
--
2
--  This file is part of JOP, the Java Optimized Processor
3
--
4
--  Copyright (C) 2001-2003, Martin Schoeberl (martin@jopdesign.com)
5
--  Copyright (C) 2003, Ed Anuff
6
--
7
--  This program is free software: you can redistribute it and/or modify
8
--  it under the terms of the GNU General Public License as published by
9
--  the Free Software Foundation, either version 3 of the License, or
10
--  (at your option) any later version.
11
--
12
--  This program is distributed in the hope that it will be useful,
13
--  but WITHOUT ANY WARRANTY; without even the implied warranty of
14
--  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15
--  GNU General Public License for more details.
16
--
17
--  You should have received a copy of the GNU General Public License
18
--  along with this program.  If not, see <http://www.gnu.org/licenses/>.
19
--
20
 
21
 
22
--
23
--      xram_xc2s_xcv.vhd
24
--
25
--      internal memory for JOP3
26
--      Version for Xilinx Spartan II/IIe and Virtex Families
27
--
28
--      Changes:
29
--    2003-12-29  EA - modified for Xilinx ISE to use Block SelectRAM+
30
--
31
--
32
 
33
Library IEEE ;
34
use IEEE.std_logic_1164.all ;
35
use IEEE.std_logic_arith.all ;
36
use IEEE.std_logic_unsigned.all ;
37
library unisim;
38
use unisim.vcomponents.all;
39
 
40
entity ram is
41
generic (width : integer := 32; addr_width : integer := 8);
42
port (
43
        reset           : in std_logic;
44
        data            : in std_logic_vector(width-1 downto 0);
45
        wraddress       : in std_logic_vector(addr_width-1 downto 0);
46
        rdaddress       : in std_logic_vector(addr_width-1 downto 0);
47
        wren            : in std_logic;
48
        clock           : in std_logic;
49
 
50
        q                       : out std_logic_vector(width-1 downto 0)
51
);
52
end ram ;
53
 
54
--
55
--      registered and delayed wraddress, wren
56
--      registered din
57
--      registered rdaddress
58
--      unregistered dout
59
--
60
--      with normal clock on wrclock:
61
--              => read during write on same address!!! (ok in ACEX)
62
--      for Cyclone use not clock for wrclock, but works also on ACEX
63
--
64
architecture rtl of ram is
65
 
66
        signal wraddr_dly       : std_logic_vector(addr_width-1 downto 0);
67
        signal wren_dly         : std_logic;
68
 
69
        COMPONENT xram_block
70
        PORT(
71
                a_rst : IN std_logic;
72
                a_clk : IN std_logic;
73
                a_en : IN std_logic;
74
                a_wr : IN std_logic;
75
                a_addr : IN std_logic_vector(7 downto 0);
76
                a_din : IN std_logic_vector(31 downto 0);
77
                b_rst : IN std_logic;
78
                b_clk : IN std_logic;
79
                b_en : IN std_logic;
80
                b_wr : IN std_logic;
81
                b_addr : IN std_logic_vector(7 downto 0);
82
                b_din : IN std_logic_vector(31 downto 0);
83
                a_dout : OUT std_logic_vector(31 downto 0);
84
                b_dout : OUT std_logic_vector(31 downto 0)
85
                );
86
        END COMPONENT;
87
 
88
 
89
begin
90
 
91
--
92
--      delay wr addr and ena because of registerd indata
93
--
94
        process(clock) begin
95
 
96
                if rising_edge(clock) then
97
                        wraddr_dly <= wraddress;
98
                        wren_dly <= wren;
99
                end if;
100
        end process;
101
 
102
        cmp_xram_block: xram_block PORT MAP(
103
                a_rst => '0',
104
                a_clk => not clock,
105
                a_en => '1',
106
                a_wr => wren_dly,
107
                a_addr => wraddr_dly,
108
                a_din => data,
109
                a_dout => open,
110
                b_rst => '0',
111
                b_clk => clock,
112
                b_en => '1',
113
                b_wr => '0',
114
                b_addr => rdaddress,
115
                b_din => X"00000000",
116
                b_dout => q
117
        );
118
 
119
end rtl;

powered by: WebSVN 2.1.0

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