]> rtime.felk.cvut.cz Git - fpga/lx-cpu1/lx-dad.git/blob - hw/lx_example_mem.vhd
Remove nonstandard ieee.std_logic_arith and ieee.std_logic_unsigned libraries.
[fpga/lx-cpu1/lx-dad.git] / hw / lx_example_mem.vhd
1 library ieee;
2
3 use ieee.std_logic_1164.all;
4 use ieee.numeric_std.all;
5 use work.lx_dad_pkg.all;
6
7 -- 8 kB data memory for internal state automata
8 -- Can be accessed from the Master CPU
9
10 entity lx_example_mem is
11         port
12         (
13                 -- Memory wiring for internal state automata use
14                 clk_i  : in std_logic;
15                 ce_i   : in std_logic;
16                 adr_i  : in std_logic_vector(9 downto 0);
17                 bls_i  : in std_logic_vector(3 downto 0);
18                 dat_i  : in std_logic_vector(31 downto 0);
19                 dat_o  : out std_logic_vector(31 downto 0);
20                 -- Memory wiring for Master CPU
21                 clk_m  : in std_logic;
22                 en_m   : in std_logic;
23                 we_m   : in std_logic_vector(3 downto 0);
24                 addr_m : in std_logic_vector(9 downto 0);
25                 din_m  : in std_logic_vector(31 downto 0);
26                 dout_m : out std_logic_vector(31 downto 0)
27         );
28 end lx_example_mem;
29
30 architecture rtl of lx_example_mem is
31 begin
32
33 I_RAMB: xilinx_dualport_bram
34         generic map
35         (
36                 we_width => 4,
37                 byte_width => 8,
38                 address_width => 10,
39                 port_a_type => READ_FIRST,
40                 port_b_type => READ_FIRST
41         )
42         port map
43         (
44                 -- Internal state automata port
45                 clka => clk_i,
46                 rsta => '0',
47                 ena => ce_i,
48                 wea => bls_i,
49                 addra => adr_i,
50                 dina => dat_i,
51                 douta => dat_o,
52
53                 -- Master CPU port
54                 clkb => clk_m,
55                 rstb => '0',
56                 enb => en_m,
57                 web => we_m,
58                 addrb => addr_m,
59                 dinb => din_m,
60                 doutb => dout_m
61         );
62
63 end rtl;