]> jspc29.x-matter.uni-frankfurt.de Git - trbnet.git/commitdiff
*** empty log message ***
authorhadeshyp <hadeshyp>
Fri, 23 Jul 2010 19:59:11 +0000 (19:59 +0000)
committerhadeshyp <hadeshyp>
Fri, 23 Jul 2010 19:59:11 +0000 (19:59 +0000)
media_interfaces/trb_net16_med_ecp_fot.vhd
trb_net16_endpoint_hades_full.vhd

index 20497479e5645e1b52719aa85b0a343c15fa3ef3..78c88a9a347a4c525d428b4a01198d9291e8293f 100644 (file)
@@ -644,7 +644,7 @@ begin
     STAT_OP(9 downto 0)   <= FSM_STAT_OP(9 downto 0);
     STAT_OP(10) <= rx_led;
     STAT_OP(11) <= tx_led;
-    STAT_OP(12) <= FSM_STAT_OP(12);
+    STAT_OP(12) <= link_error(1) and not send_reset_words_q and tx_allow;
     STAT_OP(13) <= make_trbnet_reset_q;
     STAT_OP(14) <= FSM_STAT_OP(14);
     STAT_OP(15) <= send_reset_words_q;
index efe22f29fe839d06323e1a20ea8d7e5aad190c51..1191b08b4ebb965bed4c26eef60abecf0901425a 100644 (file)
@@ -271,6 +271,10 @@ architecture trb_net16_endpoint_hades_full_arch of trb_net16_endpoint_hades_full
   signal reg_timing_trigger : std_logic;
   signal trigger_timing_rising : std_logic;
   signal last_reg_timing_trigger : std_logic;
+  signal timing_trigger_missing_stat : std_logic;
+
+  signal link_error_i            : std_logic;
+
 
   component edge_to_pulse is
     port (
@@ -775,8 +779,9 @@ begin
   proc_gen_common_stat_regs : process(REGIO_COMMON_STAT_REG_IN, trigger_number_match, temperature, int_trigger_num)
     begin
       buf_COMMON_STAT_REG_IN               <= REGIO_COMMON_STAT_REG_IN;
---       buf_COMMON_STAT_REG_IN(4)            <= not trigger_number_match;
---       buf_COMMON_STAT_REG_IN(8)            <= timing_trigger_missing;
+      buf_COMMON_STAT_REG_IN(4)            <= not trigger_number_match;
+      buf_COMMON_STAT_REG_IN(8)            <= timing_trigger_missing_stat;
+      buf_COMMON_STAT_REG_IN(15)            <= link_error_i;
       if REGIO_USE_1WIRE_INTERFACE = c_YES then
         buf_COMMON_STAT_REG_IN(31 downto 20) <= temperature;
       end if;
@@ -784,6 +789,23 @@ begin
       buf_COMMON_STAT_REG_IN(127 downto 64) <= stat_lvl1_handler;
     end process;
 
+
+
+  REG_LINK_ERROR : process(CLK)
+    begin
+      if rising_edge(CLK) then
+        if buf_REGIO_COMMON_CTRL_REG_OUT(4) = '1' then
+          link_error_i <= '0';
+        elsif MED_STAT_OP_IN(15) = '0' and MED_STAT_OP_IN(13) = '0' and MED_STAT_OP_IN(7 downto 4) = "0111" then
+          link_error_i <= '1';
+        end if;
+
+        if LVL1_TRG_RECEIVED_OUT_falling = '1' then
+          timing_trigger_missing_stat <= timing_trigger_missing;
+        end if;
+      end if;
+    end process;
+
 -------------------------------------------------
 -- Check LVL1 trigger number
 -------------------------------------------------
@@ -881,7 +903,7 @@ begin
     begin
       if rising_edge(CLK) then
         last_reg_timing_trigger <= reg_timing_trigger;
-        trigger_timing_rising   <= reg_timing_trigger and not last_reg_timing_trigger;
+        trigger_timing_rising   <= reg_timing_trigger and not last_reg_timing_trigger and buf_REGIO_COMMON_CTRL_REG_OUT(95);
 
         last_LVL1_TRG_RECEIVED_OUT <= buf_LVL1_TRG_RECEIVED_OUT;
         LVL1_TRG_RECEIVED_OUT_rising <= buf_LVL1_TRG_RECEIVED_OUT and not last_LVL1_TRG_RECEIVED_OUT;
@@ -895,7 +917,7 @@ begin
           got_timing_trigger <= '1';
         elsif (LVL1_TRG_RECEIVED_OUT_rising = '1' and buf_LVL1_TRG_TYPE_OUT >= x"8" and buf_LVL1_TRG_INFORMATION_OUT(7) = '1') then
           got_timingless_trigger <= '1';
-        elsif (LVL1_TRG_RECEIVED_OUT_rising = '1' and not (buf_LVL1_TRG_TYPE_OUT >= x"8" and buf_LVL1_TRG_INFORMATION_OUT(7) = '1')) then
+        elsif (LVL1_TRG_RECEIVED_OUT_rising = '1' and not (buf_LVL1_TRG_TYPE_OUT >= x"8" and buf_LVL1_TRG_INFORMATION_OUT(7) = '1') and got_timing_trigger = '0') then
           timing_trigger_missing <= '1';
         end if;
       end if;
@@ -928,6 +950,8 @@ begin
 --       end if;
 --     end process;
 
+
+
 -------------------------------------------------
 -- Connect Outputs
 -------------------------------------------------