]> jspc29.x-matter.uni-frankfurt.de Git - TOMcat.git/commitdiff
DLM on copper
authorMichael Boehmer <mboehmer@ph.tum.de>
Tue, 16 Aug 2022 09:45:09 +0000 (11:45 +0200)
committerMichael Boehmer <mboehmer@ph.tum.de>
Tue, 16 Aug 2022 09:45:09 +0000 (11:45 +0200)
gbe/tomcat_gbe_d0ch0_d1ch1.vhd
gbe/tomcat_gbe_d1ch1_d0ch0.vhd

index 823e6166ab8d97bdc4ed43bdb1f7370bd5f58c2e..a41409ffde25df3c64c4cacdd3b5bf49037ba3f4 100644 (file)
@@ -244,44 +244,47 @@ begin
 ---------------------------------------------------------------------------
 -- LED blink generator
 ---------------------------------------------------------------------------
-THE_BLINK_COUNTER_PROC: process( clk_sys )
-begin
-  if( rising_edge(clk_sys) ) then
-    if( tick_ms_int = '1' ) then
-      blink_counter <= blink_counter + 1;
+  THE_BLINK_COUNTER_PROC: process( clk_sys )
+  begin
+    if( rising_edge(clk_sys) ) then
+      if( tick_ms_int = '1' ) then
+        blink_counter <= blink_counter + 1;
+      end if;
     end if;
-  end if;
-end process THE_BLINK_COUNTER_PROC;
+  end process THE_BLINK_COUNTER_PROC;
 
 ---------------------------------------------------------------------------
 -- DLM timing generator
 ---------------------------------------------------------------------------
-THE_DLM_SEND_PROC: process( clk_sys )
-begin
-  if( rising_edge(clk_sys) ) then
-    inc_dlm_tag <= rst_dlm_ctr;
-    rst_dlm_ctr <= rst_dlm_ctr_x;
-    if( (reset_i = '1') or (rst_dlm_ctr = '1') or (aux_reg(31) = '0') ) then
-      dlm_ctr <= (others => '0');
-    elsif( aux_reg(31) = '1' ) then
-      dlm_ctr <= dlm_ctr + 1;
+  THE_DLM_SEND_PROC: process( clk_sys )
+  begin
+    if( rising_edge(clk_sys) ) then
+      inc_dlm_tag <= rst_dlm_ctr;
+      rst_dlm_ctr <= rst_dlm_ctr_x;
+      if( (reset_i = '1') or (rst_dlm_ctr = '1') or (aux_reg(31) = '0') ) then
+        dlm_ctr <= (others => '0');
+      elsif( aux_reg(31) = '1' ) then
+        dlm_ctr <= dlm_ctr + 1;
+      end if;
     end if;
-  end if;
-end process THE_DLM_SEND_PROC;
+  end process THE_DLM_SEND_PROC;
 
-rst_dlm_ctr_x <= '1' when ((std_logic_vector(dlm_ctr) = aux_reg(23 downto 0)) and (aux_reg(31) = '1')) else '0';
+  rst_dlm_ctr_x <= '1' when ((std_logic_vector(dlm_ctr) = aux_reg(23 downto 0)) and (aux_reg(31) = '1')) else '0';
 
--- DLM "tag" for blinking LEDs :)
-THE_DLM_TAG_CTR_PROC: process( clk_sys )
-begin
-  if( rising_edge(clk_sys) ) then
-    if( (reset_i = '1') or (aux_reg(31) = '0') ) then
-      dlm_tag_ctr <= (others => '0');
-    elsif( inc_dlm_tag = '1' ) then
-      dlm_tag_ctr <= dlm_tag_ctr + 1;
+  -- DLM "tag" for blinking LEDs :)
+  THE_DLM_TAG_CTR_PROC: process( clk_sys )
+  begin
+    if( rising_edge(clk_sys) ) then
+      if( (reset_i = '1') or (aux_reg(31) = '0') ) then
+        dlm_tag_ctr <= (others => '0');
+      elsif( inc_dlm_tag = '1' ) then
+        dlm_tag_ctr <= dlm_tag_ctr + 1;
+      end if;
     end if;
-  end if;
-end process THE_DLM_TAG_CTR_PROC;
+  end process THE_DLM_TAG_CTR_PROC;
+
+  dlm_inject_int  <= rst_dlm_ctr;
+  dlm_tx_data_int <= std_logic_vector(dlm_tag_ctr);
 
 ---------------------------------------------------------------------------
 -- GbE interface (SFP)
@@ -383,9 +386,6 @@ end process THE_DLM_TAG_CTR_PROC;
     DEBUG_OUT             => debug(63 downto 0) --open
   );
 
-  dlm_inject_int  <= rst_dlm_ctr;
-  dlm_tx_data_int <= std_logic_vector(dlm_tag_ctr);
-  
 ---------------------------------------------------------------------------
 ---------------------------------------------------------------------------
   THE_SGL_CTRL: entity sgl_ctrl
@@ -676,7 +676,7 @@ end process THE_DLM_TAG_CTR_PROC;
 --  GPIO(13 downto 13)  <= debug(33 downto 33);
 --  GPIO                <= (others => 'Z');
   
-  TIMING_TEST         <= dlm_found_int; --'0';
+  TIMING_TEST         <= dlm_inject_int; --'0';
 
 -------------------------------------------------------------------------------
 -- LED
@@ -684,7 +684,7 @@ end process THE_DLM_TAG_CTR_PROC;
   LED_SFP_GREEN   <= not (status(0) and status(1) and status(2)); --'0';
   LED_SFP_YELLOW  <= not status(5); --'0';
   LED_SFP_RED     <= not status(6); --'0';
-  LED(3)          <= not std_logic(blink_counter(8)); --additional_reg(7); --'0';
+  LED(3)          <= not std_logic(blink_counter(7)); --additional_reg(7); --'0';
   LED(2)          <= not dlm_rx_data_int(7); --additional_reg(6); --'0';
   LED(1)          <= not dlm_rx_data_int(6); --additional_reg(5); --'0';
   LED(0)          <= not dlm_rx_data_int(5); --additional_reg(4); --'0';
index 360dd7c6784830da0f243e0cabcf8e43807e32ed..212dbd57d787c2557e3cbea2b41b7a03fc20ace5 100644 (file)
@@ -283,6 +283,9 @@ begin
     end if;
   end process THE_DLM_TAG_CTR_PROC;
 
+  dlm_inject_int  <= rst_dlm_ctr;
+  dlm_tx_data_int <= std_logic_vector(dlm_tag_ctr);
+
 ---------------------------------------------------------------------------
 -- GbE interface (SFP)
 ---------------------------------------------------------------------------
@@ -334,9 +337,6 @@ begin
     DEBUG_OUT             => debug(63 downto 0) --open
   );
 
-  dlm_inject_int  <= rst_dlm_ctr;
-  dlm_tx_data_int <= std_logic_vector(dlm_tag_ctr);
-
   debug(127 downto 64) <= (others => '0');
   
 ---------------------------------------------------------------------------
@@ -684,7 +684,7 @@ begin
   LED_SFP_GREEN   <= not (status(0) and status(1) and status(2)); --'0';
   LED_SFP_YELLOW  <= not status(5); --'0';
   LED_SFP_RED     <= not status(6); --'0';
-  LED(3)          <= not std_logic(blink_counter(8)); --additional_reg(7); --'0';
+  LED(3)          <= not std_logic(blink_counter(7)); --additional_reg(7); --'0';
   LED(2)          <= not dlm_rx_data_int(7); --additional_reg(6); --'0';
   LED(1)          <= not dlm_rx_data_int(6); --additional_reg(5); --'0';
   LED(0)          <= not dlm_rx_data_int(5); --additional_reg(4); --'0';