From 5763dff93443e244df670c9a76b619cead41666e Mon Sep 17 00:00:00 2001 From: hadeshyp Date: Fri, 31 Aug 2007 11:44:00 +0000 Subject: [PATCH] small change to trb_net_base_api.vhd, Jan --- trb_net_base_api.vhd | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/trb_net_base_api.vhd b/trb_net_base_api.vhd index 9e01b81..150b983 100644 --- a/trb_net_base_api.vhd +++ b/trb_net_base_api.vhd @@ -361,7 +361,7 @@ begin ACTIVE_SBUF: trb_net_sbuf generic map ( DATA_WIDTH => 51, - VERSION => 1) + VERSION => 0) port map ( CLK => CLK, RESET => RESET, @@ -431,6 +431,7 @@ begin next_APL_DATAREADY_OUT <= '0'; fifo_to_apl_read <= '0'; next_slave_running <= slave_running; + next_sequence_counter <= sequence_counter; ------------------------------------------------------------------------------- -- IDLE ------------------------------------------------------------------------------- @@ -440,24 +441,23 @@ begin next_state <= SEND_SHORT; -- no next data word, waiting for falling edge of APL_SEND_IN next_INT_MASTER_DATAREADY_OUT <= '0'; else -- normal transfer, prepare the header - next_state <= SEND_HEADER; + next_state <= SEND_HEADER; out_select <= HDR; next_INT_MASTER_DATAREADY_OUT <= '1'; end if; -- next word will be a header else - next_state <= IDLE; + next_state <= IDLE; end if; -- APL_SEND_IN ------------------------------------------------------------------------------- -- SEND_SHORT ------------------------------------------------------------------------------- elsif current_state = SEND_SHORT then next_state <= SEND_SHORT; + update_registered_trailer <= '1'; if APL_SEND_IN = '0' then -- terminate the transfer next_state <= SEND_TRAILER; next_INT_MASTER_DATAREADY_OUT <= '1'; out_select <= TRM; - else - update_registered_trailer <= '1'; end if; ------------------------------------------------------------------------------- -- SEND_HEADER @@ -560,6 +560,7 @@ begin end if; if reg_APL_TYP_OUT = TYPE_TRM and (APL_READ_IN = '1' and reg_APL_DATAREADY_OUT = '1') then --fifo_to_apl_read = '1' next_state <= IDLE; + next_sequence_counter <= sequence_counter +1; end if; end if; -- MISSING: SEQNR check @@ -629,21 +630,21 @@ begin APL_DATA_OUT <= reg_APL_DATA_OUT; APL_TYP_OUT <= reg_APL_TYP_OUT; -- APL_RUN_OUT <= '0' when ((current_state = IDLE )) - APL_RUN_OUT <= '0' when ((current_state = IDLE and API_TYPE = 1) + APL_RUN_OUT <= '0' when ((current_state = IDLE and API_TYPE = 1) or (slave_running = '0' and API_TYPE = 0)) else '1'; APL_SEQNR_OUT <= sequence_counter; -- generate the sequence counter - -- combinatorial part - SEQNR_COMB : process(sequence_counter, current_state, next_state) - begin - if current_state = WAITING and next_state = IDLE then - next_sequence_counter <= sequence_counter+1; - else - next_sequence_counter <= sequence_counter; - end if; - end process; +-- -- combinatorial part +-- SEQNR_COMB : process(sequence_counter, current_state, next_state) +-- begin +-- if current_state = WAITING and next_state = IDLE then +-- next_sequence_counter <= sequence_counter+1; +-- else +-- next_sequence_counter <= sequence_counter; +-- end if; +-- end process; -- 2.43.0