TIME SYNCHRONIZATION

PTM (Precision Time Measurement)

Time synchronization across PCIe hierarchy with nanosecond accuracy

1. What is PTM?

What is Precision Time Measurement?

PTM (Precision Time Measurement) is a PCIe capability that enables precise time synchronization between the Root Complex and endpoints. It allows devices to coordinate time-stamped operations with nanosecond-level accuracy.

PTM Goals

2. Why PTM?

Why is PTM needed?

Many applications require precise time coordination between components. PTM provides hardware-level time synchronization without software overhead or network protocols.

Use Cases

Accuracy Targets

Application Required Accuracy
Professional Audio < 1 μs
Industrial Automation < 100 ns
Telecom (5G) < 50 ns
Financial Trading < 10 ns

3. PTM Architecture

PTM Hierarchy

    ┌───────────────────────────────────────────────────────────────┐
    │                     PTM Root (Master Clock)                   │
    │                      Root Complex/Port                        │
    │                    t1_master = Master Time                    │
    └─────────────────────────────┬─────────────────────────────────┘
                                  │
                    ┌─────────────┴─────────────┐
                    │                           │
            ┌───────▼───────┐           ┌───────▼───────┐
            │  PTM Switch   │           │  PTM Switch   │
            │  (Responder)  │           │  (Responder)  │
            │ Adds delay    │           │ Adds delay    │
            └───────┬───────┘           └───────┬───────┘
                    │                           │
            ┌───────▼───────┐           ┌───────▼───────┐
            │  PTM Endpoint │           │  PTM Endpoint │
            │  (Requester)  │           │  (Requester)  │
            │ Uses time     │           │ Uses time     │
            └───────────────┘           └───────────────┘

PTM Roles

Role Function Component
PTM Root Master time source Root Port
PTM Time Source Provides time to downstream Root Port, Switch DSP
PTM Responder Responds to PTM requests Switch USP/DSP
PTM Requester Requests time, uses context Endpoint

4. PTM Protocol

PTM Request/Response Exchange

    Requester                                         Responder
    (Endpoint)                                       (Upstream)
        │                                                │
        │ t1_req: Record local time                      │
        │                                                │
        │ ──────── PTM Request Message ─────────────────►│
        │                                                │
        │                              t2_resp: Receive  │
        │                              t3_resp: Respond  │
        │                                                │
        │ ◄─────── PTM Response Message ─────────────────│
        │          (contains t2_resp, t3_resp)           │
        │                                                │
        │ t4_req: Record local time                      │
        │                                                │
        │ Calculate:                                     │
        │   Link Delay = ((t4-t1) - (t3-t2)) / 2        │
        │   Master Time = t3 + Link Delay               │
        │                                                │

Time Calculation Equations

PTM Time Calculation

Round Trip Time (RTT): RTT = (t4_local - t1_local) Responder Processing Time: Processing = (t3_master - t2_master) Link Delay (symmetric assumption): Link_Delay = (RTT - Processing) / 2 Current Master Time: Master_Time = t3_master + Link_Delay Propagation Delay (cumulative): Total_Delay = Sum of all link delays in path

5. PTM Messages

PTM Request Message

PTM Response Message

PTM Context

Field Size Description
PTM Master Time 64 bits Master time in nanoseconds
PTM Context Valid 1 bit Context is valid
PTM Granularity 8 bits Clock granularity

6. PTM Extended Capability

Offset Register Description
00h Extended Capability Header ID = 001Fh
04h PTM Capability Requester/Responder/Root capable
08h PTM Control Enable, Root Select, Granularity

PTM Capability Fields

7. System Configuration

PTM Enable Sequence

  1. Identify PTM Root (typically Root Port)
  2. Enable PTM Root capability
  3. Enable PTM Responder on all intermediate switches
  4. Enable PTM Requester on endpoints
  5. Endpoints initiate PTM Request/Response exchanges
  6. Endpoints maintain time context via periodic updates

Granularity Configuration

PTM Granularity indicates the resolution of the PTM clock:

8. Application Examples

Audio Device Synchronization

    PTM Root (RC)
         │
    ┌────┴────┐
    │ Switch  │
    └────┬────┘
    ┌────┴────┬────────────┐
    │         │            │
   DAC 1    DAC 2       ADC
    │         │            │
    ▼         ▼            ▼
  Speaker  Speaker    Microphone
  
  All devices synchronized to < 1μs
  Enables sample-accurate playback/capture

NVMe with Timestamps