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

Subversion Repositories hicovec

[/] [hicovec/] [trunk/] [cpu/] [units/] [sram.vhd] - Blame information for rev 5

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 hmanske
------------------------------------------------------------------
2 4 hmanske
-- PROJECT:     HiCoVec (highly configurable vector processor)
3 2 hmanske
--
4
-- ENTITY:      sram
5
--
6
-- PURPOSE:     sram memory             
7
--
8
-- AUTHOR:      harald manske, haraldmanske@gmx.de
9
--
10
-- VERSION:     1.0
11
------------------------------------------------------------------
12
 
13
library ieee;
14
use ieee.std_logic_1164.all;
15
use ieee.std_logic_unsigned.all;
16
 
17
use work.cfg.all;
18
 
19
entity sram is
20
        port (
21
                clk : in std_logic;
22
                we : in std_logic;
23
                en : in std_logic;
24
                addr : in std_logic_vector(31 downto 0);
25
                di : in std_logic_vector(31 downto 0);
26
                do : out std_logic_vector(31 downto 0)
27
        );
28
end sram;
29
 
30
architecture rtl of sram is
31
        type memory_type is array(0 to sram_size) of std_logic_vector(31 downto 0);
32
        signal memory : memory_type;
33
begin
34
        process (clk)
35
        begin
36
                if clk'event and clk = '1' then
37
                        if en = '1' then
38
                                if we = '1' then
39
                                        memory(conv_integer(addr)) <= di;
40
                                        do <= di;
41
                                else
42
                                        do <= memory(conv_integer(addr));
43
                                end if;
44
                        end if;
45
                end if;
46
        end process;
47
end;

powered by: WebSVN 2.1.0

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