Skip to content
VLSI

PCIe LTSSM Explained: Link Training States and Verification Scenarios

  • 12 min read

PCI Express (PCIe) is a high-speed serial interface used to connect processors, GPUs, SSDs, network controllers, and other high-performance devices. Before two PCIe components can exchange Transaction Layer Packets (TLPs), they must establish a reliable physical link, synchronize their receivers, negotiate link parameters, and complete link training.

This process is controlled by the Link Training and Status State Machine (LTSSM). LTSSM is part of the PCIe Physical Layer and manages link initialization, training, recovery, power management, and other link-control operations.

For design and verification engineers, understanding LTSSM is essential because many PCIe failures originate before normal packet transmission begins. A link may remain in Detect, repeatedly transition between Polling and Configuration, or enter Recovery unexpectedly. Verification must therefore cover both successful state transitions and abnormal conditions that prevent the link from reaching or remaining in L0.

This article explains the major PCIe LTSSM states, the role of training sequences, and practical verification scenarios used to validate link training behavior.

What Is LTSSM in PCIe?

LTSSM is a state machine that controls how a PCIe link moves from an inactive condition to an operational state. It also manages transitions caused by speed changes, link errors, low-power requests, resets, and other link events.

A PCIe link connects two ports: an Upstream Port and a Downstream Port. During initialization, both ends exchange training sequences called Ordered Sets. These sequences allow the receiver to detect the link partner, establish synchronization, identify lanes, negotiate link width, and configure the link.

The LTSSM uses several major state groups:

  • Detect
  • Polling
  • Configuration
  • L0
  • Recovery
  • L0s, L1, and L2-related link power states
  • Disabled
  • Loopback
  • Hot Reset

Some states contain multiple substates. Their exact entry conditions, exit conditions, timers, and signaling requirements depend on the PCIe specification revision and supported link capabilities.

Detect State: Finding the Link Partner

The Detect state is the starting point of link initialization. Its main purpose is to determine whether a receiver is present on the lanes being evaluated.

It has two commonly discussed substates:

Detect.Quiet: The transmitter remains in an electrical-idle condition while the receiver-detection process is performed according to the applicable PHY implementation.

Detect.Active: The transmitter performs receiver detection to determine whether a valid electrical termination is present on the other side of the link.

If receiver detection succeeds on the required lanes, the LTSSM can proceed to Polling. If a receiver is not detected, the state machine may repeat the detection process.

Practical example:

Consider a PCIe Endpoint connected to a Root Complex through a physical lane. After reset release, the Root Complex begins link initialization. If the receiver termination is not detected because of a disconnected lane, incorrect board routing, or a PHY configuration problem, the link may remain in Detect rather than progressing to Polling.

Verification scenarios:

  • Verify that the LTSSM enters Detect after the required initialization or reset sequence.
  • Model receiver detection success and confirm progression toward Polling.
  • Model receiver detection failure and verify that the link does not incorrectly enter Polling.
  • Test different lane configurations, including a reduced-width link where supported.
  • Verify that reset and electrical-idle conditions are handled correctly.

The testbench should observe both LTSSM state transitions and relevant PHY interface signals. A state-only check may not reveal whether the receiver-detection request and response were handled correctly.

Polling State: Establishing Synchronization

After detecting a receiver, the LTSSM enters Polling. The objective is to establish reliable communication at the physical level by exchanging training sequences.

Polling includes two important substates:

Polling.Active: The transmitter sends TS1 Ordered Sets. The receiver uses the received training information to establish bit and symbol synchronization and identify the link partner's training activity.

Polling.Configuration: After the required training conditions are satisfied, the link progresses to exchanging TS2 Ordered Sets. These sequences support the transition toward link configuration.

TS1 and TS2 are not ordinary data packets. They are physical-layer training sequences containing fields used during link initialization and configuration.

Practical example:

Suppose a PCIe link is configured to support a maximum width of x4. During Polling, the ports exchange TS1 and TS2 Ordered Sets across the detected lanes. If one lane does not achieve the required synchronization, the link may not be able to establish the originally expected width.

The design must handle the supported link configuration and training conditions correctly rather than assuming that all lanes will always become operational.

Verification scenarios:

  1. Send valid TS1 Ordered Sets and verify that the receiver recognizes the training activity.
  2. Provide the expected TS2 exchange and verify progression toward Configuration.
  3. Introduce invalid or inconsistent training information and verify the specified error-handling behavior.
  4. Delay the training response to exercise applicable timeout handling.
  5. Verify that the link does not enter Configuration before the required training conditions are satisfied.

A useful coverage model tracks entry into Polling.Active, Polling.Configuration, successful training-sequence recognition, and the transition to Configuration.

Configuration State: Negotiating Link Width and Lane Numbers

The Configuration state establishes the logical organization of the PCIe link. It determines which lanes participate in the link and assigns lane numbers and link information.

Important substates include:

  • Configuration.Linkwidth.Start
  • Configuration.Linkwidth.Accept
  • Configuration.Lanenum.Wait
  • Configuration.Lanenum.Accept
  • Configuration.Complete
  • Configuration.Idle

The exact sequence and conditions must be checked against the applicable PCIe specification.

During link-width negotiation, the ports determine a mutually supported link width based on the available and usable lanes. Lane-number information is then used to identify the participating lanes and establish their logical ordering.

Practical example: x4 link training

Assume a Root Complex and Endpoint both support x4 operation. The physical connection has four lanes, but one lane fails to train successfully.

The link may establish a narrower width if the remaining lanes satisfy the applicable configuration requirements and the implementation supports that fallback. The verification environment should check the negotiated width rather than simply assuming that the maximum advertised width is always achieved.

For example, a test may check that the final negotiated link width is x2 when the test configuration and specification conditions permit x2 operation.

Verification scenarios:

  • Verify successful x1, x2, and x4 link-width negotiation where supported.
  • Introduce a lane failure and check the permitted width fallback.
  • Verify correct lane-number assignment.
  • Check that both link partners agree on the final link configuration.
  • Exercise invalid or inconsistent lane information.
  • Verify Configuration.Complete and Configuration.Idle progression.
  • Confirm that the link enters L0 only after the required configuration conditions are met.

The testbench should compare the negotiated width and lane mapping with the expected configuration, not just check whether the LTSSM eventually reaches L0.

L0 State: Normal Link Operation

L0 is the normal active operating state of a PCIe link. Once the link reaches L0, the ports can exchange normal PCIe traffic, subject to the protocol and link capabilities.

The Transaction Layer generates TLPs, the Data Link Layer manages reliable transfer and flow control, and the Physical Layer transmits and receives the encoded data stream.

Reaching L0 is an important milestone, but it does not prove that the complete PCIe implementation is correct. Packet-level behavior, flow control, error handling, and sustained traffic must also be verified.

Practical example:

After successful x4 link training, a Root Complex sends a Memory Read Request to an Endpoint. The Endpoint returns a Completion with Data. The link remains in L0 while the transaction is processed.

Verification scenarios:

  • Confirm that normal traffic is permitted only when the link is operational.
  • Transmit Memory Read and Memory Write TLPs after link training.
  • Verify that the Data Link Layer initializes and handles its required protocol operations.
  • Check that flow-control initialization completes before applicable traffic is exchanged.
  • Exercise sustained traffic while monitoring unexpected LTSSM transitions.
  • Verify the behavior when an error or recovery condition occurs during normal operation.

A useful test checks both the LTSSM state and the actual packet exchange. This helps identify cases where the state machine reports L0 but another protocol-layer function is not operating correctly.

Recovery State: Restoring or Changing Link Operation

Recovery is entered when the link needs to restore reliable operation or perform a supported change in link configuration, such as a speed change.

Important Recovery substates include:

  • Recovery.RcvrLock
  • Recovery.RcvrCfg
  • Recovery.Speed
  • Recovery.Equalization
  • Recovery.Idle

The exact substates used depend on the PCIe generation and the reason for entering Recovery.

During Recovery, the ports exchange training sequences and perform the required synchronization, configuration, and speed-related operations. For PCIe Gen3 and later, equalization is an important part of establishing operation at higher data rates.

Practical example: Link speed change

Consider a PCIe link that initially operates at 2.5 GT/s and supports a higher generation. When a speed change is requested and accepted, the link enters the applicable Recovery sequence. The ports perform the required training and equalization operations before returning to L0 at the new speed.

The verification environment should check the requested speed, training sequence, successful completion, and final negotiated speed.

Verification scenarios:

  • Trigger a supported speed change from normal operation.
  • Verify the expected Recovery state progression.
  • Exercise successful and unsuccessful receiver synchronization.
  • Verify equalization behavior for supported higher-speed generations.
  • Introduce a training response delay and check the specified timeout behavior.
  • Check that the link returns to L0 only after the required Recovery operations complete.
  • Exercise a failed speed-change attempt and verify the specified fallback or recovery behavior.

Do not treat all Recovery transitions as identical. A Recovery entry caused by a speed change may involve different behavior from one caused by a receiver or link error.

Low-Power States: L0s, L1, and L2

PCIe supports link power-management states to reduce power consumption when normal traffic is not required.

L0s: A low-power state with relatively low exit latency. It allows the link to enter a lower-power condition while retaining the ability to return to active operation.

L1: A deeper low-power state than L0s. Entry and exit involve additional power-management handshaking and timing requirements.

L2-related states: Used for more substantial link power reduction and system power-management scenarios. Their behavior is associated with specific power-management and electrical-idle conditions.

Practical example:

A system using an SSD may have periods with no active PCIe traffic. Depending on the platform's power-management configuration, the link can enter an appropriate low-power state and return to L0 when activity resumes.

Verification scenarios:

  • Request and verify entry into supported L0s and L1 states.
  • Check that the link does not enter a low-power state while required protocol conditions are unmet.
  • Verify exit from low-power states and successful return to L0.
  • Exercise repeated entry and exit cycles.
  • Verify power-management handshaking and timing requirements.
  • Check behavior when a wake-up or exit request occurs near a transition boundary.

Power-management verification should include both the LTSSM transition and the associated link-control behavior.

Disabled, Hot Reset, and Loopback States

Other LTSSM states are important for link control, testing, and recovery.

Disabled: The link is placed into a disabled condition rather than continuing normal operation. Verification should check the conditions that cause entry and the expected behavior of the link and associated data-link state.

Hot Reset: A reset mechanism communicated through the PCIe link. It allows a component to be reset through in-band signaling without relying exclusively on a fundamental reset.

Loopback: A test-oriented mode used to evaluate portions of the physical link path. The exact behavior depends on the selected loopback mode and implementation.

Verification scenarios:

  • Verify Hot Reset recognition and propagation according to the applicable specification.
  • Check the expected link-state behavior during reset and subsequent retraining.
  • Verify that normal traffic is handled correctly before and after reset.
  • Exercise entry into and exit from supported loopback modes.
  • Confirm that Disabled-state entry prevents normal link operation as required.

These scenarios are especially useful for validating reset handling, PHY control, and link reinitialization.

Practical PCIe LTSSM Verification Scenarios

A good LTSSM verification plan should cover normal training, parameter negotiation, error conditions, and transitions after the link becomes operational.

The following table provides a practical starting point:

Test scenario

Stimulus

Expected verification

Basic link training

Release reset and enable the link

Detect → Polling → Configuration → L0

Receiver not detected

Disable or withhold receiver detection

Link does not progress as if a receiver were present

Delayed training response

Delay expected TS1/TS2 activity

Correct waiting and timeout behavior

Lane-width negotiation

Train with supported lane configurations

Correct negotiated width and lane mapping

Lane failure

Make one lane unavailable

Correct supported fallback behavior

Speed change

Request a higher supported speed

Recovery and successful retraining

Equalization

Exercise higher-generation link training

Correct equalization sequence and completion

Recovery entry

Introduce a supported recovery trigger

Expected Recovery progression

Low-power entry and exit

Request L0s or L1

Correct power-state transition and return to L0

Hot Reset

Issue Hot Reset signaling

Correct reset handling and link retraining

Loopback

Request supported loopback operation

Correct entry, operation, and exit

Example: UVM-based LTSSM verification approach

A UVM testbench can organize LTSSM verification using sequences, drivers, monitors, scoreboards, and functional coverage.

A simplified test sequence could perform the following operations:

  1. Configure the Root Complex and Endpoint capabilities.
  2. Apply the required reset sequence.
  3. Enable the link and monitor the LTSSM state.
  4. Check the Detect and Polling phases.
  5. Observe TS1 and TS2 Ordered Set exchanges.
  6. Verify lane-width and lane-number negotiation.
  7. Confirm entry into L0.
  8. Run packet-level traffic.
  9. Trigger Recovery or power-management scenarios.
  10. Check the expected final state and negotiated parameters.

A simplified SystemVerilog-style assertion can check that the LTSSM reaches L0 within an environment-defined timeout after training starts:

property p_ltssm_reaches_l0;

  @(posedge clk) disable iff (!rst_n)

    training_start |-> ##[1:MAX_TRAIN_CYCLES]

    (ltssm_state == LTSSM_L0);

endproperty

assert property (p_ltssm_reaches_l0);

This is an illustrative assertion, not a complete PCIe compliance property. MAX_TRAIN_CYCLES must be selected according to the design's clocking, implementation, and applicable specification requirements. The state encoding and reset behavior must also match the DUT.

LTSSM Debugging: What to Check When Link Training Fails

When a PCIe link does not reach L0, the first step is to identify the last successfully completed LTSSM state.

  • Stuck in Detect: Check receiver detection, electrical termination, reset sequencing, and PHY configuration.
  • Stuck in Polling: Inspect TS1/TS2 exchange, receiver synchronization, lane signaling, and training response conditions.
  • Stuck in Configuration: Check lane numbers, link numbers, negotiated width, and consistency between the link partners.
  • Repeated Recovery entries: Inspect receiver errors, speed-change handling, equalization, and physical link stability.
  • Unexpected transition from L0: Check power-management requests, error indications, reset signaling, and PHY status.

Use a combination of LTSSM state traces, PIPE interface signals, Ordered Set decoding, PHY status information, and protocol analyzer captures. A protocol analyzer can help correlate the observed training sequence with the state transition, while simulation waveforms can expose internal control conditions.

Conclusion

PCIe LTSSM controls the complete link-training process, from receiver detection and synchronization to lane negotiation, normal operation, recovery, and power management. Each state has a specific responsibility, and a failure in one phase can prevent the link from reaching L0 or cause it to return to Recovery unexpectedly.

For design-verification engineers, it is not enough to verify only the successful Detect-to-L0 path. A comprehensive verification plan should also cover lane-width negotiation, speed changes, equalization, delayed training responses, low-power transitions, Hot Reset, and abnormal training conditions.

Practical knowledge of Ordered Sets, PIPE signals, LTSSM transitions, SystemVerilog assertions, and UVM testbench development helps engineers identify link-training issues and verify PCIe controllers more effectively.

Engineers who want to develop these skills can explore PCIe Protocol Training at InSkill, which covers LTSSM, Ordered Sets, Physical Layer operation, and PCIe design and testbench concepts. For additional protocol and testbench development exposure, explore PCIe Gen5 Training at VLSIGuru and PCIe Testbench Development Training at VLSIGuru.

Share LinkedIn X WhatsApp