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