The invention discloses a
USB3.0-based built-in self-test
system, which comprises a generation module, a scrambling module, an alignment module, a descrambling module and a detection module, and is characterized in that the generation 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 data characters in the basic
data stream to form an encoded data
stream, the alignment module performs COM alignment on the encoded data
stream according to control characters in the basic data
stream to form an aligned data stream, and the descrambling module
decodes and descrambles 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. Meanwhile, the invention further discloses a built-in self-test method based on the
USB3.0. According to the scheme, the structure of the whole data packet is completely reflected, all modules of the PCS data stream are covered, the test integrity is improved, and the test precision is also improved.