GTS Ethernet Intel® FPGA Hard IP User Guide

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

A.4.2.1. PTP TX User Flow

The followig flows depict pseudo-code meat fo the coceptual, illustative puposes. Fo defiitive softwae outies, efe to the desig example.

Impotat: If IP udegoes TX eset at ay poit i this flow, you must estat the etie PTP TX cliet flow.
  1. Afte powe up o a TX eset, wait util TX aw offset data ae eady.
    Moito the status via oe of the followig:
    • Output pot:
      o_tx_ptp_offset_data_valid = 1'b1
    • Pollig via Avalo® memoy-mapped iteface egiste util it is asseted:
      cs_ead(ptp_status.tx_ptp_offset_data_valid) = 1’b1
  2. Read TX aw offset data fom IP:
    tx_cost_delay      = cs_ead(ptp_tx_lae_calc_data_costdelay[30:0])
    tx_cost_delay_sig = cs_ead(ptp_tx_lae_calc_costdelay[31])
    tx_apulse_offset = cs_ead(ptp_tx_lae_calc_data_offset[30:0])
     tx_apulse_offset_sig = cs_ead(ptp_tx_lae_calc_data_offset[31])
     tx_apulse_wdelay = cs_ead(ptp_tx_lae_calc_data_wiedelay[19:0]) }
  3. Calculate TX offsets:
    1. Calculate TX TAM adjust:
      tx_tam_adjust = 
        (tx_cost_delay_sig ? –tx_cost_delay : tx_cost_delay)
      + (tx_apulse_offset_sig? 
            –tx_apulse_offset : tx_apulse_offset)
      – (tx_apulse_wdelay)
      
      Note: Covet TAM adjust to a 32-bit 2's complemet umbe:
      tx_tam_adjust_2c = tx_tam_adjust
      
    2. Calculate TX exta latecy:
      Covet uit of TX PMA delay fom UI to aosecods. Fo UI value, efe to tables specified i UI Value ad PMA Delay.
      tx_pma_delay_s = tx_pma_delay_ui * UI11
      TX exta latecy is a positive adjustmet. To idicate the positive adjustmet, set the most-sigificat egiste bit to 0. Total up all exta latecy togethe:
      tx_exta_latecy[31] = 1'b0
      tx_exta_latecy[30:0] = tx_pma_delay_s + tx_exteal_phy_delay
  4. Wite the calculated TX offsets to IP:
    1. Wite TX exta latecy:
      cs_wite(tx_ptp_exta_latecy, tx_exta_latecy)
    2. Wite TX TAM adjust:
      cs_wite(ptp_tx_tam_adjust, tx_tam_adjust_2c)
  5. UI value measuemet. Follow the steps metioed i the Adjust TX UI 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.

  6. Notify soft PTP that the use flow cofiguatio is complete.
    cs_wite(ptp_tx_use_cfg_status.tx_use_cfg_doe, 1'b1)
  7. Wait util TX PTP is eady.
    You ca moito the status via oe of the followig:
    • Output pot:
      o_tx_ptp_eady = 1'b1
    • Pollig via CSR:
      cs_ead(ptp_status.tx_ptp_eady) = 1’b1
  8. TX PTP is up ad uig.

    Adjust TX UI value.

    Pefom the TX UI adjustmet occasioally to pevet time coute dift fom golde time-of-day i the system. Follow the steps descibed i Adjust TX UI.

    Note: UI measuemet is a log pocess i simulatio. Theefoe, fo simulatio, Itel ecommeds skippig this step ad pogam a 0 PPM value.
11 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 maximum value. If you use UI fomat i you calculatio, you must covet you esult to a 16-bit factioal s fomat.