LTSSM (Link Training and Status State Machine)

blog.chinaaet.com/justlxy/p/5…

PCIe总线中的链路初始化与训练(Link Initialization & Training)是一种完全由硬件实现的功能,处于PCIe体系结构中的物理层。整个过程由链路训练状态机(Link Training and Status State Machine,LTSSM)自动完成,也就说基本没有数据链路层和事务层啥事。

LTSSM在PCIe体系结构中的位置的示意图如下:

blob.png

在系统复位后,会自动进行链路训练,以达成以下目标:位锁定(Bit Lock)、字符锁定(Symbol Lock,Gen1 & Gen2 Only)、块锁定(Block Lock,Gen3 Only)、确定链路宽度(Link Width)、通道位置翻转(Lane Reversal)、信号极性翻转(Polarity Inversion)、确定链路的数据率(Data Rate)和通道对齐(Lane-to-Lane De-skew)等功能。

www.plda.com/pcie-glossa…

The LTSSM (Link Training and Status State Machine) block checks and memorizes what is received on each lane, determines what should be transmitted on each lane and transitions from one state to another.
LTSSM(链路训练和状态机)块检查并记住每个通道上接收到的内容,确定每个通道上应传输的内容以及从一种状态转换到另一种状态。

Link Training and Status State Machine consists of 11 top-level states: Detect, Polling, Configuration, Recovery, L0, L0s, L1, L2, Hot Reset, Loopback and Disable. These can be grouped into five categories: Link Training states, Re-Training (Recovery) state, Software driven Power Management states, Active-State Power Management states, Other states.
链路训练和状态状态机由 11 个顶级状态组成:检测、轮询、配置、恢复、L0、L0s、L1、L2、热重置、环回和禁用。这些可以分为五类:链路训练状态、重新训练(恢复)状态、软件驱动的电源管理状态、活动状态电源管理状态、其他状态。

The flow of the LTSSM follows the Link Training states when exiting from any type of Reset: Detect >> Polling >> Configuration >> L0. In L0 state, normal packet transmission / reception is in progress. The Recovery State is used for a variety of reasons, such as changing back from a low-power Link state, like L1, or changing the link Bandwidth. In this state, the Link repeats as much of the training process as needed to handle the matter and returns to L0. Power management software can also place a device into a low-power device state forcing the Link into a lower Power Management Link state (L1or L2). If there are no packets to send for a time, ASPM Software may be allowed to transition the Link into low power ASPM states (L0s or ASPM L1).  In addition, software can direct a link to enter some other special states (Disabled, Loopback, Hot Reset.)
当退出任何类型的重置时,LTSSM 的流程遵循链路训练状态:检测 >> 轮询 >> 配置 >> L0。在L0状态下,正在进行正常的数据包发送/接收。使用恢复状态的原因有多种,例如从低功耗链路状态(如 L1)改回,或更改链路带宽。在这种状态下,Link 会根据处理问题的需要重复尽可能多的训练过程,然后返回到 L0。电源管理软件还可以将设备置于低功耗设备状态,强制链路进入较低的电源管理链路状态(L1 或 L2)。如果一段时间内没有要发送的数据包,则可以允许 ASPM 软件将链路转换为低功耗 ASPM 状态(L0 或 ASPM L1)。此外,软件还可以引导链路进入其他一些特殊状态(Disabled、Loopback、Hot Reset)。

www.intel.com/content/www…

11.4. Link Training 11.4。链接培训

The Physical Layer automatically performs link training and initialization without software intervention. This is a well-defined process to configure and initialize the device's Physical Layer and link so that PCIe packets can be transmitted. If you encounter link training issues, viewing the actual data in hardware should help you determine the root cause. You can use the following tools to provide hardware visibility:
物理层自动执行链路训练和初始化,无需软件干预。这是一个定义明确的过程,用于配置和初始化设备的物理层和链路,以便传输 PCIe 数据包。如果您遇到链路训练问题,查看硬件中的实际数据应该可以帮助您确定根本原因。您可以使用以下工具来提供硬件可见性:

  • Signal Tap Embedded Logic Analyzer
    Signal Tap 嵌入式逻辑分析仪
  • Third-party PCIe protocol analyzer
    第三方 PCIe 协议分析仪

You can use Signal Tap Embedded Logic Analyzer to diagnose the LTSSM state transitions that are occurring on the PIPE interface. The ltssmstate bus encodes the status of LTSSM. The LTSSM state machine reflects the Physical Layer’s progress through the link training process. For a complete description of the states these signals encode, refer to Reset, Status, and Link Training Signals. When link training completes successfully and the link is up, the LTSSM should remain stable in the L0 state. When link issues occur, you can monitor ltssmstate to determine the cause.
您可以使用 Signal Tap 嵌入式逻辑分析器来诊断 PIPE 接口上发生的 LTSSM 状态转换。 ltssmstate 总线对 LTSSM 的状态进行编码。 LTSSM 状态机反映了物理层在链路训练过程中的进度。有关这些信号编码的状态的完整说明,请参阅复位、状态和链路训练信号。当链路训练成功完成并且链路启动时,LTSSM 应保持稳定在 L0 状态。当发生链路问题时,您可以监控 ltssmstate 以确定原因。

猜你喜欢

转载自juejin.im/post/7254492693278048312
今日推荐