Link equalization method and device

By selecting link equalization parameters for each channel of the PCIe link and adjusting the channel parameters whose similarity distance is greater than the preset value to make them consistent with adjacent channel parameters, the difference in preset values ​​in the PCIe link that affects link stability is solved. problem and improve link stability.

CN118740744APending Publication Date: 2024-10-01CHENGDU HAIGUANG INTEGRATED CIRCUIT DESIGN CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410773392.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-14
Publication Date
2024-10-01

AI Technical Summary

Technical Problem

In a PCIe link, although the physical hardware environment remains unchanged, there are large differences in the selection of preset values ​​for each channel, which affects link stability.

Method used

By selecting link equalization parameters for each channel, determine the center point of all channels, calculate the similarity distance between each channel and the center point, and adjust the link equalization parameters of the channel whose similarity distance is greater than the preset value so that it is consistent with the adjacent channel Channel parameters with a smaller medium similarity distance are consistent, and the adjusted parameters are used for link balancing.

Benefits of technology

This reduces the difference in preset values ​​between links and improves link stability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118740744A_ABST
    Figure CN118740744A_ABST
Patent Text Reader

Abstract

The invention provides a link balancing method and device. The method comprises the following steps: acquiring a link equalization parameter of each channel; determining center points of link equalization parameters of all channels; calculating a similarity distance between the link equalization parameter of each channel and the central point; for the channel with the similarity distance greater than a preset empirical value, selecting the link equalization parameter of the channel with the smaller similarity distance in the adjacent channels as an adjusted link equalization parameter; and applying the adjusted link equalization parameter to a corresponding channel to perform link equalization. According to the invention, the difference of preset values between links can be reduced, and the link stability is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of data transmission, and in particular to a link balancing method and device. Background Art

[0002] In PCIe (PCIe Express) data transmission, a PCIe link includes multiple lanes from the transmission end (tx) to the receiving end (rx). Link equalization aims to establish a stable connection between devices / chips. By adjusting the settings of the transmission end and the receiving end, the link can be transmitted at a more stable and faster rate.

[0003] Link equalization is achieved through the preset values ​​defined in the PCIe specification. For different link conditions, the system requires the receiving end to send a preset value setting request to the transmitting end, requesting the transmitting end to perform equalization settings of the preset values; the transmitting end sends the completed equalization settings to the receiving end, requiring the receiving end to perform corresponding settings, and finally obtains an optimal transmitting end equalization combination (i.e., the preset value) and the receiving end's eye diagram.

[0004] There are two ways to set the preset value of the transmission end: fix the preset value of all channels of the device or chip to be the same, or, when establishing a link, each channel adaptively selects the appropriate one according to a certain algorithm.

[0005] When the devices or chips are fixed, the preset value of the channel should remain unchanged or change slightly each time the link is established. However, the actual situation is that in the unchanged physical hardware environment, the multiple selections of the preset value of each channel vary greatly, and the selection of the preset value between channels also varies greatly, affecting the stability of the link. Summary of the invention

[0006] The link balancing method and device provided by the present invention can reduce the difference in preset values ​​between links and improve link stability.

[0007] In a first aspect, the present invention provides a link balancing method, wherein the link includes a plurality of channels from a transmitting end to a receiving end, and the method includes:

[0008] Select link equalization parameters for each channel;

[0009] Determine the center point of the link equalization parameters for all channels;

[0010] Calculate the similarity distance between the link equalization parameter of each channel and the center point;

[0011] For a channel whose similarity distance is greater than a preset empirical value, a link balancing parameter of a channel with a smaller similarity distance among adjacent channels is selected as the adjusted link balancing parameter;

[0012] The adjusted link balancing parameters are applied to the corresponding channel to perform link balancing.

[0013] Optionally, the link balancing parameter includes a plurality of preset values;

[0014] Before selecting the link balancing parameters for each channel, the method further includes: sorting the preset values ​​in the preset value set in ascending order of balancing capability and sequentially numbering them;

[0015] The selecting link equalization parameters for each channel includes: adaptively selecting a preset value for each channel from a sorted preset value set, and obtaining a preset value sequence number corresponding to each channel.

[0016] Optionally, determining the center point of the link equalization parameters of all channels includes: calculating an average value of the preset value sequence numbers of all channels to obtain the preset value center point of all channels.

[0017] Optionally, calculating the similarity distance between the link equalization parameter of each channel and the center point includes: calculating the Euclidean distance between the preset value sequence number of each channel and the center point to obtain the similarity distance between the preset value sequence number of each channel and the center point.

[0018] Optionally, the selecting the link equalization parameter of the channel with the smaller similarity distance among the adjacent channels as the adjusted link equalization parameter includes: selecting the preset value sequence number of the channel with the smaller similarity distance among the adjacent channels as the adjusted preset value sequence number;

[0019] The applying the adjusted link balancing parameters to the corresponding channel to perform link balancing includes: applying the preset value related parameters corresponding to the adjusted preset value sequence numbers to the corresponding channel to perform link balancing.

[0020] In a second aspect, the present invention provides a link balancing device, wherein the link includes a plurality of channels from a transmitting end to a receiving end, and the device includes:

[0021] A selection unit, used for selecting link equalization parameters for each channel;

[0022] A determination unit, used to determine the center point of the link equalization parameters of all channels;

[0023] A calculation unit, used to calculate the similarity distance between the link equalization parameter of each channel and the central point;

[0024] An adjustment unit, configured to select, for a channel whose similarity distance is greater than a preset empirical value, a link equalization parameter of a channel whose similarity distance is smaller among adjacent channels as an adjusted link equalization parameter;

[0025] The balancing unit is used to apply the adjusted link balancing parameters to the corresponding channel to perform link balancing.

[0026] Optionally, the link balancing parameter includes a plurality of preset values;

[0027] The device further comprises: a sorting unit, configured to sort and sequentially number each preset value in the preset value set according to the order of the balancing capability from the smallest to the largest before the selection unit selects the link balancing parameter for each channel;

[0028] The selection unit is further used to adaptively select a preset value for each channel from the sorted preset value set to obtain a preset value sequence number corresponding to each channel.

[0029] Optionally, the determining unit is further configured to calculate an average value of the preset value serial numbers of all channels to obtain the preset value center points of all channels.

[0030] Optionally, the calculation unit is further used to calculate the Euclidean distance between the preset value serial number of each channel and the center point to obtain the similarity distance between the preset value serial number of each channel and the center point.

[0031] Optionally, the adjustment unit is further configured to select the preset value sequence number of the channel with the smaller similarity distance among the adjacent channels as the adjusted preset value sequence number;

[0032] The balancing unit is further configured to apply the preset value related parameters corresponding to the adjusted preset value sequence numbers to the corresponding channels to perform link balancing.

[0033] The link balancing method and device provided by the embodiment of the present invention determine the center point of the link balancing parameters of all channels according to the link balancing parameters of each channel, and for a channel whose link balancing parameter has a similarity distance with the center point greater than a preset empirical value, adjust its link balancing parameter to the link balancing parameter of the channel with a smaller similarity distance among adjacent channels before performing link balancing, thereby reducing the difference in link balancing parameters between links and improving link stability. BRIEF DESCRIPTION OF THE DRAWINGS

[0034] Figure 1 A flowchart of a link balancing method according to an embodiment of the present invention;

[0035] Figure 2 A schematic diagram of adaptively selecting a preset value for each channel provided by an embodiment of the present invention;

[0036] Figure 3 A schematic diagram of the Euclidean distance between the preset value sequence number of each channel and the preset value center point provided by an embodiment of the present invention;

[0037] Figure 4 A schematic diagram of the structure of a link balancing device according to an embodiment of the present invention;

[0038] Figure 5 It is a structural diagram of a link balancing device according to another embodiment of the present invention. DETAILED DESCRIPTION

[0039] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0040] The embodiment of the present invention provides a link balancing method, wherein the link includes multiple channels from a transmission end to a receiving end, such as Figure 1 As shown, the method includes:

[0041] S11. Select link balancing parameters for each channel.

[0042] S12. Determine the center point of the link equalization parameters of all channels.

[0043] S13, calculating the similarity distance between the link equalization parameter of each channel and the center point.

[0044] S14. For a channel whose similarity distance is greater than a preset empirical value, a link balancing parameter of a channel whose similarity distance is smaller among adjacent channels is selected as an adjusted link balancing parameter.

[0045] S15: Apply the adjusted link balancing parameters to the corresponding channel to perform link balancing.

[0046] The link balancing method provided by the embodiment of the present invention determines the center point of the link balancing parameters of all channels according to the link balancing parameters of each channel, and for a channel whose link balancing parameter has a similarity distance with the center point greater than a preset empirical value, adjusts its link balancing parameter to the link balancing parameter of a channel with a smaller similarity distance among adjacent channels before performing link balancing, thereby reducing the difference in link balancing parameters between links and improving link stability.

[0047] The link balancing method of the present invention is described in detail below in conjunction with specific embodiments.

[0048] In some cases, link balancing can be achieved by training link balancing parameters, which may have multiple preset values ​​in the PCIe specification. For example, for each lane of a PCIe link, corresponding link balancing parameters may be set. For each lane, it is necessary to match a suitable preset value for its link balancing parameter. In some examples, the suitable preset value for matching the link balancing parameter refers to a combination of different pre-shoots and de-emphasises, which are used to correct the waveform characteristics of the data being transmitted in the corresponding channel. In this embodiment, as Figure 2 As shown, the PCIe link includes, for example, 8 lanes: Lane0-Lane7, and the PCIe specification configures, for example, 11 selectable link balancing parameters for each lane. The 11 link balancing parameters have corresponding preset values ​​(referred to as "preset value sets" in this application), and the preset value set includes, for example, a series of sub-parameters indicated by numbers p0-p10 and corresponding numerical values. The number of channels included in the PCIe link is not limited to 8, and the number of preset values ​​of the link balancing parameters is not limited to 11. The above description is only an example of the present application and does not constitute a limitation on the technical solution of the present invention.

[0049] Table 1

[0050]

[0051] As shown in Table 1, the equalization capability corresponding to each preset value number in p0-p10 is comprehensively reflected by the values ​​of Pre-shoot and De-emphasis corresponding to the preset value number, and the values ​​of Pre-shoot and De-emphasis are configured by the values ​​of the three parameters txX_eq_main (current bit weight coefficient), txX_eq_pre (previous bit weight coefficient) and txX_eq_post (next bit weight coefficient). Specifically, the values ​​of Pre-shoot and De-emphasis can be configured through the three fields txX_eq_main, txX_eq_pre, and txX_eq_post in the register. Among them, txX_eq_main is used to compensate for the main peak of the transmitted data waveform, which can be calculated by txX_eq_pre and txX_eq_post; txX_eq_pre is used to compensate for the front tail of the transmitted data waveform; txX_eq_post is used to compensate for the rear tail of the transmitted data waveform.

[0052] Combine the following Figure 1-Figure 3 , and Tables 1 to 5 describe the link balancing method provided by this embodiment. The link balancing method provided by this embodiment specifically includes the following steps:

[0053] S21. Sort the preset values ​​p0-p10 in the preset value set in ascending order of balancing capability, and number them sequentially. The sequence number of each preset value after sorting is proportional to the balancing capability, so that the sequence number of each preset value can reflect the size of its balancing capability. Finally, the preset value set after sorting is obtained as shown in Table 2:

[0054] Table 2

[0055]

[0056] As shown in Table 2, in the sorted preset value set, the preset value P4 has the smallest balancing capability and is numbered 0; the preset value P7 has the largest balancing capability and is numbered 7.

[0057] S22, adaptively selecting preset values ​​for channels Lane0-Lane7 from the sorted preset value set shown in Table 2, and obtaining the preset value sequence number corresponding to each channel, as shown in Table 3:

[0058] Table 3

[0059]

[0060] like Figure 2 As shown, preset values ​​are adaptively selected for channels Lane0-Lane7 from the sorted preset value sets s_0-s_7 shown in Table 2.

[0061] S23, calculating the preset value center point of channels Lane0-Lane7.

[0062] Since in step S21, the preset values ​​in the preset value set are sorted and numbered sequentially, the obtained serial numbers of the preset values ​​in Table 2 are proportional to the balancing capability, therefore, the preset value serial numbers adaptively selected for each channel in step S23 are also proportional to the balancing capability corresponding to the preset values ​​of each channel. Based on this, when calculating the center point of the preset values ​​of channels Lane0-Lane7, the intermediate value of the preset value serial numbers finally obtained by calculating the preset value serial numbers corresponding to each channel can reflect the balancing capability expressed by the center point of the preset value.

[0063] Specifically, the k-means algorithm can be used to calculate the median value s_means of the preset value numbers of the 8 channels:

[0064] s_means=(7+2+6+7+6+7+7+4) / 8=5.75

[0065] Optionally, other clustering algorithms may be used to calculate the preset value center points of channels Lane0-Lane7, such as k-means++, intelligent k-means, genetic k-means, k-medoids, and k-medians.

[0066] S24, respectively calculating the Euclidean distances between the preset value serial numbers of channels Lane0-Lane7 and the center points of the preset values, to obtain similarity distances between the preset value serial numbers of channels Lane0-Lane7 and the center points of the preset values.

[0067] Specifically, Figure 3 As shown, the similarity distance distance_n between the preset value sequence number s_n of each channel and the intermediate value s_means is calculated according to the following formula:

[0068] distance_n=|s_n-s_means|

[0069] Among them, s_n is the preset value sequence number of lane_n.

[0070] The calculated similarity distances between the preset value sequence numbers s_n and the intermediate values ​​s_means of the channels Lane0-Lane7 are shown in Table 4:

[0071] Table 4

[0072]

[0073] S25. For a channel whose similarity distance is greater than a preset empirical value, select a preset value serial number of a channel whose similarity distance is smaller among adjacent channels as an adjusted preset value serial number.

[0074] The preset experience value may be comprehensively determined based on the distribution of the preset value sequence numbers of each channel, or may be determined based on the results of past link balancing.

[0075] In this embodiment, the preset empirical value distance_s is, for example, 1.5.

[0076] As shown in Table 4, the similarity distance between Lane1 and Lane7 is greater than 1.5, so the preset value numbers of Lane1 and Lane7 need to be adjusted. For Lane1, the preset value numbers of its two adjacent channels, Lane0 and Lane2, are 6 and 7 respectively, so the preset value number of lane1 is adjusted from 2 to 6; for Lane7, its adjacent channel is only Lane6, and the preset value number of Lane6 is 7, so the preset value number of lane7 is adjusted from 4 to 7.

[0077] The preset value sequence numbers of each channel after adjustment are shown in Table 5:

[0078] Table 5

[0079]

[0080] S26. Apply the preset value related parameters corresponding to the adjusted preset value serial numbers in Table 5 to the corresponding channels to perform link balancing.

[0081] As shown in Table 5, the preset value number of Lane 1 after adjustment is 6, and the preset value corresponding to the preset value number 6 in Table 2 is P8. For Lane 1, link balancing is performed according to the relevant parameters corresponding to P8 in Table 1; the preset value number of Lane 7 after adjustment is 7, and the preset value corresponding to the preset value number 7 in Table 2 is P7. For Lane 7, link balancing is performed according to the relevant parameters corresponding to P7 in Table 1. For other channels whose preset value numbers have not been adjusted, link balancing is performed according to the preset value related parameters corresponding to the preset value numbers obtained by the initial adaptive selection.

[0082] The embodiment of the present invention further provides a link balancing device, wherein the link includes a plurality of channels from a transmitting end to a receiving end, such as Figure 4 As shown, the device comprises:

[0083] A selection unit 11, used to select link equalization parameters for each channel;

[0084] A determination unit 12, configured to determine a center point of link equalization parameters of all channels;

[0085] A calculation unit 13, used to calculate the similarity distance between the link equalization parameter of each channel and the central point;

[0086] An adjustment unit 14, configured to select, for a channel whose similarity distance is greater than a preset empirical value, a link equalization parameter of a channel whose similarity distance is smaller among adjacent channels as an adjusted link equalization parameter;

[0087] The balancing unit 15 is configured to apply the adjusted link balancing parameters to the corresponding channel to perform link balancing.

[0088] Optionally, the link balancing parameter includes a plurality of preset values;

[0089] The link balancing device provided by the embodiment of the present invention determines the center point of the link balancing parameters of all channels according to the link balancing parameters of each channel, and for a channel whose link balancing parameter has a similarity distance with the center point greater than a preset empirical value, adjusts its link balancing parameter to the link balancing parameter of a channel with a smaller similarity distance among adjacent channels before performing link balancing, thereby reducing the difference in link balancing parameters between links and improving link stability.

[0090] like Figure 5 As shown, the device also includes:

[0091] The sorting unit 16 is used to sort the preset values ​​in the preset value set in ascending order of balancing capability before the selection unit 11 selects the link balancing parameter for each channel, and to sequentially number them;

[0092] The selection unit 11 is further configured to adaptively select a preset value for each channel from the sorted preset value set to obtain a preset value sequence number corresponding to each channel.

[0093] Optionally, the determination unit 12 is further configured to calculate an average value of the preset value serial numbers of all channels to obtain the preset value center points of all channels.

[0094] Optionally, the calculation unit 13 is further configured to calculate the Euclidean distance between the preset value serial number of each channel and the central point to obtain the similarity distance between the preset value serial number of each channel and the central point.

[0095] Optionally, the adjusting unit 14 is further configured to select the preset value sequence number of the channel with the smaller similarity distance among the adjacent channels as the adjusted preset value sequence number;

[0096] The balancing unit 15 is further configured to apply the preset value related parameters corresponding to the adjusted preset value sequence numbers to the corresponding channels to perform link balancing.

[0097] The device of this embodiment can be used to execute the technical solution of the above method embodiment. Its implementation principle and technical effect are similar and will not be repeated here.

[0098] The link balancing parameters in the embodiment of the present invention are described by taking preset values ​​as an example, but are not limited thereto, and may also be other parameters of the transmitting end or receiving end with fluctuations for link balancing.

[0099] Those skilled in the art can understand that all or part of the processes in the above method embodiments can be implemented by instructing related hardware through a computer program, and the program can be stored in a computer-readable storage medium, and when the program is executed, it can include the processes in the above method embodiments. The storage medium can be a disk, an optical disk, a read-only memory (ROM) or a random access memory (RAM), etc.

[0100] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any changes or substitutions that can be easily thought of by a person skilled in the art within the technical scope disclosed by the present invention should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims.

Claims

1. A link balancing method, wherein the link comprises a plurality of channels from a transmitting end to a receiving end, characterized in that: The method comprises: Select link equalization parameters for each channel; Determine the center point of the link equalization parameters for all channels; Calculate the similarity distance between the link equalization parameter of each channel and the center point; For a channel whose similarity distance is greater than a preset empirical value, a link balancing parameter of a channel with a smaller similarity distance among adjacent channels is selected as the adjusted link balancing parameter; The adjusted link balancing parameters are applied to the corresponding channel to perform link balancing.

2. The method according to claim 1, characterized in that The link balancing parameters include a plurality of preset values; Before selecting the link balancing parameters for each channel, the method further includes: sorting the preset values ​​in the preset value set in ascending order of balancing capability and sequentially numbering them; The selecting link equalization parameters for each channel includes: adaptively selecting a preset value for each channel from a sorted preset value set, and obtaining a preset value sequence number corresponding to each channel.

3. The method according to claim 2, characterized in that Determining the center point of the link equalization parameters of all channels includes: calculating the average value of the preset value sequence numbers of all channels to obtain the preset value center point of all channels.

4. The method according to claim 3, characterized in that Calculating the similarity distance between the link equalization parameter of each channel and the center point includes: calculating the Euclidean distance between the preset value sequence number of each channel and the center point to obtain the similarity distance between the preset value sequence number of each channel and the center point.

5. The method according to claim 4, characterized in that The selecting the link equalization parameter of the channel with the smaller similarity distance among the adjacent channels as the adjusted link equalization parameter comprises: selecting the preset value sequence number of the channel with the smaller similarity distance among the adjacent channels as the adjusted preset value sequence number; The applying the adjusted link balancing parameters to the corresponding channel to perform link balancing includes: applying the preset value related parameters corresponding to the adjusted preset value sequence numbers to the corresponding channel to perform link balancing.

6. A link balancing device, wherein the link comprises a plurality of channels from a transmitting end to a receiving end, characterized in that: The device comprises: A selection unit, used for selecting link equalization parameters for each channel; A determination unit, used to determine the center point of the link equalization parameters of all channels; A calculation unit, used to calculate the similarity distance between the link equalization parameter of each channel and the central point; An adjustment unit, configured to select, for a channel whose similarity distance is greater than a preset empirical value, a link equalization parameter of a channel whose similarity distance is smaller among adjacent channels as an adjusted link equalization parameter; The balancing unit is used to apply the adjusted link balancing parameters to the corresponding channel to perform link balancing.

7. The device according to claim 6, characterized in that The link balancing parameters include a plurality of preset values; The device further comprises: a sorting unit, configured to sort and sequentially number each preset value in the preset value set according to the order of the balancing capability from the smallest to the largest before the selection unit selects the link balancing parameter for each channel; The selection unit is further used to adaptively select a preset value for each channel from the sorted preset value set to obtain a preset value sequence number corresponding to each channel.

8. The device according to claim 7, characterized in that The determining unit is further used to calculate the average value of the preset value serial numbers of all channels to obtain the preset value center points of all channels.

9. The device according to claim 8, characterized in that The calculation unit is further used to calculate the Euclidean distance between the preset value serial number of each channel and the central point to obtain the similarity distance between the preset value serial number of each channel and the central point.

10. The device according to claim 9, characterized in that The adjustment unit is further used to select the preset value sequence number of the channel with the smaller similarity distance among the adjacent channels as the adjusted preset value sequence number; The balancing unit is further configured to apply the preset value related parameters corresponding to the adjusted preset value sequence numbers to the corresponding channels to perform link balancing.