signal read_f2 : std_logic_vector(3 downto 0) := (others => '0');
signal read_f1 : std_logic_vector(3 downto 0) := (others => '0');
signal stat_buffer : std_logic_vector(31 downto 0) := (others => '0');
-
+ signal stat_locked : std_logic_vector(15 downto 0) := (others => '0');
+
signal waiter : std_logic := '0';
INT_DATA_OUT => int_data_out,
INT_READ_IN => int_read_in,
CTRL_LOCKED => (others => '0'),
- STAT_BUFFER => stat_buffer
+ STAT_BUFFER => stat_buffer,
+ STAT_LOCKED => stat_locked
);
clk <= not clk after 10ns;
signal got_ack_internal, reg_ack_internal : std_logic; --should be raised for 1 cycle when ack
--arrived
-signal is_locked, got_locked : std_logic;
+signal is_locked, got_locked,release_locked : std_logic;
signal got_eob_out, reg_eob_out: std_logic;
signal tmp_INT_DATAREADY_OUT: std_logic;
signal current_last_header, next_last_header : std_logic_vector(50 downto 0);
-- this process control the read of the internal point from the fifo
FILTER_OUT: process (INT_READ_IN, INT_HEADER_IN, fifo_data_out,
- current_last_header)
+ current_last_header, release_locked, is_locked)
begin -- process
- got_locked <= '0';
+ got_locked <= is_locked;
fifo_read <= '0';
got_eob_out <= '0';
next_last_header <= current_last_header;
if fifo_data_out(TYPE_POSITION) = TYPE_TRM then
got_eob_out <= '1';
fifo_read <= '1';
-
+ if release_locked = '0' then
+ got_locked <= '1';
+ end if;
else -- no TRM, normal read
got_eob_out <= '0';
fifo_read <= '1';
-
+release_locked <= CTRL_LOCKED(0);
+STAT_LOCKED(0) <= is_locked;
+STAT_LOCKED(15 downto 1) <= (others => '0');
reg_locked: process(CLK)
begin
reg_eob_out <= '0';
current_last_header <= (others => '0');
elsif CLK_EN = '1' then
- is_locked <= got_locked;
+ if release_locked = '1' then
+ is_locked <= '0';
+ else
+ is_locked <= got_locked;
+ end if;
reg_eob_out <= got_eob_out;
current_last_header <= next_last_header;
else