Disclosure of Invention
In view of the above, the present application provides a local port for bidirectional communication and a port training method, wherein the local port traverses a preset value of a transmission configuration of a link partner port, and selects an optimized preset value of the transmission configuration of the link partner port according to a sum of error rates of two stages of disabling and enabling a receiving module for training, thereby reducing training time and hardware requirements and improving port compatibility.
According to a first aspect of the present invention, there is provided a port training method for bidirectional communication, comprising: receiving test data related to a sending preset value of a link partner port; performing error code monitoring at two stages of forbidding and starting the training of the receiving module, and respectively obtaining a first error rate related to a preset sending value of a link partner port and a second error rate related to the preset sending value of the link partner port and optimized receiving configuration parameters of a local port; and selecting an optimized sending preset value from a plurality of sending preset values of the link partner port according to the first error rate and the second error rate.
Preferably, in the stage of disabling the training of the receiving module, the receiving module of the local port is set by using the fixed receiving configuration parameters.
Preferably, the fixed receiving configuration parameter is used to set an equalizer gain of the receiving module to a fixed value.
Preferably, the equalizer of the receiving module includes at least one of a CTLE module, a DFE module, and a VAG module.
Preferably, the gain of the equalizer is less than 5dB during the period in which the training of the receiving module is disabled.
Preferably, the step of selecting the optimal transmission preset value comprises: and respectively calculating the sum of the first error rate and the second error rate for the plurality of preset transmission values, and selecting the preset transmission value corresponding to the minimum value of the sum of the first error rate and the second error rate as an optimized preset transmission value.
Preferably, before receiving the test data, the method further comprises: and sending the sending preset value request to the link partner port so that the link partner port extracts a sending preset value for sending the test data from the sending preset value request.
Preferably, the method further comprises the following steps: and the local port sends the optimized sending preset value to a link partner port.
Preferably, the optimized transmission preset value is used for setting an equalizer gain of a transmission module of the link partner port during normal communication.
Preferably, the optimized receiving configuration parameter is used for setting an equalizer gain of a receiving module of the local port during normal communication.
According to another aspect of the present invention, there is provided a local port of a bidirectional communication system, comprising: a link layer for receiving and transmitting data; and a SerDes module including a receiving module and a transmitting module connected to the link layer, respectively converting communication data received via the communication medium into reception data of the link layer and converting transmission data of the link layer into communication data transmitted via the communication medium, the communication data being serial data, wherein the local port receives test data related to a transmission preset value of the link partner port during training; performing error code monitoring at two stages of forbidding and starting the training of the receiving module, and respectively obtaining a first error rate related to a preset sending value of a link partner port and a second error rate related to the preset sending value of the link partner port and optimized receiving configuration parameters of a local port; and selecting an optimized sending preset value from a plurality of sending preset values of the link partner port according to the first error rate and the second error rate.
Preferably, in the stage of disabling the training of the receiving module, the receiving module of the local port is set by using the fixed receiving configuration parameters.
Preferably, the receiving module comprises at least one of the following equalizers: CTLE module, DFE module, VAG module.
Preferably, the fixed receiving configuration parameter is used to set an equalizer gain of the receiving module to a fixed value.
Preferably, the gain of the equalizer is less than 5dB during the period in which the training of the receiving module is disabled.
Preferably, the method further comprises the following steps: the first configuration module is used for detecting the error rates under different sending preset values and optimizing receiving configuration parameters during port training; and the second configuration module selects an optimized transmission preset value according to the detection result of the bit error rate, wherein for the plurality of transmission preset values, the second configuration module respectively calculates the sum of the first bit error rate and the second bit error rate, and selects the transmission preset value corresponding to the minimum value of the sum of the first bit error rate and the second bit error rate as the optimized transmission preset value.
Preferably, the sending module of the local port sends the optimized sending preset value to the link partner port.
Preferably, the optimized transmission preset value is used for setting an equalizer gain of a transmission module of the link partner port during normal communication.
Preferably, the optimized receiving configuration parameter is used for setting an equalizer gain of a receiving module of the local port during normal communication.
According to the port training method of the embodiment, the receiving configuration parameters of the receiving module are adjusted iteratively and correspondingly according to the results of error code monitoring in two stages of enabling and disabling the receiving module training, and then the optimal sending preset value and the corresponding receiving configuration parameters are selected according to the test results of the iterative test of a plurality of sending preset values and are respectively used for sending optimization of a link partner port and receiving optimization of a local port. The port training method can reduce the circuit hardware design and area cost of the BIST function.
Detailed Description
The present invention will be described below based on examples, but the present invention is not limited to only these examples. In the following detailed description of the present invention, certain specific details are set forth. It will be apparent to one skilled in the art that the present invention may be practiced without these specific details. Well-known methods, procedures, and procedures have not been described in detail so as not to obscure the present invention. The figures are not necessarily drawn to scale.
The flowcharts and block diagrams in the figures and block diagrams illustrate the possible architectures, functions, and operations of the systems, methods, and apparatuses according to the embodiments of the present invention, and may represent a module, a program segment, or merely a code segment, which is an executable instruction for implementing a specified logical function. It should also be noted that the executable instructions that implement the specified logical functions may be recombined to create new modules and program segments. The blocks of the drawings, and the order of the blocks, are thus provided to better illustrate the processes and steps of the embodiments and should not be taken as limiting the invention itself.
Fig. 1 shows a schematic block diagram of a bi-directional communication system. The electronic device used in the bidirectional communication system may be any one of a computer, a field programmable gate array, and a memory system. The link layer of the electronic device is the second layer of the standardized interconnect communication system model, providing an interface between the electronic device receiving and transmitting data and the SerDes module. The SerDes module of the electronic device realizes the interconversion between parallel data and serial data.
An electronic device for providing data in a two-way communication system is represented by local port 100 and an electronic device for using data is represented by link partner port 200.
Local port 100 includes a link layer and a SerDes module. The SerDes module includes a receiving module 101 and a data deserializer 102 on a receiving channel, and a data serializer 111 and a transmitting module 112 on a transmitting channel.
The receiving module 101 includes an equalization module 1011, a data collector 1012, an RX adaptation module 1014, and a CDR (clock and data recovery) module 1015. The equalization module 1011 includes, for example, a CTLE (continuous time linear equalizer) module, a DFE (decision feedback equalizer) module, and a VAG (variable gain equalizer) module.
During training, the receiving module 101 receives test data from the communication medium and adapts the received data by iteratively selecting a transmit preset value, adjusting an equalizer therein at each iteration to minimize the difference between the transmit data and the receive data. At the end of training, the local port 100 may select an optimal transmission preset value, and optimize configuration parameters of the equalization module 1011, such as adjustable gain coefficients of each equalizer.
During reception, the receiving module 101 receives communication data from the communication medium, and the data deserializer 102 converts serial data into parallel data which is provided to the corresponding link layer.
During transmission, the data serializer 111 converts parallel data from the corresponding link layer into serial data filtered by the transmit filter, and the transmit module 112 drives the filtered serial data onto the corresponding communication medium.
The link layer of the local port 100 includes a first configuration module 121 and a second configuration module 122. The first configuration module 121 detects the error rates and optimized receiving configuration parameters under different preset transmission values during the port training period, and the second configuration module 122 selects the preset optimized transmission value according to the detection result of the error rates. The local port 100 transmits the selected optimized transmission preset value to the link partner port 200.
The link partner port 200 has a functional module corresponding to the local port 100. Link partner port 200 includes a link layer and SerDes modules. The link layer includes a configuration module 221 for reading a PRESET value (PRESET) to update the sending configuration of the link partner port. The SerDes module includes a receive module 201 and a transmit module 211.
During training, the link partner port 200 receives the selected transmission preset value from the local port 100 and sets the configuration parameters of the transmission module 211 with the transmission preset value, while transmitting test data via the transmission module. At the end of the training, the link partner port 200 receives the optimized transmission preset value from the local port 100, and sets the configuration parameters of the transmission module 211 using the optimized transmission preset value.
During reception, the receiving module 201 receives communication data from the communication medium and provides the communication data to the corresponding link layer.
During transmission, the transmission module 211 drives the communication data onto the corresponding communication medium.
In a two-way communication system, error monitoring using hardware associated with the BIST function is required during training to obtain equalizer preset values in the local port and link partner. However, the existing port training method is only suitable for dedicated hardware supporting a specific protocol, and it is difficult to be compatible with ports of different protocols due to the length limitation of the training sequence. For example, in trainingThe error rate during training is actually 10-12Level, the hardware requirements of the counter are high and the training time is also long in order to detect errors. High-rate data communication is required in the process of error code monitoring.
According to the port training method provided by the embodiment of the invention, two-stage error code monitoring is adopted in each iteration, the first stage disables the training of the receiving module to quickly obtain the error code rate related to the sending preset value, and the second stage enables the training of the receiving module to obtain the optimized receiving configuration parameters. After iteratively performing a test of multiple transmit preset values, an optimized transmit preset value is selected for provision to the link partner port, and a local receive module is set with corresponding optimized receive configuration parameters.
Further, the fixed receiving configuration parameters adopted in the first stage can be preset, so that the error rate of the first stage is improved. For example, the peak gain of a CTLE (continuous time linear equalizer) is set to 5dB or less, for example, fixed to 3dB, and the bit error rate during training can be controlled to 10-6A rank. In order to monitor the error code, the hardware requirement of the counter is correspondingly reduced, the training time is also correspondingly shortened, and the data communication speed in the error code monitoring process can be reduced.
Fig. 2 shows a flow chart of a port training method according to an embodiment of the invention.
In step S101, port training is started, and the local port 100 sends a preset value request to the link partner port 200.
In this step, the local port 100 transmits the initial preset value to the link partner port 200. The transmission module 211 of the link partner port 200 has a transmission configuration parameter (TX setting) adjusted according to a PRESET value (PRESET). In the PCIe Gen3/4 standard, there are 10 preset values in total. The initial preset value is one of 10 preset values.
After receiving the default value, the link partner port 200 sets the configuration parameters of the sending module 211 according to the default value, and then sends the test data through the sending module 211.
In step S102, the receiving module 100 of the local port 100 receives test data via the communication medium.
In step S103, the local port 100 disables the receive module training and performs error monitoring to obtain a first error rate associated with the transmitted value. For example, the first configuration module 121 provides the fixed receiving configuration parameters to the receiving module 101, thereby increasing the error rate of the first stage. For example, the peak gain of the CTLE (continuous time linear equalizer) is set to 5dB or less, for example, fixed to 3dB, so that the bit error rate can be controlled to 10-6A rank.
In step S104, the local port 100 enables the receive module training, and performs error monitoring to obtain a second error rate. For example, the first configuration module 121 provides a plurality of different receiving configuration parameters to the receiving module 101 to obtain the bit error rate of the second stage. The training of the receiving module comprises the step of dynamically adjusting receiving configuration parameters according to the error rate until the error rate is converged to a smaller value. The second stage enables receive module training to obtain optimized receive configuration parameters. Thus, the first configuration module 121 obtains the optimized reception configuration parameter corresponding to the transmission preset value and the error rate associated with both the transmission preset value and the optimized reception configuration parameter.
In step S105, the local port 100 calculates a sum of the first error rate and the second error rate.
In step S106, the local port 100 determines whether the transmission preset value of the link partner port 200 has been traversed. If not, the process returns to step S101 and repeats steps S101 to S105. If so, step S107 is further performed.
In step S107, the first configuration module 121 obtains an optimized transmission preset value of the link partner port 200 according to the result of error monitoring in the two stages of enabling and disabling the receiving module training. For example, the optimized transmission preset value is, for example, a transmission preset value corresponding to a minimum value of a sum of the first error rate and the second error rate. Meanwhile, the first configuration module 121 may also obtain an optimized reception configuration parameter corresponding to the optimized transmission preset value.
The second configuration module 122 obtains the optimized transmission preset value of the link partner port 200 from the first configuration module 121.
In step S108, the local port 100 transmits the optimized transmission preset value to the link partner port 200 via the data serializer 111 and the transmission module 112.
In step S109, the link partner port 200 receives the data transmitted by the local module 100, extracts the optimal transmission preset value therefrom, and updates the transmission configuration of the link partner port 200, thereby ending the port training.
According to the port training method of the embodiment, the receiving configuration parameters of the receiving module are adjusted iteratively and correspondingly according to the results of error code monitoring in two stages of enabling and disabling the receiving module training, and then the optimal sending preset value and the corresponding receiving configuration parameters are selected according to the test results of the iterative test of a plurality of sending preset values and are respectively used for sending optimization of a link partner port and receiving optimization of a local port. The port training method can reduce the circuit hardware design and area cost of the BIST function.
Fig. 3 illustrates a data pattern traversing a plurality of transmission preset values in the port training method according to an embodiment of the present invention.
As described above, in the port training method shown in fig. 2, in steps S103 and S104, the first configuration module 121 of the local port 100 monitors the error rate of the received data, and obtains the first error rate associated with the transmission preset value and the second error rate associated with both the transmission preset value and the optimized reception configuration parameter, respectively, according to the results of error monitoring performed in the two stages of disabling and enabling the training of the reception module.
In each iteration of traversing the transmit preset value, the transmit module 211 of the link partner port 200 applies a particular predefined transmit module equalizer gain (i.e., preset value). In the PCIe Gen3/4 standard, there are 10 PRESET values (PRESET).
In phase 1, the local port 100 disables receive module training and reads test data with a small predetermined equalizer gain. For example, the peak gain of CTLE (continuous time linear equalizer) is 5dB or less, and fixed to 3dB, for example. Therefore, the bit error rate BER1-1 mainly depends on the transmission equalizer gain (preset value) of the transmission module 211 of the link partner port 200.
If the signal loss is high, a severe bit error rate can be expected. That is, in phase 1, many bit errors can be monitored even if the sample size is small. Since the test data is read with a small predetermined equalizer gain, it can be monitored normally without hindering the operation of the link layer even if the bit error rate is high.
In phase 2, the local port 100 enables receive module training, i.e. enables receive configuration adaptation functionality of the receive module 101. Therefore, the bit error rate BER1-2Depending on the transmit equalizer gain (preset value) of the transmit module 211 of the link partner port 200 and the receive equalizer gain of the receive module 101 of the local port 100.
Even if the signal loss is high, since the reception configuration adaptation function of the reception module 101 has been enabled, the reception module 101 can appropriately compensate for the signal loss. Therefore, the bit error rate BER1-2Should be very small or even zero, especially when the sample size is small.
The optimized parameter BER obtained by the training method1-1And bit error rate BER1-2Including the optimized transmission preset value of the link partner port 200 and the optimized reception configuration parameter of the local port 100.
The term "module" as used herein may refer to, be part of, or include the following: an Application Specific Integrated Circuit (ASIC), an electronic circuit, a processor (shared, dedicated, or group) and/or memory (shared, dedicated, or group) that executes one or more software or firmware programs, a combinational logic circuit, and/or other suitable components that provide the described functionality.
Those skilled in the art will appreciate that various modules or components according to the present invention may be implemented in hardware, firmware, or software. The software includes, for example, a code program formed using various programming languages such as JAVA, C/C + +/C #, SQL, and the like. Although the steps and sequence of steps of the embodiments of the present invention are presented in method and method diagrams, the executable instructions of the steps implementing the specified logical functions may be re-combined to create new steps. The sequence of the steps should not be limited to the sequence of the steps in the method and the method illustrations, and can be modified at any time according to the functional requirements. Such as performing some of the steps in parallel or in reverse order.
The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention, and various modifications and changes may be made by those skilled in the art. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.