From d4fba5fca7040cfa8f241fcc237522f1c2876af6 Mon Sep 17 00:00:00 2001 From: Michael Boehmer Date: Mon, 24 Jan 2022 08:28:27 +0100 Subject: [PATCH] first SerDes based delay measurement test --- media_interfaces/med_ecp3_sfp_sync_all_RS.vhd | 24 +++++++++++++++++++ media_interfaces/sync/med_sync_control_RS.vhd | 8 +++++-- 2 files changed, 30 insertions(+), 2 deletions(-) diff --git a/media_interfaces/med_ecp3_sfp_sync_all_RS.vhd b/media_interfaces/med_ecp3_sfp_sync_all_RS.vhd index cab72fb..784fedd 100644 --- a/media_interfaces/med_ecp3_sfp_sync_all_RS.vhd +++ b/media_interfaces/med_ecp3_sfp_sync_all_RS.vhd @@ -47,6 +47,8 @@ entity med_ecp3_sfp_sync_all_RS is SYNC_TX_PLL_IN : in std_logic; -- bit0 alignment for TX serializer LINK_TX_READY_IN : in std_logic; -- from TX reset generator DESTROY_LINK_IN : in std_logic_vector(3 downto 0); -- hard reset for links + WAP_REQUESTED_IN : in std_logic_vector(3 downto 0); -- TESTTESTTEST + RX_INDEX_OUT : out std_logic_vector(3 downto 0); -- TESTTESTTEST --SFP Connection SD_PRSNT_N_IN : in std_logic_vector(3 downto 0); -- SFP Present ('0' = SFP in place, '1' = no SFP mounted) SD_LOS_IN : in std_logic_vector(3 downto 0); -- SFP Loss Of Signal ('0' = OK, '1' = no signal) @@ -135,6 +137,10 @@ architecture med_ecp3_sfp_sync_all_RS_arch of med_ecp3_sfp_sync_all_RS is signal link_active_i : std_logic_vector(3 downto 0); + signal wap_requested_i : std_logic_vector(15 downto 0); + + signal rx_index_i : std_logic_vector(3 downto 0); + signal quad_mode : integer range 0 to 100; begin @@ -240,6 +246,9 @@ begin WORD_SYNC_OUT <= word_sync_sel; + -- if a SP is in the quad, we use the received WORD_SYNC. + -- in a MP only configuration, the TX WORD_SYNC is used as reference. + ------------------------------------------------- -- reset komma receive -- output only if a slave port is available in QUAD @@ -264,6 +273,18 @@ begin tx_rst_i(2) <= TX_RST_IN when (IS_MODE(2) = c_IS_MASTER) else '0'; tx_rst_i(3) <= TX_RST_IN when (IS_MODE(3) = c_IS_MASTER) else '0'; +------------------------------------------------- +-- WAP request (for testing) +------------------------------------------------- + wap_requested_i(0*4+3 downto 0*4) <= WAP_REQUESTED_IN when (IS_MODE(0) = c_IS_MASTER) else x"0"; + wap_requested_i(1*4+3 downto 1*4) <= WAP_REQUESTED_IN when (IS_MODE(1) = c_IS_MASTER) else x"0"; + wap_requested_i(2*4+3 downto 2*4) <= WAP_REQUESTED_IN when (IS_MODE(2) = c_IS_MASTER) else x"0"; + wap_requested_i(3*4+3 downto 3*4) <= WAP_REQUESTED_IN when (IS_MODE(3) = c_IS_MASTER) else x"0"; + +------------------------------------------------- +------------------------------------------------- + RX_INDEX_OUT <= rx_index_i; + ------------------------------------------------- -- Serdes ------------------------------------------------- @@ -443,6 +464,7 @@ gen_control : for i in 0 to 3 generate RX_LSM_IN => lsm_status(i), TX_PLL_LOL_IN => TX_PLL_LOL_IN, WA_POSITION_IN => wa_position_i(i*4+3 downto i*4), + WAP_REQUESTED_IN => wap_requested_i(i*4+3 downto i*4), -- control signals to SerDes RX_SERDES_RST => rx_serdes_rst(i), RX_PCS_RST => rx_pcs_rst(i), @@ -458,6 +480,7 @@ gen_control : for i in 0 to 3 generate LINK_TX_READY_IN => LINK_TX_READY_IN, LINK_RX_READY_OUT => link_rx_ready_i(i), LINK_ACTIVE_OUT => link_active_i(i), + RX_INDEX_OUT => rx_index_i(i), -- komma operation TX_DLM_IN => TX_DLM_IN, TX_DLM_WORD_IN => TX_DLM_WORD_IN, @@ -484,6 +507,7 @@ gen_control : for i in 0 to 3 generate powerup_ch(i) <= '0'; -- keep in power down rx_serdes_rst(i) <= '1'; -- keep in reset rx_pcs_rst(i) <= '1'; -- keep in reset + rx_index_i(i) <= '0'; MEDIA_MED2INT(i).dataready <= '0'; MEDIA_MED2INT(i).tx_read <= '1'; MEDIA_MED2INT(i).stat_op <= x"0007"; diff --git a/media_interfaces/sync/med_sync_control_RS.vhd b/media_interfaces/sync/med_sync_control_RS.vhd index e77929a..86f6b66 100644 --- a/media_interfaces/sync/med_sync_control_RS.vhd +++ b/media_interfaces/sync/med_sync_control_RS.vhd @@ -31,6 +31,7 @@ entity med_sync_control_RS is RX_LSM_IN : in std_logic; -- SerDes TX LinkStateMachine status TX_PLL_LOL_IN : in std_logic; -- wired'or from all QUADs WA_POSITION_IN : in std_logic_vector(3 downto 0); -- WordAlignment Position + WAP_REQUESTED_IN : in std_logic_vector(3 downto 0); -- TESTTESTTEST -- control signals to SerDes RX_SERDES_RST : out std_logic; -- reset RX (SerDes + CDR) RX_PCS_RST : out std_logic; -- reset RX (PCS) @@ -41,11 +42,12 @@ entity med_sync_control_RS is RX_K_IN : in std_logic; -- komma designator from RX SerDes -- ports for synchronous operation WORD_SYNC_IN : in std_logic; -- sync signal for Byte/Word Alignment - WORD_SYNC_OUT : out std_logic; + WORD_SYNC_OUT : out std_logic; GLOBAL_RESET_OUT : out std_logic; -- global reset from slave port LINK_TX_READY_IN : in std_logic; -- LINK_RX_READY_OUT : out std_logic; -- LINK_ACTIVE_OUT : out std_logic; -- + RX_INDEX_OUT : out std_logic; -- -- komma handling TX_DLM_IN : in std_logic; -- transmit one DLM komma TX_DLM_WORD_IN : in std_logic_vector(7 downto 0); @@ -156,7 +158,7 @@ begin D_OUT(1) => RX_SERDES_RST ); - is_wap_zero_i <= '1' when (WA_POSITION_IN = x"0") else '0'; + is_wap_zero_i <= '1' when (WA_POSITION_IN = WAP_REQUESTED_IN) else '0'; LINK_RX_READY_OUT <= link_rx_ready_i; @@ -194,6 +196,8 @@ begin DEBUG_RX_CONTROL <= debug_rx_control_i; + RX_INDEX_OUT <= word_sync_rx_i; + -- clocks for media interface media_med2int_i.clk_half <= CLK_RXHALF; -- goes to clock and reset handler media_med2int_i.clk_full <= CLK_RXI; -- goes to clock and reset handler -- 2.43.0