Time synchronization across PCIe hierarchy with nanosecond accuracy
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.
Many applications require precise time coordination between components. PTM provides hardware-level time synchronization without software overhead or network protocols.
| Application | Required Accuracy |
|---|---|
| Professional Audio | < 1 μs |
| Industrial Automation | < 100 ns |
| Telecom (5G) | < 50 ns |
| Financial Trading | < 10 ns |
┌───────────────────────────────────────────────────────────────┐
│ 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 │
└───────────────┘ └───────────────┘
| 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 |
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 │
│ │
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
| 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 |
| Offset | Register | Description |
|---|---|---|
| 00h | Extended Capability Header | ID = 001Fh |
| 04h | PTM Capability | Requester/Responder/Root capable |
| 08h | PTM Control | Enable, Root Select, Granularity |
PTM Granularity indicates the resolution of the PTM clock:
PTM Root (RC)
│
┌────┴────┐
│ Switch │
└────┬────┘
┌────┴────┬────────────┐
│ │ │
DAC 1 DAC 2 ADC
│ │ │
▼ ▼ ▼
Speaker Speaker Microphone
All devices synchronized to < 1μs
Enables sample-accurate playback/capture