In 1-step insertion mode, egress PTP packets are modified in flight with a calculated timestamp. The PTP Timestamper logic takes in packet data from the TX interface, locates the embedded PTP packet, inserts the timestamp, (optionally) recalculates the UDP checksum, and recalculates the Ethernet FCS field.
ctl_tx_ptp_1step_enable
= 0 field of the CONFIGURATION_1588_REG is set to 0, the
timestamp insertion block is bypassed to minimize the latency through the TX MAC. Insertion
is not supported for preempted packets (used in TSN).- Ordinary/Boundary Clock Mode
- The time-of-day timestamp is inserted into a combination of the Timestamp and the Correction field of the PTP packet.
- Transparent Clock
- The Correction field contains a residence time which is calculated by subtracting the ingress timestamp and adding the egress timestamp (the difference is the residence time).
The MRMAC performs packet-level
timestamp insertion using a read-modify-write method. When an outbound packet passes through
the TX PTP Insert logic, the existing value in the Correction Field is located using the
offset provided to the command port tx_ptp_cf_offset
field.
The current timestamp, TS’egress, (provided by the PTP Timer
logic) is added to the value discovered in the PTP Correction field. The PTP packet
Timestamp field is left untouched.
The following table depicts the handling of the two PTP timestamp fields for each available timestamping mode. The Timestamp Field and Incoming Correction Field columns contain the values that should be seeded into outbound PTP frames by the user logic. The Outgoing Correction Field column is what is placed into the outbound Correction Field by the MRMAC logic.
Mode | Timestamp Field | Incoming Correction Field | Outgoing Correction Field |
---|---|---|---|
Transparent | TSorig | CFingress - TS'ingress | CFingress - TS'ingress + TS'egress |
Ordinary/Boundary | TScurr | -TS'curr | - TS'curr + TS'egress |
From this table, it is apparent that the MRMAC logic does not need to be aware of the selected timestamp mode, as it behaves the same way regardless of the selected mode. The user logic is responsible for setting appropriate initial timestamp values in both the Timestamp and Correction fields of outbound PTP packets.