]> jspc29.x-matter.uni-frankfurt.de Git - trbnet.git/commitdiff
*** empty log message ***
authorhadeshyp <hadeshyp>
Mon, 25 Oct 2010 12:37:47 +0000 (12:37 +0000)
committerhadeshyp <hadeshyp>
Mon, 25 Oct 2010 12:37:47 +0000 (12:37 +0000)
trb_net16_hub_base.vhd
trb_net16_hub_func.vhd
trb_net16_hub_ipu_logic.vhd

index e0ee39b193c8fcabd1d8f51ed6de8835c40a3e94..d4a9cbd5a7f55e9933e67d9cd0d457d15feaa9b7 100644 (file)
@@ -329,6 +329,8 @@ architecture trb_net16_hub_base_arch of trb_net16_hub_base is
   signal last_lsm_read             : std_logic;
   signal next_last_lsm_read        : std_logic;
 
+  signal buf_HUB_MISMATCH_PATTERN  : std_logic_vector(31 downto 0);
+
   type counter8b_t is array (0 to 15) of unsigned(7 downto 0);
   signal received_retransmit_requests : counter8b_t;
   signal sent_retransmit_requests     : counter8b_t;
@@ -918,6 +920,7 @@ MED_DATA_OUT       <= buf_MED_DATA_OUT;
             STAT_ERRORBITS        => HUB_STAT_ERRORBITS((i+1)*32-1 downto i*32),
             STAT_ALL_ERRORBITS    => buf_HUB_ALL_ERROR_BITS((i+1)*32*16-1 downto i*32*16),
             STAT_FSM              => stat_ipu_fsm,
+            STAT_MISMATCH         => buf_HUB_MISMATCH_PATTERN(31 downto 0),
             CTRL_TIMEOUT_TIME     => current_timeout_value(i),--HUB_CTRL_TIMEOUT_TIME(i*4+3 downto i*4),
             CTRL_activepoints     => HUB_CTRL_final_activepoints((i+1)*32-1 downto i*32),
             CTRL_TIMER_TICK(0)    => timer_us_tick,
@@ -1239,7 +1242,8 @@ HUB_MED_CONNECTED(31 downto MII_NUMBER) <= (others => '1');
   buf_HC_STAT_REGS(7*32+31 downto 7*32)              <= stat_ipu_fsm;
   buf_HC_STAT_REGS(15*32-1 downto 8*32)              <= (others => '0');
   buf_HC_STAT_REGS(16*32+MII_NUMBER-1 downto 16*32)  <= mii_error(MII_NUMBER-1 downto 0);
-  buf_HC_STAT_REGS(31*32+31 downto 16*32+MII_NUMBER) <= (others => '0');
+  buf_HC_STAT_REGS(30*32+31 downto 16*32+MII_NUMBER) <= (others => '0');
+  buf_HC_STAT_REGS(31*32+31 downto 31*32)            <= buf_HUB_MISMATCH_PATTERN;
   buf_HC_STAT_REGS(35*32+31 downto 32*32)            <= HUB_STAT_ERRORBITS;
   buf_HC_STAT_REGS(63*32+31 downto 36*32)            <= (others => '0');
 
index 7f5573e11e0c216c2e4b44e7e95e21d74c4ae4b5..1d492b7f9ae7c5c45d40db78e3b04265e940f193 100644 (file)
@@ -326,6 +326,7 @@ component trb_net16_hub_streaming_port is
       STAT_ERRORBITS     : out std_logic_vector (31 downto 0);
       STAT_ALL_ERRORBITS : out std_logic_vector (16*32-1 downto 0);
       STAT_FSM           : out std_logic_vector (31 downto 0);
+      STAT_MISMATCH      : out std_logic_vector (31 downto 0);
       CTRL_TIMEOUT_TIME  : in  std_logic_vector (15 downto 0);
       CTRL_activepoints  : in  std_logic_vector (31 downto 0) := (others => '1');
       CTRL_TIMER_TICK    : in  std_logic_vector (1 downto 0)
index d2b9072374dcac9796f1916b89d96629d688132c..43dc00f0de95dba8feb044a224551959d827396c 100644 (file)
@@ -47,6 +47,7 @@ entity trb_net16_hub_ipu_logic is
     STAT_ERRORBITS     : out std_logic_vector (31 downto 0);
     STAT_ALL_ERRORBITS : out std_logic_vector (16*32-1 downto 0);
     STAT_FSM           : out std_logic_vector (31 downto 0);
+    STAT_MISMATCH      : out std_logic_vector (31 downto 0);
     CTRL_TIMEOUT_TIME  : in  std_logic_vector (15 downto 0);
     CTRL_activepoints  : in  std_logic_vector (31 downto 0) := (others => '1');
     CTRL_TIMER_TICK    : in  std_logic_vector (1 downto 0)
@@ -215,6 +216,7 @@ architecture trb_net16_hub_ipu_logic_arch of trb_net16_hub_ipu_logic is
 
   signal reply_fsm_statebits          : std_logic_vector(3 downto 0);
   signal last_locked                  : std_logic;
+  signal mismatch_pattern             : std_logic_vector(31 downto 0);
 begin
 
 ----------------------------------
@@ -926,21 +928,25 @@ begin
         tmp_number := '0';
         if reply_compare_start = '1' then
           if dhdr_addr = "100" then --upper part
+            mismatch_pattern(31 downto 16) <= (others => '0');
             for i in 0 to POINT_NUMBER-1 loop
               if dhdr_data(i*16+12) = '0' and reply_adder_val_enable(i) = '1' then
                 tmp_pack := '0';
               end if;
               if dhdr_data(i*16+7 downto i*16) /= evt_random_code and reply_adder_val_enable(i) = '1' then
                 tmp_code := '1';
+                mismatch_pattern(i+16) <= '1';
               end if;
             end loop;
             enable_packing    <= tmp_pack;
             evt_code_mismatch <= tmp_code;
             reply_compare_finished <= '1';
           elsif dhdr_addr = "101" then
+            mismatch_pattern(15 downto 0) <= (others => '0');
             for i in 0 to POINT_NUMBER-1 loop
               if dhdr_data(i*16+15 downto i*16) /= evt_number and reply_adder_val_enable(i) = '1' then
                 tmp_number := '1';
+                mismatch_pattern(i) <= '1';
               end if;
             end loop;
             evt_number_mismatch <= tmp_number;
@@ -1331,8 +1337,10 @@ begin
         else
           STAT_POINTS_locked(POINT_NUMBER-1 downto 0) <= (others => '0');
         end if;
-        if locked = '0' and last_locked = '1' then
-          STAT_ERRORBITS <= REPLY_combined_trm_F1 & REPLY_combined_trm_F2;
+        if current_state = SENDING_REPLY_TRM and packet_counter = c_F1 then
+          STAT_ERRORBITS(31 downto 16) <= comb_REPLY_POOL_DATA;
+        elsif  current_state = SENDING_REPLY_TRM and packet_counter = c_F2 then
+          STAT_ERRORBITS(15 downto 0) <= comb_REPLY_POOL_DATA;
         end if;
       end if;
     end process;
@@ -1349,6 +1357,7 @@ begin
   STAT_FSM(31 downto 16)<= (others => '0');
 
   STAT_locked <= locked;
+  STAT_MISMATCH <= mismatch_pattern;
 
 end architecture;