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

Subversion Repositories wb_tk

[/] [wb_tk/] [trunk/] [wb_ram.vhd] - Blame information for rev 7

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 4 tantos
--
2
--  Wishbone bus toolkit.
3
--
4
--  (c) Copyright Andras Tantos <andras_tantos@yahoo.com> 2001/03/31
5
--  This code is distributed under the terms and conditions of the GNU General Public Lince.
6
--
7
--
8
-- ELEMENTS:
9
--   wb_ram: ram element.
10
 
11
-------------------------------------------------------------------------------
12
--
13
--  wb_ram
14
--
15
-------------------------------------------------------------------------------
16
 
17
library IEEE;
18
use IEEE.std_logic_1164.all;
19
 
20
library wb_tk;
21
use wb_tk.technology.all;
22
 
23
entity wb_ram is
24
        generic (
25 6 tantos
                dat_width: positive := 8;
26
                adr_width: positive := 10
27 4 tantos
        );
28
        port (
29 6 tantos
                clk_i: in std_logic;
30 4 tantos
--              rst_i: in std_logic := '0';
31 6 tantos
                adr_i: in std_logic_vector (adr_width-1 downto 0);
32
--              sel_i: in std_logic_vector ((dat_width/8)-1 downto 0) := (others => '1');
33
                dat_i: in std_logic_vector (dat_width-1 downto 0);
34
                dat_oi: in std_logic_vector (dat_width-1 downto 0) := (others => '-');
35
                dat_o: out std_logic_vector (dat_width-1 downto 0);
36 4 tantos
                cyc_i: in std_logic;
37
                ack_o: out std_logic;
38
                ack_oi: in std_logic := '-';
39
--              err_o: out std_logic;
40
--              err_oi: in std_logic := '-';
41
--              rty_o: out std_logic;
42
--              rty_oi: in std_logic := '-';
43
                we_i: in std_logic;
44
                stb_i: in std_logic
45
        );
46
end wb_ram;
47
 
48
architecture wb_ram of wb_ram is
49 6 tantos
        signal mem_stb: std_logic;
50
        signal mem_dat_o: std_logic_vector(dat_width-1 downto 0);
51
        signal mem_ack: std_logic;
52
begin
53
        mem_stb <= stb_i and cyc_i;
54
        tech_ram: spmem
55
                generic map (
56
                        default_out => 'X',
57
                        default_content => '0',
58
                        adr_width   => adr_width,
59
                        dat_width   => dat_width,
60
                        async_read  => true
61
                )
62
                port map (
63
                        stb_i    => mem_stb,
64
                        clk_i    => clk_i,
65
--                      reset    => '0',
66
                        adr_i    => adr_i,
67
                        dat_i    => dat_i,
68
                        dat_o    => mem_dat_o,
69
                        we_i     => we_i
70 4 tantos
                );
71 6 tantos
 
72
        dat_o_gen: for i in dat_o'RANGE generate
73
                dat_o(i) <= (mem_dat_o(i) and stb_i and cyc_i and not we_i) or (dat_oi(i) and not (stb_i and cyc_i and not we_i));
74
        end generate;
75
        ack_o <= (mem_ack and stb_i and cyc_i) or (ack_oi and not (stb_i and cyc_i));
76 4 tantos
end wb_ram;
77
 

powered by: WebSVN 2.1.0

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