2 use ieee.std_logic_1164.
all;
3 use ieee.numeric_std.
all;
4 use ieee.std_logic_unsigned.
all;
7 use work.zpu_config.
all;
8 use work.zpuino_config.
all;
9 use work.zpuinopkg.
all;
11 use work.wishbonepkg.
all;
15 wb_clk_i
: in std_logic;
16 wb_rst_i
: in std_logic;
18 wb_dat_o
: out std_logic_vector(31 downto 0);
19 wb_dat_i
: in std_logic_vector(31 downto 0);
20 wb_adr_i
: in std_logic_vector(maxIOBit
downto minIOBit
);
21 -- wb_sel_i: in std_logic_vector(3 downto 0);
22 wb_cti_i
: in std_logic_vector(2 downto 0);
23 wb_we_i
: in std_logic;
24 wb_cyc_i
: in std_logic;
25 wb_stb_i
: in std_logic;
26 wb_ack_o
: out std_logic;
29 sram_addr
: out std_logic_vector(18 downto 0);
30 sram_data
: inout std_logic_vector(15 downto 0);
31 sram_ce
: out std_logic;
32 sram_we
: out std_logic;
33 sram_oe
: out std_logic;
34 sram_be
: out std_logic
39 architecture behave
of sram_ctrl
is
41 signal sram_data_write
: std_logic_vector(15 downto 0);
50 signal state
: state_type
;
51 signal sram_addr_q
: unsigned
(18 downto 0);
57 sram_data
<= sram_data_write
when wb_we_i
='1' and wb_cyc_i
='1' else (others => 'Z');
59 wb_dat_o
(31 downto 16) <= (others => '0');
61 sram_addr
<= std_logic_vector(sram_addr_q
);
65 if rising_edge
(wb_clk_i
) then
77 if wb_cyc_i
='1' and wb_stb_i
='1' then
79 sram_addr_q
<= unsigned
(wb_adr_i
(20 downto 2));
80 sram_data_write
<= wb_dat_i
(15 downto 0);
81 sram_we
<= not wb_we_i
;
96 wb_dat_o
(15 downto 0) <= sram_data
;
98 if wb_cti_i
= CTI_CYCLE_INCRADDR
then
99 sram_addr_q
<= sram_addr_q
+ 1;