From 23ae288b7936e8dcd93164faa12e98324a2a9e27 Mon Sep 17 00:00:00 2001 From: hadeshyp Date: Sun, 17 Apr 2011 15:18:07 +0000 Subject: [PATCH] *** empty log message *** --- special/handler_data.vhd | 13 +++++++++++-- special/handler_ipu.vhd | 1 + trb_net16_hub_base.vhd | 14 +++++++------- trb_net16_hub_ipu_logic.vhd | 3 +-- trb_net16_hub_logic.vhd | 9 +++++---- trb_net_onewire.vhd | 1 + 6 files changed, 26 insertions(+), 15 deletions(-) diff --git a/special/handler_data.vhd b/special/handler_data.vhd index 0d465c8..1fd105e 100644 --- a/special/handler_data.vhd +++ b/special/handler_data.vhd @@ -141,8 +141,8 @@ architecture handler_data_arch of handler_data is signal flag_half_full : std_logic_vector(DATA_INTERFACE_NUMBER-1 downto 0); signal flag_almost_full_combined : std_logic; signal flag_half_full_combined : std_logic; - + signal tmg_trg_error_i : std_logic; begin @@ -177,7 +177,14 @@ begin end generate; - header_buffer_data_in <= "000000" & TMG_TRG_ERROR_IN & LVL1_TRG_INFO_IN(0) & LVL1_TRG_TYPE_IN & LVL1_TRG_CODE_IN & LVL1_TRG_NUMBER_IN; + header_buffer_data_in <= "000000" & tmg_trg_error_i & LVL1_TRG_INFO_IN(0) & LVL1_TRG_TYPE_IN & LVL1_TRG_CODE_IN & LVL1_TRG_NUMBER_IN; + +process(CLOCK) + begin + if rising_edge(CLOCK) then + tmg_trg_error_i <= (TMG_TRG_ERROR_IN or tmg_trg_error_i) and not header_buffer_write; + end if; + end process; --------------------------------------------------------------------------- @@ -231,6 +238,8 @@ begin ); + + --------------------------------------------------------------------------- -- Length FIFO --------------------------------------------------------------------------- diff --git a/special/handler_ipu.vhd b/special/handler_ipu.vhd index fe60abc..3f833b4 100644 --- a/special/handler_ipu.vhd +++ b/special/handler_ipu.vhd @@ -99,6 +99,7 @@ begin current_state <= next_state; error_not_found <= next_error_not_found; error_missing <= next_error_missing; + error_lvl1 <= next_error_lvl1; lvl1_fifo_read <= next_lvl1_fifo_read; hdr_fifo_read <= next_hdr_fifo_read; ipu_finished_i <= next_ipu_finished_i; diff --git a/trb_net16_hub_base.vhd b/trb_net16_hub_base.vhd index ccee226..e6d0b78 100644 --- a/trb_net16_hub_base.vhd +++ b/trb_net16_hub_base.vhd @@ -1335,9 +1335,9 @@ HUB_MED_CONNECTED(31 downto MII_NUMBER) <= (others => '1'); if rising_edge(CLK) then case to_integer(unsigned(HUB_CTRL_TIMEOUT_TIME(k*4+3 downto k*4))) is when 0 => current_timeout_value(k) <= std_logic_vector(to_unsigned(0,16)); - when 1 => current_timeout_value(k) <= std_logic_vector(to_unsigned(64,16) - unsigned(hub_level&'0')); - when 2 => current_timeout_value(k) <= std_logic_vector(to_unsigned(128,16) - unsigned(hub_level&'0')); - when 3 => current_timeout_value(k) <= std_logic_vector(to_unsigned(256,16) - unsigned(hub_level&'0')); + when 1 => current_timeout_value(k) <= std_logic_vector(to_unsigned(128,16) - unsigned(hub_level&'0')); + when 2 => current_timeout_value(k) <= std_logic_vector(to_unsigned(256,16) - unsigned(hub_level&'0')); + when 3 => current_timeout_value(k) <= std_logic_vector(to_unsigned(512,16) - unsigned(hub_level&'0')); when 4 => current_timeout_value(k) <= std_logic_vector(to_unsigned(1024,16) - unsigned(hub_level&'0')); when 5 => current_timeout_value(k) <= std_logic_vector(to_unsigned(2048,16) - unsigned(hub_level&'0')); when 6 => current_timeout_value(k) <= std_logic_vector(to_unsigned(4096,16) - unsigned(hub_level&'0')); @@ -1394,22 +1394,22 @@ HUB_MED_CONNECTED(31 downto MII_NUMBER) <= (others => '1'); --Timeouts 88-8B if reg_STROBES(8) = '1' then HC_STAT_REGS(8*32+31 downto 8*32) <= (others => '0'); - else + elsif combined_resync = '0' and reset_i = '0' then HC_STAT_REGS(8*32+31 downto 8*32) <= STAT_TIMEOUT(0*32+31 downto 0*32) or HC_STAT_REGS(8*32+31 downto 8*32); end if; if reg_STROBES(9) = '1' then HC_STAT_REGS(9*32+31 downto 9*32) <= (others => '0'); - else + elsif combined_resync = '0' and reset_i = '0' then HC_STAT_REGS(9*32+31 downto 9*32) <= STAT_TIMEOUT(1*32+31 downto 1*32) or HC_STAT_REGS(9*32+31 downto 9*32); end if; if reg_STROBES(10) = '1' then HC_STAT_REGS(10*32+31 downto 10*32) <= (others => '0'); - else + elsif combined_resync = '0' and reset_i = '0' then HC_STAT_REGS(10*32+31 downto 10*32) <= STAT_TIMEOUT(2*32+31 downto 2*32) or HC_STAT_REGS(10*32+31 downto 10*32); end if; if reg_STROBES(11) = '1' then HC_STAT_REGS(11*32+31 downto 11*32) <= (others => '0'); - else + elsif combined_resync = '0' and reset_i = '0' then HC_STAT_REGS(11*32+31 downto 11*32) <= STAT_TIMEOUT(3*32+31 downto 3*32) or HC_STAT_REGS(11*32+31 downto 11*32); end if; diff --git a/trb_net16_hub_ipu_logic.vhd b/trb_net16_hub_ipu_logic.vhd index 43dc00f..716f8dd 100644 --- a/trb_net16_hub_ipu_logic.vhd +++ b/trb_net16_hub_ipu_logic.vhd @@ -582,7 +582,7 @@ begin begin if rising_edge(CLK) then connection_timed_out(i) <= '0'; - if REPLY_DATAREADY_IN(i) = '1' or real_activepoints(i) = '0' or locked = '0' + if REPLY_DATAREADY_IN(i) = '1' or real_activepoints(i) = '0' or locked = '0' or got_trm(i) = '1' or locking_point(i) = '1' or reg_CTRL_TIMEOUT_TIME = 0 then timeout_counter(i) <= (others => '0'); elsif timeout_counter(i) = reg_CTRL_TIMEOUT_TIME then @@ -595,7 +595,6 @@ begin end generate; - ---------------------------------- --saving (D)HDR ---------------------------------- diff --git a/trb_net16_hub_logic.vhd b/trb_net16_hub_logic.vhd index b620e98..c9cd2e7 100644 --- a/trb_net16_hub_logic.vhd +++ b/trb_net16_hub_logic.vhd @@ -573,14 +573,15 @@ begin begin if rising_edge(CLK) then connection_timed_out(i) <= '0'; - if REPLY_DATAREADY_IN(i) = '1' or real_activepoints(i) = '0' or locked = '0' + if REPLY_DATAREADY_IN(i) = '1' or real_activepoints(i) = '0' or locked = '0' or got_trm(i) = '1' or locking_point(i) = '1' or reg_CTRL_TIMEOUT_TIME = 0 then timeout_counter(i) <= (others => '0'); elsif timeout_counter(i) = reg_CTRL_TIMEOUT_TIME then connection_timed_out(i) <= '1'; - elsif timer_ms_tick = '1' and INIT_READ_IN(i) = '0' and INIT_DATAREADY_OUT(i) = '1' then - timeout_counter(i) <= timeout_counter(i) + to_unsigned(2,2); - elsif timer_ms_tick = '1' and REPLY_POOL_next_read = '1' and got_trm(i) = '0' then +-- elsif timer_ms_tick = '1' and INIT_READ_IN(i) = '0' and INIT_DATAREADY_OUT(i) = '1' then +-- timeout_counter(i) <= timeout_counter(i) + to_unsigned(2,2); + elsif timer_ms_tick = '1' and ((REPLY_POOL_next_read = '1' and got_trm(i) = '0') + or (INIT_READ_IN(i) = '0' and INIT_DATAREADY_OUT(i) = '1')) then timeout_counter(i) <= timeout_counter(i) + to_unsigned(1,1); end if; end if; diff --git a/trb_net_onewire.vhd b/trb_net_onewire.vhd index 2bf6ebb..40c79af 100644 --- a/trb_net_onewire.vhd +++ b/trb_net_onewire.vhd @@ -293,6 +293,7 @@ begin output_tmp <= '0'; recv_bit <= '0'; strong_pullup <= '0'; + state <= START; else recv_bit_ready <= next_recv_bit_ready; state <= next_state; -- 2.43.0