E-tile Hard IP User Guide: E-Tile Hard IP for Ethernet and E-Tile CPRI PHY Intel® FPGA IPs

ID 683468
Date 8/30/2022
Public

A newer version of this document is available. Customers should click here to go to the newest version.

Document Table of Contents

2.9.2.7. 10G/25G TX and RX Unit Interval Adjustment

The accuracy drift occurs when there is a PPM difference between the MAC layer clock and the Master TOD clock. To correct the drift, you may use the RX and TX Unit Interval (UI) adjustment method. IEEE 802.3 standards permit the Ethernet clocks frequency to vary within ±100 PPM.

For the system with PPM, you are required to do at least one UI adjustment once out of reset. Any timestamp before the UI adjustment is invalid. The UI adjustment shall be performed after the rx/tx_ptp_ready is asserted and before starting any PTP operation. The UI adjustment applies to the system independent of PPM provided that the PPM is within the Ethernet specification. Once UI adjustment is completed, it takes two Alignment marker periods for UI to adjust and produce an accurate timestamp.

The UI adjustment is a software flow, implemented by user software, utilizing 10G/25G PTP PPM UI Adjustment registers in the 1588 PTP Registers section to compute the new UI. Once determined, the UI register updates the UI value.

10G/25G UI Adjustment Calculation

The UI Adjustment Calculation applies to both, TX and RX paths. The software must take at least two snapshots of the 10G/25G PTP PPM UI Adjustment registers within 1s time frame. The new UI value is computed from the difference between the two snapshots. The longer the interval between the first and the next snapshot, the better accuracy the new UI value provides. 8 The accuracy can also be improved by taking multiple snapshots within 1s time frame. If two compared snapshots are taken outside of the 1s time frame, they shall be discarded.
Note: The UI adjustment shall not be performed when TOD changes are in progress or during reset.
User software performs the following steps to calculate the new UI value.
  1. Set TAM_SNAPSHOT to 1 to take the first snapshot of the Time of Alignment Marker (TAM) and the Alignment Marker Count (AM_Count) values. Your software snapshots the TAM and AM_Count values into the TX/RX_TAM_H/L and TX/RX_COUNT registers located in the 1588 PTP Registers.
  2. Read TX/RX_TAM_H/L and TX/RX_COUNT registers and save values from the first snapshot as:
    • TX_TAM_0 = {TX_TAM_H, TX_TAM_L}
    • TX_Count_0 = TX_COUNT
    • RX_TAM_0 = {RX_TAM_H, RX_TAM_L}
    • RX_Count_0 = RX_COUNT
  3. Clear TAM_SNAPSHOT to 0 to complete the first snapshot.
  4. Set TAM_SNAPSHOT to 1 again to take the Nth snapshot of the TAM and AM_Count values where N represents the number of taken snapshots.
  5. Read TX/RX_TAM_H/L and TX/RX_COUNT registers and save values from the Nth snapshot:
    • TX_TAM_N = {TX_TAM_H, TX_TAM_L}
    • TX_Count_N = TX_COUNT
    • RX_TAM_N = {RX_TAM_H, RX_TAM_L}
    • RX_Count_N = RX_COUNT
  6. Ensure the interval between the 1th snapshot and the Nth snapshot is within 1s else the snapshots are invalid for use and your software needs to restart from step 1.
  7. Calculate the new UI value:

    UI = TAM_Interval / (AM_Count * Reference_Time_Load_Interval).

    Refer steps below to calculate TAM_Interval, AM_Count, and est_AM_Count.

    Note: For more information about Reference Time Load Interval, refer to the Reference Time Load Interval.
  8. Compute the TAM_Interval value. TAM is a time value in nanosecond (ns). Once the TAM value reaches 1 billion ns, it rolls over to 1s creating a rollover condition. When TAM value rolls over, the subsequent TAM_N value appears smaller than the first TAM_0 value.
    • If (TAM_N > TAM_0): TAM_Interval (ns) = (TAM_N - TAM-_0)
    • If (TAM_N ≤ TAM_0): TAM_Interval (ns) = ((1s + TAM_N) - TAM_0)
    To calculate the TX_TAM_Interval, replace TAM_N with TX_TAM_N value and TAM_0 with TX_TAM_0 value. Same steps apply to calculate the RX_TAM_Interval.
  9. Calculate the estimated AM Count (est_AM_Count). The est_AM_Count value is used to ensure that AM_Count, calculated in next step, is valid.

    est_AM_Count = INT (TAM_Interval / (Reference_Time_Load_Interval * 0ppm_UI)

    where INT() is a round up function to the nearest integer, the value of 0ppm_UI for 10GE variant is 96.969696 ps and the value of 0ppm_UI for 25GE variant is 38.787878 ps. Compare the est_AM_Count with 64,000, which is the maximum AM_Count with offset. If est_AM_count exceeds 64,000, discard the snapshot and start from step 1.

  10. Calculate the AM_Count value. AM_Count can reach a rollover condition when reaching maximum value. Use the appropriate equation to calculate the AM_Count.
    • If (Count_N > Count_0): AM_Count = (Count_N – Count_0)
    • If (Count_N ≤ Count_0): AM_Count = ((65,535 – Count_0) + Count_N)
  11. Write the calculated TX and RX UI values to TX_UI_REG and RX_UI_REG registers.
Table 23.  Reference Time Load IntervalThis table shows the Reference time load interval values for PPM UI adjustment calculation.
Configuration Data Path Reference_Time_Load_Interval value in bits
25G variant with RS-FEC TX 81,920*66=5,406,720
Note: 81,920 is a 66-bit value of alignment marker interval (in terms of block numbers)
RX 81,920*66=5,406,720
10GE/25GE variants without RS-FEC TX 81,920*66=5,406,720
RX 6,336
100G with and without RS-FEC TX 16384*20*66=21,626,880
Note: 16384 is a 66-bit value of alignment marker interval (in terms of block numbers) per virtual lane.
RX
8 Comparing the first snapshot with a third snapshot taken at a later time gives a more accurate UI than comparing the first snapshot with the second snapshot taken at an earlier time.