Simulation test method and device

By suspending tasks and querying the test scenario library during the simulation test of data communication chips, duplicate tests are avoided, which solves the problem of slow coverage convergence in the simulation test of data communication chips and achieves faster functional coverage and verification completeness.

CN121807628APending Publication Date: 2026-04-07NEW H3C SEMICON TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-11-28
Publication Date
2026-04-07

AI Technical Summary

Technical Problem

In the simulation testing of data communication chips in the existing technology, as the number of protocol interfaces increases, the computational resources and cycle limitations of regression testing lead to the problem of slow convergence of functional coverage.

Method used

By suspending the test task during simulation testing, the test scenario library is queried to see if the same test scenario has already been simulated. If it has, the task is terminated; otherwise, execution is resumed and the scenario parameters are stored to ensure that the test is not repeated until the regression test requirements are met.

Benefits of technology

It improves the coverage and convergence speed of simulation tests, saves computing resources and time, and enhances the verification completeness and testing efficiency of data communication chips.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121807628A_ABST
    Figure CN121807628A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a simulation test method and device, and relates to the technical field of chips, and the method comprises the steps: obtaining a first test task corresponding to a first test scene; hanging up the obtained first test task; querying a test scene library based on the scene parameters of the first test scene, and determining whether a simulation test for the first test scene has been performed; if yes, ending the first test task; if not, the execution of the first test task is recovered, scene parameters of the first test scene are stored in the test scene library, and a new first test task corresponding to a new first test scene is obtained under the condition that the regression test requirement of the digital communication chip is not met, and returning to the step of suspending the obtained first test task. By adopting the simulation test scheme provided by the embodiment of the invention, the coverage rate convergence speed of the to-be-tested function can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of chip technology, and in particular to a simulation testing method and apparatus. Background Technology

[0002] Data communication chips support various protocol interfaces. To ensure the correctness and stability of the functions corresponding to these protocol interface combinations, the above functions of the chip need to be simulated and tested before the chip is fabricated.

[0003] In related technologies, regression testing is generally used for simulation testing. However, current data communication chips support more and more protocol interfaces, while regression testing is limited by computing resources and regression cycle. Therefore, the coverage of the tested functions is prone to slow convergence in simulation testing. Summary of the Invention

[0004] The purpose of this invention is to provide a simulation testing method and apparatus to improve the coverage convergence speed of the function to be tested. The specific technical solution is as follows:

[0005] In a first aspect, embodiments of this application provide a simulation testing method, the method comprising:

[0006] Obtain the first test task corresponding to the first test scenario, wherein each test scenario corresponds to an interface combination, and an interface combination contains one or more protocol interfaces among the protocol interfaces supported by the data communication chip to be tested.

[0007] Suspend the first test task obtained;

[0008] Based on the scenario parameters of the first test scenario, the test scenario library is queried to determine whether a simulation test for the first test scenario has been performed. The test scenario library stores scenario parameters for test scenarios for which simulation tests for the data communication chip have been completed.

[0009] If yes, then the first test task ends;

[0010] If not, the execution of the first test task is resumed, and the scenario parameters of the first test scenario are stored in the test scenario library;

[0011] If the regression testing requirements of the data communication chip are not met, obtain a new first test task corresponding to the new first test scenario, and return to the step of suspending the obtained first test task.

[0012] In one embodiment of this application, the step of querying the test scenario library based on the scenario parameters of the first test scenario to determine whether a simulation test for the first test scenario has been performed includes:

[0013] Obtain the first hash value of the scenario parameters of the first test scenario;

[0014] The first hash value is compared with the second hash value of the scene parameters of the test scene stored in the test scene library;

[0015] If a second hash value exists that is identical to the first hash value, then it is determined that a simulation test for the first test scenario has been performed.

[0016] If the first hash value is different from all the second hash values, then it is determined that no simulation test for the first test scenario has been performed.

[0017] In one embodiment of this application, after the first test task is completed, the method further includes:

[0018] Based on the scenario parameters of the first test scenario, the function of the data communication chip tested by the first test task is determined;

[0019] The test function coverage information of the data communication chip is updated based on the determined functions.

[0020] In one embodiment of this application, before querying the test scenario library based on the scenario parameters of the first test scenario to determine whether a simulation test for the first test scenario has been performed, the method further includes:

[0021] Apply for a mutex lock for the test scenario library and lock the test scenario library;

[0022] After the first test task is completed, or after the scenario parameters of the first test scenario are stored in the test scenario library, the method further includes:

[0023] Unlock the aforementioned test scenario library.

[0024] In one embodiment of this application, the method further includes:

[0025] After the first test task is completed, if a reproduction instruction for the first test scenario is received, a second test task is created based on the scenario parameters of the first test scenario stored in the test scenario library.

[0026] Perform the second test task.

[0027] In one embodiment of this application, the scenario parameters of the test scenario include at least one of the following parameters:

[0028] The interface types of each protocol interface in the interface combination corresponding to the test scenario;

[0029] The module information of the communication module to which each protocol interface belongs in the interface combination corresponding to the test scenario in the communication modules included in the data communication chip;

[0030] The interface number of each protocol interface in the interface combination corresponding to the test scenario;

[0031] The data transmission rate of each protocol interface in the interface combination corresponding to the test scenario.

[0032] Secondly, embodiments of this application provide a simulation testing apparatus, the apparatus comprising:

[0033] The task acquisition module is used to acquire the first test task corresponding to the first test scenario. Each test scenario corresponds to an interface combination, and an interface combination contains one or more protocol interfaces supported by the data communication chip to be tested.

[0034] The task suspension module is used to suspend the first test task obtained.

[0035] The scenario library traversal module is used to query the test scenario library based on the scenario parameters of the first test scenario to determine whether a simulation test has been performed for the first test scenario. If yes, the task end module is triggered; if no, the task execution module is triggered. The test scenario library stores scenario parameters for test scenarios for which simulation tests have been completed for the data communication chip.

[0036] The task termination module is used to terminate the first test task;

[0037] The task execution module is used to resume the execution of the first test task and store the scenario parameters of the first test scenario in the test scenario library;

[0038] The task reacquisition module is used to obtain a new first test task corresponding to a new first test scenario when the regression test requirements of the data communication chip are not met, and then return to the task suspension module.

[0039] In one embodiment of this application, the scene library traversal module is specifically used for:

[0040] Obtain the first hash value of the scenario parameters of the first test scenario;

[0041] The first hash value is compared with the second hash value of the scene parameters of the test scene stored in the test scene library;

[0042] If a second hash value exists that is identical to the first hash value, then it is determined that a simulation test for the first test scenario has been performed.

[0043] If the first hash value is different from all the second hash values, then it is determined that no simulation test for the first test scenario has been performed.

[0044] In one embodiment of this application, the apparatus further includes:

[0045] The function determination module is used to determine the function of the data communication chip tested by the first test task based on the scenario parameters of the first test scenario after the first test task is completed.

[0046] The information update module is used to update the test function coverage information of the data communication chip based on the determined functions.

[0047] In one embodiment of this application, the apparatus further includes:

[0048] The scenario library locking module is used to request a scenario library mutex lock and lock the test scenario library before querying the test scenario library based on the scenario parameters of the first test scenario to determine whether a simulation test for the first test scenario has been performed.

[0049] The scenario library unlocking module is used to unlock the test scenario library after the first test task is completed or after the scenario parameters of the first test scenario are stored in the test scenario library.

[0050] In one embodiment of this application, the apparatus further includes:

[0051] The scenario reproduction module is used to, after the first test task is completed, if a reproduction instruction for the first test scenario is received, create a second test task based on the scenario parameters of the first test scenario stored in the test scenario library, and execute the second test task.

[0052] In one embodiment of this application, the scenario parameters of the test scenario include at least one of the following parameters:

[0053] The interface types of each protocol interface in the interface combination corresponding to the test scenario;

[0054] The module information of the communication module to which each protocol interface belongs in the interface combination corresponding to the test scenario in the communication modules included in the data communication chip;

[0055] The interface number of each protocol interface in the interface combination corresponding to the test scenario;

[0056] The data transmission rate of each protocol interface in the interface combination corresponding to the test scenario.

[0057] Thirdly, embodiments of this application provide an electronic device, including a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other through the communication bus;

[0058] Memory, used to store computer programs;

[0059] When a processor executes a program stored in memory, it implements any of the steps described in the first aspect above.

[0060] Fourthly, embodiments of this application provide a computer-readable storage medium storing a computer program, which, when executed by a processor, implements any of the steps described in the first aspect above.

[0061] Beneficial effects of the embodiments of the present invention:

[0062] As can be seen from the above, when testing a chip using the solution provided in the embodiments of this application, after obtaining the first test task corresponding to the first test scenario, the first test task is first suspended, and it is checked whether a simulation test for the first test scenario has been performed. If a simulation test for the first test scenario has been performed, the first test task is directly terminated. This can prevent repeated simulation tests of the same test scenario, thereby quickly performing simulation tests for different test scenarios and improving the coverage convergence speed of chip functions corresponding to various test scenarios. Attached Figure Description

[0063] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other embodiments can be obtained based on these drawings.

[0064] Figure 1 A flowchart illustrating the first simulation testing method provided in this application embodiment;

[0065] Figure 2 A flowchart illustrating the second simulation testing method provided in this application embodiment;

[0066] Figure 3 A flowchart illustrating the third simulation testing method provided in this application embodiment;

[0067] Figure 4 This is a schematic diagram of the structure of the first simulation testing device provided in the embodiments of this application;

[0068] Figure 5 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation

[0069] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art based on this application are within the scope of protection of the present invention.

[0070] First, the relationship between the four concepts mentioned in the simulation test scheme provided in the embodiments of this application—protocol interface combination, test scenario, test task, and data communication chip function—is explained.

[0071] The functionality of a data communication chip is reflected in its ability to process data. The steps involved in this data processing flow are typically executed by calling the protocol interfaces supported by the data communication chip. A data processing flow corresponds to one function of the data communication chip, and the combination of the protocol interfaces called by each step in a data processing flow constitutes a protocol interface combination. Furthermore, a protocol interface combination can contain one or more protocol interfaces. If a protocol interface combination contains only one protocol interface, it means that the function corresponding to that combination only requires calling that specific protocol interface to perform data processing.

[0072] When simulating and testing the functionality of a data communication chip, it is necessary to build a data processing flow based on the protocol interface combination corresponding to the function under test in a simulation platform, such as an EDA (Electronic Design Automation) simulation platform, to simulate the external environment of the data communication chip, such as the data attributes and traffic load of the data processed in the data processing flow. This process is called generating a test scenario.

[0073] A test task can be understood as generating a test scenario in a simulation platform and then running a data processing flow according to the aforementioned external environment. After the simulation platform completes the test task, it obtains the data processing results. Based on the pre-set functional expectations, it can verify whether the data processing results are correct and whether the test process is normal, thereby verifying whether the chip function corresponding to the protocol interface combination is correct and stable.

[0074] The simulation testing method and apparatus provided in the embodiments of this application will be described in detail below.

[0075] See Figure 1 , Figure 1 This is a flowchart illustrating the first simulation testing method provided in this application embodiment. In this embodiment, the method includes the following steps S101-S106.

[0076] Step S101: Obtain the first test task corresponding to the first test scenario.

[0077] Each test scenario corresponds to an interface combination, and an interface combination contains one or more protocol interfaces supported by the data communication chip under test.

[0078] For an introduction to protocol interface combinations, test scenarios, and test tasks, please refer to the aforementioned content, which will not be repeated here.

[0079] Specifically, when users perform simulation tests on the functions of data communication chips, they can start the regression test function in the simulation platform to fully compile the data communication chip to be tested and generate simulation executable files, such as simv executable files, vsim executable files, etc., to simulate the data communication chip in the simulation platform. All subsequent test scenarios are generated based on this file.

[0080] After the user completes the compilation in the simulation platform, the simulation platform can randomly combine protocol interfaces or combine the protocol interfaces specified by the user to generate a test scenario corresponding to the obtained interface combination, based on the interface specification information of various protocol interfaces supported by the data communication chip contained in the simulation executable file. This test scenario serves as the first test scenario, thereby creating the first test task corresponding to the first test scenario in its own platform or with the help of a scheduling system that cooperates with its own platform.

[0081] In one embodiment of this application, the simulation platform is an EDA simulation platform, and the scheduling system is an LSF (LoadSharing Facility) scheduling system.

[0082] Step S102: Suspend the first test task obtained.

[0083] The simulation platform can manage the status of the first test task, such as suspended, paused, or in progress.

[0084] Once the simulation platform receives the first test task, it creates a simulation process for the first test task to execute it. After the simulation process is created, it can be suspended, thereby suspending the first test task. Subsequently, the execution of the first test task or its termination will be determined based on the results of whether a simulation test for the first test scenario has been performed.

[0085] In one embodiment of this application, the data communication chip often supports multiple combinations of protocol interfaces, resulting in various test scenarios and test tasks. The simulation platform can assign a unique task identifier (called JobID) to each test task to manage its status. For example, the EDA simulation platform creates a first test task using the LSF scheduling system, submits the first test task using the bsub command of the LSF scheduling system, and retrieves the task identifier using a pre-written Python script. A mapping relationship is then established between the first test task and the retrieved task identifier, thereby assigning a task identifier to the first test task.

[0086] After assigning a task identifier to the first test task, the simulation platform can set the value of the task identifier of the first test task to indicate the value of suspending the task. In this way, the simulation process corresponding to the first test task will be suspended according to the task identifier, thereby suspending the first test task.

[0087] Step S103: Based on the scenario parameters of the first test scenario, query the test scenario library to determine whether a simulation test for the first test scenario has been performed. If a simulation test for the first test scenario has been performed, proceed to step S104; if no simulation test for the first test scenario has been performed, proceed to step S105.

[0088] The test scenario library stores scenario parameters for test scenarios that have completed simulation testing of data communication chips.

[0089] For details on scene parameters, please refer to the subsequent embodiments; they will not be elaborated here.

[0090] Specifically, the simulation platform can compare the scenario parameters of the first test scenario with the scenario parameters of each test scenario stored in the test scenario library to check whether the scenario parameters of the two types of test scenarios are completely consistent.

[0091] If there is a test scenario in the test scenario library that has the same scenario parameters as the first test scenario, it means that the test scenario library has stored the scenario parameters of the first test scenario, which also means that the simulation platform has completed the simulation test of the first test scenario. At this time, step S104 is executed.

[0092] If the scenario parameters of all test scenarios in the test scenario library are different from those of the first test scenario, it means that the simulation platform has not performed simulation testing on the first test scenario, or that the simulation platform has not completed the simulation testing on the first test scenario. In this case, proceed to step S105.

[0093] The specific implementation method for detecting whether the scenario parameters of the two types of test scenarios are completely consistent can be found in the subsequent embodiments, which will not be detailed here.

[0094] Step S104: End the first test task.

[0095] Specifically, the simulation platform can invoke a task termination command to forcibly terminate the execution of the first test task. After the first test task ends, the simulation platform can acquire a new first test task and enter a new round of simulation testing.

[0096] For example, the EDA platform can call the bjobs termination command to terminate the execution of the first test task. After the first test task is completed, the EDA platform can restart the simulation threads of steps S101-S103 above through a pre-written Python script by the user to enter a new round of simulation testing.

[0097] Step S105: Resume execution of the first test task and store the scenario parameters of the first test scenario in the test scenario library.

[0098] Specifically, the simulation platform can invoke the task recovery command to resume the simulation process of the suspended first test task, thereby resuming the execution of the first test task. Additionally, the simulation platform can store the scenario parameters of the first test scenario in the test scenario library according to the format requirements of the test scenario.

[0099] For example, the EDA simulation platform can call the bjobs recovery command to resume the simulation process of the suspended first test task, thereby resuming the execution of the first test task.

[0100] Step S106: If the regression testing requirements of the data communication chip are not met, obtain the new first test task corresponding to the new first test scenario, and return to step S102.

[0101] After the first test task is completed, or after the first test task is completed and the scenario parameters of the first test scenario are stored in the test scenario library, the simulation platform can detect whether the regression test requirements of the data communication chip are met.

[0102] The regression testing requirements mentioned above can take many forms, such as the number of simulation tests reaching a preset number, the total simulation test duration reaching a preset duration, etc., and the embodiments of this application do not limit this.

[0103] If the simulation platform detects that the regression testing requirements of the data communication chip are not met, such as the number of tests not reaching the preset number or the total duration not reaching the preset duration, the simulation platform can obtain a new first test task corresponding to the new first test scenario and enter a new round of simulation testing.

[0104] If the simulation platform detects that the regression test requirements of the data communication chip are met, the simulation of the data communication chip function will end.

[0105] As can be seen from the above, when testing a chip using the solution provided in this application embodiment, after obtaining the first test task corresponding to the first test scenario, the first test task is first suspended, and it is checked whether a simulation test for the first test scenario has been performed. If a simulation test for the first test scenario has been performed, the first test task is directly terminated. This can prevent repeated simulation tests of the same test scenario, thereby saving computing resources and testing time, shortening the test cycle of regression testing, and this solution can quickly perform simulation tests for different test scenarios, improve the coverage and convergence speed of chip functions corresponding to various test scenarios, and enhance the completeness of data communication chip verification.

[0106] In addition, in the simulation test scheme provided in this application embodiment, the various states of the test task cooperate with the test scenario library. When the task is suspended, the test scenario library is queried to detect the first test scenario corresponding to the first test task. When the task resumes execution, the scenario parameters corresponding to the first test task are stored in the test scenario library. When the task is interrupted, no operation is performed on the test scenario library, thus achieving a closed loop of linkage between the test task and the test scenario library and realizing full-cycle control of the test scenario.

[0107] The following section introduces the scenario parameters for the test scenario.

[0108] In one embodiment of this application, the scenario parameters of the test scenario include at least one of the following parameters:

[0109] The interface types of each protocol interface in the interface combination corresponding to the test scenario;

[0110] The module information of each protocol interface in the interface combination corresponding to the test scenario among the various communication modules included in the data communication chip;

[0111] The interface number of each protocol interface in the interface combination corresponding to the test scenario;

[0112] The data transmission rate of each protocol interface in the interface combination corresponding to the test scenario.

[0113] Next, we will introduce the parameters of the four scenarios mentioned above one by one.

[0114] 1. Interface type

[0115] The protocol interface types of data communication chips include Ethernet protocol interface, Flex Ethernet protocol interface, Interlaken protocol interface, etc., which will not be listed here, and the embodiments of this application are not limited in this regard.

[0116] 2. Module Information

[0117] Most data communication chips are modular chips, which can be divided into multiple communication modules. Each communication module has module number, module type and other module information.

[0118] 3. Interface number

[0119] Data communication chips typically support multiple protocol interfaces, each with its own interface number.

[0120] 4. Data transmission rate

[0121] The data transmission rate of the protocol interface can be the maximum data transmission rate of the protocol interface.

[0122] In this solution, the scenario parameters of the test scenario include at least one of the above four parameters. By comparing the above four parameters of the test scenario, it is possible to accurately determine whether the simulation platform has performed simulation testing for the first test scenario, thereby improving the accuracy of the simulation test.

[0123] The following explains the two implementation methods mentioned in step S103 above for detecting whether the scenario parameters of the first test scenario and the test scenario that has completed the simulation test are completely consistent.

[0124] In the first implementation, the simulation platform can obtain the first hash value of the scenario parameters of the first test scenario; compare the first hash value with the second hash value of the scenario parameters of the test scenario stored in the test scenario library; if there is a second hash value that is the same as the first hash value, it is determined that a simulation test for the first test scenario has been performed; if the first hash value is different from all the second hash values, it is determined that a simulation test for the first test scenario has not been performed.

[0125] Specifically, after obtaining the first test task corresponding to the first test scenario, a hash algorithm can be used to calculate the hash value of the scenario parameters of the first test scenario as the first hash value, or the hash value of the scenario parameters of the first test scenario calculated by other platforms or systems can be directly obtained as the first hash value.

[0126] For example, after obtaining the first test task, the simulation platform can create a parameter configuration file (e.g., eth_cfg.txt) corresponding to the first test task and write the scenario parameters of the first test scenario into this parameter configuration file. After suspending the first test task, the simulation platform reads the scenario parameters of the first test scenario from this parameter configuration file, calculates the hash value of the scenario parameters of the first test scenario, and uses it as the first hash value.

[0127] In addition, the test scenario library can store not only the scenario parameters of test scenarios that have completed simulation testing, but also the second hash values ​​of these scenario parameters and other information. See Table 1 below, which lists the scene_db.txt file included in the test scenario library, used to record information related to test scenarios that have completed simulation testing.

[0128] Table 1

[0129]

[0130] Among them, the interface combination corresponding to the test scenario with scenario number 1 includes a protocol interface. The interface type of this protocol interface is ETH, which is an Ethernet interface. The module number of the communication module to which this interface belongs is 0, the interface number is 0, the data transmission rate is 400Gbps, R8 indicates that this protocol interface corresponds to 8 parallel physical transmission channels, and 400-R8 indicates that 400Gbps data transmission is achieved by using 8 parallel physical transmission channels.

[0131] The test scenario with scenario number 2 corresponds to an interface combination containing two protocol interfaces. One protocol interface has an interface type of ETH, and the module number of the communication module to which this interface belongs is 0. The interface number is 0, and the data transmission rate is 100Gbps. R2 indicates that this protocol interface corresponds to 2 parallel physical transmission channels, and 100-R2 indicates that 100Gbps data transmission is achieved using 2 parallel physical transmission channels. The other protocol interface has an interface type of ETH, and the module number of the communication module to which this interface belongs is 0. The interface number is 4, and the data transmission rate is 200Gbps. R4 indicates that this protocol interface corresponds to 4 parallel physical transmission channels, and 200-R4 indicates that 200Gbps data transmission is achieved using 4 parallel physical transmission channels.

[0132] The SHA-256 hash value is the hash value calculated using the SHA-256 hash algorithm. Furthermore, the SHA-256 hash value for test scenario 1 is the hash value obtained by hashing the four scenario parameters under that test scenario; the SHA-256 hash value for test scenario 2 is the hash value obtained by hashing the eight scenario parameters under that test scenario.

[0133] After obtaining the first hash value, the simulation platform can compare the first hash value with each of the second hash values ​​stored in the test scenario library. If there is a second hash value that is the same as the first hash value, it means that the test scenario library stores the scenario parameters of the first test scenario, thus indicating that the simulation platform has performed simulation tests for the first test scenario. If the first hash value is different from each of the second hash values, it means that no simulation tests for the first test scenario have been performed.

[0134] In the second implementation, the simulation platform can directly compare the scene parameters of the first test scenario with the scene parameters of the test scenarios stored in the test scenario library. If there are scene parameters in the test scenario library that are the same as those of the first test scenario, it means that the test scenario library stores the scene parameters of the first test scenario, thus indicating that the simulation platform has performed simulation tests for the first test scenario. If all scene parameters in the test scenario library are different from those of the first test scenario, it means that no simulation tests have been performed for the first test scenario.

[0135] Since the interface combination covered by the first test scenario may include one or more interfaces, if the second implementation method is used to check whether the scenario parameters of the two types of test scenarios are completely consistent, the workload of parameter detection is directly proportional to the number of interfaces corresponding to these two types of test scenarios. The more interfaces and scenario parameters a test scenario has, the greater the workload of parameter detection. Therefore, when the number of interfaces corresponding to the test scenario is large, the workload of checking whether the scenario parameters of the test scenarios are consistent is large, and the detection efficiency is low. In the first implementation method, since the hash value of the scenario parameters of the test scenario is always a fixed number of bits, regardless of how much the number of interfaces and scenario parameters of the test scenario increases, the workload of comparing the hash values ​​of the scenario parameters of the two test scenarios can be regarded as constant. Therefore, compared with the second implementation method, when the number of interfaces corresponding to the test scenario is large, the first implementation method, that is, by comparing hash values, can quickly determine whether simulation testing for the first test scenario has been performed, thereby further improving the coverage convergence speed of the tested function.

[0136] If the simulation platform supports multi-threaded parallel processing of multiple first test tasks, simulation testing can be performed according to the scheme provided in the following embodiments.

[0137] In one embodiment of this application, see Figure 2 The flowchart of the second simulation test method is provided. In this embodiment, for each test task, the above method includes the following steps S201-S207.

[0138] Step S201: Obtain the first test task corresponding to the first test scenario.

[0139] Step S202: Suspend the first test task.

[0140] The steps S201 and S202 described above are similar to the steps S101 and S102 described above, and will not be repeated here.

[0141] Step S203: Request a mutex lock for the scenario library and lock the test scenario library.

[0142] The simulation platform requests a mutex lock for the test scenario library using a Python lock library. If the request is successful, it means no other thread from the first test task is currently accessing the test scenario library, so the test scenario library is locked, preventing other threads from accessing it. If the request fails, it means another thread from the first test task is currently accessing the test scenario library mutex lock, and the first test task process can only lock the test scenario library after the other process has finished accessing and unlocking it. In the event of a failed request, the mutex lock can be requested again periodically until it is successfully acquired.

[0143] Step S204: Based on the scenario parameters of the first test scenario, query the test scenario library to determine whether a simulation test for the first test scenario has been performed. If a simulation test for the first test scenario has been performed, proceed to step S205; if no simulation test for the first test scenario has been performed, proceed to step S206.

[0144] This step is similar to step S103 mentioned above, and will not be repeated here.

[0145] Step S205: End the first test task and unlock the test scenario library after the task is completed.

[0146] Step S206: Resume execution of the first test task, store the scenario parameters of the first test scenario in the test scenario library, and unlock the test scenario library after storage is completed.

[0147] Step S207: If the regression testing requirements of the data communication chip are not met, obtain the new first test task corresponding to the new first test scenario, and return to step S202.

[0148] The steps S205-S207 described above are similar to the steps S104-S106 described above, with the only difference being that step S205 unlocks the test scenario library after the task is completed, and step S206 unlocks the test scenario library after storing the scenario parameters of the first test scenario into the test scenario library. These details will not be elaborated here.

[0149] In this solution, after suspending the first test task and before querying the test scenario library, a mutex lock can be requested for the test scenario library to lock it. This prevents other first test task processes from accessing the test scenario library while one first test task is accessing it, thus avoiding data conflicts and disorder in the test scenario library. This improves the accuracy and stability of the test scenario library, thereby improving the accuracy and stability of simulation testing and ensuring the stable operation of regression testing in multi-task concurrent scenarios.

[0150] After the first test task is completed, other processing can be performed in the manner provided in the following embodiments.

[0151] In one embodiment of this application, after the first test task is completed, the function of the data communication chip tested by the first test task can be determined based on the scenario parameters of the first test scenario; and the function coverage information of the data communication chip to be tested can be updated based on the determined function.

[0152] Specifically, during the development phase of the data communication chip, the combination of various protocol interfaces of the data communication chip and the functions implemented through the interface combination are pre-designed. That is, the correspondence between the various interface combinations of the data communication chip and the chip functions is known. Therefore, after the first test task is completed, the functions corresponding to the interface combinations covered by the test scenario (i.e. the first test scenario) can be determined according to the pre-known correspondence between the various interface combinations and the chip functions.

[0153] In addition, when performing regression testing on chip functions, the functions to be tested are also predetermined, and then simulation testing is performed to verify whether the simulation test results achieve the expected effect of the functions to be tested.

[0154] The aforementioned coverage information of the functions to be tested is used to characterize the coverage of the data communication chip functions to be covered in the plan.

[0155] For example, the aforementioned test function coverage information may include the status identifier of each test function, the proportion of covered functions among the functions planned to be covered, etc. After determining the function of the data communication chip to be tested in the first test task, the status identifier of the function can be updated to covered, the proportion of covered functions among the functions planned to be covered can be updated, etc.

[0156] In addition to the status identifier and percentage, the above-mentioned function coverage information to be tested may also include other information, so that after the function to be tested by the first test task is determined, the other information is updated. This application embodiment does not limit this.

[0157] Users can understand the coverage status of data communication chip functions by using the function coverage information to be tested. For example, the simulation software can store a function coverage file to record the aforementioned function coverage information. Each time the first test task is completed and the functions of the data communication chip tested in the first test task are determined, the function coverage file can be updated based on the determined functions. After meeting the regression testing requirements of the data communication chip, the simulation platform can send the information in the test scenario library and the function coverage file to the user so that the user can understand the simulation test results and reduce the potential quality risks of the data communication chip.

[0158] After the first test task corresponding to the first test scenario is completed, users or other platforms may have the requirement to retest the functions corresponding to the interface combination covered by the first test scenario.

[0159] In view of this, in one embodiment of this application, if the simulation platform receives a reproduction instruction for the first test scenario after the first test task is completed, it creates a second test task and executes the second test task according to the scenario parameters of the first test scenario stored in the test scenario library.

[0160] Specifically, if the simulation platform receives a reproduction instruction for the first test scenario, it can search for the scenario parameters of the first test scenario in the test scenario library. Based on the scenario parameters of the first test scenario, it can create a second test task corresponding to the first test scenario on its own platform or with the help of a scheduling system that cooperates with its own platform, execute the second test task, and complete the reproduction of the first test scenario.

[0161] In this solution, since the test scenario library stores the scenario parameters of the tested test scenarios, if a user wants to reproduce the first tested test scenario, they can directly issue a reproduction command for the first test scenario in the simulation platform, and the simulation platform can reproduce it. There is no need for the user to redevelop and debug new test cases, realizing one-click triggering of the reproduction process. This not only simplifies user operation, improves functional verification efficiency, shortens the verification cycle, and reduces verification and debugging costs, but also enables rapid reproduction of chip functions. This allows for quick location of chip problems through reproduction, achieving accurate reproduction and traceability of problem scenarios, and significantly reducing the cost of chip problem investigation and debugging.

[0162] In addition, as mentioned in the foregoing embodiments, the solution provided in this application can write the scenario parameters of the first test scenario into a parameter configuration file when performing simulation testing on the first test scenario. Subsequently, the simulation test can be carried out based on the parameter configuration file. Therefore, if the user wants to reproduce the first test scenario, in addition to using the test scenario library for reproduction, the user can also write a parameter configuration file. In this way, the simulation platform can submit the simulation according to the parameter configuration file written by the user, so as to achieve rapid reproduction of the first test scenario.

[0163] In one embodiment of this application, see Figure 3 The flowchart of the third simulation test method is shown. In this embodiment, the above method includes the following steps S301-S308.

[0164] Step S301: Obtain the first test task corresponding to the first test scenario.

[0165] Step S302: Suspend the first test task.

[0166] Step S303: Request a mutex lock for the scenario library and lock the test scenario library.

[0167] Step S304: Obtain the first hash value of the scenario parameters of the first test scenario; compare the first hash value with the second hash value of the scenario parameters of the test scenario stored in the test scenario library; if there is a second hash value that is the same as the first hash value, then proceed to step S305; if the first hash value is different from all the second hash values, then proceed to step S306.

[0168] Step S305: End the first test task and unlock the test scenario library after the task is completed.

[0169] Step S306: Resume execution of the first test task, store the scenario parameters of the first test scenario in the test scenario library, unlock the test scenario library after storage, and after the first test task is completed, determine the function of the data communication chip tested by the first test task based on the scenario parameters of the first test scenario; update the test function coverage information of the data communication chip based on the determined function.

[0170] Step S307: If the regression testing requirements of the data communication chip are not met, obtain the new first test task corresponding to the new first test scenario, and return to step S302.

[0171] Step S308: If a reproduction instruction for the first test scenario is received, a second test task is created and executed according to the scenario parameters of the first test scenario stored in the test scenario library.

[0172] Corresponding to the aforementioned simulation testing method, this application also provides a simulation testing device.

[0173] In one embodiment of this application, see Figure 4 A schematic diagram of a simulation testing device is provided. In this embodiment, the device includes:

[0174] The task acquisition module 401 is used to acquire the first test task corresponding to the first test scenario. Each test scenario corresponds to an interface combination, and an interface combination contains one or more protocol interfaces supported by the data communication chip to be tested.

[0175] Task suspension module 402 is used to suspend the first test task obtained;

[0176] The scenario library traversal module 403 is used to query the test scenario library based on the scenario parameters of the first test scenario to determine whether a simulation test for the first test scenario has been performed. If yes, the task end module 404 is triggered; if no, the task execution module 405 is triggered. The test scenario library stores scenario parameters for test scenarios for which simulation tests for the data communication chip have been completed.

[0177] The task termination module 404 is used to terminate the first test task;

[0178] The task execution module 405 is used to resume the execution of the first test task and store the scenario parameters of the first test scenario in the test scenario library;

[0179] The task reacquisition module 406 is used to obtain a new first test task corresponding to the new first test scenario when the regression test requirements of the data communication chip are not met, and then return to the task suspension module 402.

[0180] As can be seen from the above, when testing a chip using the solution provided in this application embodiment, after obtaining the first test task corresponding to the first test scenario, the first test task is first suspended, and it is checked whether a simulation test for the first test scenario has been performed. If a simulation test for the first test scenario has been performed, the first test task is directly terminated. This can prevent repeated simulation tests of the same test scenario, thereby saving computing resources and testing time, shortening the test cycle of regression testing, and this solution can quickly perform simulation tests for different test scenarios, improve the coverage and convergence speed of chip functions corresponding to various test scenarios, and enhance the completeness of data communication chip verification.

[0181] In addition, in the simulation test scheme provided in this application embodiment, the various states of the test task cooperate with the test scenario library. When the task is suspended, the test scenario library is queried to detect the first test scenario corresponding to the first test task. When the task resumes execution, the scenario parameters corresponding to the first test task are stored in the test scenario library. When the task is interrupted, no operation is performed on the test scenario library, thus achieving a closed loop of linkage between the test task and the test scenario library and realizing full-cycle control of the test scenario.

[0182] In one embodiment of this application, the scene library traversal module 403 is specifically used for:

[0183] Obtain the first hash value of the scenario parameters of the first test scenario;

[0184] The first hash value is compared with the second hash value of the scene parameters of the test scene stored in the test scene library;

[0185] If a second hash value exists that is identical to the first hash value, then it is determined that a simulation test for the first test scenario has been performed.

[0186] If the first hash value is different from all the second hash values, then it is determined that no simulation test for the first test scenario has been performed.

[0187] This solution can quickly determine whether a simulation test for the first test scenario has been performed by comparing hash values, thereby further improving the coverage convergence speed of the function to be tested.

[0188] In one embodiment of this application, the apparatus further includes:

[0189] The function determination module is used to determine the function of the data communication chip tested by the first test task based on the scenario parameters of the first test scenario after the first test task is completed.

[0190] The information update module is used to update the test function coverage information of the data communication chip based on the determined functions.

[0191] In this solution, users can understand the coverage status of the data communication chip's functions by using the coverage information of the functions to be tested. For example, the simulation software can store a function coverage file to record the aforementioned function coverage information. Each time the first test task is completed and the functions of the data communication chip tested in the first test task are determined, the function coverage file can be updated based on the determined functions. After meeting the regression testing requirements of the data communication chip, the simulation platform can send the information in the test scenario library and the function coverage file to the user so that the user can understand the simulation test results and reduce the potential quality risks of the data communication chip.

[0192] In one embodiment of this application, the apparatus further includes:

[0193] The scenario library locking module is used to request a scenario library mutex lock and lock the test scenario library before querying the test scenario library based on the scenario parameters of the first test scenario to determine whether a simulation test for the first test scenario has been performed.

[0194] The scenario library unlocking module is used to unlock the test scenario library after the first test task is completed or after the scenario parameters of the first test scenario are stored in the test scenario library.

[0195] In this solution, after suspending the first test task and before querying the test scenario library, a mutex lock can be requested for the test scenario library to lock it. This prevents other first test task processes from accessing the test scenario library while one first test task is accessing it, thus avoiding data conflicts and disorder in the test scenario library. This improves the accuracy and stability of the test scenario library, thereby improving the accuracy and stability of simulation testing and ensuring the stable operation of regression testing in multi-task concurrent scenarios.

[0196] In one embodiment of this application, the apparatus further includes:

[0197] The scenario reproduction module is used to, after the first test task is completed, if a reproduction instruction for the first test scenario is received, create a second test task based on the scenario parameters of the first test scenario stored in the test scenario library, and execute the second test task.

[0198] In this solution, since the test scenario library stores the scenario parameters of the tested test scenarios, if a user wants to reproduce the first tested test scenario, they can directly issue a reproduction command for the first test scenario in the simulation platform, and the simulation platform can reproduce it. There is no need for the user to redevelop and debug new test cases, realizing one-click triggering of the reproduction process. This not only simplifies user operation, improves functional verification efficiency, shortens the verification cycle, and reduces verification and debugging costs, but also enables rapid reproduction of chip functions. This allows for quick location of chip problems through reproduction, achieving accurate reproduction and traceability of problem scenarios, and significantly reducing the cost of chip problem investigation and debugging.

[0199] In one embodiment of this application, the scenario parameters of the test scenario include at least one of the following parameters:

[0200] The interface types of each protocol interface in the interface combination corresponding to the test scenario;

[0201] The module information of the communication module to which each protocol interface belongs in the interface combination corresponding to the test scenario in the communication modules included in the data communication chip;

[0202] The interface number of each protocol interface in the interface combination corresponding to the test scenario;

[0203] The data transmission rate of each protocol interface in the interface combination corresponding to the test scenario.

[0204] In this solution, the scenario parameters of the test scenario include at least one of the above four parameters. By comparing the above four parameters of the test scenario, it is possible to accurately determine whether the simulation platform has performed simulation testing for the first test scenario, thereby improving the accuracy of the simulation test.

[0205] This invention also provides an electronic device, such as... Figure 5 As shown, it includes a processor 501, a communication interface 502, a memory 503, and a communication bus 504, wherein the processor 501, the communication interface 502, and the memory 503 communicate with each other through the communication bus 504.

[0206] Memory 503 is used to store computer programs;

[0207] When the processor 501 executes the program stored in the memory 503, it implements the steps of any of the above simulation test methods.

[0208] The communication bus mentioned in the above electronic devices can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. This communication bus can be divided into address bus, data bus, control bus, etc. For ease of illustration, only one thick line is used to represent it in the diagram, but this does not mean that there is only one bus or one type of bus.

[0209] The communication interface is used for communication between the aforementioned electronic devices and other devices.

[0210] The memory may include random access memory (RAM) or non-volatile memory (NVM), such as at least one disk storage device. Optionally, the memory may also be at least one storage device located remotely from the aforementioned processor.

[0211] The processors mentioned above can be general-purpose processors, including central processing units (CPUs), network processors (NPs), etc.; they can also be digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.

[0212] In another embodiment of the present invention, a computer-readable storage medium is also provided, which stores a computer program that, when executed by a processor, implements the steps of any of the above simulation test methods.

[0213] In another embodiment of the present invention, a computer program product containing instructions is also provided, which, when run on a computer, causes the computer to perform the steps of any of the simulation test methods described in the above embodiments.

[0214] In the above embodiments, implementation can be achieved, in whole or in part, through software, hardware, firmware, or any combination thereof. When implemented in software, it can be implemented, in whole or in part, as a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of the present invention are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium accessible to a computer or a data storage device such as a server or data center that integrates one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid-state disk (SSD)).

[0215] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0216] The various embodiments in this specification are described in a related manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, the embodiments for apparatus, electronic devices, computer-readable storage media, and computer program product systems are basically similar to the method embodiments, and therefore the descriptions are relatively simple; relevant parts can be referred to the descriptions of the method embodiments.

[0217] The above description is merely a preferred embodiment of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention are included within the scope of protection of the present invention.

Claims

1. A simulation testing method, characterized in that, The method includes: Obtain the first test task corresponding to the first test scenario, wherein each test scenario corresponds to an interface combination, and an interface combination contains one or more protocol interfaces among the protocol interfaces supported by the data communication chip to be tested. Suspend the first test task obtained; Based on the scenario parameters of the first test scenario, the test scenario library is queried to determine whether a simulation test for the first test scenario has been performed. The test scenario library stores scenario parameters for test scenarios for which simulation tests for the data communication chip have been completed. If yes, then the first test task ends; If not, the execution of the first test task is resumed, and the scenario parameters of the first test scenario are stored in the test scenario library; If the regression testing requirements of the data communication chip are not met, obtain a new first test task corresponding to the new first test scenario, and return to the step of suspending the obtained first test task.

2. The method according to claim 1, characterized in that, The step of querying the test scenario library based on the scenario parameters of the first test scenario to determine whether a simulation test for the first test scenario has already been performed includes: Obtain the first hash value of the scenario parameters of the first test scenario; The first hash value is compared with the second hash value of the scene parameters of the test scene stored in the test scene library; If a second hash value exists that is identical to the first hash value, then it is determined that a simulation test for the first test scenario has been performed. If the first hash value is different from all the second hash values, then it is determined that no simulation test for the first test scenario has been performed.

3. The method according to claim 1 or 2, characterized in that, After the first test task is completed, the method further includes: Based on the scenario parameters of the first test scenario, the function of the data communication chip tested by the first test task is determined; The test function coverage information of the data communication chip is updated based on the determined functions.

4. The method according to claim 1 or 2, characterized in that, Before querying the test scenario library based on the scenario parameters of the first test scenario to determine whether a simulation test for the first test scenario has already been performed, the method further includes: Apply for a mutex lock for the test scenario library and lock the test scenario library; After the first test task is completed, or after the scenario parameters of the first test scenario are stored in the test scenario library, the method further includes: Unlock the aforementioned test scenario library.

5. The method according to claim 1 or 2, characterized in that, The method further includes: After the first test task is completed, if a reproduction instruction for the first test scenario is received, a second test task is created based on the scenario parameters of the first test scenario stored in the test scenario library. Perform the second test task.

6. The method according to claim 1 or 2, characterized in that, The test scenario parameters include at least one of the following: The interface types of each protocol interface in the interface combination corresponding to the test scenario; The module information of the communication module to which each protocol interface belongs in the interface combination corresponding to the test scenario in the communication modules included in the data communication chip; The interface number of each protocol interface in the interface combination corresponding to the test scenario; The data transmission rate of each protocol interface in the interface combination corresponding to the test scenario.

7. A simulation testing device, characterized in that, The device includes: The task acquisition module is used to acquire the first test task corresponding to the first test scenario. Each test scenario corresponds to an interface combination, and an interface combination contains one or more protocol interfaces supported by the data communication chip to be tested. The task suspension module is used to suspend the first test task obtained. The scenario library traversal module is used to query the test scenario library based on the scenario parameters of the first test scenario to determine whether a simulation test has been performed for the first test scenario. If yes, the task end module is triggered; if no, the task execution module is triggered. The test scenario library stores scenario parameters for test scenarios for which simulation tests have been completed for the data communication chip. The task termination module is used to terminate the first test task; The task execution module is used to resume the execution of the first test task and store the scenario parameters of the first test scenario in the test scenario library; The task reacquisition module is used to obtain a new first test task corresponding to a new first test scenario when the regression test requirements of the data communication chip are not met, and then return to the task suspension module.

8. The apparatus according to claim 7, characterized in that, The scene library traversal module is specifically used for: Obtain the first hash value of the scenario parameters of the first test scenario; The first hash value is compared with the second hash value of the scene parameters of the test scene stored in the test scene library; If a second hash value exists that is identical to the first hash value, then it is determined that a simulation test for the first test scenario has been performed. If the first hash value is different from all the second hash values, then it is determined that no simulation test for the first test scenario has been performed.

9. The apparatus according to claim 7 or 8, characterized in that, The device further includes: The function determination module is used to determine the function of the data communication chip tested by the first test task based on the scenario parameters of the first test scenario after the first test task is completed. The information update module is used to update the test function coverage information of the data communication chip based on the determined functions.

10. The apparatus according to claim 7 or 8, characterized in that, The device further includes: The scenario library locking module is used to request a scenario library mutex lock and lock the test scenario library before querying the test scenario library based on the scenario parameters of the first test scenario to determine whether a simulation test for the first test scenario has been performed. The scenario library unlocking module is used to unlock the test scenario library after the first test task is completed or after the scenario parameters of the first test scenario are stored in the test scenario library.

11. The apparatus according to claim 7 or 8, characterized in that, The device further includes: The scenario reproduction module is used to, after the first test task is completed, if a reproduction instruction for the first test scenario is received, create a second test task based on the scenario parameters of the first test scenario stored in the test scenario library, and execute the second test task.

12. The apparatus according to claim 7 or 8, characterized in that, The test scenario parameters include at least one of the following: The interface types of each protocol interface in the interface combination corresponding to the test scenario; The module information of the communication module to which each protocol interface belongs in the interface combination corresponding to the test scenario in the communication modules included in the data communication chip; The interface number of each protocol interface in the interface combination corresponding to the test scenario; The data transmission rate of each protocol interface in the interface combination corresponding to the test scenario.

13. An electronic device, characterized in that, It includes a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other through the communication bus; Memory, used to store computer programs; A processor, when executing a program stored in memory, implements the steps of the method described in any one of claims 1-6.

14. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the steps of the method described in any one of claims 1-6.