Testing methods, apparatus, electronic devices and storage media for on-chip networks
Patent Information
- Application Number
- CN202610773733.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-05-29
- Publication Date
- 2026-09-01
AI Technical Summary
传统的人工搭建与维护测试环境的方式已经无法适配快速迭代的设计需求,称为测试效率提升的主要瓶颈
[0012] In another aspect of this disclosure, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements the methods described above.
Smart Images

Figure CN122679086A_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to automated testing techniques, and in particular to a testing method, apparatus, electronic device, and storage medium for on-chip networks. Background Technology
[0002] In large-scale System on Chip (SoC) chip design, Network on Chip (NoC) serves as the core hub for data interaction among multiple modules. It integrates a bus architecture with multiple protocols and interfaces. During testing, it is necessary to cover multiple dimensions of scenarios, such as protocol compliance, address mapping accuracy, path connectivity, packet assembly / disassembly rule adaptability, and stability of multi-master-slave parallel access.
[0003] Due to the frequent iterations of SoC functions, parameters such as NoC interface type, bit width, address mapping rules, and clock frequency also need frequent adjustments, and the corresponding test environment needs to be updated accordingly. Traditional methods of manually building and maintaining the test environment are no longer suitable for the rapidly iterating design requirements, becoming a major bottleneck for improving test efficiency. Summary of the Invention
[0004] This disclosure provides a testing method, apparatus, electronic device, and storage medium for on-chip networks, which can improve the testing efficiency and update iteration efficiency of on-chip networks.
[0005] One aspect of this disclosure provides a testing method for on-chip networks, comprising: The on-chip network to be tested is parsed to obtain test configuration information, which includes port configuration information of the on-chip network and device configuration information of the simulation device. Based on the port configuration information and the device configuration information, the simulation device, test components, and test cases are created; Based on the port configuration information, the connection relationship between the ports of the on-chip network and the simulation device is determined, and an on-chip network test system is constructed. A test script is generated, and the test cases are executed by running the test script to control the simulation device to transmit data through the on-chip network, and the test results of the on-chip network are obtained through the test component.
[0006] Optionally, parsing the on-chip network to be tested and obtaining test configuration information includes: Parse the source file of the on-chip network to determine the port definition of each port in the on-chip network; Receive and parse the on-chip network requirement table to determine the port communication configuration parameters of each port in the on-chip network. The port configuration information includes the port definition and the communication configuration parameters. Receive and parse the address mapping table to determine the memory access space address of the simulated communication device in the simulation device; The control requirement table is received and parsed to determine the network control parameters of the simulation control device in the simulation device. The device configuration information includes the memory access space address and the network control parameters.
[0007] Optionally, the step of creating the simulation device, test components, and test cases based on the port configuration information and the device configuration information includes: Based on the port communication configuration parameters, the number of communication devices and the device communication configuration parameters of each simulated communication device are determined, and the simulated communication device is created. The simulated communication device includes a master device and a slave device. The device communication configuration parameters include at least one of the following: protocol type and version, interface type, signal bit width, and domain segment enable state. The simulation control device is created based on the network control parameters, which include clock frequency and reset type. The simulation control device includes a clock generator and a reset generator. Based on the port communication configuration parameters and the memory access address of the simulated communication device, the test component is created, and the test component includes at least one of a task-driven component, a data acquisition component, and a data comparison component. Based on the port communication configuration parameters and the memory access address of the simulated communication device, test cases are generated for at least one test scenario. The test scenarios include communication scenarios between a single master device and a single slave device, communication scenarios between a single master device and multiple slave devices, communication scenarios between multiple master devices and a single slave device, and communication scenarios between multiple master devices and multiple slave devices.
[0008] Optionally, the step of creating the simulation device, test components, and test cases based on the port configuration information and the device configuration information includes: Based on the port configuration information and the device configuration information, the on-chip network, the simulated communication device, the clock generator, and the reset generator are instantiated in the top-level file of the simulation test program; Based on the port configuration information and the device configuration information, generate files corresponding to the test components and the test cases; The step of determining the connection relationship between the ports of the on-chip network and the simulation device based on the port configuration information, and constructing the on-chip network test system, includes: Based on the port definitions of each port in the on-chip network, the communication port of the on-chip network is connected to the simulated communication device, the clock control port of the on-chip network is connected to the clock generator, and the reset port of the on-chip network is connected to the reset generator.
[0009] Optionally, the step of executing the test cases by running the test script to control the simulation device to transmit data through the on-chip network and obtaining the test results of the on-chip network through the test component includes: The test script calls the port test function, which controls the task-driven component to trigger the simulated communication device to execute the data transmission operation corresponding to the test case. The data acquisition component collects the actual transmitted data from the data transmitting device and the actual received data from the data receiving device in the simulated communication device, respectively. The data comparison component determines the target received data corresponding to the data receiving device based on the actual transmitted data and the data packet splicing rules corresponding to the port of the on-chip network, and compares the actual received data and the target received data to obtain the test result.
[0010] Optionally, the method further includes: Based on the port communication configuration parameters and the memory access address of the simulated communication device, a functional coverage model is generated, and the functional coverage model is configured with a list of test items. Based on the functional coverage model, the network test coverage is updated using the test results obtained from the test item list and the test components. This network test coverage represents the test completion rate of the on-chip network. Another aspect of this disclosure provides a testing apparatus for on-chip networks, comprising: The configuration information parsing module is used to parse the on-chip network to be tested and obtain test configuration information, which includes the port configuration information of the on-chip network and the device configuration information of the simulation device. The component generation module is used to create the simulation device, test components, and test cases based on the port configuration information and the device configuration information. The system building module is used to determine the connection relationship between the port of the on-chip network and the simulation device based on the port configuration information, and to build an on-chip network test system; The testing module is used to generate test scripts, execute the test cases by running the test scripts, control the simulation device to transmit data through the on-chip network, and obtain the test results of the on-chip network through the testing component.
[0011] In another aspect of this disclosure, an electronic device is provided, comprising: Memory, used to store computer programs; A processor is configured to execute a computer program stored in the memory, wherein, when the computer program is executed, it implements the methods described above.
[0012] In another aspect of this disclosure, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements the methods described above.
[0013] In another aspect of this disclosure, a computer program product is provided, including computer program instructions that, when executed by a processor, implement the method described above.
[0014] Based on the embodiments of this disclosure, by acquiring the test configuration information of the on-chip network, a simulation device, test components, and test cases are automatically created to build an on-chip network test system. The simulation device is automatically controlled to execute the data transmission tasks in the test cases through the on-chip network under test, and the test results are automatically collected through the test components. Compared with traditional testing methods, users only need to provide basic test configuration information to complete the test environment setup, which improves the testing efficiency of on-chip networks and avoids errors caused by manually setting up the test environment. When the on-chip network is updated, users can achieve synchronous updates of the test system and test cases by modifying the corresponding test configuration information, without having to modify parameters and code in the relevant files of the test system and test cases. Furthermore, the automatically generated test system follows a unified standard, which facilitates the collaboration, system maintenance, and handover of the R&D team.
[0015] The technical solutions of this disclosure will be further described in detail below with reference to the accompanying drawings and embodiments. Attached Figure Description
[0016] The accompanying drawings, which form part of this specification, illustrate embodiments of this disclosure and, together with the description, serve to explain the principles of this disclosure.
[0017] This disclosure will become clearer with reference to the accompanying drawings and the following detailed description, wherein: Figure 1 A flowchart illustrating one embodiment of the testing method for the network-on-a-chip disclosed herein; Figure 2 A flowchart illustrating another embodiment of the testing method for the network-on-a-chip disclosed herein; Figure 3 A flowchart illustrating another embodiment of the testing method for the network-on-a-chip disclosed herein; Figure 4A flowchart illustrating another embodiment of the testing method for the network-on-a-chip disclosed herein; Figure 5 This is a structural block diagram of one embodiment of the test apparatus for the network-on-a-chip disclosed herein; Figure 6 This is a schematic diagram of the structure of an application embodiment of the electronic device disclosed herein. Detailed Implementation
[0018] Various exemplary embodiments of the present disclosure will now be described in detail with reference to the accompanying drawings. It should be noted that, unless otherwise specifically stated, the relative arrangement, numerical expressions, and values of the components and steps set forth in these embodiments do not limit the scope of the present disclosure.
[0019] Those skilled in the art will understand that the terms "first," "second," etc., in the embodiments of this disclosure are only used to distinguish different steps, devices, or modules, and do not represent any specific technical meaning, nor do they indicate a necessary logical order between them.
[0020] It should also be understood that in the embodiments disclosed herein, "a plurality of" may refer to two or more, and "at least one" may refer to one, two or more.
[0021] It should also be understood that any component, data or structure mentioned in the embodiments of this disclosure can generally be understood as one or more unless expressly defined or given to the contrary in the context.
[0022] Furthermore, the term "and / or" in this disclosure is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, or B existing alone. Additionally, the character " / " in this disclosure generally indicates that the preceding and following related objects have an "or" relationship.
[0023] It should also be understood that the description of the various embodiments in this disclosure emphasizes the differences between the various embodiments, and the similarities or similarities can be referred to each other. For the sake of brevity, they will not be described in detail.
[0024] At the same time, it should be understood that, for ease of description, the dimensions of the various parts shown in the accompanying drawings are not drawn according to actual scale.
[0025] The following description of at least one exemplary embodiment is merely illustrative and is in no way intended to limit this disclosure or its application or use.
[0026] Techniques, methods, and equipment known to those skilled in the art may not be discussed in detail, but where appropriate, such techniques, methods, and equipment should be considered part of the specification.
[0027] It should be noted that similar labels and letters in the following figures indicate similar items; therefore, once an item is defined in one figure, it does not need to be discussed further in subsequent figures.
[0028] The setup and maintenance of a traditional NoC testing environment mainly includes the following steps: 1. Engineers manually write test frameworks based on the NoC design documents, and instantiate simulation devices of various communication protocols one by one in the test framework, and manually configure parameters such as signal bit width and protocol version of each simulation device; 2. Manually connect the ports of the NoC under test to the simulation equipment and other components; 3. Manually write bus read / write stimulus tasks and develop test components; 4. Manually write test cases for various scenarios; 5. After the NoC parameter is changed, the verification environment code needs to be modified manually in each place, the simulation equipment needs to be reconfigured, and the test cases need to be adjusted. 6. Manually write compilation scripts and regression scripts, and manually collect and merge test coverage data.
[0029] The above testing methods have the following main technical defects: 1. The test environment setup cycle is long and involves a lot of repetitive work: It requires manual parsing of NoC design documents and instantiation of various simulation devices and components, as well as development of test cases, with a setup cycle of several days or even weeks; 2. The cost of simultaneous design and testing iteration is high: When the NoC's interface, signal width, address mapping and other parameters change, the test environment needs to be modified manually, and the maintenance cost increases exponentially. 3. Incomplete test scenario coverage: Manually writing test cases makes it difficult to quickly cover all protocol types, address boundaries, data alignment / disalignment, multi-master-slave parallel and other complex application scenarios of NoC; 4. Poor environmental standardization and reliability: The environment structure, naming rules and interface definitions developed by different engineers are not consistent, making team collaboration difficult, and manual coding and wiring are prone to introducing errors; 5. Poor reusability: The NoC verification environment differs between different projects, resulting in high costs for cross-project adaptation.
[0030] To address the aforementioned technical issues, this disclosure provides a testing method for on-chip networks. Figure 1 This is a flowchart illustrating a testing method for an on-chip network provided as an exemplary embodiment of this disclosure. The testing method for on-chip networks provided in this embodiment can be applied to electronic devices running simulation software. Figure 1 As shown, the method includes the following steps: Step 101: parse the on-chip network to be tested and obtain the test configuration information, which includes the port configuration information of the on-chip network and the device configuration information of the simulation device.
[0031] Test configuration information can include information obtained by directly parsing the code of the NoC under test, or configuration information obtained by parsing user-uploaded configuration files. For example, the port definitions of each port of the on-chip network can be obtained by parsing the code of the NoC under test, and the storage space address and accessible address of the simulation device can be obtained by parsing the configuration file. The simulation device is a simulation model that simulates certain device functions in software, such as a master device (processor, controller, etc.) capable of initiating read / write requests, and a slave device (memory, etc.) for passively responding to read / write requests.
[0032] Indicatively, port configuration information describes the communication rules of each port of the NoC under test, such as protocol type, protocol version, address and data bit widths in signals, and supported command prompt (CMD) operation types; device configuration information describes the communication rules of the corresponding simulation device, such as the storage space address and accessible address of the simulation device.
[0033] Step 102: Based on port configuration information and device configuration information, create simulation devices, test components, and test cases.
[0034] Simulation devices are software models that simulate specific device functions. Specifically, the type and number of simulation devices required for network testing can be determined based on port configuration information to create the simulation devices. Test components are software modules that follow preset verification methods and are used to build reusable test environments. For example, when using the Universal Verification Methodology (UVM) for NoC testing, test components may include UMV components such as environment (uvm_env), agent (uvm_agent), driver (uvm_driver), and sequencer (uvm_sequencer). Test cases are used to verify specific functions or performance of the NoC under test and are collections of data such as input stimuli (e.g., timing signals, register configurations, data patterns) and execution conditions (e.g., clock frequency).
[0035] In one possible implementation, the automated network testing process in this embodiment of the present disclosure is achieved by running a test project script. This test project script contains pre-written standardized templates such as test component templates, test case templates, and simulation device templates. When the test project script runs to execution step 102, a test project directory and a test component hierarchy structure can be established first. The test component templates are called according to the test component hierarchy structure. Test component files, test case files, simulation device files, etc. are created in the test project directory. Based on port configuration information and device configuration information, corresponding configuration parameters are added to the test component files to obtain customized test components, simulation devices, and test cases for the NoC to be tested.
[0036] Step 103: Determine the connection relationship between the ports of the on-chip network and the simulation device based on the port configuration information, and build the on-chip network test system.
[0037] Optionally, in step 102 above, the type of emulation device required for the NoC to be tested and the number of each type of emulation device have been determined based on the port configuration information and device configuration information. Therefore, based on the port definitions and other information in the port configuration information, each port of the NoC can be matched with the corresponding emulation device (for example, by identifying the suffix of the port identifier to determine the matching relationship between each port of the NoC and each emulation device). Based on the matching relationship, emulation connection statements are generated in the top-level file of the emulation software to establish connections between the ports of the on-chip network and the emulation devices, thereby constructing an on-chip network test system.
[0038] Step 104: Generate test scripts, execute test cases by running test scripts to control the simulation device to transmit data through the on-chip network, and obtain the test results of the on-chip network through the test components.
[0039] In one possible implementation, the test script includes a simulation script and a regression script. The simulation script executes a specific test case and outputs the corresponding test results, while the regression script manages and runs the simulation scripts in batches, executing multiple test cases sequentially and summarizing the test results for each test case.
[0040] In a demonstrative way, by executing test cases, the simulation device is controlled to transmit data in various scenarios through the on-chip network. The functionality of the NoC is tested by comparing the expected data transmission and reception with the actual data transmission and reception.
[0041] Based on the embodiments of this disclosure, by acquiring the test configuration information of the on-chip network, a simulation device, test components, and test cases are automatically created to build an on-chip network test system. The simulation device is automatically controlled to execute the data transmission tasks in the test cases through the on-chip network under test, and the test results are automatically collected through the test components. Compared with traditional testing methods, users only need to provide basic test configuration information to complete the test environment setup, which improves the testing efficiency of on-chip networks and avoids errors caused by manually setting up the test environment. When the on-chip network is updated, users can achieve synchronous updates of the test system and test cases by modifying the corresponding test configuration information, without having to modify parameters and code in the relevant files of the test system and test cases. Furthermore, the automatically generated test system follows a unified standard, which facilitates the collaboration, system maintenance, and handover of the R&D team.
[0042] In one possible implementation, the test configuration information is obtained by parsing the on-chip network under test and configuration tables such as the on-chip network requirement table, address mapping table, and control requirement table provided by the user. The user fills in the corresponding parameters according to the standardized table template, and modifies the data in the corresponding tables when the NoC undergoes iterative updates. Automated testing of the NoC can be achieved by running the test project script with one click. Step 101 above can specifically include the following steps: Step 101a: Parse the source file of the on-chip network to determine the port definitions of each port in the on-chip network.
[0043] Optionally, the test project script (e.g., implemented via a Python script) parses the Register Transfer Level (RTL) code of the NoC under test, determines the port definitions of each port in the on-chip network, and information such as the module name of the NoC module, and obtains a port set table, which is used to provide a basis for subsequent automated connection.
[0044] As an illustration, the test script can identify port definitions such as module names, port declarations, and port names from the RTL code of the NoC under test by recognizing keywords, thus obtaining a port set table. Furthermore, the electronic device can display this port set table for users to check for identification errors or omissions.
[0045] Step 101b: Receive and parse the on-chip network requirements table to determine the port communication configuration parameters of each port in the on-chip network.
[0046] The port configuration information includes the port definition and port communication configuration parameters mentioned above.
[0047] Indicatively, port communication configuration parameters may include at least one of the following: port identifier, protocol type and version (i.e., the bus protocol followed by the port, such as AXI3, AXI4, APB2, APB3, AHB5, etc.), port direction (indicating the purpose of the port, such as master port or slave port), address bit width (the address signal bit width of the port, used to determine the addressing range), data bit width, burst length bit width (indicating the data bit width in burst transmission), identifier (ID) bit width, user-defined signal bit width, supported burst operation types (such as increment, loopback, fixed, lock, etc.), number of write IDs, number of read IDs, whether out-of-order delivery is supported, and whether read data interleaving is supported.
[0048] Step 101c: Receive and parse the address mapping table to determine the memory access address of the simulated communication device in the simulation device.
[0049] A simulated communication device is a device used for sending and receiving data via NoC (Normally Invoked Communication). Examples include simulated master devices and simulated slave devices. Specifically, the memory access address space of a simulated communication device may include, for example, the accessible address space range of the master device and the memory address range of the slave device.
[0050] Step 101d: Receive and parse the control requirement table to determine the network control parameters of the simulation control device in the simulation equipment.
[0051] The device configuration information includes the memory access address and network control parameters mentioned above.
[0052] The simulation control equipment is used to control the operating mode of the NoC under test, and includes, for example, a clock generator and a reset generator. Specifically, network control parameters may include, for example, the clock frequency corresponding to each clock port of the NoC under test, and the reset method corresponding to each reset port.
[0053] There is no strict order of execution between steps 101a to 101d. Steps 101a to 101d can be executed in any order or in parallel.
[0054] Based on the embodiments of this disclosure, port definitions are obtained by parsing the source files of the on-chip network, and test configuration information such as port communication configuration parameters, memory access space addresses, and network control parameters are obtained by parsing configuration tables such as the on-chip network requirement table, address mapping table, and control requirement table. Then, a test environment is built and network tests are executed based on the test configuration information, so that users can build or update the test environment by filling in the basic configuration table.
[0055] In one possible implementation, simulation devices, test components, and test cases are created based on one or more test configuration information obtained in steps 101a to 101d above. Step 102 may specifically include the following steps: Step 102a: Based on the port communication configuration parameters, determine the number of communication devices and the device communication configuration parameters of each simulated communication device, and create the simulated communication device.
[0056] The simulated communication equipment includes master and slave devices. The communication configuration parameters of the equipment include at least one of the following: protocol type and version, interface type, signal bit width, and domain segment enable status.
[0057] As an illustration, you can iterate through the port directions in the port communication configuration parameters corresponding to each port of the NoC to determine the number of simulated communication devices (i.e., the number of communication devices) required for the NoC to be tested. Specifically, this can include the number of simulated master devices and the number of simulated slave devices.
[0058] After generating a corresponding number of standardized simulated communication devices, the device communication configuration parameters of each simulated communication device are further determined based on the port communication configuration parameters and the parameters are configured so that the simulated communication devices match the port communication configuration parameters of the corresponding ports (e.g., the protocol type and version are consistent), thus completing the generation of customized simulated communication devices.
[0059] Step 102b: Create a simulation control device based on network control parameters, including clock frequency and reset type. The simulation control device includes a clock generator and a reset generator.
[0060] The NoC internally contains one or more clock domains, each requiring a clock signal with a corresponding clock frequency. Additionally, some simulated communication devices may also require clock signals. A clock generator is used to generate and output a clock signal at a specific frequency. The NoC internally includes modules that require reset (e.g., triggers) to ensure that the module starts operating from a known state during testing. Furthermore, some simulated communication devices may also require reset. A reset generator is used to trigger the corresponding module to reset via the NoC's reset port. Reset types may include, for example, low-level reset, high-level reset, asynchronous reset, and synchronous reset.
[0061] Step 102c: Based on the port communication configuration parameters and the memory access address of the simulated communication device, create a test component. The test component includes at least one of the following: a task-driven component, a data acquisition component, and a data comparison component.
[0062] Task-driven components, such as drivers, are used to drive the simulated communication device to execute data transmission tasks in test cases. Data acquisition components, such as monitors, are used to collect the actual data sent or received by the simulated communication device during data transmission. Data comparison components, such as checkers, are used to compare the actual received data with the expected target received data to generate test results. Additionally, test components may include UVM components such as env, agent, and sequencer. Some components, such as drivers and monitors, are created based on port communication configuration parameters, while others, such as checkers, need to be created by combining port communication configuration parameters and the memory access space address of the simulated communication device to check whether the address accessed by the master device is within the accessible address space range and whether the NoC correctly routes the data to the corresponding slave device.
[0063] Step 102d: Based on the port communication configuration parameters and the memory access address of the simulated communication device, generate test cases corresponding to at least one test scenario. The test scenarios include communication scenarios between a single master device and a single slave device, communication scenarios between a single master device and multiple slave devices, communication scenarios between multiple master devices and a single slave device, and communication scenarios between multiple master devices and multiple slave devices.
[0064] The port communication configuration parameters provide the communication capabilities of each port of the NoC, while the address mapping table provides the access rules between the master and slave devices. Therefore, the test project script, based on the port communication configuration parameters and the memory space address of the simulated communication device, generates standardized test cases for each port of the NoC by combining enumeration and random constraints, covering four communication scenarios: single master single slave, single master multiple slave, multiple master single slave, and multiple master multiple slave.
[0065] In a schematic example, for a single-master-slave communication scenario, the system iterates through all slave devices accessible to each master device, generating a single-master-slave test case for each master-slave pair. The test tasks in this single-master-slave test case randomly constrain the access addresses to the slave device's storage address range, ensuring sufficient test tasks cover all supported cmd types and sizes of the master and slave devices. The test includes the following parameters: address type (aligned / unaligned address), address range (maximum boundary / minimum boundary + intermediate random address), and all master-slave backpressure types. For single-master multi-slave communication scenarios, a single-master multi-slave test case is generated for each master device. The test task in this single-master multi-slave test case involves the master device traversing and accessing the storage space of all accessible slave devices, with each access meeting the full-scenario requirements of basic verification. For multi-master single-slave communication scenarios, a multi-master single-slave test case is generated for each slave device. The test task in this multi-master single-slave test case requires all master devices that can access the slave device to sequentially traverse and access the slave device's storage space, with each access meeting the full-scenario requirements of basic verification. For multi-master multi-slave communication scenarios, a multi-master multi-slave test case is generated. The test task in this multi-master multi-slave test case requires multiple master devices to simultaneously access the storage space of multiple accessible slave devices, with randomized stimulus parameters.
[0066] Based on the embodiments of this disclosure, by automatically parsing various configuration tables and based on port configuration information and device configuration information, the automatic instantiation and parameter configuration of simulated communication devices with different protocol versions are realized, as well as the creation of simulated control devices and the generation of test cases covering multiple scenarios. This quickly generates a complete test environment that can be directly compiled and run, improving the efficiency and reliability of test environment construction and effectively solving the problems of incomplete test scenario coverage that exist in manually writing test cases.
[0067] In one possible implementation, the test engineering script automates signal connections and builds the test system. For example... Figure 2 As shown, step 102 above may specifically include the following steps 201-202, and step 103 above may specifically include the following step 203: Step 201: Based on the port configuration information and device configuration information, instantiate the on-chip network, simulated communication device, clock generator, and reset generator in the top-level file of the simulation test program.
[0068] As an illustration, for on-chip networks and simulated communication devices, the test project script can directly write the corresponding instantiation statement in the top-level file and call the corresponding code file to achieve instantiation; for clock generators and reset generators, instantiation can be achieved by writing the corresponding code block in the top-level file.
[0069] Step 202: Based on the port configuration information and device configuration information, generate files corresponding to the test components and test cases.
[0070] For test components and test cases, it is necessary to generate independent code files in the test project directory based on port configuration information and device configuration information.
[0071] Step 203: Based on the port definitions of each port in the on-chip network, establish a connection between the communication port of the on-chip network and the simulated communication device, establish a connection between the clock control port of the on-chip network and the clock generator, and establish a connection between the reset port of the on-chip network and the reset generator.
[0072] Optionally, based on information such as port definitions in the port configuration information, each port of the NoC is matched with the corresponding simulation device (for example, the matching relationship between each port of the NoC and each simulation device is determined by identifying the suffix of the port identifier), and simulation connection statements are written in the top-level file based on the matching relationship to establish connections between the communication ports of the on-chip network and the simulation communication devices, establish connections between the clock control ports of the on-chip network and the clock generator, and establish connections between the reset ports of the on-chip network and the reset generator, thereby constructing an on-chip network test system.
[0073] Based on the embodiments of this disclosure, the test engineering script performs automated signal connections and builds a test system, avoiding common human errors such as signal connection errors, parameter configuration omissions, and protocol bit width mismatches that are common when writing code manually, thus ensuring the correctness of the test environment.
[0074] In one possible implementation, the test engineering script automates network testing by compiling simulation scripts and regression scripts. For example... Figure 3 As shown, step 104 above may specifically include the following steps: Step 301: The test script calls the port test function to control the task-driven component to trigger the simulated communication device to execute the data transmission operation corresponding to the test case.
[0075] Specifically, the regression script runs the corresponding simulation scripts sequentially according to the test case execution order. The simulation scripts call port test functions, such as the bus_test() function, to randomly generate stimulus parameters that match the current test case, triggering the simulated communication device to execute the data transmission operation corresponding to the test case, thus completing the test cases for each scenario.
[0076] Optionally, the task-driven component sends transaction-level incentive data to the simulated communication device through automatically generated front-door read / write tasks.
[0077] Optionally, the test script can automatically generate front-door and back-door read / write tasks to complete specific data transmission operations and back-door access. For example, it can generate front-door read / write tasks supported by master devices of various protocol types based on port communication configuration parameters, and generate unified back-door read / write tasks based on the memory space addresses of simulated communication devices in the address mapping table. The front-door and back-door read / write tasks are called by test cases. In specific test cases, custom field values are defined for the front-door read / write tasks, and the back-door read / write tasks are adapted to the memory space addresses of each slave device, supporting rapid initialization of slave device memory space.
[0078] Step 302: Collect the actual transmitted data from the data transmitting device and the actual received data from the data receiving device in the simulated communication device using the data acquisition component.
[0079] Optionally, the monitor component in the master device collects the actual transmitted data, and the monitor component in the slave device collects the actual received data, and sends them to the checker component for data comparison.
[0080] Step 303: Based on the actual transmitted data and the data packet splicing rules corresponding to the port of the on-chip network, the data comparison component determines the target received data corresponding to the data receiving device, and compares the actual received data and the target received data to obtain the test results.
[0081] Optionally, the data comparison component checker converts the actual sent data into the expected target received data based on the data packet splicing rules corresponding to the port. Then, it compares the actual received data with the target received data. If they match, the operation is determined to be correct; otherwise, an error result is generated.
[0082] Based on the embodiments of this disclosure, simulation scripts and regression scripts are automatically generated and compiled through test engineering scripts, enabling users to complete the entire testing process, including test script compilation, test environment setup, and regression testing, with a single click, without manual intervention.
[0083] In one possible implementation, the test engineering script can automatically generate a functional coverage model and provide real-time feedback on network test coverage. For example... Figure 4 As shown, the method provided in this embodiment may further include the following steps: Step 401: Generate a functional coverage model based on port communication configuration parameters and the memory access space address of the simulated communication device.
[0084] This functional coverage model is configured with a list of test items. The functional coverage model is a tool used to measure test progress. Optionally, this list of test items is generated based on port communication configuration parameters and the memory access addresses of the simulated communication device. Each test item corresponds to a NoC attribute to be tested, such as the burst type, burst length, and data bit width of a port, as well as the address attributes of the slave device, such as the start address, end address, and intermediate random addresses of a slave device.
[0085] The functional coverage model is bound to each test case, and each test case automatically triggers the functional coverage model to sample when it is executed.
[0086] Step 402: Update the network test coverage based on the test item list and the data transmitted by the simulated communication device using the functional coverage model.
[0087] This network test coverage rate characterizes the degree of test completion of the on-chip network.
[0088] To illustrate, when the data acquisition component monitor in the test component acquires a transaction stimulus actually sent by a master device or actually received by a slave device, it calls a function to trigger the functional coverage model to sample, reads the field that the transaction stimulus hits in the test item list, marks the corresponding test item as "covered", and calculates the proportion of "covered" test items to all test items to determine the test completion rate.
[0089] Based on the embodiments of this disclosure, a functional coverage model is automatically generated by the test engineering script and bound to the test cases. The network test coverage is automatically sampled and fed back in real time. After the test is completed, the test completion rate of the on-chip network and the test items that were not tested can be intuitively reflected. This makes it convenient for users to check the test completion status, adjust the test cases to fill the test gaps, and improve the completeness of the on-chip network test.
[0090] Please refer to Figure 5 This illustration shows a structural block diagram of a test apparatus for an on-chip network provided in an exemplary embodiment of the present disclosure. The apparatus provided in this embodiment includes: The configuration information parsing module 501 is used to parse the on-chip network to be tested and obtain the test configuration information, which includes the port configuration information of the on-chip network and the device configuration information of the simulation device. The component generation module 502 is used to create simulation devices, test components, and test cases based on port configuration information and device configuration information. System building module 503 is used to determine the connection relationship between the ports of the on-chip network and the simulation device based on the port configuration information, and to build an on-chip network test system; Test module 504 is used to generate test scripts, execute test cases by running test scripts, control the simulation device to transmit data through the on-chip network, and obtain the test results of the on-chip network through the test component.
[0091] Optionally, the configuration information parsing module 501 mentioned above can be further used for: Parse the source file of the on-chip network to determine the port definition of each port in the on-chip network; Receive and parse the on-chip network requirements table to determine the port communication configuration parameters of each port in the on-chip network. The port configuration information includes port definition and port communication configuration parameters. Receive and parse the address mapping table to determine the memory access address of the simulated communication device in the simulation device; Receive and parse the control requirement table to determine the network control parameters of the simulation control device in the simulation equipment. The device configuration information includes memory access space address and network control parameters.
[0092] Optionally, the component generation module 502 described above can be further used for: Based on port communication configuration parameters, determine the number of communication devices and the device communication configuration parameters of each simulated communication device, and create simulated communication devices. The simulated communication devices include master devices and slave devices. The device communication configuration parameters include at least one of the following: protocol type and version, interface type, signal bit width, and domain segment enable status. A simulation control device is created based on network control parameters, including clock frequency and reset type. The simulation control device includes a clock generator and a reset generator. Based on port communication configuration parameters and memory access addresses of simulated communication devices, create test components. The test components include at least one of the following: task-driven components, data acquisition components, and data comparison components. Based on port communication configuration parameters and the memory access address of the simulated communication device, test cases are generated for at least one test scenario. The test scenarios include communication between a single master device and a single slave device, communication between a single master device and multiple slave devices, communication between multiple master devices and a single slave device, and communication between multiple master devices and multiple slave devices.
[0093] Optionally, the component generation module 502 described above can be further used for: Based on port configuration information and device configuration information, instantiate the on-chip network, simulated communication device, clock generator, and reset generator in the top-level file of the simulation test program; Based on port configuration information and device configuration information, generate files corresponding to test components and test cases; The aforementioned system building module 503 can be further used for: Based on the port definitions of each port in the on-chip network, the communication port of the on-chip network is connected to the simulated communication device, the clock control port of the on-chip network is connected to the clock generator, and the reset port of the on-chip network is connected to the reset generator.
[0094] Optionally, the aforementioned test module 504 can be further used for: The test script calls the port test function, which controls the task-driven component to trigger the simulated communication device to execute the data transmission operation corresponding to the test case. The actual data transmitted by the data transmitting device and the actual data received by the data receiving device in the simulated communication equipment are collected by the data acquisition component. The data comparison component determines the target received data for the data receiving device based on the actual transmitted data and the packet splicing rules corresponding to the port of the on-chip network. The actual received data and the target received data are then compared to obtain the test results.
[0095] Optionally, the apparatus provided in this disclosure may further include: The model generation module is used to generate a functional coverage model based on port communication configuration parameters and memory access addresses of the simulated communication device. The functional coverage model is configured with a list of test items. The coverage statistics module is used to update the network test coverage based on the test item list and the data transmitted by the simulated communication device through the functional coverage model. The network test coverage represents the test completion rate of the on-chip network.
[0096] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on its differences from other embodiments. Similar, identical, or corresponding parts between embodiments can be referred to mutually. Since the method, apparatus, and device embodiments are basically corresponding, relevant parts can be referred to the corresponding descriptions. The methods, apparatus, and devices in the embodiments of this disclosure also correspond to each other in specific implementation and beneficial technical effects; related content can be referred to mutually and will not be repeated here.
[0097] In addition, this disclosure also provides an electronic device, including: Memory, used to store computer programs; A processor is configured to execute a computer program stored in the memory, wherein when the computer program is executed, it implements the on-chip network testing method described in any of the above embodiments of the present disclosure.
[0098] Figure 6 This is a schematic diagram illustrating the structure of an application embodiment of the electronic device disclosed herein. Below, reference is made to… Figure 6This describes an electronic device according to embodiments of the present disclosure. The electronic device may be either or both of a first device and a second device, or a standalone device independent of them, which may communicate with the first device and the second device to receive acquired input signals from them.
[0099] like Figure 6 As shown, the electronic device includes one or more processors and memory.
[0100] A processor can be a central processing unit (CPU) or other form of processing unit with data processing and / or instruction execution capabilities, and can control other components in an electronic device to perform desired functions.
[0101] The memory may include one or more computer program products, which may include various forms of computer-readable storage media, such as volatile memory and / or non-volatile memory. The volatile memory may include, for example, random access memory (RAM) and / or cache memory. The non-volatile memory may include, for example, read-only memory (ROM), hard disk, flash memory, etc. One or more computer program instructions may be stored on the computer-readable storage medium, and the processor may execute the program instructions to implement the on-chip network testing methods of the various embodiments of this disclosure described above, and / or other desired functions.
[0102] In one example, the electronic device may also include input devices and output devices, which are interconnected via a bus system and / or other forms of connection mechanism (not shown).
[0103] In addition, the input device may include, for example, a keyboard, a mouse, etc.
[0104] This output device can output various information to the outside, including determined distance information, direction information, etc. The output device may include, for example, a display, a speaker, a printer, and a communication network and its connected remote output devices, etc.
[0105] Of course, for the sake of simplicity, Figure 6 Only some of the components of the electronic device relevant to this disclosure are shown, omitting components such as buses, input / output interfaces, etc. In addition, the electronic device may include any other suitable components depending on the specific application.
[0106] In addition to the methods and apparatus described above, embodiments of this disclosure may also be computer program products comprising computer program instructions that, when executed by a processor, cause the processor to perform the steps in the testing methods for on-chip networks according to various embodiments of this disclosure as described in the foregoing sections of this specification.
[0107] The computer program product can be written in any combination of one or more programming languages to perform the operations of the embodiments of this disclosure. The programming languages include object-oriented programming languages such as Java and C++, as well as conventional procedural programming languages such as C or similar languages. The program code can be executed entirely on a user's computing device, partially on a user's computing device, as a standalone software package, partially on a user's computing device and partially on a remote computing device, or entirely on a remote computing device or server.
[0108] Furthermore, embodiments of this disclosure may also be computer-readable storage media storing computer program instructions thereon, which, when executed by a processor, cause the processor to perform the steps in the testing methods for on-chip networks according to various embodiments of this disclosure as described in the foregoing portion of this specification.
[0109] The computer-readable storage medium may be any combination of one or more readable media. A readable medium may be a readable signal medium or a readable storage medium. A readable storage medium may be, for example, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of readable storage media (a non-exhaustive list) include: an electrical connection having one or more wires, a portable disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof.
[0110] Those skilled in the art will understand that all or part of the steps of the above method embodiments can be implemented by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When the program is executed, it performs the steps of the above method embodiments. The aforementioned storage medium includes various media that can store program code, such as ROM, RAM, magnetic disk, or optical disk.
[0111] The basic principles of this disclosure have been described above with reference to specific embodiments. However, it should be noted that the advantages, benefits, and effects mentioned in this disclosure are merely examples and not limitations, and should not be considered as essential features of each embodiment of this disclosure. Furthermore, the specific details disclosed above are for illustrative and facilitative purposes only, and are not limitations. These details do not limit the scope of this disclosure to the necessity of employing the aforementioned specific details for implementation.
[0112] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on its differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For system embodiments, since they largely correspond to method embodiments, the description is relatively simple; relevant parts can be referred to the descriptions in the method embodiments.
[0113] The block diagrams of devices, apparatuses, devices, and systems disclosed herein are merely illustrative examples and are not intended to require or imply that they must be connected, arranged, or configured in the manner shown in the block diagrams. As those skilled in the art will recognize, these devices, apparatuses, devices, and systems can be connected, arranged, and configured in any manner. Words such as “comprising,” “including,” “having,” etc., are open-ended terms meaning “including but not limited to,” and are used interchangeably with them. The terms “or” and “and” as used herein refer to the terms “and / or,” and are used interchangeably with them unless the context clearly indicates otherwise. The term “such as” as used herein refers to the phrase “such as but not limited to,” and is used interchangeably with it.
[0114] The methods and apparatus of this disclosure may be implemented in many ways. For example, they may be implemented by software, hardware, firmware, or any combination of software, hardware, and firmware. The above-described order of steps for the methods is for illustrative purposes only, and the steps of the methods of this disclosure are not limited to the order specifically described above unless otherwise specifically stated. Furthermore, in some embodiments, this disclosure may also be implemented as a program recorded on a recording medium, the program including machine-readable instructions for implementing the methods according to this disclosure. Thus, this disclosure also covers recording media storing programs for performing the methods according to this disclosure.
[0115] It should also be noted that in the apparatus, devices, and methods of this disclosure, the components or steps can be disassembled and / or recombined. These disassemblies and / or recombinations should be considered as equivalent solutions to this disclosure.
[0116] The above description of the disclosed aspects is provided to enable any person skilled in the art to make or use this disclosure. Various modifications to these aspects will be readily apparent to those skilled in the art, and the general principles defined herein may be applied to other aspects without departing from the scope of this disclosure. Therefore, this disclosure is not intended to be limited to the aspects shown herein, but rather to be carried out within the widest scope consistent with the principles and novel features disclosed herein.
[0117] The above description has been given for purposes of illustration and description. Furthermore, this description is not intended to limit the embodiments of this disclosure to the forms disclosed herein. Although numerous exemplary aspects and embodiments have been discussed above, those skilled in the art will recognize certain variations, modifications, alterations, additions, and sub-combinations therein.
Claims
1. A testing method for on-chip networks, characterized in that, include: The on-chip network to be tested is parsed to obtain test configuration information, which includes port configuration information of the on-chip network and device configuration information of the simulation device. Based on the port configuration information and the device configuration information, the simulation device, test components, and test cases are created; Based on the port configuration information, the connection relationship between the ports of the on-chip network and the simulation device is determined, and an on-chip network test system is constructed. A test script is generated, and the test cases are executed by running the test script to control the simulation device to transmit data through the on-chip network, and the test results of the on-chip network are obtained through the test component.
2. The method according to claim 1, characterized in that, The process of parsing the on-chip network to be tested and obtaining test configuration information includes: Parse the source file of the on-chip network to determine the port definition of each port in the on-chip network; Receive and parse the on-chip network requirement table to determine the port communication configuration parameters of each port in the on-chip network. The port configuration information includes the port definition and the port communication configuration parameters. Receive and parse the address mapping table to determine the memory access space address of the simulated communication device in the simulation device; The control requirement table is received and parsed to determine the network control parameters of the simulation control device in the simulation device. The device configuration information includes the memory access space address and the network control parameters.
3. The method according to claim 2, characterized in that, The process of creating the simulation device, test components, and test cases based on the port configuration information and the device configuration information includes: Based on the port communication configuration parameters, the number of communication devices and the device communication configuration parameters of each simulated communication device are determined, and the simulated communication device is created. The simulated communication device includes a master device and a slave device. The device communication configuration parameters include at least one of the following: protocol type and version, interface type, signal bit width, and domain segment enable state. The simulation control device is created based on the network control parameters, which include clock frequency and reset type. The simulation control device includes a clock generator and a reset generator. Based on the port communication configuration parameters and the memory access address of the simulated communication device, the test component is created, and the test component includes at least one of a task-driven component, a data acquisition component, and a data comparison component. Based on the port communication configuration parameters and the memory access address of the simulated communication device, test cases are generated for at least one test scenario. The test scenarios include communication scenarios between a single master device and a single slave device, communication scenarios between a single master device and multiple slave devices, communication scenarios between multiple master devices and a single slave device, and communication scenarios between multiple master devices and multiple slave devices.
4. The method according to claim 3, characterized in that, The process of creating the simulation device, test components, and test cases based on the port configuration information and the device configuration information includes: Based on the port configuration information and the device configuration information, the on-chip network, the simulated communication device, the clock generator, and the reset generator are instantiated in the top-level file of the simulation test program; Based on the port configuration information and the device configuration information, generate files corresponding to the test components and the test cases; The step of determining the connection relationship between the ports of the on-chip network and the simulation device based on the port configuration information, and constructing the on-chip network test system, includes: Based on the port definitions of each port in the on-chip network, the communication port of the on-chip network is connected to the simulated communication device, the clock control port of the on-chip network is connected to the clock generator, and the reset port of the on-chip network is connected to the reset generator.
5. The method according to claim 3, characterized in that, The step of executing the test cases by running the test script to control the simulation device to transmit data through the on-chip network and obtaining the test results of the on-chip network through the test component includes: The test script calls the port test function, which controls the task-driven component to trigger the simulated communication device to execute the data transmission operation corresponding to the test case. The data acquisition component collects the actual transmitted data from the data transmitting device and the actual received data from the data receiving device in the simulated communication device, respectively. The data comparison component determines the target received data corresponding to the data receiving device based on the actual transmitted data and the data packet splicing rules corresponding to the port of the on-chip network, and compares the actual received data and the target received data to obtain the test result.
6. The method according to any one of claims 2 to 5, characterized in that, The method further includes: Based on the port communication configuration parameters and the memory access address of the simulated communication device, a functional coverage model is generated, and the functional coverage model is configured with a list of test items. The network test coverage is updated using the functional coverage model, based on the test item list and the data transmitted by the simulated communication device. The network test coverage represents the test completion rate of the on-chip network.
7. A testing device for on-chip networks, characterized in that, include: The configuration information parsing module is used to parse the on-chip network to be tested and obtain test configuration information, which includes the port configuration information of the on-chip network and the device configuration information of the simulation device. The component generation module is used to create the simulation device, test components, and test cases based on the port configuration information and the device configuration information. The system building module is used to determine the connection relationship between the port of the on-chip network and the simulation device based on the port configuration information, and to build an on-chip network test system; The testing module is used to generate test scripts, execute the test cases by running the test scripts, control the simulation device to transmit data through the on-chip network, and obtain the test results of the on-chip network through the testing component.
8. An electronic device, comprising: Memory, used to store computer programs; A processor for executing a computer program stored in the memory, wherein the computer program, when executed by the processor, implements the method described in any one of claims 1-6.
9. A computer-readable storage medium storing a computer program, which, when executed, performs the method according to any one of claims 1-6.
10. A computer program product comprising computer program instructions, characterized in that, When the computer program instructions are executed by the processor, they implement the method described in any one of claims 1-6.
