2 use ieee.std_logic_1164.all;
3 use ieee.std_logic_arith.all;
4 use ieee.std_logic_unsigned.all;
6 --------------------------------------------------------------------------------
10 IRF_ADR_W : integer := 5;
11 P_BASE : integer := 16;
12 P_SIZE : integer := 4);
14 -- Primary slave interface
15 ACK_O : out std_logic;
19 -- Dual-port memory interface
20 IRF_ADR_O : out std_logic_vector (IRF_ADR_W-1 downto 0);
22 SL_ACK_I : in std_logic;
23 SL_IRF_ADR_I : in std_logic_vector (IRF_ADR_W-1 downto 0);
24 SL_STB_O : out std_logic := '0';
25 SL_MUX_CODE : out std_logic_vector (1 downto 0));
28 --------------------------------------------------------------------------------
30 architecture behavioral of sequencer is
32 type state_t is (ready, phase1, phase2, phase3, done);
33 subtype irf_adr_t is std_logic_vector (IRF_ADR_W-1 downto 0);
35 constant P1_MASK: irf_adr_t := conv_std_logic_vector(P_BASE+0*P_SIZE, IRF_ADR_W);
36 constant P2_MASK: irf_adr_t := conv_std_logic_vector(P_BASE+1*P_SIZE, IRF_ADR_W);
37 constant P3_MASK: irf_adr_t := conv_std_logic_vector(P_BASE+2*P_SIZE, IRF_ADR_W);
39 signal state : state_t := ready;
41 signal INNER_ACK : std_logic := '0';
43 --------------------------------------------------------------------------------
47 ACK_O <= STB_I and INNER_ACK;
49 IRF_ADR_O <= SL_IRF_ADR_I when conv_integer(SL_IRF_ADR_I) < P_BASE else
50 SL_IRF_ADR_I or P1_MASK when state = phase1 else
51 SL_IRF_ADR_I or P2_MASK when state = phase2 else
52 SL_IRF_ADR_I or P3_MASK when state = phase3 else
55 SL_MUX_CODE <= "00" when state = phase1 else
56 "01" when state = phase2 else
57 "10" when state = phase3 else
61 FSM : process (CLK_I, RST_I) is
63 if rising_edge(CLK_I) then
78 if SL_ACK_I = '1' then
85 if SL_ACK_I = '1' then
92 if SL_ACK_I = '1' then
108 end architecture behavioral;