From dde9ce1f3f828e0bc38f6b3f4bd186267f7309aa Mon Sep 17 00:00:00 2001 From: hadeshyp Date: Sat, 21 May 2011 22:18:37 +0000 Subject: [PATCH] *** empty log message *** --- .../trb_net16_med_ecp_fot_4_ctc.vhd | 3 ++- trb_net16_api_base.vhd | 2 +- trb_net16_hub_base.vhd | 26 +++++++++---------- trb_net16_hub_logic.vhd | 20 ++++++++++---- 4 files changed, 31 insertions(+), 20 deletions(-) diff --git a/media_interfaces/trb_net16_med_ecp_fot_4_ctc.vhd b/media_interfaces/trb_net16_med_ecp_fot_4_ctc.vhd index 917e4d9..f06d02f 100644 --- a/media_interfaces/trb_net16_med_ecp_fot_4_ctc.vhd +++ b/media_interfaces/trb_net16_med_ecp_fot_4_ctc.vhd @@ -837,7 +837,8 @@ end generate; if CTRL_OP(i*16+8) = '1' then STAT_OP(i*16+12) <= request_retransmit_i(i); else - STAT_OP(i*16+12) <= (link_error_q(i)(1) or packet_timeout(i)) and not send_reset_words(i) and tx_allow(i); + STAT_OP(i*16+12) <= (link_error_q(i)(1) or packet_timeout(i)) + and not CTRL_OP(i*16+15) and not send_reset_words(i) and tx_allow(i); end if; end if; end process; diff --git a/trb_net16_api_base.vhd b/trb_net16_api_base.vhd index 1e89383..0cbf58f 100644 --- a/trb_net16_api_base.vhd +++ b/trb_net16_api_base.vhd @@ -874,7 +874,7 @@ INT_MASTER_DATAREADY_OUT <= buf_INT_MASTER_DATAREADY_OUT; else --API_TYPE = 1 if master_start = '1' then buf_APL_RUN_OUT <= '1'; - elsif master_running = '0' and state_to_apl = sa_INACTIVE and APL_DATAREADY_OUT = '0' then --add dataready on 18032011 + elsif master_running = '0' and state_to_apl = sa_INACTIVE and reg_APL_DATAREADY_OUT = '0' then --add dataready on 18032011 buf_APL_RUN_OUT <= '0'; end if; end if; diff --git a/trb_net16_hub_base.vhd b/trb_net16_hub_base.vhd index e6d0b78..f2f0eae 100644 --- a/trb_net16_hub_base.vhd +++ b/trb_net16_hub_base.vhd @@ -25,7 +25,7 @@ entity trb_net16_hub_base is INIT_CTRL_REGS : std_logic_vector(2**(4)*32-1 downto 0) := x"00000000_00000000_00000000_00000000" & x"00000000_00000000_00000000_00000000" & - x"00000000_00000000_000090FF_00000000" & + x"00000000_00000000_00007077_00000000" & x"FFFFFFFF_FFFFFFFF_FFFFFFFF_FFFFFFFF"; COMPILE_TIME : std_logic_vector(31 downto 0) := x"00000000"; COMPILE_VERSION : std_logic_vector(15 downto 0) := x"0001"; @@ -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'); - elsif combined_resync = '0' and reset_i = '0' then + elsif combined_resync = '0' and reset_i = '0' and timer_ms_tick = '1' 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'); - elsif combined_resync = '0' and reset_i = '0' then + elsif combined_resync = '0' and reset_i = '0' and timer_ms_tick = '1' 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 +-- if reg_STROBES(10) = '1' then HC_STAT_REGS(10*32+31 downto 10*32) <= (others => '0'); - 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; +-- elsif combined_resync = '0' and reset_i = '0' and timer_ms_tick = '1' 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'); - elsif combined_resync = '0' and reset_i = '0' then + elsif combined_resync = '0' and reset_i = '0' and timer_ms_tick = '1' 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; @@ -1424,11 +1424,11 @@ HUB_MED_CONNECTED(31 downto MII_NUMBER) <= (others => '1'); else HC_STAT_REGS(13*32+31 downto 13*32) <= HC_STAT_ack_waiting(1*32+31 downto 1*32) or HC_STAT_REGS(13*32+31 downto 13*32); end if; - if reg_STROBES(14) = '1' then +-- if reg_STROBES(14) = '1' then HC_STAT_REGS(14*32+31 downto 14*32) <= (others => '0'); - else - HC_STAT_REGS(14*32+31 downto 14*32) <= HC_STAT_ack_waiting(2*32+31 downto 2*32) or HC_STAT_REGS(14*32+31 downto 14*32); - end if; +-- else +-- HC_STAT_REGS(14*32+31 downto 14*32) <= HC_STAT_ack_waiting(2*32+31 downto 2*32) or HC_STAT_REGS(14*32+31 downto 14*32); +-- end if; if reg_STROBES(15) = '1' then HC_STAT_REGS(15*32+31 downto 15*32) <= (others => '0'); else @@ -1458,7 +1458,7 @@ HUB_MED_CONNECTED(31 downto MII_NUMBER) <= (others => '1'); --LSM packet timeout A6 if reg_STROBES(38) = '1' then HC_STAT_REGS(38*32+31 downto 38*32) <= (others => '0'); - else + elsif reset_i = '0' then for i in 0 to MII_NUMBER-1 loop HC_STAT_REGS(38*32+i) <= HC_STAT_REGS(38*32+i) or (MED_STAT_OP(i*16+12)); end loop; diff --git a/trb_net16_hub_logic.vhd b/trb_net16_hub_logic.vhd index c9cd2e7..0d60699 100644 --- a/trb_net16_hub_logic.vhd +++ b/trb_net16_hub_logic.vhd @@ -106,7 +106,7 @@ architecture trb_net16_hub_logic_arch of trb_net16_hub_logic is signal REPLY_POOL_next_read : std_logic; signal comb_REPLY_POOL_next_read : std_logic; - + signal reg_stat_timeout : std_logic_vector(POINT_NUMBER-1 downto 0); signal reply_point_lock, next_point_lock : std_logic; signal comb_REPLY_muxed_DATAREADY : std_logic; @@ -574,13 +574,13 @@ 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' or got_trm(i) = '1' - or locking_point(i) = '1' or reg_CTRL_TIMEOUT_TIME = 0 then + or reset_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') + 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; @@ -807,8 +807,18 @@ STAT_locked <= locked; ---------------------------------- --Debugging ---------------------------------- - - STAT_TIMEOUT(POINT_NUMBER-1 downto 0) <= connection_timed_out; + process(CLK) + begin + if rising_edge(CLK) then + if timer_ms_tick = '1' or reset_i = '1' then + reg_stat_timeout <= (others => '0'); + else + reg_stat_timeout <= reg_stat_timeout or connection_timed_out; + end if; + end if; + end process; + + STAT_TIMEOUT(POINT_NUMBER-1 downto 0) <= reg_stat_timeout; STAT_TIMEOUT(31 downto POINT_NUMBER) <= (others => '0'); STAT(0) <= got_trm(0); -- 2.43.0