USB host verification method
By adopting the USB host verification method based on UVM and VIP modules in the on-chip system, the problem of low USB host verification efficiency is solved, and comprehensive coverage of function points and efficiency improvement are achieved.
Patent Information
- Application Number
- CN202411043075.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-31
- Publication Date
- 2024-08-30
- Estimated Expiration
- 2044-07-31
AI Technical Summary
There is a problem of inefficiency in verifying the USB host that supports the XHCI protocol in the system-on-chip, mainly due to the complexity of the driver software involved in the protocol and the maintenance requirements for a large number of table entries and data structures.
Using the USB host verification method based on verification methodology (UVM) and intellectual property verification (VIP) module, by extracting test function points, build a verification system, instantiate interfaces and modules, establish data connections, generate test sequences and use cases, one by one Debugging and performing coverage regression operations to ensure full coverage of function points.
It achieves comprehensive coverage of USB host test function points, simplifies the verification process, and significantly improves verification efficiency.
Smart Images

Figure CN118569157A
Abstract
Description
Technical Field
[0001] The invention relates to the field of chip testing, and in particular to a USB host verification method. Background Art
[0002] Universal Serial Bus (USB) is a serial bus standard for connecting computer systems and external devices. It is used to regulate the connection and communication process between computers and external devices.
[0003] Usually, the USB system consists of three components: USB host, USB device, and USB hub. These three components communicate in accordance with the USB protocol specification. The eXtensible Host Controller Interface (XHCI) protocol is the USB 3.0 interface standard.
[0004] Verification of the USB host is an important process to ensure that its design and functionality are reliable and error-free in actual applications. Verification is usually divided into two parts: hardware and software, involving a variety of test methods and tools to ensure that the USB host chip can correctly communicate with various USB devices. USB host verification mainly includes the following aspects: functional verification, performance verification, compatibility verification, electrical characteristics verification, stability and reliability verification, security verification, etc.
[0005] Verifying a USB host that supports the XHCI protocol in a System on Chip (SoC) is challenging because the protocol involves the cooperation of driver software, which requires the establishment and maintenance of a large number of table entries and data structures to monitor and drive the working status of the ports and interfaces of multiple devices mounted under the USB host, as well as the data reception and transmission process, resulting in low verification efficiency.
[0006] In order to overcome the above technical problems of the prior art, the present invention provides a USB host verification method, which can cover and verify all functional points of the USB host module and can effectively improve the verification efficiency. Summary of the invention
[0007] In order to alleviate or partially alleviate the above technical problems, the solution of the present invention is as follows: A USB host authentication method comprises the following steps: Step 1: Extract test function points according to the functions and protocol specifications of the USB host; Step 2: Build a verification system, instantiate several interfaces in the top layer of the verification, and instantiate several verification modules, and establish data connection relationships between the verification modules; initialize the verification environment layer and the USB host, generate test sequences and test cases, and start the verification system; wherein the several verification modules include agent modules, reference models, and aligners; the agent modules include USB device intellectual property core verification agent modules, XHCI protocol agent modules, sequence generators, and drivers; Step 3: Sending a transmission packet to the sequence generator in the proxy module through the test sequence, the driver in the proxy module requests the transmission packet from the sequence generator in the proxy module, and then drives the data to the interface of the proxy module; Step 4: The USB host processes the input data of the USB host and obtains the output data of the USB host; collects the output data of the USB host, converts it into a transmission packet, and sends it to the reference model and the comparator; Step 5: The reference model converts the input data of the reference model into an uplink transmission packet or a downlink transmission packet, and performs consistency comparison with the transmission packet output by the USB protocol monitor in the USB device intellectual property core verification agent module and the transmission packet output by the XHCI protocol driver in the XHCI protocol agent module in the comparator; Step 6: According to the test function points, the coverage collector is connected to the multiple monitors in the proxy module respectively to build a test function point coverage model; Step 7: Debug each test case one by one, and check whether the inspection results in all verification modules and the data comparison results in the comparator are normal.
[0008] Furthermore, the USB host verification method also includes the following steps: Step 8: Execute a regression operation including coverage, and for test function points that have not been covered, add or modify test cases to cover the test function points that have not been covered.
[0009] Furthermore, the plurality of interfaces include: an instantiated USB intellectual property core verification module interface, an instantiated AXI slave interface, an instantiated AXI host interface and an instantiated APB configuration interface.
[0010] Furthermore, the sequence generator includes: a USB protocol sequence generator, an application side AXI bus sequence generator, an APB configuration interface sequence generator and an XHCI protocol sequence generator.
[0011] Furthermore, the proxy module also includes: an application-side AXI bus proxy module and an APB configuration interface proxy module.
[0012] Furthermore, the multiple monitors include: a USB protocol monitor in the USB device intellectual property core verification agent module, an application side AXI bus monitor in the application side AXI bus agent module, and an APB configuration interface monitor in the APB configuration interface agent module.
[0013] Furthermore, the verification system includes: a register model and a configuration class; in the step five, the reference model also converts the configuration data of the register model and the switch configuration data in the configuration class into an uplink transmission packet or a downlink transmission packet.
[0014] Furthermore, the test function points include one or more of the following: data transceiver path, USB protocol compliance, enumeration process, link training, low power mode, clock reset, and register access.
[0015] Furthermore, the verification environment layer is a container for creating, starting and scheduling the plurality of verification modules.
[0016] Further, the instantiated AXI slave interface is connected to the AXI host port included in the USB host; the instantiated AXI host interface is connected to the AXI slave port included in the USB host; the instantiated APB configuration interface is connected to the APB configuration port included in the USB host; the instantiated USB intellectual property core verification module interface is connected to the USB physical layer port included in the USB host.
[0017] The technical solution of the present invention has the following beneficial technical effects: The present invention provides a USB host verification method based on Universal Verification Methodology (UVM) and Verification Intellectual Property (VIP) modules, which can easily achieve comprehensive coverage of USB host test function points, simplify the process, and effectively improve verification efficiency.
[0018] In addition, other beneficial effects of the present invention will be mentioned in the specific embodiments. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] Figure 1 This is a flow chart of the main steps of the USB mainstream verification method proposed by the present invention; Figure 2 It is a detailed step flow chart of the USB host authentication method proposed by the present invention. DETAILED DESCRIPTION
[0020] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are 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.
[0021] Figure 1 This is a flow chart of the main steps of the USB mainstream verification method proposed by the present invention. The USB host verification method mainly includes the following steps: (1) Extract test function points, build and start the verification system; (2) Verify each test function point based on the verification module and test cases; the verification modules here include: reference model, comparator, proxy module, etc.
[0022] (3) For uncovered test function points, add or modify test cases to achieve comprehensive coverage of test function points.
[0023] Figure 2 The following is a detailed flow chart of the USB host authentication method proposed by the present invention. The USB host authentication method specifically includes the following steps: Step 1: Extract test function points according to the USB host's functions and protocol specifications.
[0024] The design module to be tested in the present invention is a USB host, which includes a USB physical layer port, a USB host controller, an Advanced eXtensible Interface (AXI) host port, an AXI slave port and an Advanced Peripheral Bus (APB) configuration port.
[0025] Specifically, the protocol specifications include USB 3.0 protocol specifications and XHCI protocol specifications.
[0026] Preferably, according to the specifications and design schemes of the USB 3.0 protocol, the XHCI protocol and the USB host to be tested, test function points are extracted and a verification plan is formulated.
[0027] Furthermore, the test function points include one or more of the following: data transceiver path, USB protocol compliance, enumeration process, link training, low power mode, clock reset, and register access.
[0028] Step 2: Build the verification system, instantiate several interfaces in the top layer of the verification, instantiate several verification modules, and establish data connection relationships between the verification modules; initialize the verification environment layer and USB host, generate test sequences and test cases, and start the verification system.
[0029] The several verification modules include: a comparator, a reference model, and an agent module.
[0030] The proxy module in the present invention includes: a USB device intellectual property core verification proxy module, an application-side AXI bus proxy module, an APB configuration interface proxy module, and an XHCI protocol proxy module. The proxy module includes a driver and a sequence generator. Specifically, the aforementioned USB device intellectual property core verification proxy module, the application-side AXI bus proxy module, the APB configuration interface proxy module, and the XHCI protocol proxy module all include corresponding drivers and corresponding sequence generators.
[0031] In the present invention, the verification environment layer is a container for creating, starting and scheduling various verification modules. The verification environment layer includes a reference model, a comparator, a register model, a configuration class, and several proxy modules.
[0032] The verification top layer includes the design module to be tested, that is, the USB host. For example, the interfaces instantiated in the verification top layer include: an instantiated USB intellectual property core verification module interface, an instantiated AXI slave interface, an instantiated AXI host interface, and an instantiated APB configuration interface.
[0033] Specifically, the instantiated AXI slave interface is connected to the AXI host port included in the USB host; the instantiated AXI host interface is connected to the AXI slave port included in the USB host; the instantiated APB configuration interface is connected to the APB configuration port included in the USB host; the instantiated USB intellectual property core verification module interface is connected to the USB physical layer port included in the USB host.
[0034] In the present invention, the term "application side" commonly used in the art refers to: a part closer to the user from the perspective of the device or module itself.
[0035] In the present invention, the test case layer is a test case set covering the functional points of all the design modules to be tested, which includes a number of test cases for testing the functional points of the design modules to be tested.
[0036] For example, in order to obtain the test case set, a basic test case is first constructed to create a verification environment instance, a register model instance and a configuration class instance, and other test cases are extended from this basic test case.
[0037] These test cases generate test stimuli for each port of the design module to be tested by calling one or more constructed test sequences in a specific order. Each test case covers one or more functional points of the design module to be tested to fully verify the design module to be tested.
[0038] Preferably, different test cases are constructed by starting different test sequences step by step, and different test cases are used to cover different functional points of the design module to be tested.
[0039] The test case layer of the present invention is a plurality of verification function points extracted according to USB, XHCI protocols and the specifications of the design module to be tested, and generates verification stimuli for corresponding function points by calling a combination of test sequences in a specific order.
[0040] Furthermore, the test sequence is a class library developed together with the test case, which is used to generate test stimuli. According to different functional points to be verified, different test sequences must be constructed to generate different test stimuli to verify the design module to be tested.
[0041] For example, based on the port type classification, the test stimulus may include: sending data stimulus of the AXI host port on the application side of the design module to be tested, receiving data stimulus of the AXI slave port on the application side of the design module to be tested, reading and writing register data stimulus of the APB configuration port on the application side of the design module to be tested, receiving data stimulus of the USB physical layer interface in the design module to be tested, and sending data stimulus of the USB physical layer interface in the design module to be tested.
[0042] Furthermore, the input transaction level modeling (TLM) port or output TLM port of the verification module is connected according to the preset data flow direction, and the instantiated interfaces are associated with each verification module through the UVM configuration database. Finally, the UVM framework function run_test is called at the top level of the verification to start the platform.
[0043] Step 3: Sending a transmission packet to the sequence generator in the proxy module through the test sequence, the driver in the proxy module requests the transmission packet from the sequence generator in the proxy module, and then drives the data to the interface of the proxy module.
[0044] Specifically, each test sequence sends a corresponding transmission packet to the sequence generator in the verification agent module connected to it, and the corresponding XHCI driver, application-side AXI bus driver, USB protocol driver, and APB configuration interface driver request transmission packets from their respective test sequence generators, and then drive data to the interface in the agent module according to the information in the transmission packet.
[0045] The sequence generators here include: USB protocol sequence generator, application side AXI bus sequence generator, APB configuration interface sequence generator and XHCI protocol sequence generator.
[0046] Step 4: The USB host processes the USB host input data and obtains the USB host output data; the USB host output data is collected, converted into a transmission packet and sent to the reference model and the comparator.
[0047] Specifically, the USB host processes the input data according to the USB 3.0 protocol and generates corresponding output data. The USB protocol monitor in the USB device intellectual property verification agent module and the APB configuration interface monitor in the APB configuration interface agent module convert the USB host output data collection data into transmission packets, and then send the corresponding transmission packets to the reference model and comparator respectively.
[0048] Step 5: The reference model converts the input data of the reference model into an uplink transmission packet or a downlink transmission packet, and performs a consistency comparison in the comparator with the transmission packet output by the USB protocol monitor in the USB device intellectual property core verification agent module and the transmission packet output by the XHCI protocol driver in the XHCI protocol agent module.
[0049] Specifically, the reference model converts the input data of the reference model, the configuration data of the register model, and the switch configuration data in the configuration class into uplink transmission packets or downlink transmission packets, and performs data consistency comparison through the transmission packets output by the comparator and the USB protocol monitor, and the transmission packets output by the XHCI protocol driver.
[0050] Among them, the USB device intellectual property core verification agent module includes a USB protocol monitor, and the XHCI protocol agent module includes an XHCI protocol driver.
[0051] Step 6: According to the test function points, the coverage collector is connected to the multiple monitors in the proxy module respectively to build a test function point coverage model.
[0052] Specifically, by specifying the range and number of hits that the data of each test function point needs to cover, and setting corresponding function coverage groups for the same group of test function points, the coverage collector module is connected with all the monitor modules.
[0053] All monitors here include: USB protocol monitor in USB device intellectual property core verification agent module, application side AXI bus monitor in application side AXI bus agent module, APB configuration interface monitor in APB configuration interface agent module. In the present invention, XHCI protocol agent module does not include monitor.
[0054] Step 7: Debug each test case one by one, and check whether the inspection results in all verification modules and the data comparison results in the comparator are normal.
[0055] Specifically, debug each test case one by one to ensure that each test case truly covers the test function point extracted in step 1, and that the checks in all verification modules and the data comparisons of the comparators are all passed. Otherwise, the test function point will fail the verification.
[0056] Step 8: Perform regression operations including coverage. For test function points that have not been covered, add or modify test cases to cover the test function points that have not been covered.
[0057] The term "regression" here refers to executing all test cases again.
[0058] Specifically, all test cases are executed with coverage regression operations to collect code coverage and functional coverage; based on the coverage analysis results, for test function points that have not been covered, new test cases are added or modified to cover the test function points.
[0059] The terms in the present invention, for example, "verification top layer", "test case layer", "verification environment layer", "reference model", "configuration class", "design module to be tested", "register model", etc., are all commonly used terms in the art, and their meanings can be determined by those skilled in the art based on the common technical knowledge in the field.
[0060] In order to better illustrate the present invention, numerous specific details are provided in the above specific embodiments. It should be understood by those skilled in the art that the present invention can also be implemented without certain specific details. In some examples, methods, means, components and circuits well known to those skilled in the art are not described in detail in order to highlight the subject matter of the present invention.
[0061] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any person skilled in the art can easily think of changes or substitutions within the technical scope disclosed by the present invention, which 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 USB host authentication method, characterized in that: The steps include: Step 1: Extract test function points according to the functions and protocol specifications of the USB host; Step 2: Build a verification system, instantiate several interfaces in the top layer of the verification, instantiate several verification modules, and establish data connection relationships between verification modules; Initialize the verification environment layer and USB host, generate test sequences and test cases, and start the verification system; Wherein, the several verification modules include an agent module, a reference model and a comparator; The proxy module includes a USB device intellectual property core verification proxy module, an XHCI protocol proxy module, a sequence generator and a driver; Step 3: Sending a transmission packet to the sequence generator in the proxy module through the test sequence, the driver in the proxy module requests the transmission packet from the sequence generator in the proxy module, and then drives the data to the interface of the proxy module; Step 4: The USB host processes the input data of the USB host and obtains the output data of the USB host; collects the output data of the USB host, converts it into a transmission packet, and sends it to the reference model and the comparator; Step 5: The reference model converts the input data of the reference model into an uplink transmission packet or a downlink transmission packet, and performs consistency comparison with the transmission packet output by the USB protocol monitor in the USB device intellectual property core verification agent module and the transmission packet output by the XHCI protocol driver in the XHCI protocol agent module in the comparator; Step 6: According to the test function points, the coverage collector is connected to the multiple monitors in the proxy module respectively to build a test function point coverage model; Step 7: Debug each test case one by one, and check whether the inspection results in all verification modules and the data comparison results in the comparator are normal.
2. The USB host authentication method according to claim 1, wherein: The USB host verification method further comprises the following steps: Step 8: Perform regression operations including coverage. For test function points that have not been covered, add or modify test cases to cover the test function points that have not been covered.
3. The USB host authentication method according to claim 2, wherein: The several interfaces include: an instantiated USB intellectual property core verification module interface, an instantiated AXI slave interface, an instantiated AXI host interface and an instantiated APB configuration interface.
4. The USB host authentication method according to claim 3, wherein: The sequence generator comprises: a USB protocol sequence generator, an application side AXI bus sequence generator, an APB configuration interface sequence generator and an XHCI protocol sequence generator.
5. The USB host authentication method according to claim 4, wherein: The proxy module also includes: an application-side AXI bus proxy module and an APB configuration interface proxy module.
6. The USB host authentication method according to claim 5, characterized in that: The multiple monitors include: a USB protocol monitor in a USB device intellectual property core verification agent module, an application side AXI bus monitor in an application side AXI bus agent module, and an APB configuration interface monitor in an APB configuration interface agent module.
7. The USB host authentication method according to claim 6, characterized in that: The verification system includes: a register model and a configuration class; In the step 5, the reference model also converts the configuration data of the register model and the switch configuration data in the configuration class into an uplink transmission packet or a downlink transmission packet.
8. The USB host authentication method according to claim 7, wherein: The test function points include one or more of the following: data transceiver path, USB protocol compliance, enumeration process, link training, low power mode, clock reset, and register access.
9. The USB host authentication method according to claim 8, characterized in that: The verification environment layer is a container for creating, starting and scheduling the verification modules.
10. The USB host authentication method according to claim 9, characterized in that: The instantiated AXI slave interface is connected to the AXI host port included in the USB host; The instantiated AXI host interface is connected to the AXI slave port included in the USB host; The instantiated APB configuration interface is connected to the APB configuration port included in the USB host; The instantiated USB intellectual property core verification module interface is connected to a USB physical layer port included in a USB host.
Citation Information
Patent Citations
USB switching method and device and system
CN107402893A
Data network design verification method and device and verification equipment
CN112597719A
SOC chip system-level verification system and method
CN115828839A
UVM-based xHCI drive implementation system and method
CN117785593A
USB class protocol modules
US20130138860A1
