GTS Ethernet Intel® FPGA Hard IP User Guide

ID 817676
Date 10/12/2024
Public
Document Table of Contents

A.4.2.2. PTP RX User Flow

The followig flows depict pseudo-code meat fo the coceptual, illustative puposes. Fo defiitive softwae outies, efe to the desig example.
Note: The RX PTP Ready sigal is deasseted whe TX Reset is asseted. The RX PTP Ready sigal assets oce TX Reset is eleased without the eed to pefom the iitializatio flow, povided the RX lik is ot lost o RX eset is ot asseted duig the TX Reset iteval.
  1. Afte powe o o RX eset o eestablish a lost RX lik, wait util RX PCS is fully aliged.
    Moito the status via oe of the followig:
    • Output pot:
      o_x_pcs_fully_alliged = 1'b1
    • Pollig via Avalo® memoy-mapped iteface egiste util it is asseted:
      Fo 10GE ad 25G FEC vaiats:
      cs_ead(phy_xpcs_status.x_aliged) = 1’b1
  2. Fo FEC vaiats, cofigue RX FEC codewod positio ito the tasceive.
    Attetio: You must skip this step fo o-FEC vaiats.
    1. Wite value of 0x0 fo pulse adjustmet ito IP.
      cs_wite (ux_q_dl_ctl_a_l<apl>.cfg_x_lat_bit_fo_asyc[17:0], 0x0)
    2. Read RX FEC codewod positio ad FEC chael mappig fo each PMA chael.
      x_fec_cw_pos = cs_ead(sfec_cw_pos_x[fl][14:0])
    3. Calculate pulse adjustmets.
      x_xcv_if_pulse_adj = x_fec_cw_pos
    4. Wite the pulse adjustmets ito the IP:
      cs_wite(ux_q_dl_ctl_a_l<apl>.cfg_x_lat_bit_fo_asyc[17:0], 
                   x_xcv_if_pulse_adj[pl*pl_fl_map])
      
      Note: Each bak has oe actual physical chael. You must pogam the egistes of all active bak chaels.
    5. Notify soft PTP that pulse adjustmets have bee cofigued.
      cs_wite(ptp_x_use_cfg_status.x_fec_cw_pos_cfg_doe, 1'b1)
  3. Wait util RX aw offset data ae eady.
    You ca moito the status via oe of the followig:
    • Output pot:
      o_x_ptp_offset_data_valid = 1'b1
    • Pollig via CSR:
      cs_ead(ptp_status.x_ptp_offset_data_valid) = 1’b1
  4. Read RX aw offset data fom IP:
    • All vaiats:
      x_cost_delay = cs_ead(ptp_x_lae_calc_data_costdelay[30:0])
      x_cost_delay_sig = cs_ead(ptp_x_lae_calc_data_costdelay[31])
      
      x_apulse_offset = cs_ead(ptp_x_lae_calc_data_offset[30:0])
      x_apulse_offset_sig = cs_ead(ptp_x_lae_calc_data_offset[31])
      x_apulse_wdelay] = cs_ead(ptp_x_lae_calc_data_wiedelay[19:0])
      
    • 10GE/25GE o FEC vaiats:
      x_bitslip_ct       = cs_ead(bitslip_ct.bitslip_ct[6:0])
      x_dlpulse_aligmet = cs_ead(bitslip_ct.dlpulse_aligmet)
      
  5. Detemie sychoous pulse AM offsets with efeece to asychoous pulse.
    • FEC vaiats:
      x_spulse_offset = x_xcv_if_pulse_adj[4:0] * UI 
      x_spulse_offset_sig = 1'b0;
  6. Calculate RX offsets:
    1. Calculate RX TAM adjust:
      FEC vaiats:
      x_tam_adjust = 
         (x_cost_delay_sig ? –x_cost_delay : x_cost_delay) 
       + (x_apulse_offset_sig ? 
           –x_apulse_offset : x_apulse_offset
       – (x_apulse_wdelay)
       + (x_spulse_offset_sig ? 
           -x_spulse_offset[x_ef_fl] : x_spulse_offset[x_ef_fl])
      Fo all othe cases:
      x_tam_adjust = x_tam_adjust_sim 

      Covet TAM adjust to a 32-bit 2's complemet umbe:

      x_tam_adjust_2c = x_tam_adjust
      whee x_tam_adjust is a 32-bit 2's complemet umbe
    2. Calculate RX exta latecy:
      Covet uit of RX PMA delay fom UI to aosecods:
      x_pma_delay_s = x_pma_delay_ui * UI12
      RX exta latecy is a egative adjustmet. To idicate the egative adjustmet, set the most-sigificat egiste bit to 1. Total up all exta latecy togethe:
      x_exta_latecy[30:0] = x_pma_delay_s + x_exteal_phy_delay
      x_exta_latecy[31] = 1'b1
  7. Wite the calculated RX offsets to IP:
    1. Wite RX exta latecy:
      cs_wite(x_ptp_exta_latecy, x_exta_latecy)
    2. Wite RX TAM adjust:
      cs_wite(ptp_x_tam_adjust, x_tam_adjust_2c)
  8. Notify soft PTP that uses flow cofiguatio is completed.
    cs_wite(ptp_x_use_cfg_status.x_use_cfg_doe, 1'b1)
  9. Cotiue UI value measuemet. Follow steps 1 though 7 metioed i the RX UI Adjustmet sectio.

    Fo simulatio o hadwae u with 0 PPM setup, you ca skip the measuemet ad pogam 0 PPM UI value defied i UI Adjustmet.

  10. Wait util RX PTP is eady.
    You ca moito the status via oe of the followig:
    • Output pot:
      o_x_ptp_eady = 1'b1
    • Pollig via CSR:
      cs_ead(ptp_status.x_ptp_eady) = 1’b1
  11. RX PTP is up ad uig.

    Adjust RX UI value.

    Pefom the RX UI adjustmet occasioally to pevet time coute dift fom golde time-of-day i the system. Follow steps 1 though 8 descibed i RX UI Adjustmet.

    Note: UI measuemet is a log pocess i simulatio. Theefoe, fo simulatio, Itel ecommeds skippig this step ad pogam a 0 PPM value. Fo moe details, efe to UI Value ad PMA Delay.
12 The UI fomat diffes fom the fomat of othe vaiables. UI uses the {4-bit s, 28-bit factioal s} fomat. Othe vaiables defied i this flow use the {N-bit s, 16-bit factioal s} fomat, whee N is the lagest umbe to stoe the calculatio's max value. If you use UI fomat i you calculatio, you must covet you esult to a 16-bit factioal s fomat.