From c61ee493e0e9593ec618407aa4ee828307b00922 Mon Sep 17 00:00:00 2001 From: hadeshyp Date: Wed, 18 Nov 2009 10:25:58 +0000 Subject: [PATCH] *** empty log message *** --- trb_net16_hub_base.vhd | 38 +++++++++++++++++++++++++------- trb_net16_hub_streaming_port.vhd | 11 +++++++-- 2 files changed, 39 insertions(+), 10 deletions(-) diff --git a/trb_net16_hub_base.vhd b/trb_net16_hub_base.vhd index 1bdb705..debfe56 100644 --- a/trb_net16_hub_base.vhd +++ b/trb_net16_hub_base.vhd @@ -183,12 +183,13 @@ architecture trb_net16_hub_base_arch of trb_net16_hub_base is signal HC_SEQNR_OUT : std_logic_vector (7 downto 0); signal HC_STAT_REGS : std_logic_vector (2**4*32-1 downto 0); signal STAT_REG_STROBE : std_logic_vector (2**4-1 downto 0); - signal HC_CTRL_REGS : std_logic_vector (2**3*32-1 downto 0); + signal CTRL_REG_STROBE : std_logic_vector (2**4-1 downto 0); + signal HC_CTRL_REGS : std_logic_vector (2**4*32-1 downto 0); signal HC_COMMON_STAT_REGS : std_logic_vector(std_COMSTATREG*32-1 downto 0); signal HC_COMMON_CTRL_REGS : std_logic_vector(std_COMCTRLREG*32-1 downto 0); signal buf_HC_STAT_REGS : std_logic_vector (2**4*32-1 downto 0); signal HC_STAT_ack_waiting : std_logic_vector(127 downto 0) := (others => '0'); - + signal HUB_CTRL_LOCAL_NETWORK_RESET : std_logic_vector(MII_NUMBER-1 downto 0); signal HUB_MED_CONNECTED : std_logic_vector (31 downto 0); signal HUB_CTRL_final_activepoints : std_logic_vector (2**(c_MUX_WIDTH-1)*32-1 downto 0); @@ -234,6 +235,9 @@ architecture trb_net16_hub_base_arch of trb_net16_hub_base is signal STAT_TIMEOUT : std_logic_vector(4*32-1 downto 0); + signal local_network_reset : std_logic_vector(MII_NUMBER-1 downto 0); + signal network_reset_counter: std_logic_vector(11 downto 0); + attribute syn_preserve : boolean; attribute syn_keep : boolean; attribute syn_preserve of m_DATA_IN : signal is true; @@ -272,10 +276,27 @@ begin resync(i) <= MED_STAT_OP(i*16+15) when MII_IS_UPLINK(i) = c_YES else '0'; MED_CTRL_OP(13+i*16 downto i*16) <= (others => '0'); MED_CTRL_OP(14+i*16) <= HUB_CTRL_media_interfaces_off(i); - MED_CTRL_OP(15+i*16) <= combined_resync; + MED_CTRL_OP(15+i*16) <= combined_resync or local_network_reset(i) when MII_IS_UPLINK(i) = 0 else combined_resync; end generate; combined_resync <= or_all(resync); + gen_local_network_reset : process(CLK) + begin + if rising_edge(CLK) then + if CTRL_REG_STROBE(8) = '1' then + local_network_reset <= HUB_CTRL_LOCAL_NETWORK_RESET; + network_reset_counter <= x"001"; + end if; + if network_reset_counter /= 0 then + network_reset_counter <= network_reset_counter + 1; + end if; + if network_reset_counter(10) = '1' then + network_reset_counter <= (others => '0'); + local_network_reset <= (others => '0'); + end if; + end if; + end process; + --------------------------------------------------------------------- --Multiplexer @@ -766,7 +787,7 @@ MED_DATA_OUT <= buf_MED_DATA_OUT; hub_control : trb_net16_regIO generic map( NUM_STAT_REGS => 4, - NUM_CTRL_REGS => 3, + NUM_CTRL_REGS => 4, INIT_CTRL_REGS => x"00000000_00000000_00000000_00000000" & x"00000000_00000000_00000000_00000000" & x"00000000_00000000_00009999_00000000" & @@ -817,7 +838,7 @@ MED_DATA_OUT <= buf_MED_DATA_OUT; COMMON_STAT_REG_STROBE => open, COMMON_CTRL_REG_STROBE => open, STAT_REG_STROBE => STAT_REG_STROBE, - CTRL_REG_STROBE => open, + CTRL_REG_STROBE => CTRL_REG_STROBE, --Port to write Unique ID IDRAM_DATA_IN => IDRAM_DATA_IN, IDRAM_DATA_OUT => open, @@ -832,7 +853,7 @@ MED_DATA_OUT <= buf_MED_DATA_OUT; DAT_NO_MORE_DATA_IN => DAT_NO_MORE_DATA_IN, DAT_UNKNOWN_ADDR_IN => DAT_UNKNOWN_ADDR_IN, DAT_TIMEOUT_OUT => DAT_TIMEOUT_OUT, - DAT_WRITE_ACK_IN => '0' + DAT_WRITE_ACK_IN => DAT_WRITE_ACK_IN ); @@ -983,7 +1004,7 @@ HUB_MED_CONNECTED(31 downto MII_NUMBER) <= (others => '1'); end process; - PROC_LED : process(CLK) + PROC_REG_STAT_REGS : process(CLK) begin if rising_edge(CLK) then HC_STAT_REGS <= buf_HC_STAT_REGS; @@ -992,6 +1013,7 @@ HUB_MED_CONNECTED(31 downto MII_NUMBER) <= (others => '1'); --Control Registers HUB_CTRL_media_interfaces_off <= HC_CTRL_REGS(2**2*32+31 downto 2**2*32); + HUB_CTRL_LOCAL_NETWORK_RESET <= HC_CTRL_REGS(7*32+MII_NUMBER-1 downto 7*32); PROC_active_points : process (CLK) begin @@ -1032,7 +1054,7 @@ HUB_MED_CONNECTED(31 downto MII_NUMBER) <= (others => '1'); COMMON_CTRL_REGS <= HC_COMMON_CTRL_REGS; MY_ADDRESS_OUT <= HUB_ADDRESS; STAT_REGS <= HC_STAT_REGS; - STAT_CTRL_REGS <= HC_CTRL_REGS; + STAT_CTRL_REGS <= HC_CTRL_REGS(255 downto 0); HUB_CTRL_TIMEOUT_TIME <= HC_CTRL_REGS(5*32+15 downto 5*32); HUB_STAT_CHANNEL <= buf_HUB_STAT_CHANNEL; STAT_DEBUG <= buf_STAT_DEBUG; diff --git a/trb_net16_hub_streaming_port.vhd b/trb_net16_hub_streaming_port.vhd index ebe6526..6b9c946 100644 --- a/trb_net16_hub_streaming_port.vhd +++ b/trb_net16_hub_streaming_port.vhd @@ -370,7 +370,7 @@ begin MED_INIT_DATAREADY_OUT => io_dataready_out(2), MED_INIT_DATA_OUT => io_data_out(47 downto 32), MED_INIT_PACKET_NUM_OUT => io_packet_num_out(8 downto 6), - MED_INIT_READ_IN => io_read_in(4), + MED_INIT_READ_IN => io_read_in(2), MED_REPLY_DATAREADY_OUT => io_dataready_out(3), MED_REPLY_DATA_OUT => io_data_out(63 downto 48), @@ -590,7 +590,14 @@ begin ); - +STAT_DEBUG(0) <= cts_reply_dataready_in; +STAT_DEBUG(1) <= cts_reply_read_out; +STAT_DEBUG(2) <= cts_init_dataready_out; +STAT_DEBUG(3) <= cts_reply_read_out; +STAT_DEBUG(4) <= io_dataready_out(2); +STAT_DEBUG(5) <= io_dataready_out(3); +STAT_DEBUG(6) <= '0'; +STAT_DEBUG(7) <= '0'; end architecture; \ No newline at end of file -- 2.43.0