]> jspc29.x-matter.uni-frankfurt.de Git - trbnet.git/commitdiff
*** empty log message ***
authorhadeshyp <hadeshyp>
Wed, 17 Feb 2010 16:17:48 +0000 (16:17 +0000)
committerhadeshyp <hadeshyp>
Wed, 17 Feb 2010 16:17:48 +0000 (16:17 +0000)
trb_net16_endpoint_hades_full.vhd
trb_net16_hub_base.vhd
trb_net16_hub_streaming_port.vhd

index 415f9f3f068653839527b5ef489f617f469c9c59..b3ac922e76c19deb1a8b51232aa9610216b34a7d 100644 (file)
@@ -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;
index 985fcb220de67179e3232703f94c381a005e85e7..96b00cba014203fecb2737314c3b25c57446cfd1 100644 (file)
@@ -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
index cbb27743a3b770945882240cd3f4fc56476424b7..92ebc7fad9755883e695fcd4e4dee1c81b9e8300 100644 (file)
@@ -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