Visible to Intel only — GUID: lpp1702341209398
Ixiasoft
Visible to Intel only — GUID: lpp1702341209398
Ixiasoft
5.4.2.1. PTP TX User Flow
In this section, the acronyms PL and VL stand for Physical Lane and Virtual Lane respectively.
The following flows depict pseudo-code meant for the conceptual, illustrative purposes. For definitive software routines, refer to the design example.
- After power up or a TX reset, wait until TX raw offset data are ready.
You can monitor the status via one of the following:
- Output port:
o_tx_ptp_offset_data_valid = 1'b1
- Polling via Avalon® memory-mapped interface register until it is asserted:
csr_read(ptp_status.tx_ptp_offset_data_valid) = 1’b1
- Output port:
- Read TX raw offset data from IP:
tx_const_delay = csr_read(ptp_tx_lane_calc_data_constdelay[30:0]) tx_const_delay_sign = csr_read(ptp_tx_lane_calc_constdelay[31]) tx_apulse_offset = csr_read(ptp_tx_lane_calc_data_offset[30:0]) tx_apulse_offset_sign = csr_read(ptp_tx_lane_calc_data_offset[31]) tx_apulse_wdelay = csr_read(ptp_tx_lane_calc_data_wiredelay[19:0]) }
- Calculate TX offsets:
- Calculate TX TAM adjust:
tx_tam_adjust = (tx_const_delay_sign ? –tx_const_delay : tx_const_delay) + (tx_apulse_offset_sign? –tx_apulse_offset : tx_apulse_offset) – (tx_apulse_wdelay)
Note: Convert TAM adjust to a 32-bit 2's complement number:tx_tam_adjust_2c = tx_tam_adjust
- Calculate TX extra latency:
Convert unit of TX PMA delay from UI to nanoseconds. For UI value, refer to tables specified in UI Value and PMA Delay.
tx_pma_delay_ns = tx_pma_delay_ui * UI4
TX extra latency is a positive adjustment. To indicate the positive adjustment, set the most-significant register bit to 0. Total up all extra latency together:tx_extra_latency[31] = 1'b0 tx_extra_latency[30:0] = tx_pma_delay_ns + tx_external_phy_delay
- Calculate TX TAM adjust:
- Write the calculated TX offsets to IP:
- Write TX extra latency:
csr_write(tx_ptp_extra_latency, tx_extra_latency)
- Write TX TAM adjust:
csr_write(ptp_tx_tam_adjust, tx_tam_adjust_2c)
- Write TX extra latency:
- UI value measurement. Follow the steps mentioned in the TX UI Adjustment section.
For simulation or hardware run with 0 ppm setup, you can skip the measurement and program 0 ppm UI value defined in UI Adjustment.
- Notify soft PTP that user flow configuration is complete.
csr_write(ptp_tx_user_cfg_status.tx_user_cfg_done, 1'b1)
- Wait until TX PTP is ready.
You can monitor the status via one of the following:
- Output port:
o_tx_ptp_ready = 1'b1
- Polling via CSR:
csr_read(ptp_status.tx_ptp_ready) = 1’b1
- Output port:
- TX PTP is up and running.
- Adjust TX UI value.
Perform the TX UI adjustment occasionally to prevent time counter drift from golden time-of-day in the system. Follow the steps described in TX UI Adjustment .
Note: UI measurement is a long process in simulation. Therefore, for simulation, Intel recommends skipping this step and program a 0 ppm value.
- Adjust TX UI value.