Hard Processor System Technical Reference Manual: Agilex™ 5 SoCs

ID 814346
Date 7/19/2024
Public
Document Table of Contents

5.1.7.16.2. Coarse Correction Method

To synchronize or update the system time in one process (coarse correction method), complete the following steps:

  1. Set the offset (positive or negative) in the timestamp update registers (MAC_System_Time_Seconds_Update and MAC_System_Time_Nanoseconds_Update).
  2. Set bit3 (TSUPDT) of the MAC_Timestamp_Control register. The value in the timestamp update registers is added to or subtracted from the system time when the TSUPDT bit is cleared. To synchronize or update the system time to reduce system-time jitter (fine correction method), complete the following steps:
    1. Refer to algorithm explained in System Time Register Module, and calculate the rate at which you want to make the system time increment slower or faster.
    2. Update the MAC_Timestamp_Addend register with the new value and set bit 5 of the MAC_Timestamp_Control register.
    3. Wait for the time for which you want the new value of the MAC_Timestamp_Addend register to be active. You can do this by enabling the timestamp trigger interrupt after the system time reaches the target value.
    4. Program the required target time in MAC_PPS(#i)_Target_Time_Seconds register and MAC_PPS(#i)_Target_Time_Nanoseconds register.
    5. Enable the timestamp interrupt, which is bit 12 of MAC_Interrupt_Enable register.
    6. Set bit 4 of the MAC_Timestamp_Control register.
    7. When this trigger causes an interrupt, read the MAC_Interrupt_Status register.
    8. Reprogram the MAC_Timestamp_Addend register with the old value and set bit 5 again.