]> jspc29.x-matter.uni-frankfurt.de Git - trbnet.git/commitdiff
*** empty log message ***
authorhadeshyp <hadeshyp>
Tue, 19 Oct 2010 15:09:00 +0000 (15:09 +0000)
committerhadeshyp <hadeshyp>
Tue, 19 Oct 2010 15:09:00 +0000 (15:09 +0000)
special/handler_data.vhd
special/handler_ipu.vhd
special/handler_trigger_and_data.vhd
trb_net16_endpoint_hades_full.vhd
trb_net16_endpoint_hades_full_handler.vhd
trb_net16_regIO.vhd
trb_net_components.vhd

index 1fb55dda12fc246fde9415f05d0d85165687bc9d..3217daac483e2d6ec36f2c55d9b4742708492852 100644 (file)
@@ -48,6 +48,7 @@ entity handler_data is
     IPU_HDR_DATA_READ_IN         : in  std_logic;
     IPU_HDR_DATA_EMPTY_OUT       : out std_logic;
 
+    TMG_TRG_ERROR_IN             : in  std_logic;
     --Status
     STAT_DATA_BUFFER_LEVEL       : out std_logic_vector(DATA_INTERFACE_NUMBER*32-1 downto 0);
     STAT_HEADER_BUFFER_LEVEL     : out std_logic_vector(31 downto 0);
@@ -175,7 +176,7 @@ begin
 
   end generate;
 
-  header_buffer_data_in          <= "0000000" & LVL1_TRG_INFO_IN(0) & LVL1_TRG_TYPE_IN & LVL1_TRG_CODE_IN & LVL1_TRG_NUMBER_IN;
+  header_buffer_data_in          <= "000000" & TMG_TRG_ERROR_IN & LVL1_TRG_INFO_IN(0) & LVL1_TRG_TYPE_IN & LVL1_TRG_CODE_IN & LVL1_TRG_NUMBER_IN;
 
 
 ---------------------------------------------------------------------------
index 4b0df536466a8b693bcb8b321c8272cf00844fff..fe60abc5bbf8e4f32d7297eeb88e5fe7d11ffbe2 100644 (file)
@@ -56,6 +56,7 @@ architecture handler_ipu_arch of handler_ipu is
   signal state_bits                                            : std_logic_vector(3 downto 0);
 
   signal error_not_found,        next_error_not_found          : std_logic;
+  signal error_lvl1,             next_error_lvl1               : std_logic;
   signal error_sync                                            : std_logic;
   signal error_missing,          next_error_missing            : std_logic;
   signal error_not_configured                                  : std_logic;
@@ -114,12 +115,13 @@ begin
 
   THE_FSM : process(current_state, error_not_found, IPU_START_READOUT_IN, DAT_HDR_DATA_EMPTY_IN,
                     DAT_HDR_DATA_IN, last_hdr_fifo_valid_read, ipu_dataready_i, IPU_READ_IN,
-                    error_missing, dat_fifo_valid_read, next_dat_fifo_number,
+                    error_missing, dat_fifo_valid_read, next_dat_fifo_number, error_lvl1,
                     dat_fifo_finished, dat_fifo_number, DAT_DATA_IN, suppress_output)
     begin
       next_state                 <= current_state;
       next_error_not_found       <= error_not_found;
       next_error_missing         <= error_missing;
+      next_error_lvl1            <= error_lvl1;
       next_hdr_fifo_read         <= '0';
       next_lvl1_fifo_read        <= '0';
       next_ipu_data_i            <= (others => '0');
@@ -139,6 +141,7 @@ begin
             end if;
             next_error_not_found <= '0';
             next_error_missing   <= '0';
+            next_error_lvl1      <= '0';
             next_dat_fifo_number <=  0;
           end if;
 
@@ -148,6 +151,7 @@ begin
           if last_hdr_fifo_valid_read = '1' then
             next_state <= SEND_DHDR;
             next_suppress_output <= DAT_HDR_DATA_IN(28);
+            next_error_lvl1      <= DAT_HDR_DATA_IN(29);
           end if;
 
 --         when GOT_LENGTH =>
@@ -176,6 +180,7 @@ begin
           next_ipu_dataready_i <= (dat_fifo_valid_read or (ipu_dataready_i and not IPU_READ_IN));
           next_ipu_data_i      <= DAT_DATA_IN(dat_fifo_number*32+31 downto dat_fifo_number*32);
 
+
         when END_READOUT =>
           next_ipu_finished_i <= '1';
           if IPU_START_READOUT_IN = '0' then
@@ -331,7 +336,10 @@ begin
   ipu_error_pattern_i(21)           <= error_missing;        --part of data missing
   ipu_error_pattern_i(22)           <= error_sync;           --severe sync problem
   ipu_error_pattern_i(23)           <= error_not_configured; --FEE not configured
-  ipu_error_pattern_i(31 downto 24) <= (others => '0');
+  ipu_error_pattern_i(26 downto 24) <= (others => '0');
+  ipu_error_pattern_i(27)           <= error_lvl1;
+  ipu_error_pattern_i(31 downto 28) <= (others => '0');
+
 
   error_not_configured              <= '0';
 
index 6373e76fba0145bc7e7cea073d67ecf22c4ef4c8..42860f48faea386009fc6e744b1ef90e606fc7dc 100644 (file)
@@ -58,6 +58,8 @@ entity handler_trigger_and_data is
     FEE_DATA_FINISHED_IN         : in  std_logic_vector(DATA_INTERFACE_NUMBER-1 downto 0);
     FEE_DATA_ALMOST_FULL_OUT     : out std_logic_vector(DATA_INTERFACE_NUMBER-1 downto 0);
 
+    TMG_TRG_ERROR_IN             : in  std_logic;
+
     --Status Registers
     STAT_DATA_BUFFER_LEVEL       : out std_logic_vector(DATA_INTERFACE_NUMBER*32-1 downto 0);
     STAT_HEADER_BUFFER_LEVEL     : out std_logic_vector(31 downto 0);
@@ -181,6 +183,7 @@ begin
       IPU_HDR_DATA_OUT             => ipu_header,
       IPU_HDR_DATA_READ_IN         => ipu_header_read,
       IPU_HDR_DATA_EMPTY_OUT       => ipu_header_empty,
+      TMG_TRG_ERROR_IN             => TMG_TRG_ERROR_IN,
       --Status
       STAT_DATA_BUFFER_LEVEL       => STAT_DATA_BUFFER_LEVEL,
       STAT_HEADER_BUFFER_LEVEL     => STAT_HEADER_BUFFER_LEVEL,
index b02c11bb95d6f3b7bb2ecf70b60fc61a0869b911..d0a341bbb6c61d98c30c6a0ea75d6818f0ea11fa 100644 (file)
@@ -85,6 +85,12 @@ entity trb_net16_endpoint_hades_full is
     LVL1_TRG_RELEASE_IN          : in  std_logic := '0';
     LVL1_INT_TRG_NUMBER_OUT      : out std_logic_vector(15 downto 0);  --internally generated trigger number, for informational uses only
 
+    --Information about trigger handler errors
+    TRG_MULTIPLE_TRG_OUT         : out std_logic;
+    TRG_TIMEOUT_DETECTED_OUT     : out std_logic;
+    TRG_SPURIOUS_TRG_OUT         : out std_logic;
+    TRG_MISSING_TMG_TRG_OUT      : out std_logic;
+    TRG_SPIKE_DETECTED_OUT       : out std_logic;
 
     --Data Port
     IPU_NUMBER_OUT               : out std_logic_vector (15 downto 0);
@@ -258,12 +264,12 @@ architecture trb_net16_endpoint_hades_full_arch of trb_net16_endpoint_hades_full
   signal buf_LVL1_TRG_DATA_VALID_OUT      : std_logic;
 
        signal int_lvl1_delay            : std_logic_vector(15 downto 0);
-       signal int_multiple_trg          : std_logic;
        signal int_trg_reset             : std_logic;
        signal reset_trg_logic           : std_logic;
        signal stat_lvl1_handler         : std_logic_vector(63 downto 0);
        signal stat_counters_lvl1_handler: std_logic_vector(63 downto 0);
        signal trg_invert_i              : std_logic;
+  signal int_multiple_trg          : std_logic;
   signal int_lvl1_timeout_detected : std_logic;
   signal int_lvl1_spurious_trg     : std_logic;
   signal int_lvl1_missing_tmg_trg  : std_logic;
@@ -912,7 +918,11 @@ begin
                        DEBUG_OUT                    => DEBUG_LVL1_HANDLER_OUT
                );
 
-
+  TRG_SPIKE_DETECTED_OUT   <= int_spike_detected;
+  TRG_SPURIOUS_TRG_OUT     <= int_lvl1_spurious_trg;
+  TRG_TIMEOUT_DETECTED_OUT <= int_lvl1_timeout_detected;
+  TRG_MULTIPLE_TRG_OUT     <= int_multiple_trg;
+  TRG_MISSING_TMG_TRG_OUT  <= int_lvl1_missing_tmg_trg;
 
 --   THE_TRG_SYNC : signal_sync
 --      generic map(
index a1630160f5eb7c821b8a0dc3a53dba24fc647273..fde1d44773f164c7bdb3b0b89e7c517cf3464219 100644 (file)
@@ -73,6 +73,13 @@ entity trb_net16_endpoint_hades_full_handler is
     LVL1_TRG_INFORMATION_OUT     : out std_logic_vector(23 downto 0);
     LVL1_INT_TRG_NUMBER_OUT      : out std_logic_vector(15 downto 0);  --internally generated trigger number, for informational uses only
 
+    --Information about trigger handler errors
+    TRG_MULTIPLE_TRG_OUT         : out std_logic;
+    TRG_TIMEOUT_DETECTED_OUT     : out std_logic;
+    TRG_SPURIOUS_TRG_OUT         : out std_logic;
+    TRG_MISSING_TMG_TRG_OUT      : out std_logic;
+    TRG_SPIKE_DETECTED_OUT       : out std_logic;
+
     --Response from FEE
     FEE_TRG_RELEASE_IN           : in  std_logic_vector(DATA_INTERFACE_NUMBER-1 downto 0);
     FEE_TRG_STATUSBITS_IN        : in  std_logic_vector(DATA_INTERFACE_NUMBER*32-1 downto 0);
@@ -208,6 +215,14 @@ architecture trb_net16_endpoint_hades_full_handler_arch of trb_net16_endpoint_ha
   signal debug_data_handler_i    : std_logic_vector(31 downto 0);
   signal debug_ipu_handler_i     : std_logic_vector(31 downto 0);
 
+  signal int_multiple_trg          : std_logic;
+  signal int_lvl1_timeout_detected : std_logic;
+  signal int_lvl1_spurious_trg     : std_logic;
+  signal int_lvl1_missing_tmg_trg  : std_logic;
+  signal int_spike_detected        : std_logic;
+  signal tmg_trg_error_i           : std_logic;
+
+
 begin
 ---------------------------------------------------------------------------
 -- TrbNet Endpoint
@@ -266,6 +281,12 @@ begin
       LVL1_TRG_RELEASE_IN        => lvl1_release_i,
       LVL1_INT_TRG_NUMBER_OUT    => lvl1_int_trg_number_i,
 
+      --Information about trigger handler errors
+      TRG_SPIKE_DETECTED_OUT     => int_spike_detected,
+      TRG_SPURIOUS_TRG_OUT       => int_lvl1_spurious_trg,
+      TRG_TIMEOUT_DETECTED_OUT   => int_lvl1_timeout_detected,
+      TRG_MULTIPLE_TRG_OUT       => int_multiple_trg,
+      TRG_MISSING_TMG_TRG_OUT    => int_lvl1_missing_tmg_trg,
       --Data Port
       IPU_NUMBER_OUT             => ipu_number_i,
       IPU_READOUT_TYPE_OUT       => ipu_readout_type_i,
@@ -495,6 +516,7 @@ begin
       FEE_DATA_FINISHED_IN       => FEE_DATA_FINISHED_IN,
       FEE_DATA_ALMOST_FULL_OUT   => FEE_DATA_ALMOST_FULL_OUT,
 
+      TMG_TRG_ERROR_IN           => tmg_trg_error_i,
       --Status Registers
       STAT_DATA_BUFFER_LEVEL     => stat_data_buffer_level,
       STAT_HEADER_BUFFER_LEVEL   => stat_header_buffer_level,
@@ -510,6 +532,8 @@ begin
   lvl1_valid_i                 <= lvl1_valid_timing_i or lvl1_valid_notiming_i or lvl1_invalid_i;
   STAT_DEBUG_IPU_HANDLER_OUT   <= debug_ipu_handler_i;
   STAT_DEBUG_DATA_HANDLER_OUT  <= debug_data_handler_i;
+  tmg_trg_error_i              <= int_lvl1_missing_tmg_trg or int_lvl1_spurious_trg or int_lvl1_timeout_detected or int_multiple_trg
+                                  or int_spike_detected;
 
 ---------------------------------------------------------------------------
 -- Connect Status Registers
@@ -540,6 +564,12 @@ begin
 -- Connect I/O Ports
 ---------------------------------------------------------------------------
 
+  TRG_SPIKE_DETECTED_OUT   <= int_spike_detected;
+  TRG_SPURIOUS_TRG_OUT     <= int_lvl1_spurious_trg;
+  TRG_TIMEOUT_DETECTED_OUT <= int_lvl1_timeout_detected;
+  TRG_MULTIPLE_TRG_OUT     <= int_multiple_trg;
+  TRG_MISSING_TMG_TRG_OUT  <= int_lvl1_missing_tmg_trg;
+
   LVL1_TRG_DATA_VALID_OUT        <= lvl1_data_valid_i;
   LVL1_VALID_TIMING_TRG_OUT      <= lvl1_valid_timing_i;
   LVL1_VALID_NOTIMING_TRG_OUT    <= lvl1_valid_notiming_i;
index f887c46e89ab925b033e421fa783cbfdd5cab525..359fdd2761ed7d84f62f7f2b4e1742c49b98446e 100644 (file)
@@ -490,7 +490,7 @@ begin
               end case;
 
             when c_F3 =>
-              next_API_DATA_OUT <= (others => '0');
+              next_API_DATA_OUT <= global_time_i(19 downto 4);
               if API_READ_IN = '1' then
                 next_state <= SEND_REPLY_DATA_finish;
               end if;
@@ -551,7 +551,7 @@ begin
               next_API_DATA_OUT <= buf_DAT_DATA_IN(15 downto 0);
               next_API_DATAREADY_OUT <= '1';
             when c_F3 =>
-              next_API_DATA_OUT <= (others => '0');
+              next_API_DATA_OUT <=  global_time_i(19 downto 4);--(others => '0');
               next_API_DATAREADY_OUT <= '1';
               if API_READ_IN = '1' then
                 next_length <= length-1;
@@ -637,7 +637,7 @@ begin
             when c_F0 =>  next_API_DATA_OUT <= address;
             when c_F1 =>  next_API_DATA_OUT <= buf_DAT_DATA_IN(31 downto 16);
             when c_F2 =>  next_API_DATA_OUT <= buf_DAT_DATA_IN(15 downto 0);
-            when c_F3 =>  next_API_DATA_OUT <= (others => '0');
+            when c_F3 =>  next_API_DATA_OUT <= global_time_i(19 downto 4);--(others => '0');
                           if API_READ_IN = '1' then
                             next_state <= SEND_REPLY_DATA_finish;
                           end if;
@@ -651,7 +651,7 @@ begin
             when c_F0 => next_API_DATA_OUT <= address;
             when c_F1 => next_API_DATA_OUT <= dat_data_counter;
             when c_F2 => next_API_DATA_OUT <= (others => '0');
-            when c_F3 => next_API_DATA_OUT <= (others => '0');
+            when c_F3 => next_API_DATA_OUT <= global_time_i(19 downto 4);--(others => '0');
                          if API_READ_IN = '1' then
                            next_state <= SEND_REPLY_DATA_finish;
                          end if;
index 952e9b25c6d99ecca15c629abdf2351f23ce2704..8d80a5a259ab28689a853e1521c952ac532a3e0e 100644 (file)
@@ -412,7 +412,12 @@ end component trb_net16_med_scm_sfp_gbe;
       LVL1_TRG_RELEASE_IN          : in  std_logic := '0';
       LVL1_INT_TRG_NUMBER_OUT      : out std_logic_vector(15 downto 0);  --internally generated trigger number, for informational uses only
 
-
+      --Information about trigger handler errors
+      TRG_MULTIPLE_TRG_OUT         : out std_logic;
+      TRG_TIMEOUT_DETECTED_OUT     : out std_logic;
+      TRG_SPURIOUS_TRG_OUT         : out std_logic;
+      TRG_MISSING_TMG_TRG_OUT      : out std_logic;
+      TRG_SPIKE_DETECTED_OUT       : out std_logic;
       --Data Port
       IPU_NUMBER_OUT               : out std_logic_vector (15 downto 0);
       IPU_READOUT_TYPE_OUT         : out std_logic_vector (3 downto 0);
@@ -550,6 +555,13 @@ end component trb_net16_med_scm_sfp_gbe;
       FEE_DATA_FINISHED_IN         : in  std_logic_vector(DATA_INTERFACE_NUMBER-1 downto 0);
       FEE_DATA_ALMOST_FULL_OUT     : out std_logic_vector(DATA_INTERFACE_NUMBER-1 downto 0);
 
+      --Information about trigger handler errors
+      TRG_MULTIPLE_TRG_OUT         : out std_logic;
+      TRG_TIMEOUT_DETECTED_OUT     : out std_logic;
+      TRG_SPURIOUS_TRG_OUT         : out std_logic;
+      TRG_MISSING_TMG_TRG_OUT      : out std_logic;
+      TRG_SPIKE_DETECTED_OUT       : out std_logic;
+
       --Slow Control Port
       --common registers
       REGIO_COMMON_STAT_REG_IN     : in  std_logic_vector(std_COMSTATREG*32-1 downto 0) := (others => '0');
@@ -932,6 +944,7 @@ end component trb_net16_med_scm_sfp_gbe;
       IPU_HDR_DATA_READ_IN         : in  std_logic;
       IPU_HDR_DATA_EMPTY_OUT       : out std_logic;
 
+      TMG_TRG_ERROR_IN             : in  std_logic;
       --Status
       STAT_DATA_BUFFER_LEVEL       : out std_logic_vector(DATA_INTERFACE_NUMBER*32-1 downto 0);
       STAT_HEADER_BUFFER_LEVEL     : out std_logic_vector(31 downto 0);
@@ -1088,6 +1101,7 @@ end component trb_net16_med_scm_sfp_gbe;
       FEE_DATA_FINISHED_IN         : in  std_logic_vector(DATA_INTERFACE_NUMBER-1 downto 0);
       FEE_DATA_ALMOST_FULL_OUT     : out std_logic_vector(DATA_INTERFACE_NUMBER-1 downto 0);
 
+      TMG_TRG_ERROR_IN             : in  std_logic;
       --Status Registers
       STATUS_OUT                   : out std_logic_vector(127 downto 0);
       STAT_DATA_BUFFER_LEVEL       : out std_logic_vector(DATA_INTERFACE_NUMBER*32-1 downto 0);