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

Subversion Repositories gpib_controller

[/] [gpib_controller/] [trunk/] [vhdl/] [src/] [gpib_helper/] [MemoryBlock_by_logic.vhd] - Blame information for rev 6

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

Line No. Rev Author Line
1 3 Andrewski
--------------------------------------------------------------------------------
2
-- Entity: MemoryBlock
3
-- Date:2011-11-14  
4
-- Author: Administrator     
5
--
6
-- Description ${cursor}
7
--------------------------------------------------------------------------------
8
library ieee;
9
use ieee.std_logic_1164.all;
10
use ieee.std_logic_unsigned.all;
11
use ieee.std_logic_arith.all;
12
 
13
library UNISIM;
14
use UNISIM.vcomponents.all;
15
 
16
use work.utilPkg.all;
17
use work.helperComponents.all;
18
 
19
 
20
entity MemoryBlock is
21
        port (
22
                reset : in std_logic;
23
                clk : in std_logic;
24
                -------------------------------------------------
25
                p1_addr : in std_logic_vector(10 downto 0);
26
                p1_data_in : in std_logic_vector(7 downto 0);
27
                p1_strobe : in std_logic;
28
                p1_data_out : out std_logic_vector(7 downto 0);
29
                -------------------------------------------------
30
                p2_addr : in std_logic_vector(10 downto 0);
31
                p2_data_in : in std_logic_vector(7 downto 0);
32
                p2_strobe : in std_logic;
33
                p2_data_out : out std_logic_vector(7 downto 0)
34
        );
35
end MemoryBlock;
36
 
37
architecture arch of MemoryBlock is
38
 
39
        type mem is array(0 to 31) of std_logic_vector(7 downto 0);
40
 
41
        signal memory : mem;
42
        signal addrP1, addrP2 : integer range 0 to 31;
43
 
44
begin
45
 
46
        addrP1 <= conv_integer(UNSIGNED(p1_addr));
47
        addrP2 <= conv_integer(UNSIGNED(p2_addr));
48
 
49
        process(reset, clk) begin
50
                if reset = '1' then
51
 
52
                elsif rising_edge(clk) then
53
                        p1_data_out <= memory(addrP1);
54
                        p2_data_out <= memory(addrP2);
55
 
56
                        if p1_strobe = '1' then
57
                                memory(addrP1) <= p1_data_in;
58
                        end if;
59
 
60
                        if p2_strobe = '1' then
61
                                memory(addrP2) <= p2_data_in;
62
                        end if;
63
                end if;
64
        end process;
65
 
66
end arch;
67
 

powered by: WebSVN 2.1.0

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