From e73a2c147fd1e8749b32e758f6961c2d314cf65a Mon Sep 17 00:00:00 2001 From: hadeshyp Date: Wed, 17 Feb 2010 16:17:48 +0000 Subject: [PATCH] *** empty log message *** --- trb_net16_endpoint_hades_full.vhd | 10 ++++---- trb_net16_hub_base.vhd | 4 ++-- trb_net16_hub_streaming_port.vhd | 40 +++++++++++++++++++++---------- 3 files changed, 36 insertions(+), 18 deletions(-) diff --git a/trb_net16_endpoint_hades_full.vhd b/trb_net16_endpoint_hades_full.vhd index 415f9f3..b3ac922 100644 --- a/trb_net16_endpoint_hades_full.vhd +++ b/trb_net16_endpoint_hades_full.vhd @@ -235,6 +235,7 @@ signal reset_no_link : std_logic; signal temperature : std_logic_vector(11 downto 0); signal got_timing_trigger : std_logic; signal trigger_number_match : std_logic; + signal buf_TIMER_TICKS_OUT : std_logic_vector(1 downto 0); begin @@ -308,7 +309,8 @@ begin STAT_IBUF_BUFFER => buf_STAT_INIT_BUFFER(32*(i+1)-1 downto i*32), CTRL_GEN => buf_CTRL_GEN(32*(i+1)-1 downto i*32), STAT_INIT_OBUF_DEBUG => buf_STAT_INIT_OBUF_DEBUG(32*(i+1)-1 downto i*32), - STAT_REPLY_OBUF_DEBUG => buf_STAT_REPLY_OBUF_DEBUG(32*(i+1)-1 downto i*32) + STAT_REPLY_OBUF_DEBUG => buf_STAT_REPLY_OBUF_DEBUG(32*(i+1)-1 downto i*32), + TIMER_TICKS_IN => buf_TIMER_TICKS_OUT ); gen_api : if i /= c_TRG_LVL1_CHANNEL generate @@ -534,8 +536,8 @@ begin GLOBAL_TIME => GLOBAL_TIME_OUT, LOCAL_TIME => LOCAL_TIME_OUT, TIME_SINCE_LAST_TRG => TIME_SINCE_LAST_TRG_OUT, - TIMER_US_TICK => TIMER_TICKS_OUT(0), - TIMER_MS_TICK => TIMER_TICKS_OUT(1), + TIMER_US_TICK => buf_TIMER_TICKS_OUT(0), + TIMER_MS_TICK => buf_TIMER_TICKS_OUT(1), --Common Register in / out COMMON_STAT_REG_IN => buf_COMMON_STAT_REG_IN, COMMON_CTRL_REG_OUT => buf_REGIO_COMMON_CTRL_REG_OUT, @@ -793,7 +795,7 @@ begin STAT_REG_STROBE <= buf_STAT_REG_STROBE; CTRL_REG_STROBE <= buf_CTRL_REG_STROBE; - + TIMER_TICKS_OUT <= buf_TIMER_TICKS_OUT; buf_CTRL_GEN <= IOBUF_CTRL_GEN; REGIO_COMMON_CTRL_REG_OUT <= buf_REGIO_COMMON_CTRL_REG_OUT; diff --git a/trb_net16_hub_base.vhd b/trb_net16_hub_base.vhd index 985fcb2..96b00cb 100644 --- a/trb_net16_hub_base.vhd +++ b/trb_net16_hub_base.vhd @@ -1000,8 +1000,8 @@ HUB_MED_CONNECTED(31 downto MII_NUMBER) <= (others => '1'); buf_HC_STAT_REGS(36*32-1 downto 32*32) <= HUB_STAT_ERRORBITS; loop_links : for i in 0 to 16 generate - buf_HC_STAT_REGS(5*32+i) <= '1' when i < MII_NUMBER and MII_IS_UPLINK(i) = 1 else '0'; - buf_HC_STAT_REGS(6*32+i) <= '1' when i < MII_NUMBER and MII_IS_DOWNLINK(i) = 1 else '0'; + buf_HC_STAT_REGS(5*32+i) <= '1' when (i < MII_NUMBER or (i = MII_NUMBER and INT_NUMBER > 0)) and MII_IS_UPLINK(i) = 1 else '0'; + buf_HC_STAT_REGS(6*32+i) <= '1' when (i < MII_NUMBER or (i = MII_NUMBER and INT_NUMBER > 0)) and MII_IS_DOWNLINK(i) = 1 else '0'; end generate; loop_links_2 : for i in 0 to 15 generate diff --git a/trb_net16_hub_streaming_port.vhd b/trb_net16_hub_streaming_port.vhd index cbb2774..92ebc7f 100644 --- a/trb_net16_hub_streaming_port.vhd +++ b/trb_net16_hub_streaming_port.vhd @@ -164,33 +164,49 @@ signal reset_i : std_logic; signal HUB_MED_CTRL_OP : std_logic_vector(mii*16-1 downto 0); signal reset_i_mux_io : std_logic; +signal hub_make_network_reset : std_logic; +signal hub_got_network_reset : std_logic; + begin --------------------------------------------------------------------- -- Reset --------------------------------------------------------------------- +--13: reset sequence received +--14: not connected +--15: send reset sequence - - SYNC_RESET_MUX_IO : process(CLK) - begin - if rising_edge(CLK) then - reset_i <= MED_STAT_OP(mii*16+13) or RESET; - reset_i_mux_io <= MED_STAT_OP(mii*16+14) or reset_i; - end if; - end process; + SYNC_RESET_MUX_IO : process(CLK) + begin + if rising_edge(CLK) then + reset_i <= hub_got_network_reset or RESET; + reset_i_mux_io <= hub_got_network_reset or RESET; + end if; + end process; --generate media resync gen_resync : for i in 0 to mii-1 generate MED_CTRL_OP(13+i*16 downto i*16) <= (others => '0'); MED_CTRL_OP(14+i*16) <= HUB_MED_CTRL_OP(14+i*16); - MED_CTRL_OP(15+i*16) <= MED_STAT_OP(mii*16+15); + MED_CTRL_OP(15+i*16) <= hub_make_network_reset ; end generate; MED_CTRL_OP(13+mii*16 downto mii*16) <= (others => '0'); MED_CTRL_OP(14+mii*16) <= '0'; - MED_CTRL_OP(15+mii*16) <= MED_STAT_OP(mii*16+15); - - + MED_CTRL_OP(15+mii*16) <= hub_make_network_reset; + + proc_network_reset : process(MED_STAT_OP) + variable tmp15, tmp13 : std_logic := '0'; + begin + tmp15 := '0'; + tmp13 := '0'; + for i in 0 to MII_NUMBER loop + tmp15 := tmp or MED_STAT_OP(i*16+15) when MII_IS_UPLINK = 1 else tmp15; + tmp13 := tmp or MED_STAT_OP(i*16+13) when MII_IS_UPLINK = 1 else tmp13; + end loop; + hub_make_network_reset <= tmp15; + hub_got_network_reset <= tmp13; + end process; --------------------------------------------------------------------- -- Connecting I/O -- 2.43.0