PCIE (Peripheral Component Interface Express) link state monitoring method and device, chip and electronic equipment

By setting up a PCIE link status monitoring device in the chip to monitor and process the LTSSM status in real time, the problems of low monitoring efficiency and large resource occupation in the prior art are solved, and efficient link status management and fault handling are achieved.

CN119071185APending Publication Date: 2024-12-03SANECHIPS TECH CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411273043.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-11
Publication Date
2024-12-03

AI Technical Summary

Technical Problem

In the prior art, PCIE link status monitoring requires a tight chip I/O pin and requires external equipment and environment support, limiting the flexibility and efficiency of monitoring.

Method used

By setting up a PCIE link status monitoring device in the chip, receiving the status information of the LTSSM, and starting the timer monitoring status switching. If the switch is not successfully switched to the normal working state, an interrupt is reported to the CPU to trigger a reset, real-time monitoring and fault processing are realized.

Benefits of technology

It realizes real-time monitoring of LTSSM status without occupying I/O pins, timely handling deadlocks and faults, ensuring the normal operation of the PCIE link, and saving chip resources.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119071185A_ABST
    Figure CN119071185A_ABST
Patent Text Reader

Abstract

The invention provides a PCI E link state monitoring method, which is applied to a PCI E link state monitoring device, a chip to which the PCI E link state monitoring device belongs further comprises a CPU and a PCI E controller comprising an LTSSM, and the method comprises the following steps: receiving state information reported by the LTSSM, and storing the state information; when it is determined that the LTSSM is switched from the low power consumption state to the normal working state according to the state information, a preset first timer is started; when the low-power-consumption state is not successfully switched to the normal working state within the first timing duration of the preset first timer, interruption is reported to the CPU, so that the CPU instructs the software controller to control the LTSSM to reset to the link repeated training state, chip resources can be reasonably utilized, historical state information is reserved, and normal operation of the PCLE link is guaranteed. The invention further provides a PCI E link state monitoring device, a chip and electronic equipment.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of communication technology, and in particular to a PCIE link status monitoring method, device, chip and electronic device. Background Art

[0002] The link state of PCIE (Peripheral Component Interconnect Express, high-speed serial computer expansion bus standard) is mainly controlled by the internal LTSSM (Link Training and Status State Machine), which is located in the physical layer of the PCIE controller and is an important component for link initialization and control of the PCIE link after power-on. During the link initialization and training process, LTSSM guides the completion of PCIE device identification, rate negotiation, power management, reset, link width channel sequence negotiation, etc., and the process is automatically completed by hardware without software participation. After the PCIE link training and initialization are completed, the state of LTSSM and its state jump are closely related to the link, operating rate, reset and power state of PCIE, which directly reflects the working state of PCIE. Therefore, through LTSSM, we can quickly understand the information of the current PCIE link and physical layer, which plays a very important role in the debugging and positioning of PCIE. In addition, the power consumption state switching of LTSSM may cause LTSSM to deadlock, which in turn causes the entire link to fail. Therefore, LTSSM still needs to be monitored in real time during normal operation.

[0003] In the related art, the status signal of LTSSM is sent to the I / O (input / output) pin of the chip through the port, and an oscilloscope is connected to observe the working status of LTSSM. This solution needs to occupy the already tight chip I / O pins, and also requires external equipment and environmental support, and has certain usage restrictions. Summary of the invention

[0004] The present disclosure provides a PCIE link status monitoring method, device, chip and electronic device.

[0005] In a first aspect, an embodiment of the present disclosure provides a PCIE link status monitoring method, which is applied to a high-speed serial computer expansion bus standard PCIE link status monitoring device, wherein the chip to which the PCIE link status monitoring device belongs also includes a central processing unit CPU and a PCIE controller including a link training state machine LTSSM, and the method includes:

[0006] Receive status information reported by the LTSSM, and store the status information;

[0007] When it is determined according to the state information that the LTSSM switches from the low power consumption state to the normal working state, starting a preset first timer;

[0008] If the low power consumption state is not successfully switched to the normal working state within the first timing duration of the preset first timer, an interrupt is reported to the CPU, and the interrupt is used to trigger the CPU to instruct the software controller to control the LTSSM to reset to the link retraining state.

[0009] In a second aspect, an embodiment of the present disclosure provides a PCIE link status monitoring device, comprising a memory and a processor; the memory stores a computer program that can be executed by the processor, and the computer program implements the PCIE link status monitoring method when executed by the processor.

[0010] In a third aspect, an embodiment of the present disclosure provides a chip, including a central processing unit CPU, a PCI bus including a link training state machine LTSSM, and a PCIE link status monitoring device as described above, wherein the PCIE link status monitoring module is electrically connected to the LTSSM and the CPU.

[0011] In a fourth aspect, an embodiment of the present disclosure provides an electronic device, comprising a controller and the chip as described above, wherein the controller is electrically connected to the PCIE link status monitoring device.

[0012] The PCIE link status monitoring method in the embodiment of the present disclosure is applied to a PCIE link status monitoring device, and the chip to which the PCIE link status monitoring device belongs also includes a CPU and a PCIE controller including an LTSSM. The method includes: receiving status information reported by the LTSSM and storing the status information; when it is determined according to the status information that the LTSSM switches from a low power consumption state to a normal working state, starting a preset first timer; when it fails to successfully switch from the low power consumption state to the normal working state within a first timing duration of the preset first timer, reporting an interrupt to the CPU so that the CPU instructs the software controller to control the LTSSM to reset to a link retraining state; by setting a PCIE link status monitoring device inside the chip to record the status of the LTSSM, it is possible to reasonably utilize chip resources and retain the historical status information of the LTSSM, so as to facilitate subsequent status switching abnormality analysis; monitoring the status of the LTSSM in real time, and reporting and resetting the LTSSM in a timely manner when a status switching abnormality occurs in the LTSSM, so as to ensure the normal operation of the PCLE link. BRIEF DESCRIPTION OF THE DRAWINGS

[0013] In the accompanying drawings of the embodiments of the present disclosure:

[0014] Figure 1A schematic diagram of a chip structure provided in an embodiment of the present disclosure;

[0015] Figure 2 The process of the PCIE link status monitoring method provided in the embodiment of the present disclosure is Figure 1 ;

[0016] Figure 3 The process of the PCIE link status monitoring method provided in the embodiment of the present disclosure is Figure 2 ;

[0017] Figure 4 The process of the PCIE link status monitoring method provided in the embodiment of the present disclosure is Figure 3 ;

[0018] Figure 5 A flowchart of a PCIE link status monitoring method provided for a specific example of the present disclosure;

[0019] Figure 6 A schematic diagram of the module composition of a PCIE link status monitoring device provided in an embodiment of the present disclosure;

[0020] Figure 7 A schematic diagram of the module composition of an electronic device provided in an embodiment of the present disclosure. DETAILED DESCRIPTION

[0021] In order to enable those skilled in the art to better understand the technical solution of the present disclosure, the embodiments of the present disclosure are described in detail below with reference to the accompanying drawings.

[0022] The present disclosure will be described more fully below with reference to the accompanying drawings, but the embodiments shown may be embodied in different forms, and the present disclosure should not be construed as being limited to the embodiments set forth below. On the contrary, the purpose of providing these embodiments is to make the present disclosure thorough and complete, and will enable those skilled in the art to fully understand the scope of the present disclosure.

[0023] The accompanying drawings of the embodiments of the present disclosure are used to provide a further understanding of the embodiments of the present disclosure and constitute a part of the specification. Together with the detailed embodiments, they are used to explain the present disclosure and do not constitute a limitation of the present disclosure. By describing the detailed embodiments with reference to the accompanying drawings, the above and other features and advantages will become more apparent to those skilled in the art.

[0024] The present disclosure may be described with reference to plan views and / or cross-sectional views by means of ideal schematic views of the present disclosure. Therefore, the exemplary illustrations may be modified according to manufacturing techniques and / or tolerances.

[0025] In the absence of conflict, the various embodiments of the present disclosure and the various features therein may be combined with each other.

[0026] The terms used in the present disclosure are only used to describe specific embodiments and are not intended to limit the present disclosure. The term "and / or" as used in the present disclosure includes any and all combinations of one or more related enumerated items. The singular forms "one" and "the" as used in the present disclosure are also intended to include plural forms, unless the context clearly indicates otherwise. The terms "including", "made of..." as used in the present disclosure specify the presence of the features, wholes, steps, operations, elements and / or components, but do not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or groups thereof.

[0027] Unless otherwise defined, all terms (including technical and scientific terms) used in this disclosure have the same meaning as commonly understood by those of ordinary skill in the art. It will also be understood that terms such as those defined in commonly used dictionaries should be interpreted as having a meaning consistent with their meaning in the context of the relevant art and this disclosure, and will not be interpreted as having an idealized or overly formal meaning unless explicitly defined in this disclosure.

[0028] The present disclosure is not limited to the embodiments shown in the drawings, but includes modifications of the configurations formed based on the manufacturing process. Therefore, the regions illustrated in the drawings have schematic properties, and the shapes of the regions shown in the drawings illustrate the specific shapes of the regions of the elements, but are not intended to be limiting.

[0029] The embodiment of the present disclosure provides a PCIE link status monitoring method, the method is applied to a PCIE link status monitoring device (FSM_TRACK), the PCIE link status monitoring device is arranged in a chip, Figure 1 is a schematic diagram of the structure of the chip, such as Figure 1 As shown, the chip also includes a CPU (Central Processing Unit) and a PCIE controller. The PCIE controller includes an LTSSM. The PCIE link status monitoring module is electrically connected to the LTSSM and the CPU. The CPU transmits data through the PCIE controller.

[0030] Figure 2 The process of the PCIE link status monitoring method provided in the embodiment of the present disclosure is Figure 1 , combined with Figure 1 and Figure 2 As shown, the method is applied to a PCIE link status monitoring device, comprising the following steps:

[0031] Step S11, receiving status information reported by LTSSM and storing the status information.

[0032] The PCIE link status monitoring device receives the status information reported by the LTSSM, and stores the status information in a register in the PCIE link status monitoring device.

[0033] In some embodiments, the storage status information includes: when the amount of stored status information reaches a preset threshold, the status information with the longest storage time is overwritten with the latest received status information. For PCIE controllers with more complex functions and more application scenarios, in order to save power consumption, there will be frequent link retraining states and power consumption state switching. These link retraining states caused by rate requirements or power consumption requirements will be accompanied by frequent LTSSM state jumps. Since a large amount of status information is generated during the operation of the PCIE controller, for such a PCIE controller, the preset threshold can be set larger so that the fault occurrence status can be accurately tracked during fault analysis. For PCIE controllers with simpler applications and functions, since the amount of status information generated during the operation of the PCIE controller is small, the preset threshold can be set smaller to save chip area resources.

[0034] Step S12: when it is determined according to the state information that the LTSSM switches from the low power consumption state to the normal working state, start a preset first timer.

[0035] The PCIE link status monitoring device can determine that the LTSSM has switched states based on the status information reported by the LTSSM. If it is determined that the LTSSM switches from a low power consumption state to a normal working state, a preset first timer is started, and the timing duration of the preset first timer is a first timing duration.

[0036] Step S13, if the low power consumption state is not successfully switched to the normal working state within the first timing duration of the preset first timer, an interrupt is reported to the CPU, and the interrupt is used to trigger the CPU to instruct the software controller to control the LTSSM to reset to the link retraining state.

[0037] Software Controller ( Figure 1 The LTSSM is not shown) and is arranged outside the chip, and is used to send control instructions to the PCIE controller, and receive instructions sent by the PCIE link status monitoring device. If the LTSSM fails to successfully switch from the low power consumption state to the normal working state within the first timing period, it means that the LTSSM is deadlocked, and then an interrupt is reported to the CPU to notify the CPU that the LTSSM is deadlocked, so that the CPU instructs the software controller to control the LTSSM to reset to the link retraining state, so that the LTSSM can re-train the link, thereby waking up the deadlocked LTSSM and jumping out of the deadlock state.

[0038] The PCIE link status monitoring method in the embodiment of the present disclosure is applied to a PCIE link status monitoring device, and the chip to which the PCIE link status monitoring device belongs also includes a CPU and a PCIE controller including an LTSSM. The method includes: receiving status information reported by the LTSSM and storing the status information; when it is determined according to the status information that the LTSSM switches from a low power consumption state to a normal working state, starting a preset first timer; when it fails to successfully switch from the low power consumption state to the normal working state within a first timing duration of the preset first timer, reporting an interrupt to the CPU, and the interrupt is used to trigger the CPU to instruct the software controller to control the LTSSM to reset to a link repetition training state; by setting a chip internal setting to record the status of the LTSSM, the chip resources can be reasonably utilized, and the historical status information of the LTSSM is retained, so as to facilitate subsequent status switching abnormality analysis; the status of the LTSSM is monitored in real time, and when a status switching abnormality occurs in the LTSSM, it is reported in time and the LTSSM is reset in time to ensure the normal operation of the PCLE link.

[0039] In some embodiments, after starting the preset first timer (i.e., step S12), the PCIE link state monitoring method may further include the following steps: after the LTSSM is reset, the first timer is cleared. It should be noted that, when the LTSSM successfully switches from the low power state to the normal working state within the first timing duration, the preset first timer will also be cleared when the first timing duration is reached, so as to perform subsequent LTSSM state monitoring.

[0040] In some embodiments, there are five main states of LTSSM, each of which has multiple sub-states. In the embodiment of the present disclosure, the PCIE link state monitoring device mainly manages and monitors the following five states of LTSSM:

[0041] Link Training (LT) state: When the PCIE controller is powered on and initialized or exits any type of reset (Cold, Warm Reset), the LTSSM performs state jumps according to the process of the link training state. The state jump process is: Detect (discovery substate) => Polling (voting substate) => Configuration (configuration substate) => L0 (normal working substate);

[0042] Link retraining (Re-Training) state: also known as the Recovery state, generally changes from a low-power link state (such as L1) back to the L0 state; or the link rate needs to be changed (transmission speed or bit width changes), the link needs to be trained multiple times to negotiate these changes and change back to the L0 state;

[0043] Software-driven Power Management (PM) state: The power management software can put the PCIE controller into a low power state such as D1, D2 or D3, at which point the PCIE controller enters a lower power management link state (L1 or L2 state);

[0044] Active-State Power Management (ASPM) state: automatically initiated by hardware. If the PCIE link is idle for a period of time, it can allow the ASPM hardware to automatically put the PCIE link into the low-power ASPM state (L0s or L1);

[0045] Other states: The software controller can directly set the PCIE link to enter some special states, such as Disable (invalid state), External Loop back (external loopback state), Hot Reset (hot start state), etc.

[0046] Among them, the software-driven power management state and the dynamic power management state belong to the low power consumption state.

[0047] In some embodiments, determining that the LTSSM switches from a low power consumption state to a normal working state based on status information includes the following steps: when it is determined according to the status information that the LTSSM is in a PM state and receives an exit low power consumption instruction sent by the software controller, determining that the LTSSM switches from a low power consumption state to a normal working state; when it is determined according to the status information that the LTSSM is in an ASPM state and the PCI bus is in a non-idle state, or when it is determined according to the status information that the LTSSM is in an ASPM state and receives a wake-up instruction sent by the CPU, determining that the LTSSM switches from a low power consumption state to a normal working state.

[0048] Figure 3 The process of the PCIE link status monitoring method provided in the embodiment of the present disclosure is Figure 2 In some embodiments, as Figure 3 As shown, the PCIE link status monitoring method also includes the following steps:

[0049] Step S21 , when it is determined according to the state information that the LTSSM switches from the normal working state to the low power consumption state, verify the legality of the LTSSM entering the low power consumption state.

[0050] For PCIE controllers that support low-power states, during normal data transmission, LTSSM may accidentally enter low-power states such as L0s, L1 or L2 under normal working conditions. This unexpected entry into a low-power state can cause failures such as waiting timeouts for unfinished transmission data, unexpected bus hangs, and data loss. In order to avoid the above situation, when the PCIE link state monitoring device detects that the LTSSM switches from a normal working state to a low-power state, it can verify whether it is legal to enter a low-power state according to current business needs. If it is currently in a business transmission state, it is determined that the LTSSM has accidentally entered a low-power state, that is, the LTSSM is illegally entering a low-power state; if a low-power indication is received from the software controller or the PCI bus is in an idle state, it can be determined that the LTSSM is legal to enter a low-power state, and no measures are taken against the PCIE controller.

[0051] In some embodiments, the verification of the legality of LTSSM entering the low power state may include the following steps: determining that LTSSM entering the low power state is illegal when no low power instruction is received from the software controller or the PCI bus is in a non-idle state.

[0052] Step S22: When it is illegal for the LTSSM to enter the low power consumption state, report the interrupt to the CPU.

[0053] When it is illegal for the LTSSM to enter the low power state, an interrupt needs to be reported to the CPU immediately so that the CPU can instruct the software controller to control the LTSSM to reset to the link retraining state, so that the LTSSM can re-perform link training and return to the normal working state by re-establishing the link.

[0054] Figure 4 The process of the PCIE link status monitoring method provided in the embodiment of the present disclosure is Figure 3 In some embodiments, as Figure 4 As shown, the PCIE link status monitoring method also includes the following steps:

[0055] Step S31: when it is determined according to the status information that the LTSSM is in the link training state, start a preset second timer.

[0056] If the PCIE link status monitoring device determines that the LTSSM is in the link training state according to the status information, indicating that the LTSSM needs to perform link training, the preset second timer is started, and the timing duration of the preset second timer is the second timing duration. The second timer can be used to monitor whether the LTSSM link training process is normal.

[0057] Step S32: if the system fails to switch to the normal working state within the second timing duration of the preset second timer, the interruption is reported to the CPU.

[0058] If the LTSSM fails to successfully switch from the link training state to the normal working state within the second timing period, indicating that the LTSSM training has timed out, an interrupt is reported to the CPU to notify the CPU that the LTSSM training timeout has occurred, so that the CPU instructs the software controller to control the LTSSM to reset to the link retraining state, so that the LTSSM can re-perform link training.

[0059] In some embodiments, after starting the preset second timer (i.e., step S31), the PCIE link state monitoring method may further include the following steps: after the LTSSM is reset, the second timer is cleared. It should be noted that, if the LTSSM successfully switches from the link training state to the normal working state within the second timing duration, the preset second timer will also be cleared when the second timing duration is reached, so as to perform subsequent LTSSM state monitoring.

[0060] In some embodiments, the power supply of the PCIE link status monitoring device is different from the power supply of the PCIE controller, that is, the PCIE link status monitoring device adopts an independent power supply and can achieve independent reset without relying on the PCIE controller; moreover, in the event that the PCIE controller hangs unexpectedly, the fault can also be analyzed by reading the LTSSM historical status information stored in the PCIE link status monitoring device.

[0061] Correspondingly, after starting the preset second timer (i.e., step S31), the PCIE link state monitoring method may further include the following steps: when the PCIE controller is of a preset type and successfully switches to a normal working state within the second timing duration of the preset second timer, turn off the power supply and clock of the PCIE link state monitoring device. That is to say, for a PCIE controller of a preset type, after the LTSSM enters a normal working state, it will hardly switch states again. Therefore, after the LTSSM enters a normal working state, the power supply and clock of the PCIE link state monitoring device can be turned off to reduce the power consumption of the chip. A PCIE controller of a preset type refers to a PCIE controller with relatively simple applications and functions. The LTSSM of such a PCIE controller may only have some of the above five states. After the LTSSM of the PCIE controller of a preset type is initialized and the link is established, it enters a normal working state from the link training state. The LTSSM will almost always maintain a normal working state, and there will be no frequent state jumps.

[0062] In some embodiments, when the switching from the low power consumption state to the normal working state is not successfully performed within the first timing duration of the preset first timer, after reporting the interruption to the CPU (i.e., step S13), and / or, when the switching to the normal working state is not successfully performed within the second timing duration of the preset second timer, after reporting the interruption to the CPU (i.e., step S32), the PCIE link status monitoring method may further include the following steps: performing state switching abnormality analysis based on the status information.

[0063] In order to clearly illustrate the solution of the embodiment of the present disclosure, the following Figure 1 and Figure 5 , the PCIE link status monitoring process is described in detail through a specific example. Figure 5 As shown, the PCIE link status monitoring method includes the following steps:

[0064] Step S1, after FSM_TRACK and PCIE controller receive the LTSSM enable signal sent by CPU, PCIE controller transmits LTSSM status information to FSM_TRACK in real time through LTSSM, FSM_TRACK obtains the status information reported by LTSSM and starts status monitoring.

[0065] Step S2, FSM_TRACK determines whether LTSSM is currently in link training state, if so, execute step S3; otherwise, continue monitoring.

[0066] Step S3, FSM_TRACK records the status information, and starts the link establishment timeout timer (ie, the preset second timer) when the LTSSM starts to enter the link training state.

[0067] Step S4, FSM_TRACK determines whether it has entered the normal working state (L0) within the timing duration of the link establishment timeout timer. If it has entered the L0 state within the timing duration of the link establishment timeout timer, execute step S5; otherwise, execute step S11.

[0068] Step S5, FSM_TRACK monitors the LTSSM state switching caused by changes in power state and power consumption state during the normal operation of the PCIE controller, and records the state changes; if the LTSSM switches from a normal working state to a low power consumption state (including L0s, L1 or L2 states), execute step S6; otherwise, continue monitoring.

[0069] Step S6, verifying the legality of LTSSM entering the low power consumption state, if legal, executing step S7; if illegal, executing step S12.

[0070] Step S7: If the LTSSM switches from the low power consumption state to the normal working state, execute step S8; otherwise, continue monitoring.

[0071] Step S8, starting an anti-deadlock timer (ie, a preset first timer).

[0072] Step S9, FSM_TRACK determines whether it has entered the normal working state (L0) within the timing duration of the anti-deadlock timer. If it has entered the L0 state within the timing duration of the anti-deadlock timer, continue monitoring; otherwise, execute step S10.

[0073] If the state is successfully switched back to the L0 state within the timing duration of the anti-deadlock timer, the anti-deadlock timer is reset and the LTSSM state continues to be monitored; if the state is not successfully switched back to the L0 state within the timing duration of the anti-deadlock timer, it means that the LTSSM is deadlocked due to the state switching, and step S10 is executed.

[0074] Step S10, FSM_TRACK reports an interrupt to the CPU, such as a deadlock interrupt, so that the CPU instructs the software controller to initiate a reset to the PCIE controller, so that the LTSSM is reset to the link retraining state and restarts the LTSSM state training.

[0075] Step S11, FSM_TRACK reports an interrupt to the CPU, such as an initialization timeout interrupt, so that the CPU instructs the software controller to initiate a reset to the PCIE controller, so that the LTSSM is reset to the link retraining state and restarts the LTSSM state training.

[0076] It should be noted that FSM_TRACK can also determine the state before the deadlock occurs based on the recorded historical state information, and report the state before the deadlock and the expected state to the CPU for fault analysis. FSM_TRACK can also latch the state information for CPU query, and clear the link establishment timeout timer after the LTSSM is reset.

[0077] Step S12, FSM_TRACK reports an interrupt to the CPU, such as illegal entry into a low power interrupt, so that the CPU instructs the software controller to initiate a reset to the PCIE controller, so that the LTSSM is reset to the link retraining state and restarts the LTSSM state training.

[0078] The disclosed embodiment adds a PCIE link status monitoring device to a chip with a PCIE controller, and the PCIE link status monitoring device can obtain the LTSSM status information of the PCIE controller and store the status information for query by the CPU or software controller. The PCIE link status monitoring device can monitor the LTSSM in real time, determine whether the LTSSM is currently working normally according to the current PCIE service transmission requirements, monitor whether the LTSSM is deadlocked during state switching, and if the LTSSM is deadlocked, the software controller can be notified in time to reset the LTSSM.

[0079] The disclosed embodiment provides a LTSSM state storage mechanism with a security mechanism, which can record the LTSSM state during operation for debugging and viewing. In addition, it can also monitor the link status in real time, report to the CPU in time when LTSSM fails, and reset LTSSM in time to ensure the normal operation of the PCIE link.

[0080] The disclosed embodiment adopts an on-chip storage mechanism to realize the status recording and monitoring of LTSSM in the PCIE controller. Compared with the related art, the use of an on-chip storage mechanism to monitor LTSSM for debugging and fault analysis of the PCIE controller can be free from environmental and resource restrictions, while also saving chip I / O pins. The LTSSM status monitoring mechanism proposed in the disclosed embodiment can record the historical status, state change time, rate and other information of the LTSSM, and read it through software, so as to facilitate viewing the relevant logs after an error occurs in the PCIE controller. In addition, the disclosed embodiment can also monitor the switching of LTSSM between key states in real time, report state switching anomalies in a timely manner and process them, prevent LTSSM from deadlocking due to state switching such as power consumption or power supply, and ensure timely recovery of the PCIE link.

[0081] Compared with the related art, the embodiments of the present disclosure have the following technical effects:

[0082] 1. The LTSSM state jump of the PCIE controller can be recorded without an external oscilloscope, which reduces the difficulty of debugging the PCIE link, increases the historical state record, and can observe more historical states. The amount of storable state information can be set according to resources and business conditions, and the chip resources can be used reasonably.

[0083] 2. Use multiple timers to monitor the LTSSM status in real time at key points where failures are prone to occur. If an unexpected link break occurs, the interrupt can be reported to the CPU in a timely manner.

[0084] 3. It can also quickly determine whether the state jump of LTSSM is reasonable based on current business needs to prevent other unexpected states (such as low power consumption state) from occurring during work.

[0085] The disclosed embodiments are mainly used for LTSSM status monitoring and protection in a PCIE controller. The PCIE controller can be debugged and fault analyzed without an external environment such as an oscilloscope, and the LTSSM can be effectively protected. The embodiment is suitable for scenarios with certain security requirements for the LTSSM.

[0086] The present disclosure also provides a PCIE link status monitoring device. Figure 6 As shown, it includes a memory and a processor; the memory stores a computer program that can be executed by the processor, and when the computer program is executed by the processor, any one of the PCIE link status monitoring methods of the embodiments of the present disclosure is implemented.

[0087] Among them, the processor is a device with data processing capabilities, including but not limited to the central processing unit (CPU); the memory is a device with data storage capabilities, including but not limited to random access memory (RAM, more specifically SDRAM, DDR, etc.), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory (FLASH); the I / O interface (read-write interface) is connected between the processor and the memory, and can realize information exchange between the memory and the processor, including but not limited to the data bus (Bus), etc.

[0088] The present disclosure also provides a chip, such as Figure 1 As shown, the chip includes a CPU, a PCIE controller including an LTSSM, and the PCIE link status monitoring device as described above, and the PCIE link status monitoring device is electrically connected to the LTSSM and the CPU.

[0089] The present disclosure also provides an electronic device, such as Figure 7 As shown, it includes a software controller 10 and a chip 20. The chip 20 is the chip as described above. The software controller 10 is electrically connected to the PCIE link status monitoring device.

[0090] Those skilled in the art will appreciate that all or some of the steps, systems, and functional modules / units in the apparatus disclosed above may be implemented as software, firmware, hardware, or a suitable combination thereof.

[0091] In hardware implementations, the division between functional modules / units mentioned in the above description does not necessarily correspond to the division of physical components; for example, one physical component may have multiple functions, or one function or step may be performed by several physical components in cooperation.

[0092] Some physical components or all physical components may be implemented as software executed by a processor, such as a central processing unit (CPU), a digital signal processor or a microprocessor, or implemented as hardware, or implemented as an integrated circuit, such as an application-specific integrated circuit. Such software may be distributed on a computer-readable medium, which may include a computer storage medium (or non-temporary medium) and a communication medium (or temporary medium). As known to those of ordinary skill in the art, the term computer storage medium includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information (such as computer-readable instructions, data structures, program modules or other data). Computer storage media include, but are not limited to, random access memory (RAM, more specifically SDRAM, DDR, etc.), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory (FLASH) or other disk storage; read-only compact disk (CD-ROM), digital versatile disk (DVD) or other optical disk storage; magnetic cassettes, magnetic tapes, disk storage or other magnetic storage; any other medium that can be used to store desired information and can be accessed by a computer. Furthermore, it is well known to those skilled in the art that communication media typically embodies computer readable instructions, data structures, program modules, or other data in a modulated data signal such as a carrier wave or other transport mechanism, and may include any information delivery media.

[0093] The present disclosure has disclosed example embodiments, and although specific terms are employed, they are used and should be interpreted only in a general illustrative sense and not for limiting purposes. In some instances, it will be apparent to those skilled in the art that, unless otherwise expressly stated, features, characteristics, and / or elements described in conjunction with a particular embodiment may be used alone or in combination with features, characteristics, and / or elements described in conjunction with other embodiments. Therefore, those skilled in the art will appreciate that various changes in form and detail may be made without departing from the scope of the present disclosure.

Claims

1. A PCIE link status monitoring method is applied to a high-speed serial computer expansion bus standard PCIE link status monitoring device, wherein the chip to which the PCIE link status monitoring device belongs also includes a central processing unit CPU and a PCIE controller including a link training state machine LTSSM, and the method comprises: Receive status information reported by the LTSSM, and store the status information; When it is determined according to the state information that the LTSSM switches from the low power consumption state to the normal working state, starting a preset first timer; If the low power consumption state is not successfully switched to the normal working state within the first timing duration of the preset first timer, an interrupt is reported to the CPU, and the interrupt is used to trigger the CPU to instruct the software controller to control the LTSSM to reset to the link retraining state.

2. The method according to claim 1, wherein: The low power consumption state includes a software-driven power management PM state and a dynamic power management ASPM state, and the determining, according to the state information, that the LTSSM switches from the low power consumption state to the normal working state includes: When it is determined according to the state information that the LTSSM is in the PM state and an exit low power consumption instruction sent by the software controller is received, determining that the LTSSM is switched from the low power consumption state to the normal working state; When it is determined according to the status information that the LTSSM is in the ASPM state and the PCI bus is in a non-idle state, or when it is determined according to the status information that the LTSSM is in the ASPM state and receives a wake-up instruction sent by the CPU, it is determined that the LTSSM switches from a low power consumption state to a normal working state.

3. The method according to claim 1, wherein: The method further comprises: In a case where it is determined according to the state information that the LTSSM switches from a normal working state to a low power consumption state, verifying the legitimacy of the LTSSM entering the low power consumption state; When it is illegal for the LTSSM to enter a low power consumption state, the interrupt is reported to the CPU.

4. The method according to claim 3, wherein: The verifying the legitimacy of the LTSSM entering the low power consumption state includes: In case that the low power consumption entry instruction sent by the software controller is not received, or the PCI bus is in a non-idle state, it is determined that it is illegal for the LTSSM to enter the low power consumption state.

5. The method according to claim 1, wherein: The method further comprises: When it is determined according to the state information that the LTSSM is in a link training state, starting a preset second timer; If the state of the normal working state is not successfully switched within the second timing duration of the preset second timer, the interruption is reported to the CPU.

6. The method according to claim 5, wherein: The power supply of the PCIE link status monitoring device is different from the power supply of the PCIE controller. After starting the preset second timer, the method further includes: When the PCIE controller is of a preset type and is successfully switched to a normal working state within the second timing duration of the preset second timer, the power supply and clock of the PCIE link state monitoring device are turned off.

7. The method according to any one of claims 1 to 6, wherein: In the case where the low power consumption state is not successfully switched to the normal working state within the first timing duration of the preset first timer, after reporting the interruption to the CPU, and / or in the case where the low power consumption state is not successfully switched to the normal working state within the second timing duration of the preset second timer, after reporting the interruption to the CPU, the method further includes: According to the state information, a state switching abnormality analysis is performed.

8. A PCIE link status monitoring device, comprising a memory and a processor; the memory stores a computer program that can be executed by the processor, and when the computer program is executed by the processor, the PCIE link status monitoring method described in any one of claims 1 to 7 is implemented.

9. A chip comprising a central processing unit (CPU), a PCIE controller comprising a link training state machine (LTSSM), and the PCIE link status monitoring device as claimed in claim 8, wherein the PCIE link status monitoring device is electrically connected to the LTSSM and the CPU.

10. An electronic device, comprising a software controller and the chip according to claim 9, wherein the software controller is electrically connected to the PCIE link status monitoring device.

Citation Information

Cited By

  • PCIe (Peripheral Component Interconnect Express) dynamic degradation type link resetting method and system

    CN121957308A