USB3.0-based built-in self-test method and system
By adding control characters to the built-in self-test system of USB3.0 and scrambling, encoding, aligning and decoding the data stream, it solves the problem that the existing technology cannot fully reflect the data packet structure and simulate the actual working conditions, and achieves high-level Coverage and high-accuracy self-testing.
Patent Information
- Application Number
- CN202411378889.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-30
- Publication Date
- 2025-01-24
AI Technical Summary
The existing built-in self-test technology based on USB3.0 cannot fully reflect the structure of the entire data packet and cannot traverse all data modules of PCS, resulting in incomplete self-test coverage and inability to simulate actual working conditions.
Adopt a built -in self -test method and system based on USB3.0, to generate control characters in the data stream by generating modules to form basic data streams, and to add modules, alignment modules, interpretation modules, and detection modules to data flow on the data flow to the data flow Add disturbance, encoding, COM alignment and decoding to form test data streams, which in turn compares with the benchmark data stream.
A complete manifestation of the entire data packet structure is achieved, all modules covering the PCS data stream, improving the integrity and accuracy of the test, which can fully simulate the actual working conditions, and improve the self -test coverage.
Smart Images

Figure CN119360930A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of chip testing, and more particularly to a built-in self-test method based on USB 3.0. Background Art
[0002] The commonly used built-in self-test technology based on USB3.0 mainly completes the BIST (built-in self-test) function by adding a PRBS (pseudo-random binary sequence) generator and detector in the PCS (physical coding sublayer).
[0003] The PRBS generator is usually composed of an LFSR (linear feedback shift register) and an XOR circuit. By selecting a primitive polynomial and SEED (seed value) to generate a corresponding pseudo-random binary sequence, this method can be used to simulate a real data stream.
[0004] The PRBS detector usually includes an internal PRBS generator and a detection circuit. The internal PRBS generator and the external PRBS generator of the PRBS detector usually have the same primitive polynomial and SEED, so that the PRBS generated by the internal PRBS generator is compared with the received PRBS (external PRBS generator) to determine whether the received data is correct.
[0005] Although the above method can simulate the real data flow, the data goes in and out directly and does not contain control characters (control characters generally need to include COM characters, which are used for data alignment, and COM characters refer to K28.5 after 8b / 10b encoding). Therefore, it is impossible to traverse all data modules of PCS, that is, the complexity of the data obtained from the test is low and it cannot complete the test of some specific functions and cannot simulate the actual working conditions.
[0006] Therefore, in the existing USB3.0-based built-in self-test technology, although the PRBS generator can generate a pseudo-random sequence, only the payload data in the real data packet can be regarded as a pseudo-random sequence similar to that generated by the PRBS generator, while the actual data packet usually contains a header, a payload, an ECC, and an end. In other words, a simple pseudo-random sequence cannot fully reflect the structure of the entire data packet, nor can it verify all modules in the PCS for the data stream, resulting in incomplete self-test coverage.
[0007] Therefore, it is necessary to provide an improved built-in self-test method based on USB 3.0 to overcome the above defects. Summary of the invention
[0008] The purpose of the present invention is to provide a built-in self-test method and system based on USB3.0, in which the structure of the entire data packet is fully embodied, all modules of the PCS data stream are covered, the integrity of the test is improved, and the test accuracy is also improved.
[0009] To achieve the above-mentioned purpose, the present invention provides a built-in self-test system based on USB3.0, which includes a generation module, a scrambling module, an alignment module, a descrambling module and a detection module. The generation module generates control characters and adds them to an existing data stream to form a basic data stream. The scrambling module scrambles and encodes data characters in the basic data stream to form a coded data stream. The alignment module performs COM alignment on the coded data stream according to the control characters in the basic data stream and forms an aligned data stream. The descrambling module decodes and descrambles the data characters in the aligned data stream to form a test data stream. The detection module compares the test data stream with the reference data stream to detect the consistency of the two data streams.
[0010] Preferably, the basic data stream formed in the generation module includes a header control character, a data character, an intermediate control character and an ending control character, the header control character is at the starting position of the basic data stream, and the ending control character is at the ending position of the basic data stream, the data characters and the intermediate control characters between the header control character and the ending control character are arranged alternately in sequence, and the data characters are obtained by filling with data 0.
[0011] Preferably, the alignment module identifies whether the header control character in the coded data stream is a COM character, discards characters before the COM character in the current coded data stream, takes the COM character as the starting position of the coded data stream, and performs COM alignment on the coded data stream.
[0012] Preferably, the generating module further generates an indication signal corresponding to the data character, and sends the indication signal to the scrambling module, and the scrambling module scrambles and encodes the data character of the basic data stream according to the indication signal.
[0013] Preferably, the detection module checks the reference data stream to determine whether the head control character and the tail control character of the test data stream are the same, and determines whether the number of received data characters meets the design requirements.
[0014] At the same time, the present invention also discloses a built-in self-test method based on USB3.0, comprising the following steps: a. adding a head control character to the head of an existing data stream and adding a tail control character to the tail of the existing data stream, and making multiple groups of data characters located between the head control character and the tail control character to form a basic data stream; b. scrambling and encoding the data characters in the basic data stream according to an indication signal to form a coded data stream; c. COM aligning the coded data stream according to the head control character to form an aligned data stream; d. decoding and descrambling the data characters in the aligned data stream according to the indication signal to form a test data stream; e. comparing the test data stream with the reference data stream to detect the consistency of the two data streams.
[0015] Preferably, the basic data stream formed in step a includes a header control character, a data character, an intermediate control character and an end control character, the header control character is at the starting position of the basic data stream, and the end control character is at the end position of the basic data stream, the data characters and the intermediate control characters are alternately arranged between the header control character and the end control character until the end of the end control character, and the data characters are obtained by filling with data 0.
[0016] Preferably, in the step c, specifically, when it is determined that the header control character is a COM character, the characters before the COM character in the current coded data stream are discarded, so that the COM character is used as the starting position of the coded data stream.
[0017] Preferably, in step e, the header control characters and the tail control characters of the reference data stream and the test data stream are compared to see whether they are the same, and it is determined whether the number of data characters in the test data stream meets the design requirements.
[0018] Compared with the prior art, the USB3.0-based built-in self-test method and system of the present invention adds a header control character to the header of an existing data stream and adds a tail control character to the tail of an existing data stream, and only scrambles, encodes, COM aligns, decodes and descrambles the data characters in the data stream of each stage in sequence, so that the data streams of each stage formed can reflect the structure of the entire data packet, and also makes the process of the data characters from the basic data stream to the test data stream basically the same as the process experienced by the actual data stream, so that all data modules of the PCS can be traversed, the actual working conditions can be fully simulated, the coverage of the self-test is improved, and the accuracy of the test results is further improved.
[0019] The present invention will become more apparent from the following description taken in conjunction with the accompanying drawings, which are used to illustrate embodiments of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] Figure 1The structure diagram of the built-in self-test system based on USB3.0 of the present invention is shown in FIG.
[0021] Figure 2 The figure is a flow chart of the USB 3.0-based built-in self-test method of the present invention. DETAILED DESCRIPTION
[0022] Embodiments of the present invention are now described with reference to the accompanying drawings, in which like element numbers represent like elements. As described above, the present invention provides a built-in self-test method and system based on USB3.0, in which the structure of the entire data packet is fully embodied, covering all modules of the PCS data stream, improving the test integrity and improving the test accuracy.
[0023] Please refer to Figure 1 , Figure 1 FIG. 1 is a block diagram of a USB 3.0-based built-in self-test system of the present invention. Figure 1 As shown, the USB3.0-based built-in self-test system of the present invention includes a generation module, a scrambling module, an alignment module, a descrambling module and a detection module. The generation module generates control characters and adds them to the existing data word stream to form a basic data stream, the scrambling module scrambles and encodes the data characters in the basic data stream to form a coded data stream, the alignment module performs COM alignment on the coded data stream according to the control characters in the basic data stream, and forms an aligned data stream, the descrambling module decodes and descrambles the data characters in the aligned data stream to form a test data stream, and the detection module compares the test data stream with the reference data stream to detect the consistency of the two data streams. As described above, the USB3.0-based built-in self-test system of the present invention generates various control characters through the generation module, and adds each control character to the corresponding position of the existing data stream, and scrambles, encodes, COM aligns, decodes and descrambles the data characters in the data stream of each stage in turn, so that the data streams of each stage formed can reflect the structure of the entire data packet, so that all data modules of the PCS can be traversed, and the actual working conditions can be fully simulated, thereby improving the coverage of the self-test and further improving the accuracy of the test results.
[0024] Specifically, the basic data stream includes a header control character, a data character, an intermediate control character and an end control character, the header control character is at the starting position of the basic data stream, and the end control character is at the end position of the basic data stream, the data characters and the intermediate control characters between the header control character and the end control character are alternately arranged in sequence, and the data characters are obtained by filling with data 0; wherein, in a specific application process, a state machine is preset inside the generation module, and when started, the internal state machine generates 0xbc and 0xfc as header control characters, and at the same time generates 0x3c as an intermediate control character, and generates 0x7c as an end control character. In the basic data stream, starting with the header control characters (0xbc and 0xfc), the intermediate data characters (data 0) and the intermediate control characters (0x3c) are alternately arranged in sequence until the end control character (0x7c) ends, thereby forming a complete basic data stream.
[0025] The scrambling module scrambles and encodes the data characters in the basic data stream to form a coded data stream. In the scrambling module, the data characters (data 0) in the basic data stream are scrambled to form a pseudo-random sequence, but each control character is not scrambled; specifically, the generating module also generates an indication signal corresponding to the data character, and sends the indication signal to the scrambling module. The scrambling module scrambles the data characters of the basic data stream according to the indication signal, and each control character does not have a corresponding indication signal, so each control character is not scrambled, that is, the coded data stream is exactly the same as each control character of the basic data stream. In addition, if the system is currently in the BIST (built-in self-test) mode, the scrambled data stream will be strobed and output, and the strobed data stream will be encoded by 8b / 10b, and then output to the PMA (physical medium adaptation layer) through the FIFO buffer, so as to complete the sending function of the data stream in the BIST mode and form a complete coded data stream. The 8b / 10b encoding can achieve functions such as DC balance and clock recovery, and the extra code (K code) can also be used to achieve control and help align modules.
[0026] The alignment module identifies whether the header control character in the encoded data stream is a COM character, and discards the characters before the COM character in the current encoded data stream, takes the COM character as the starting position of the encoded data stream, and performs COM alignment on the encoded data stream; specifically, when the alignment module identifies the COM character in the encoded data stream, if there are other characters before the COM character in the encoded data stream, all the characters before the COM character are removed to avoid the generated basic data stream not starting from the header control character, thereby effectively removing possible garbled characters and improving the accuracy of the test results.
[0027] In addition, the descrambling module decodes and descrambles the data characters in the aligned data stream according to the indication signal carried by the data characters in the aligned data stream and forms a test data stream, but does not decode and descramble the control characters in the aligned data stream, so that each control character in the test data stream is the same as each control character in the encoded data stream, the aligned data stream and the basic data stream. Among them, the processing process of the aligned data stream by the descrambling module is completely opposite to the processing of the basic data stream by the scrambling module, which will not be described in detail here.
[0028] As described above, the basic data stream generated by the generating module is finally formed into a test data stream after the data characters are scrambled, encoded, decoded and descrambled by the scrambling module and the descrambling module, and the process from the basic data stream to the test data stream is basically the same as the process experienced by the actual data stream, so that all data modules of the PCS can be traversed, and the actual working conditions can be fully simulated, further improving the accuracy of the test results. Among them, the specific processes of scrambling, encoding, decoding and descrambling of data characters are well known to those skilled in the art and will not be described in detail here.
[0029] In addition, in the present invention, the detection module checks whether the header control characters and the tail control characters of the test data stream are the same through the reference data stream, and determines whether the number of received data characters meets the design requirements; specifically, if the header control characters and the tail control characters of the test data stream respectively correspond to the header control characters and the tail control characters of the reference data stream, and the number of received data characters also meets the design requirements, a BIST success signal is output, otherwise a BIST failure signal is output; that is, a complete self-test process is completed.
[0030] As described above, the built-in self-test system based on USB3.0 of the present invention generates various control characters through the generation module and adds them to the corresponding positions of the existing data stream, and scrambles and encodes the data characters through the scrambling module, COM aligns through the alignment module, and decodes and descrambles the data characters through the descrambling module, so that the data streams formed in each stage can reflect the structure of the entire data packet, so that all data modules of the PCS can be traversed, the actual working conditions can be fully simulated, the coverage of the self-test is improved, and the accuracy of the test results is further improved.
[0031] Please refer to Figure 2 , describes the built-in self-test method based on USB3.0 of the present invention. Figure 2 As shown, the USB 3.0-based built-in self-test method of the present invention comprises the following steps:
[0032] Step S001, adding a head control character to the head of an existing data stream and adding a tail control character to the tail of the existing data stream, and making multiple groups of data characters located between the head control character and the tail control character to form a basic data stream; in this step, by adding control characters to the head and tail of the existing data stream, the other data streams formed can traverse all data modules of the PCS, thereby expanding the integrity of the test and improving the accuracy of the test; in addition, the basic data stream formed in this step includes a head control character, a data character, an intermediate control character and an end control character, the head control character is at the starting position of the basic data stream, and the end control character is at the end position of the basic data stream, between the head control character and the end control character, the data character and the intermediate control character are alternately arranged in sequence until the end of the end control character, and the data character is obtained by filling with data 0; wherein, the existing data stream mainly refers to the data character, each control character (head control character, intermediate control character and end control character) is generated by a state machine preset in its system, and an indication signal corresponding to the data character is also generated, and the indication signal is used to mark or indicate the data character in subsequent steps.
[0033] Step S002, scrambling and encoding the data characters in the basic data stream according to the indication signal to form a coded data stream; in this step, the data characters (data 0) in the basic data stream are scrambled to form a pseudo-random sequence, but each control character is not scrambled; specifically, the basic data stream is scrambled according to the indication signal corresponding to the data character, and each control character does not have a corresponding indication signal, so each control character is not scrambled, that is, the coded data stream is exactly the same as each control character of the basic data stream; in addition, in the BIST (built-in self-test) mode, the scrambled data stream will be enabled for output, the enabled data stream will be encoded through 8b / 10b, and then output to the PMA (physical medium adaptation layer) through the FIFO buffer, thereby completing the sending function of the data stream in the BIST mode and forming a complete coded data stream.
[0034] Step S003, COM alignment is performed on the encoded data stream according to the header control character to form an aligned data stream; in this step, it is identified whether the header control word in the encoded data stream is a COM character. When the COM character in the encoded data stream is identified, all characters before the COM character in the encoded data stream are removed, so as to use the COM character as the starting position of the encoded data stream to avoid the formation of a basic data stream that does not start from the header control character, which can effectively remove possible garbled characters and improve the accuracy of the test results.
[0035] Step S004, decode and descramble the data characters in the aligned data stream according to the indication signal to form a test data stream; in this step, contrary to the step S002, the data characters in the aligned data stream are sequentially decoded and descrambled according to the indication signal, and similarly, no operation is performed on each control character, and a test data stream is formed, so that each control character in the test data stream is the same as each control character in the coded data stream, the aligned data stream and the basic data stream. Until the descrambling process is completed in this step, the scrambling, encoding, decoding and descrambling of the data characters in the aforementioned steps finally form a test data stream, that is, the process from the basic data stream to the test data stream is basically the same as the process experienced by the actual data stream, so that all data modules of the PCS can be traversed, and the actual working conditions can be fully simulated, further improving the accuracy of the test results. Among them, the specific processes of scrambling, encoding, decoding and descrambling of data characters are well known to those skilled in the art, and will not be described in detail here.
[0036] Step S005, compare the test data stream with the reference data stream to detect the consistency of the two data streams; in this step, by comparing the test data stream with the reference data stream, it is detected whether the two data streams are consistent so as to complete the self-test process; specifically, compare whether the header control characters and the tail control characters of the reference data stream and the test data stream are the same, and determine whether the number of data characters in the test data stream meets the requirements. If the header control characters and the tail control characters of the test data stream correspond to the header control characters and the tail control characters of the reference data stream, respectively, and the number of received data characters also meets the design requirements, then a BIST success signal is output, otherwise a BIST failure signal is output; at this point, a complete self-test process is completed.
[0037] As described above, the built-in self-test method based on USB3.0 of the present invention adds the header control characters and the end control characters to the corresponding positions of the existing data stream, and scrambles, encodes, COM aligns, decodes, and descrambles the data characters of the data stream at each stage, so that the data stream at each stage can reflect the structure of the entire data packet. Therefore, the built-in self-test method of the present invention can traverse all data modules of the PCS, can fully simulate the actual working conditions, improve the coverage of the self-test, and further improve the accuracy of the test results.
[0038] The present invention has been described above in conjunction with the best embodiments, but the present invention is not limited to the embodiments disclosed above, but should cover various modifications and equivalent combinations based on the essence of the present invention.
Claims
1. A built-in self-test system based on USB3.0, characterized in that: The invention comprises a generating module, a scrambling module, an alignment module, a descrambling module and a detecting module. The generating module generates control characters and adds the control characters to an existing data stream to form a basic data stream. The scrambling module scrambles and encodes the data characters in the basic data stream to form a coded data stream. The alignment module performs COM alignment on the coded data stream according to the control characters in the basic data stream to form an aligned data stream. The descrambling module decodes and descrambles the data characters in the aligned data stream to form a test data stream. The detecting module compares the test data stream with the reference data stream to detect the consistency of the two data streams.
2. The USB 3.0 based built-in self-test system as claimed in claim 1, characterized in that: The basic data stream formed in the generation module includes a header control character, a data character, an intermediate control character and an end control character. The header control character is at the starting position of the basic data stream, and the end control character is at the end position of the basic data stream. The data characters and the intermediate control characters between the header control character and the end control character are arranged alternately in sequence, and the data characters are obtained by filling with data 0.
3. The USB 3.0 based built-in self-test system as claimed in claim 2, characterized in that: The alignment module identifies whether the head control character in the coded data stream is a COM character, discards the characters before the COM character in the current coded data stream, takes the COM character as the starting position of the coded data stream, and performs COM alignment on the coded data stream.
4. The USB 3.0 based built-in self-test system as claimed in claim 2, characterized in that: The generating module further generates an indication signal corresponding to the data character, and sends the indication signal to the scrambling module, and the scrambling module scrambles and encodes the data character of the basic data stream according to the indication signal.
5. The USB 3.0 based built-in self-test system as claimed in claim 4, characterized in that: The detection module checks the reference data stream to determine whether the head control character and the end control character of the test data stream are the same, and determines whether the number of received data characters meets the design requirements.
6. A built-in self-test method based on USB3.0, characterized in that: The steps include: a. Add a header control character to the head of an existing data stream and add a tail control character to the tail of an existing data stream, and place multiple groups of data characters between the header control character and the tail control character to form a basic data stream; b. Scramble and encode the data characters in the basic data stream according to the indication signal to form an encoded data stream; c. Perform COM alignment on the encoded data stream according to the header control characters to form an aligned data stream; d. Decode and descramble the data characters in the alignment data stream according to the indication signal to form a test data stream; e. Compare the test data stream with the reference data stream to detect the consistency of the two data streams.
7. The USB 3.0-based built-in self-test method according to claim 6, characterized in that: The basic data stream formed in step a includes a header control character, a data character, an intermediate control character and an end control character. The header control character is at the starting position of the basic data stream, and the end control character is at the end position of the basic data stream. The data characters and the intermediate control characters are alternately arranged between the header control character and the end control character until the end of the end control character, and the data characters are obtained by filling with data 0.
8. The USB 3.0-based built-in self-test method according to claim 6, wherein: In the step c, specifically, when it is determined that the header control character is a COM character, the characters before the COM character in the current coded data stream are discarded, so that the COM character is used as the starting position of the coded data stream.
9. The USB 3.0-based built-in self-test method according to claim 6, wherein: In step e, the header control characters and the tail control characters of the reference data stream and the test data stream are compared to see whether they are the same, and it is determined whether the number of data characters in the test data stream meets the design requirements.
Citation Information
Cited By
Implementation method and system for PCIE physical layer built-in self-test code
CN120066873A
Implementation method and system for pcie physical layer built-in self-test code
CN120066873B