From 28f87da306100d44dc6470fab8de88de8a7b72d2 Mon Sep 17 00:00:00 2001 From: Jan Michel Date: Mon, 29 Apr 2013 16:49:10 +0200 Subject: [PATCH] fixed two bugs with timer ticks in Hub and Hub with CTS --- media_interfaces/med_ecp3_sfp_sync.vhd | 18 ++++++++++++++---- trb_net16_hub_base.vhd | 2 +- trb_net16_hub_streaming_port_sctrl_cts.vhd | 1 + 3 files changed, 16 insertions(+), 5 deletions(-) diff --git a/media_interfaces/med_ecp3_sfp_sync.vhd b/media_interfaces/med_ecp3_sfp_sync.vhd index 9c4a5c1..3f016cf 100644 --- a/media_interfaces/med_ecp3_sfp_sync.vhd +++ b/media_interfaces/med_ecp3_sfp_sync.vhd @@ -273,8 +273,17 @@ THE_TX_FSM : tx_reset_fsm STATE_OUT => tx_fsm_state ); --- Master does not do bit-locking -wa_position_rx <= wa_position when (IS_SYNC_SLAVE = 1) else x"0000"; + + +-- Master does not do bit-locking +SYNC_WA_POSITION : process begin + wait until rising_edge(clk_200_i); + if IS_SYNC_SLAVE = 1 then + wa_position_rx <= wa_position; + else + wa_position_rx <= x"0000"; + end if; +end process; --Slave enables RX/TX when sync is done, Master waits additional time to make sure link is stable @@ -486,7 +495,8 @@ end process; ------------------------------------------------- -- Debug Registers ------------------------------------------------- -debug_reg(3 downto 0) <= rx_fsm_state; +debug_reg(2 downto 0) <= rx_fsm_state(2 downto 0); +debug_reg(3) <= rx_serdes_rst; debug_reg(4) <= CLEAR; debug_reg(5) <= tx_allow_q; debug_reg(6) <= rx_los_low; @@ -498,7 +508,7 @@ debug_reg(10) <= rx_allow_q; debug_reg(11) <= CTRL_OP(15); debug_reg(12) <= make_link_reset_i; debug_reg(13) <= send_link_reset_i; -debug_reg(14) <= rst_qd; +debug_reg(14) <= sd_los_i; debug_reg(15) <= rx_pcs_rst; -- debug_reg(31 downto 24) <= tx_data; diff --git a/trb_net16_hub_base.vhd b/trb_net16_hub_base.vhd index 01067fc..d3548a8 100644 --- a/trb_net16_hub_base.vhd +++ b/trb_net16_hub_base.vhd @@ -1751,6 +1751,6 @@ HUB_MED_CONNECTED(31 downto MII_NUMBER) <= (others => '1'); HUB_STAT_GEN(31 downto 4) <= (others => '0'); TIMER_TICKS_OUT(0) <= timer_us_tick; - TIMER_TICKS_OUT(1) <= timer_us_tick; + TIMER_TICKS_OUT(1) <= timer_ms_tick; end architecture; diff --git a/trb_net16_hub_streaming_port_sctrl_cts.vhd b/trb_net16_hub_streaming_port_sctrl_cts.vhd index b9208c1..49387c6 100644 --- a/trb_net16_hub_streaming_port_sctrl_cts.vhd +++ b/trb_net16_hub_streaming_port_sctrl_cts.vhd @@ -1127,6 +1127,7 @@ COMMON_STAT_REGS <= common_stat; last_write_enable <= write_enable when rising_edge(CLK); last_read_enable <= read_enable when rising_edge(CLK); + TIMER_TICKS_OUT <= timer_ticks; --------------------------------------------------------------------- -- Debug -- 2.43.0