From 21a9d85bc69e9e8da78516f3c498748500a59ec1 Mon Sep 17 00:00:00 2001 From: Michael Boehmer Date: Tue, 16 Aug 2022 11:45:09 +0200 Subject: [PATCH] DLM on copper --- gbe/tomcat_gbe_d0ch0_d1ch1.vhd | 68 +++++++++++++++++----------------- gbe/tomcat_gbe_d1ch1_d0ch0.vhd | 8 ++-- 2 files changed, 38 insertions(+), 38 deletions(-) diff --git a/gbe/tomcat_gbe_d0ch0_d1ch1.vhd b/gbe/tomcat_gbe_d0ch0_d1ch1.vhd index 823e616..a41409f 100644 --- a/gbe/tomcat_gbe_d0ch0_d1ch1.vhd +++ b/gbe/tomcat_gbe_d0ch0_d1ch1.vhd @@ -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'; diff --git a/gbe/tomcat_gbe_d1ch1_d0ch0.vhd b/gbe/tomcat_gbe_d1ch1_d0ch0.vhd index 360dd7c..212dbd5 100644 --- a/gbe/tomcat_gbe_d1ch1_d0ch0.vhd +++ b/gbe/tomcat_gbe_d1ch1_d0ch0.vhd @@ -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'; -- 2.43.0