Simulation test method and device, equipment, storage medium and program product

The hardware simulation unit written through the hardware description language uses excitation signals and status information, combined with reference status information, to solve the problem of low coverage and accuracy of hardware simulation tests in the prior art, and realizes a more comprehensive hardware chip functional test.

CN119088688APending Publication Date: 2024-12-06MOORE THREADS TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411155511.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-21
Publication Date
2024-12-06

AI Technical Summary

Technical Problem

The existing hardware simulation test methods have low coverage and accuracy, and cannot effectively trigger the hardware simulation unit to perform specified functions in various operating states.

Method used

The hardware simulation unit written in the hardware description language uses excitation signals and status information, combined with reference status information, triggers the hardware simulation unit to perform the functions to be tested in a specified state, ensuring the coverage and accuracy of simulation tests.

Benefits of technology

It improves the coverage and accuracy of hardware simulation tests, and can effectively trigger the hardware simulation unit to perform specified functions in various operating states, ensuring that the functional test results of the hardware chip are reliable.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119088688A_ABST
    Figure CN119088688A_ABST
Patent Text Reader

Abstract

The invention discloses a simulation test method, device and equipment, a storage medium and a program product, and relates to the technical field of digital integrated circuit design. The method comprises the following steps: triggering a hardware simulation unit to execute a processing task corresponding to a test case; the hardware simulation unit is written through a hardware description language and is used for simulating a hardware chip; acquiring state information output by the hardware simulation unit, wherein the state information is used for indicating a real-time state of executing the processing task by the hardware simulation unit; and in response to matching of the state information and the reference state information, triggering the hardware simulation unit to execute a specified function of the hardware chip.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of digital integrated circuit (IC) design, and in particular to a simulation test method, device, equipment, storage medium and program product. Background Art

[0002] During the hardware design and development process, it is usually necessary to perform simulation tests on various hardware functions to verify whether the hardware functions normally.

[0003] In the related art, a hardware simulation unit for simulating a hardware chip can be written in advance using a hardware description language, and then the hardware simulation unit can be triggered to perform a predetermined processing task by running a test case. During this process, the test case will trigger the hardware simulation unit to execute the hardware function to be tested.

[0004] However, the above solution of triggering the hardware function to be tested through test cases has the problems of low test coverage and poor test accuracy. Summary of the invention

[0005] The embodiments of the present application provide a hardware simulation test method, device, equipment, storage medium and program product, which can improve the coverage and accuracy of hardware simulation test. The technical solution is as follows.

[0006] On the one hand, a hardware simulation test method is provided, the method comprising:

[0007] Triggering a hardware simulation unit to execute a processing task corresponding to a test case; the hardware simulation unit is written in a hardware description language and is used to simulate the hardware chip;

[0008] Acquire status information output by the hardware simulation unit, wherein the status information is used to indicate a real-time status of the hardware simulation unit executing the processing task;

[0009] In response to the state information matching the reference state information, triggering the hardware simulation unit to execute a specified function of the hardware chip; the reference state information is used to indicate a specified state corresponding to the specified function;

[0010] Among them, if the output result of the hardware simulation unit executing the processing task is normal, it means that the designated function of the hardware chip has passed the test.

[0011] In one aspect, a hardware simulation test device is provided, the device comprising:

[0012] A stimulus function unit, used to trigger the hardware simulation unit to execute the processing task corresponding to the test case; the hardware simulation unit is written in a hardware description language and is used to simulate the hardware chip;

[0013] A trigger function unit, used to obtain status information output by the hardware simulation unit, wherein the status information is used to indicate a real-time status of the hardware simulation unit executing the processing task;

[0014] The trigger function unit is further used to trigger the hardware simulation unit to execute a specified function of the hardware chip in response to the state information matching the reference state information; the reference state information is used to indicate a specified state corresponding to the specified function;

[0015] Among them, if the output result of the hardware simulation unit executing the processing task is normal, it means that the designated function of the hardware chip has passed the test.

[0016] On the other hand, a computer device is provided, which includes a processor and a memory, wherein the memory stores instructions, and the instruction set is loaded and executed by the processor to implement the hardware simulation test method as described above.

[0017] On the other hand, a computer-readable storage medium is provided, wherein instructions are stored in the storage medium, and the instructions are loaded and executed by a processor to implement the hardware simulation test method as described above.

[0018] On the other hand, a computer program product is provided, which includes computer instructions stored in a computer-readable storage medium; the computer instructions are read and executed by a processor of a computer device, so that the computer device implements the hardware simulation test method as described above.

[0019] The beneficial effects brought by the technical solution provided by the embodiment of the present application include at least:

[0020] The present application provides a solution for simulating a hardware chip in a simulation tool in a combination of software and hardware. At the software simulation level, the hardware simulation unit is triggered to perform a processing task through an excitation signal generated during the running of a test case. At the hardware simulation level, when the hardware simulation unit executes to a specified state (corresponding to reference state information), the hardware simulation unit is triggered to perform a specified function to be tested. In the above scheme, different reference state information can be set so that the timing of the hardware simulation unit executing the specified function matches the various operating states of the hardware simulation unit. Specifically, on the one hand, more comprehensive reference state information can be set so that the hardware simulation unit can execute the specified function in as many operating states as possible. On the other hand, specified reference state information can be set so that the hardware simulation unit can execute the specified function in the operating state that the developer is concerned about. Through the above two aspects, the simulation test solution provided by the present application can ensure the coverage and accuracy of the simulation test of the hardware chip. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0022] Figure 1 is a schematic diagram of a context switch involved in the present application;

[0023] Figure 2 It is a framework diagram of a simulation test involved in this application;

[0024] Figure 3 It is a software architecture diagram of a simulation test tool involved in an embodiment of the present application;

[0025] Figure 4 It is a method flow chart of a simulation test method involved in this application;

[0026] Figure 5 It is a software architecture diagram of a simulation test tool involved in an embodiment of the present application;

[0027] Figure 6 It is a software architecture diagram of a simulation test tool involved in an embodiment of the present application;

[0028] Figure 7 It is a software architecture diagram of a simulation test tool involved in an embodiment of the present application;

[0029] Figure 8It is a software architecture diagram of a simulation test tool involved in an embodiment of the present application;

[0030] Fig. 9 It is a software architecture diagram of a simulation test tool involved in an embodiment of the present application;

[0031] Fig.10 It is a process framework diagram of a hardware test involved in this application;

[0032] Fig.11 It is a process framework diagram of another hardware test involved in this application;

[0033] Fig.12 is a block diagram of a simulation test device provided by an exemplary embodiment of the present application;

[0034] Fig.13 It is a structural diagram of a computer device provided by an exemplary embodiment of the present application. DETAILED DESCRIPTION

[0035] In order to make the purpose, technical solution and advantages of this application clearer, the following will further describe the implementation methods of this application in detail with reference to the accompanying drawings. First, some concepts involved in this application are introduced:

[0036] 1) Hardware simulation test

[0037] In digital integrated circuit (IC) design, hardware simulation testing refers to the technology of testing and verifying the function, reliability, stability and performance of hardware through simulation.

[0038] Hardware simulation testing can usually include functional testing, performance testing, and reliability testing.

[0039] Functional testing is one of the basic testing methods in digital IC design. It verifies whether the hardware simulation unit meets the design requirements by testing the various functions of the hardware simulation unit. In functional testing, the input signal of the hardware can be simulated to trigger the hardware simulation unit to perform the corresponding function, and then the output of the hardware simulation unit is checked to see if it meets the expectations to test whether the hardware function meets the design requirements.

[0040] The levels of functional testing of hardware can be as follows:

[0041] Integrated Test (IT) level: Integrate all modules of the hardware together to perform a complete functional test of the hardware;

[0042] Block Test (BT) level: Integrate some closely related modules in the hardware and perform partial function testing of the hardware;

[0043] Unit Test (UT): performs testing on a single module of hardware.

[0044] Hardware simulation testing can be divided into software simulation and hardware simulation. Among them, software simulation is the simulation and verification of the functions and characteristics of hardware chips based on hardware description languages ​​(such as VHDL or Verilog). Software simulation can verify whether the circuit design of the hardware chip meets the design requirements by simulating the hardware behavior in a computer environment.

[0045] The solutions shown in the subsequent embodiments of this application are mainly used in the software simulation stage in digital IC design.

[0046] 2) Context

[0047] In hardware, context is used to indicate the status of the task currently executed by the hardware; specifically, the hardware context may include the status of the program counter and registers. Generally speaking, different hardware contexts may correspond to different tasks.

[0048] 3) Context Switch

[0049] Context switching refers to the process in which the hardware chip pauses the currently executing task A, saves the context corresponding to task A, and then loads the context of new task B into the hardware chip to run the new task B. The above-mentioned saved context can be used to load it into the hardware chip again when task A is rescheduled, so that the hardware chip can resume executing task A.

[0050] The software can trigger the context switching function to flexibly switch multiple tasks executed by the hardware chip at any time according to user needs, ensuring that high-priority tasks can be responded to quickly.

[0051] For example, Figure 1 This is a schematic diagram of a context switch involved in this application. Figure 1 As shown, Figure 1 Part (a) is the case where no context switch occurs. Figure 1 Parts (b) and (c) are where context switches occur.

[0052] like Figure 1 As shown in part (a) of FIG, when no Context Switch occurs, the chip executes tasks in sequence according to n contexts.

[0053] like Figure 1As shown in part (b) of the figure, if the priority of the task corresponding to context 2 is higher than the priority of the task corresponding to context 1, the software can interrupt the task corresponding to context 1 through the Store operation while the chip is executing the task according to context 1, so that the chip can execute the task according to context 2. The software waits for the chip to complete the task according to context 2, and then triggers the chip to continue executing the task according to context 1 through the Resume operation.

[0054] like Figure 1 As shown in part (c) of FIG. 5 , when the chip is executing tasks according to n contexts, the software can trigger the context switching function multiple times.

[0055] In hardware, the Context Switch function itself is not a single functional unit, but a function jointly developed by multiple functional units within the hardware. When the Context Switch function is executed, multiple functional units within the hardware work together to complete the entire context switch process.

[0056] Please refer to Figure 2 , which shows a framework diagram of a simulation test involved in this application, such as Figure 2 As shown, the simulation test framework generally includes the following parts: test case 210, parsing platform 220, test platform 230, hardware simulation unit 240, and reference model 250 of hardware chip.

[0057] The test case 210, the analysis platform 220, the test platform 230, the hardware simulation unit 240, and the reference model 250 of the hardware chip are implemented in a simulation tool through software code or data. The simulation tool can be run in a general computer device (such as a personal computer, a personal workstation or a server, etc.). For example, the simulation tool can be a simulation tool such as a Verilog Compile Simulator (VCS).

[0058] The test case 210 includes tasks or data for testing the functions of the hardware simulation unit 240. For example, the test case may include information or data such as a test target, a test method, and a test script. The test script may be a program code written in C / C++, for example, the test script may be a program code for calling a hardware chip to perform a processing task.

[0059] The parsing platform 220 is a parsing platform for converting the calling behavior of the hardware chip during the running of the test case 210 into a signal (also called a stimulus signal) that can be recognized and executed by the hardware chip / hardware simulation unit 240. The parsing platform 220 can be a program code written in C / C++.

[0060] The testbench 230 may also be referred to as a hardware test environment, which is used to perform operations such as control and signal acquisition on the hardware simulation unit 240 during the hardware simulation test process. The testbench 230 may be a program code written in systemverilog. The simulation test solution provided in the present application is a register transfer level (RTL) simulation solution. In various embodiments of the present application, the above-mentioned testbench 230 may also be referred to as a hardware simulation environment or a universal verification method (UVM) verification environment.

[0061] The hardware simulation unit 240 is a program written in a hardware description language, which is used to simulate the hardware chip; wherein the hardware description language is a language that describes the structure and behavior of digital system hardware in text form, and the hardware description language can represent logic circuit diagrams, logic expressions, and logic functions performed by digital logic systems. Specifically, the hardware simulation unit 240 written in the hardware description language describes the hardware chip based on the transmission between registers, which can simulate the internal circuit of the hardware chip (including circuit elements and their connection methods), and can also simulate the complete timing of the internal circuit of the hardware chip during execution; after complete verification, the hardware simulation unit 240 can also be translated into a circuit diagram of the hardware chip through a synthesis tool.

[0062] The hardware simulation unit 240 may have the complete functions of a hardware chip, or may have partial functions of the hardware.

[0063] In the embodiment of the present application, the hardware chip simulated by the hardware simulation unit 240 may be an integrated IP chip, such as a graphics processing unit (GPU) chip or a central processing unit (CPU) chip, etc.

[0064] The hardware simulation unit 240 may also be referred to as a Design Under Test (DUT) or RTL.

[0065] The reference model 250 is a software model that simulates the functions of the hardware chip. It can simulate the complete process of input, execution and output of the hardware chip to perform tasks by software, and generate corresponding simulation result data. The reference model 250 can be a program code written in C / C++. The difference between the reference model 250 and the hardware simulation unit 240 is that the reference model 250 only needs to simulate the behavior logic of the hardware chip, and does not need to simulate the circuit structure and execution timing of the hardware chip.

[0066] like Figure 2 As shown, the test case 210 and the analysis platform 220 are connected via a software-simulated interface, such as a software-simulated high-speed peripheral component interconnect (Peripheral Component Interconnect-Express, PCI-E) interface, that is, the information / data transmitted between the test case 210 and the analysis platform 220 is information / data that meets the PCI-e protocol; the analysis platform 220 and the test platform 230 are connected via a software-simulated interface, such as a software-simulated advanced eXtensible Interface (AXI) interface, that is, the information / data transmitted between the analysis platform 220 and the test platform 230 is information / data that meets the AXI protocol; the analysis platform 220 and the reference model 250 can be connected via a software-simulated interface (such as an AXI interface), and the test platform 230 and the hardware simulation unit 240 can be connected via a software-simulated interface (such as an AXI interface); optionally, the analysis platform 220 can also be connected to the hardware simulation unit 240 via a software-simulated interface (such as an AXI interface).

[0067] exist Figure 2 In the simulation test framework shown, when the test case 210 is executed, the parsing platform 220 converts and generates a stimulus signal for hardware execution according to the software running status of the test case 210 (specifically, it can be the call status of the hardware chip by the test script in the test case 210); on the one hand, the stimulus signal can be input into the hardware simulation unit 240 to trigger the hardware simulation unit 240 to execute the processing task corresponding to the test case 210, thereby obtaining the actual output result of the hardware simulation unit 240; on the other hand, the stimulus signal can also be used as the input of the reference model 250, and the reference model 250 simulates the logic of the hardware chip executing the processing task corresponding to the test case 210 according to the stimulus signal, thereby obtaining the expected output result consistent with the design expectation of the hardware chip; by comparing the above-mentioned actual output result with the expected output result, it can be determined whether the hardware simulation unit 240 correctly executes the processing task corresponding to the test case 210.

[0068] Through the above Figure 2 In the scenario where the framework shown performs simulation testing on a certain function of a hardware chip (such as a context switching function), if a test case is used to directly trigger the hardware simulation unit 240 to execute the function, then since the test case does not understand the real-time state inside the hardware simulation unit 240, it cannot guarantee that the timing of triggering the hardware simulation unit 240 to execute the function can cover various execution states inside the hardware, resulting in poor coverage and accuracy of the hardware test; for example, assuming that the hardware simulation unit 240 cannot correctly execute the context switching function when the internal state is the specified state A (for example, the state value of some circuit elements reaches the S0 state), and the test case cannot know the internal state of the hardware simulation unit 240, therefore when the hardware simulation unit 240 is triggered to execute the function, the hardware simulation unit 240 is likely not in the specified state A, which results in the test case being unable to test the situation where the hardware simulation unit 240 executes the above function under the specified state A.

[0069] The simulation test solution provided in the embodiment of the present application is Figure 2 Based on the framework shown, the functions of the test platform 230 are expanded to support triggering the hardware simulation unit 240 to execute the hardware function to be tested under a specified hardware state, thereby solving the technical problems of poor coverage and accuracy of the above-mentioned hardware test.

[0070] For example, please refer to Figure 3 , which shows a software architecture diagram of a simulation test tool involved in an embodiment of the present application. Figure 3 As shown, in the embodiment of the present application, the above-mentioned simulation test tool may include an excitation function unit 310 and a trigger function unit 320; the above-mentioned excitation function unit 310 may be based on Figure 2 The analysis platform 220 in the framework shown in the figure is implemented, and the trigger function unit 320 can be based on Figure 2 The test platform 230 shown is implemented; wherein, Figure 3 The interface implementation method between the test case, the stimulus function unit 310, the trigger function unit 320 and the hardware simulation unit in Figure 2 The interface implementation methods among the test cases 210, the parsing platform 220, the test platform 230 and the hardware simulation unit 240 in the illustrated framework are the same and will not be described again here.

[0071] In the solution provided by the embodiment of the present application, one test case may correspond to multiple processing tasks. During a simulation test, the test case may, through the stimulation function unit 310, call the hardware simulation unit to execute each processing task in sequence. At the same time, the trigger function unit 320 may select part or all of the multiple processing tasks mentioned above, and detect the status of the hardware simulation unit executing the processing task in real time on the selected processing task. When it is detected that the hardware simulation unit is in a specified state, the hardware simulation unit is triggered to execute the hardware function to be tested.

[0072] Please refer to Figure 4 , which shows a method flow chart of a simulation test method involved in the present application. The simulation test method can be executed by a computer device running a simulation test tool (such as VCS). Figure 4 As shown, the simulation test method may include the following steps:

[0073] Step 410: The hardware simulation unit is triggered to execute the processing task corresponding to the test case; the hardware simulation unit is written in a hardware description language and is used to simulate the hardware chip.

[0074] Among them, the above-mentioned processing tasks can be tasks supported by hardware chips and hardware simulation units and executed by software calls, such as computing tasks, rendering tasks, audio and video encoding and decoding tasks, etc.

[0075] The above test cases may correspond to multiple processing tasks. When the test cases are running, the hardware simulation unit is called to execute each processing task in sequence (the hardware simulation unit executes one of multiple tasks at the same time). At the same time, the hardware simulation unit also outputs the output results of the processing tasks.

[0076] For example, Figure 3 For example, during the running of the test case, the stimulus function unit 310 can directly send a stimulus signal to the hardware simulation unit, or indirectly send a stimulus signal to the hardware simulation unit through the trigger function unit 320, and the hardware simulation unit performs a processing task according to the stimulus signal.

[0077] Step 420: The status information output by the hardware simulation unit is obtained, where the status information is used to indicate the real-time status of the hardware simulation unit in executing the processing task.

[0078] The above-mentioned status information is used to indicate the real-time internal status of the hardware simulation unit during the execution of the processing task; for example, the status information can indicate the status related to each circuit element simulated by the hardware simulation unit, and for another example, the status information can indicate the execution status of the above-mentioned processing task in the hardware simulation unit (such as the execution progress of the current processing task).

[0079] Since the hardware simulation unit is a program code written in a hardware description language, and the program code is used to simulate a hardware chip, the real-time state of the hardware simulation unit is equivalent to the real-time state of the hardware chip when executing a processing task.

[0080] The above step 420 may be executed by the above trigger function unit 320 .

[0081] In an embodiment of the present application, during the process of the above-mentioned hardware simulation unit executing a processing task, the trigger function unit 320 can collect the real-time status inside the hardware simulation unit when the hardware simulation unit simulates the hardware chip to execute the processing task through the interface between the hardware simulation unit and obtain the above-mentioned status information.

[0082] For example, the trigger function unit 320 can read the signal status or storage value of certain circuit elements (such as registers, counters, multiplexers, etc.) in the hardware simulation unit to obtain the above status information.

[0083] Step 430: In response to the state information matching the reference state information, the hardware simulation unit is triggered to execute the specified function of the hardware chip; the reference state information is used to indicate the specified state corresponding to the specified function.

[0084] The above-mentioned specified function is the function to be tested in the current simulation test process in the hardware chip simulated by the hardware simulation unit.

[0085] The reference state information indicates the state that the hardware simulation unit should have when the specified function is triggered.

[0086] Among them, the above-mentioned reference state information is predetermined state information, and is also state information used to trigger the hardware simulation unit to perform a specified function; in other words, in an embodiment of the present application, by matching the state information corresponding to the real-time state of the hardware simulation unit with the reference state information, the hardware simulation unit can be controlled to execute the function to be tested under a specified operating state.

[0087] Optionally, the data type and format of the reference state information may be consistent with the state information. For example, the state information and the reference state information may be sequences of the same length, each consisting of numerical values.

[0088] The above-mentioned state information matches the reference state information, which may mean that the state information is identical or consistent with the reference state information; or, the above-mentioned state information matches the reference state information, which may mean that the difference between the state information and the reference state information is less than a difference threshold (or that the similarity between the state information and the reference state information is greater than a similarity threshold).

[0089] In different test scenarios of specified functions, the data type and format of the status information used may be the same or different; correspondingly, in different test scenarios of specified functions, the data type and format of the reference status information used may be the same or different.

[0090] The above step 430 may be executed by the above trigger function unit 320 .

[0091] If the output result of the processing task executed by the hardware simulation unit is normal, it can be indicated that the designated function of the hardware chip has passed the test.

[0092] In the embodiment of the present application, the output result of the above-mentioned hardware simulation unit performing the above-mentioned processing task corresponds to Figure 2 When verifying whether the specified function of the hardware simulation unit is normal, the output result of the hardware simulation unit executing the above processing task can be compared with the expected output result. If the two are consistent, it can be considered that the specified function of the hardware simulation unit is normal. The above expected output result can also be obtained by Figure 2 The reference model in the framework shown is generated.

[0093] In summary, the present application provides a solution for simulating a hardware chip in a simulation tool in a combination of software and hardware. At the software simulation level, the hardware simulation unit is triggered to perform processing tasks through the stimulus signal generated during the running of the test case. At the hardware simulation level, when the hardware simulation unit executes to a specified state (corresponding to the reference state information), the hardware simulation unit is triggered to execute the specified function to be tested. In the above scheme, different reference state information can be set so that the timing when the hardware simulation unit executes the specified function matches the various operating states of the hardware simulation unit. Specifically, on the one hand, by setting more comprehensive reference state information, the hardware simulation unit can execute the specified function in as many operating states as possible. On the other hand, by setting specified reference state information, the hardware simulation unit can execute the specified function in the operating state that the developer is concerned about. Through the above two aspects, the present application provides a simulation test solution that can ensure the coverage and accuracy of the simulation test of the hardware chip.

[0094] This application Figure 3 and 4 The solution provided by the embodiment shown can be applied to any test and verification scenario of other hardware functions triggered by software in addition to the basic function of hardware executing processing tasks; for example, the test and verification scenario can include the test and verification scenario of context switch function, the test and verification scenario of turning on or off some computing core functions, etc. Figure 3 and Figure 4 Examples of specific applications of the embodiments shown.

[0095] 1. Test verification scenario of context switching function

[0096] In a test and verification scenario of the context switch function, the above step 430 may be implemented as follows: in response to the state information matching the reference state information, triggering the hardware simulation unit to execute the context switch function of the hardware chip.

[0097] by Figure 3 For example, in the test verification scenario of the context switching function, the above-mentioned stimulus function unit 310 sends a stimulus signal to the above-mentioned hardware simulation unit, calling the hardware simulation unit to execute task 1 of rendering a picture; the above-mentioned trigger function unit 320 obtains status information, and in response to the above-mentioned status information matching the reference status information, triggers the above-mentioned hardware simulation unit to execute the context switching function, for example, triggers the hardware simulation unit to suspend the task of rendering picture 1, and executes task 2 of high-performance computing, or triggers the hardware simulation unit to resume executing another task 3 of rendering a picture, and so on.

[0098] Among them, if the output result of the above-mentioned hardware simulation unit executing the above-mentioned processing task is normal, it can be indicated that the above-mentioned context switching function of the above-mentioned hardware simulation unit has passed the test; specifically, for multiple processing tasks corresponding to a test case, the context switching function only changes the execution order of these processing tasks, but does not change the processing results of these processing tasks. Through the scheme shown in the embodiment of the present application, after the above-mentioned trigger function unit 320 triggers the hardware simulation unit to execute the context switching function, if the hardware simulation unit can correctly execute the context switching function, then the output result of the hardware simulation unit executing the above-mentioned processing task should be consistent with the expected output result of the test case. Conversely, if the output result of the hardware simulation unit executing the above-mentioned processing task is inconsistent with the expected output result of the test case, it means that there is an abnormality in the context switching function of the above-mentioned hardware simulation unit.

[0099] From a hardware perspective, Context Switch can occur at any time / any state during the operation of the hardware chip, and the hardware chip responds to the store and resume events issued by the software according to the established process. In other words, at different simulation moments in the test process, the hardware chip executes the same Context Switch function, but the internal states of the hardware chip corresponding to different simulation moments will be different, and in some internal states of the hardware chip, the ContextSwitch function of the hardware chip may be abnormal. Therefore, the Context Switch function has great randomness and more corner points in chip verification (corner points, that is, complex test points, corresponding to the internal states of the hardware chip that are difficult to cover in this application). Through the scheme shown in the embodiment of the present application, Figure 3 For example, during the Context Switch function test of the hardware chip, the trigger function unit 320 is used to detect the real-time state of the hardware simulation unit during the execution of the processing task, and when the hardware simulation unit is in a specified state (that is, the state corresponding to the above-mentioned reference state information), the hardware simulation unit is triggered to execute the Context Switch function. On the one hand, by predetermining more reference state information, the internal state of the hardware chip when the hardware simulation unit executes the Context Switch function can be covered as much as possible. On the other hand, the reference state information can also be manually specified, so as to test the situation where the hardware simulation unit executes the Context Switch function at a specified corner point.

[0100] 2. Test and verification scenarios for turning on or off some computing core functions

[0101] In the test verification scenario of turning on or off the function of some computing cores, the above step 430 can be implemented as: in response to the state information matching the reference state information, triggering the hardware simulation unit to execute the function of turning on or off some computing cores of the hardware chip.

[0102] by Figure 3 For example, in a test verification scenario of turning on or off the functions of some computing cores, the above-mentioned stimulus function unit 310 can send an stimulus signal to the hardware simulation unit to call the hardware simulation unit to perform a predetermined processing task (such as a convolution calculation task); at the same time, the trigger function unit 320 obtains status information, and in response to the status information matching the reference status information, triggers the above-mentioned hardware simulation unit to execute the function of turning on or off some computing cores.

[0103] Among them, if the output result of the above-mentioned hardware simulation unit executing the above-mentioned processing task is normal, it means that the function of the above-mentioned hardware simulation unit to turn on or off some computing cores has passed the test; specifically, for multiple processing tasks corresponding to a test case, the number of computing cores enabled by the hardware chip only changes the execution speed / execution time of these processing tasks, but does not change the processing results of these processing tasks. For example, for the task of rendering a picture, the time for the hardware chip to process the task through one computing core may be 1ms, and the time for processing the task through 100 computing cores may be 0.01ms, but the final rendering result should be consistent; Figure 3 For example, through the scheme shown in the embodiment of the present application, after the trigger function unit 320 triggers the hardware simulation unit to execute the function of turning on or off some computing cores, if the hardware simulation unit can correctly execute the function of turning on or off some computing cores, then the output result of the hardware simulation unit executing the above processing task should be consistent with the expected output result of the test case, otherwise it means that there is an abnormality in the function of turning on or off some computing cores of the above hardware simulation unit.

[0104] based on Figure 3 and Figure 4 In the embodiment shown, in the case of the test verification scenario of the above-mentioned context switching function, the above-mentioned specified function includes a context switching function, and the above-mentioned status information may include at least one of circuit status information and task status information; wherein the above-mentioned circuit status information is used to indicate the operating status of the hardware circuit in the hardware chip simulated by the above-mentioned hardware simulation unit; and the above-mentioned task status information is used to indicate the execution status of the processing task in the above-mentioned hardware simulation unit.

[0105] Among them, the operating status of the above-mentioned hardware circuit may refer to the operating status of each circuit / functional component in the hardware simulation unit during the execution of the processing task (for example, not executed, ready to execute, executing, execution completed, etc.).

[0106] The execution status of the above-mentioned processing task in the above-mentioned hardware simulation unit may refer to the progress status of the processing task currently being executed by the hardware simulation unit, such as the preparation status before task execution, the status during task execution, the status after task execution is completed, etc.

[0107] In the context switching function test verification scenario above, the above Figure 4 Step 430 in the illustrated embodiment may be implemented as the following steps 430a and 430b.

[0108] Step 430a:In response to the circuit state information matching the first reference state information, the hardware simulation unit is triggered to perform a context switching save operation; the save operation includes pausing the first task being executed and saving the task state of the first task; the first reference state information is used to indicate the operating state specified by the hardware circuit.

[0109] Among them, the simulation tool can compare the circuit state information with the first reference state information. When the above circuit state information is the same as the first reference state information, or the similarity is greater than a preset similarity threshold, it can be considered that the operating state of the hardware circuit in the hardware chip simulated by the above hardware simulation unit meets the predetermined state that needs to trigger the save operation. At this time, the simulation tool can trigger the hardware simulation unit to perform the save operation. At this time, the hardware simulation unit can suspend the current task (i.e., the above first task) and save the task state of the first task (such as task processing progress, intermediate data of task processing) in the specified register or shared memory, so as to resume the first task later. Among them, the above specified register or shared memory can be a register or memory simulated by the hardware simulation unit.

[0110] In an embodiment of the present application, the simulation tool can simulate hardware behavior to trigger the hardware simulation unit to perform a save operation of a context switch. For example, the simulation tool can configure the registers corresponding to the save operation in the hardware simulation unit to trigger the hardware simulation unit to perform a save operation of a context switch.

[0111] Step 430b: In response to the task status information matching the second reference status information, the hardware simulation unit is triggered to perform a context switch recovery operation; the recovery operation includes resuming execution of the first task according to the saved task status of the first task; the second reference status information is used to indicate the specified running status of the processing task.

[0112] Among them, the simulation tool can obtain task status information (for example, after triggering the save operation, obtaining the task status information), and compare the task status information with the second reference status information. When the above task status information is the same as the second reference status information, or the similarity is greater than a preset similarity threshold, it can be considered that the progress status of other tasks processed by the hardware simulation unit after pausing the first task meets the predetermined running status that needs to trigger the recovery operation. At this time, the simulation tool can trigger the hardware simulation unit to perform the recovery operation. The hardware simulation unit reads the previously saved status information of the first task from the specified register or shared memory, and resumes the execution of the first task through the read task status of the first task.

[0113] In an embodiment of the present application, the simulation tool can simulate hardware behavior to trigger the hardware simulation unit to perform a recovery operation of a context switch. For example, the simulation tool can configure the registers corresponding to the recovery operation in the hardware simulation unit to trigger the hardware simulation unit to perform a recovery operation of a context switch.

[0114] For example, based on the above Figure 3 For the software architecture shown, please refer to Figure 5 , which shows a software architecture diagram of a simulation test tool involved in an embodiment of the present application. Figure 5 As shown, the trigger function unit 320 triggers the hardware simulation unit to perform a context switching save (store) operation in response to the circuit state information matching the first reference state information.

[0115] exist Figure 5 In the embodiment, the trigger function unit 320 is further used to trigger the hardware simulation unit to perform a resume operation of the context switch in response to the task state information matching the second reference state information.

[0116] In an embodiment of the present application, the save operation of the context switch (corresponding to the store event sent by the software) may occur at any time. In this regard, the operating status of the hardware circuit in the hardware simulation unit is detected to trigger the hardware simulation unit to perform the save operation under a predetermined state of the hardware circuit, so as to ensure the coverage and accuracy of the save operation in the context switching function executed by the test hardware simulation unit; and the recovery operation of the context switch (corresponding to the recovery event sent by the software) requires that the hardware simulation unit first complete the complete execution process of other tasks. In this regard, the progress status of the processing task in the hardware simulation unit is detected to trigger the hardware simulation unit to perform the recovery operation, thereby ensuring the correctness of the execution timing of the recovery operation of the context switch.

[0117] Based on the solutions provided by the above embodiments of the present application, in some embodiments, the above circuit state information includes one or more of the following information:

[0118] 1) The state value of one or more state machines simulated by the above hardware simulation unit.

[0119] In hardware chips, the state machine can be composed of state registers and combinational logic circuits. It can transfer states according to pre-set states based on control signals. It is the control center that coordinates related signal actions and completes specific operations. Large integrated chips usually have multiple complex state machines inside, which control the execution process of different complex logic functions.

[0120] The state value of the state machine can represent different states of the hardware; for example: idle, reset, execute, end, etc.

[0121] In an embodiment of the present application, the hardware simulation unit may include multiple simulated circuits / functional components. The hardware simulation unit requires multiple circuits / functional components to cooperate in performing the above-mentioned processing tasks. Corresponding state machines may be set in some circuits / functional components, and the state value of the state machine may represent the state of the current circuit / functional component. If the state value of the state machine inside the hardware simulation unit changes, it means that the operating state of the hardware circuit in the hardware simulation unit changes, indicating that the processing tasks in the test case have been executed at different stages in the hardware simulation unit.

[0122] In the embodiment of the present application, Figure 3 For example, the trigger function unit 320 can obtain the state values ​​of all state machines in the hardware simulation unit, or the state values ​​of one or more state machines pre-specified in the hardware simulation unit. The state values ​​of these state machines are arranged in a certain order, which can constitute the above-mentioned circuit state information.

[0123] 2) The signal value of one or more circuit elements simulated by the above hardware simulation unit.

[0124] The signal value of the above circuit element may include at least one of the following:

[0125] Received signal values ​​sent by other circuit elements;

[0126] the value of signals sent to other circuit elements;

[0127] Internally generated signal values;

[0128] The internally stored value of the signal.

[0129] In the embodiment of the present application, each circuit / functional component simulated in the hardware simulation unit may include at least one circuit element, each circuit element may correspond to one or more signal values, and different types of circuit elements may correspond to different types of signal values; for example, the clock circuit of the hardware simulation unit may include a simulated MOS tube, which may output a clock signal, and for another example, the hardware simulation unit may include simulated multiple registers, each of which may receive a setting signal (used to control the register to write data) and an enable signal (used to control the register to output data), etc. sent by other circuit elements. When the hardware simulation unit executes the processing task in the test case, the signal value of the circuit element simulated in the hardware simulation unit changes, which means that the operating state of the hardware circuit in the hardware simulation unit has changed, indicating that the execution process of the processing task has reached a different stage.

[0130] In the embodiment of the present application, Figure 3For example, the trigger function unit 320 can obtain the signal values ​​of some specified circuit elements in the hardware simulation unit. The signal values ​​of these circuit elements are arranged in a certain order, which can constitute the above circuit state information.

[0131] The scheme shown in the above-mentioned embodiments of the present application provides a method of using the state value of a state machine simulated by a hardware simulation unit or the signal value of a circuit element as the circuit state information of the hardware simulation unit, so that the circuit state information can accurately represent the operating state of the hardware circuit, and then can accurately trigger the hardware simulation unit to execute the store operation in the context switching function when the hardware circuit of the hardware simulation unit is in a predetermined operating state, thereby ensuring the accuracy of the store operation triggering.

[0132] Based on the solution provided by the above embodiments of the present application, in some embodiments, the above task status information includes: a task status identifier, used to indicate whether the above hardware simulation unit has completed the execution of the second task, and the above second task is a processing task performed by the above hardware simulation unit after the above save operation.

[0133] For example, Figure 3 For example, during the execution of the first task by the hardware simulation unit, the trigger function unit 320 triggers the hardware simulation unit to perform a store operation, the hardware simulation unit suspends the first task and saves the status information of the first task, and then switches to execute the second task according to the order of tasks in the test case; during the execution of the second task, the hardware simulation unit can output a task status identifier, for example, the hardware simulation unit can output a task status identifier indicating that the second task is not completed when the execution of the second task begins, and the hardware simulation unit can output a task status identifier indicating that the second task is completed when the execution of the second task ends.

[0134] Among them, the above-mentioned task status identifier can be a 1-bit signal (such as a signal named task_finish); for example, when the value of task_finish is 1, it indicates that the hardware simulation unit has completed the execution of the second task, and when the value of task_finish is 0, it indicates that the hardware simulation unit has not completed the execution of the second task; or, when the value of task_finish is 1, it indicates that the hardware simulation unit has not completed the execution of the second task, and when the value of task_finish is 0, it indicates that the hardware simulation unit has completed the execution of the second task.

[0135] In the embodiment of the present application, when the above-mentioned task status information includes a task status identifier, the second reference status information may be status information for indicating that the hardware simulation unit has completed the second task.

[0136] Through the scheme shown in the embodiment of the present application, when the acquired task status information indicates that the hardware simulation unit has completed the second task, the hardware simulation unit is triggered to resume the execution of the first task, thereby avoiding triggering the recovery operation during the execution of the task by the hardware simulation unit and ensuring the accuracy of the recovery operation triggering.

[0137] Based on the solution provided by the above embodiments of the present application, in some embodiments, the above task status information may include, in addition to the task status identifier, a recovery requirement identifier, which is used to indicate whether the above first task has a requirement to resume execution in the above hardware simulation unit.

[0138] In some embodiments, the recovery requirement flag is set by the hardware simulation unit when the hardware simulation unit determines whether to perform a save operation. For example, when the hardware simulation unit is triggered to perform a save operation and determines that the save operation needs to be performed, the recovery requirement flag can be set to indicate that the first task has a need to resume execution in the hardware simulation unit; conversely, when the hardware simulation unit is triggered to perform a save operation and determines that the save operation does not need to be performed, the recovery requirement flag can be set to indicate that the first task does not have a need to resume execution in the hardware simulation unit.

[0139] In an embodiment of the present application, the above-mentioned hardware simulation unit may have the ability to decide whether to execute a store operation upon receiving a store event (that is, being triggered to execute a store operation); for example, when the hardware simulation unit receives a store event, it may determine whether to execute a store operation based on the execution progress of the current task.

[0140] For example, when the hardware simulation unit receives a store event, if the current task (such as the first task mentioned above) is about to be completed, the time required to execute the store operation may be sufficient for the first task to be completed. In this case, the hardware simulation unit can determine not to execute the store operation but continue to execute the first task. If the current task has just started to execute and has not reached the progress of completion, it can be determined to execute the store operation and switch to execute the second task.

[0141] For example, assuming that the first task is a computing task, which has 10 computing steps, when the hardware simulation unit receives a store event, if the first task has executed to the last computing step, the hardware simulation unit can determine on its own not to perform the store operation; when the hardware simulation unit receives a store event, if the first task has not executed to the last computing step, the hardware simulation unit determines to perform the store operation.

[0142] In an embodiment of the present application, after the hardware simulation unit receives a store event and determines whether to execute a store operation, it can output a recovery requirement identifier; for example, when the hardware simulation unit determines to execute a store operation, it can output a recovery requirement identifier indicating that the first task has a need to resume execution; when the hardware simulation unit determines not to execute a store operation, it can output a recovery requirement identifier indicating that the first task does not have a need to resume execution.

[0143] Among them, the above-mentioned recovery requirement identifier can also be a 1-bit signal (such as a signal named need_resume); for example, when the value of need_resume is 1, it indicates that the first task has the need to resume execution, and when the value of need_resume is 0, it indicates that the first task does not have the need to resume execution; or, when the value of need_resume is 1, it indicates that the first task does not have the need to resume execution, and when the value of need_resume is 0, it indicates that the first task has the need to resume execution.

[0144] In the embodiment of the present application, when the task status information also includes a resume requirement identifier, the second reference status information may also include status information indicating that the first task has a resume requirement. That is, the task status information includes both the task_finish and need_resume values, and accordingly, the second reference status information also includes both the task_finish and need_resume values. Figure 3 For example, when the values ​​of task_finish and need_resume in the task status information are the same as the values ​​of task_finish and need_resume in the second reference status information, the triggering function unit 320 triggers the hardware simulation unit to perform a recovery operation to resume execution of the first task.

[0145] Through the scheme shown in the embodiment of the present application, when the acquired task status information indicates that the hardware simulation unit has completed the second task and there is a need to resume execution of the first task, the hardware simulation unit is triggered to resume execution of the first task, thereby avoiding triggering the recovery operation during the execution of the task by the hardware simulation unit, and avoiding triggering the recovery operation when resume is not needed, thereby ensuring the accuracy of triggering the recovery operation.

[0146] In some embodiments, in the context switching function test verification scenario, the state information may include circuit state information but not task state information; that is, the trigger function unit may not trigger the recovery operation, and the recovery operation trigger logic may be executed by the test case. Figure 5In the software architecture shown, the trigger function unit 320 can only obtain circuit status information, and when the circuit status information matches the first reference status information, trigger the hardware simulation unit to perform a save operation of the context switch; after the hardware simulation unit performs the save operation, the relevant information of the save operation can be sent to the test case, and the test case subsequently obtains the task status information of the hardware simulation unit, and when the above task status information matches the second reference status information, the test case triggers the hardware simulation unit to perform a recovery operation of the context switch.

[0147] Based on the solution provided by the above-mentioned embodiments of the present application, in some embodiments, in the case of the test verification scenario of the above-mentioned context switching function, the above-mentioned step 430a can be implemented as follows: in response to the circuit state information matching the first reference state information, a hit signal is generated; in response to the hit signal, the hardware simulation unit is triggered to perform a save operation.

[0148] The hit signal may be a 1-bit signal. For example, the hit signal may be a "store_flag=1" signal, that is, the signal name is "store_flag" and the value is "1".

[0149] In the scheme shown in the embodiment of the present application, by distinguishing the function of detecting the hit condition of the save operation from the function of triggering the hardware simulation unit to perform the save operation, the condition detection process of the save operation and the triggering process of the save operation are implemented through decoupled code modules, thereby simplifying the complexity of a single code module and ensuring the stability of the save operation trigger.

[0150] based on Figure 5 For the software architecture shown, please refer to Figure 6 , which shows a software architecture diagram of a simulation test tool involved in an embodiment of the present application. Figure 6 As shown, the trigger function unit 320 includes: a hit detection unit 320a, a save trigger unit 320b and a restore trigger unit 320c.

[0151] The hit detection unit 320a, the save trigger unit 320b, and the restore trigger unit 320c can be functional units configured by developers in advance in the test platform built by the VCS simulation tool by writing execution codes. For example, the hit detection unit 320a, the save trigger unit 320b, and the restore trigger unit 320c are all program codes written by developers through SystemVerilog, and these program codes cooperate to realize the functions of the trigger function unit 320.

[0152] The hit detection unit 320a is used to send a hit signal to the save trigger unit 320b in response to the circuit state information matching the first reference state information. For example, the hit detection unit 320a can be responsible for obtaining the circuit state information of the hardware simulation unit, and comparing the obtained circuit state information with the first reference state information to determine whether the circuit state information matches the first reference state information (for example, whether they are the same). If the comparison result is determined to be a match, it means that the obtained circuit state information hits the first reference state information. At this time, the hit detection unit 320a can send a hit signal to the save trigger unit 320b.

[0153] Taking the above hit signal being a "store_flag=1" signal as an example, the above hit detection unit 320a sends the hit signal to the save trigger unit 320b, which can also be called the hit detection unit 320a writing "store_flag=1" to the save trigger unit 320b.

[0154] The save trigger unit 320b is used to trigger the hardware simulation unit to perform a save operation in response to receiving the hit signal. For example, when the hit signal is received, the save trigger unit 320b can configure the save register in the hardware simulation unit (for example, set the value in the save register) through the software-simulated AXI interface between the hardware simulation unit and the hardware simulation unit. The hardware simulation unit detects that the save register has received the configuration, and can perform the save operation.

[0155] Optionally, after the save trigger unit 320b triggers the hardware simulation unit to perform the save operation, the hit signal may be reset to a miss signal, indicating that the triggering of the save operation has been completed, or indicating that there is currently no unfinished save operation.

[0156] For example, after the save trigger unit 320b receives the "store_flag=1" signal, it can trigger the hardware simulation unit to execute the logic of the save operation, and then reset "store_flag=1" to "store_flag=0"; wherein the operation of the above-mentioned save trigger unit 320b resetting "store_flag=1" to "store_flag=0" can also be called writing "store_flag=0".

[0157] The above-mentioned recovery trigger unit 320c is used to trigger the hardware simulation unit to perform a recovery operation in response to the above-mentioned task state information matching the second reference state information. For example, the recovery trigger unit 320c can configure the recovery register in the hardware simulation unit through the software-simulated AXI interface between the hardware simulation unit and the hardware simulation unit. The hardware simulation unit detects that the recovery register has received the configuration, and can perform the recovery operation.

[0158] In an embodiment of the present application, the recovery trigger unit 320c can be responsible for obtaining the task status information of the hardware simulation unit, and comparing the obtained task status information with the second reference status information to determine whether the task status information matches the second reference status information (for example, whether they are the same). If the comparison result is determined to be a match, it means that the obtained task status information hits the above-mentioned second reference status information. At this time, the recovery trigger unit 320c can trigger the hardware simulation unit to perform a recovery operation.

[0159] For example, the second reference state information is task_finish=1&&need_resume=1, and the recovery trigger unit 320c can continuously / periodically obtain the values ​​of the task_finish and need_resume signals output by the hardware simulation unit. If the values ​​of the task_finish and need_resume signals output by the hardware simulation unit are both 1, the hardware simulation unit is triggered to perform a recovery operation.

[0160] Optionally, the hit detection unit 320a and the save trigger unit 320b may also be implemented as the same functional unit, that is, the trigger function unit 320 implements the functions of the hit detection unit 320a and the save trigger unit 320b through one functional unit.

[0161] Optionally, when the hit detection unit 320a and the save trigger unit 320b are implemented as the same functional unit, the functional unit can directly trigger the hardware simulation unit to perform a save operation without generating the above-mentioned hit signal, after comparing the acquired circuit state information with the first reference state information and determining that the circuit state information matches the first reference state information.

[0162] Based on the solutions provided in the above embodiments of the present application, in some embodiments, the above Figure 4 The illustrated embodiment further includes the following steps: receiving configured first reference state information, or randomly determining the first reference state information.

[0163] In the embodiment of the present application, the first reference status information may be status information configured outside the trigger function unit manually or in other ways.

[0164] Among them, the first reference state information of the above-mentioned receiving configuration may refer to the complete information content of the received first reference state information, for example, a sequence composed of state values ​​of one or more state machines in a received hardware simulation unit, or a sequence composed of signal values ​​of one or more circuit elements in a received hardware simulation unit.

[0165] Alternatively, a number of candidate circuit state information may be pre-set in the above-mentioned simulation tool, each candidate circuit state information may be a sequence of state values / signal values, and each candidate circuit state information corresponds to its own identifier (such as a number); the first reference state information of the above-mentioned receiving configuration may refer to the identifier of receiving the first reference state information.

[0166] For example, combined Figure 6 For the software architecture shown, please refer to Figure 7 , which shows a software architecture diagram of a simulation test tool involved in this application. Figure 7 As shown, the above-mentioned hit detection unit 320a is also used to receive the configured first reference state information (corresponding to the first reference state information) before sending the hit signal to the storage trigger unit in response to the circuit state information matching the first reference state information. Figure 7 cond_X in .

[0167] exist Figure 7 In the above-mentioned hit detection unit 320a, an input interface for information can be provided to the outside (such as an AXI interface of software simulation, or an internal software interface of the test platform), and a first reference state information input from the outside can be received through the input interface. In the subsequent simulation test process, the hit detection unit 320a can compare the circuit state information obtained from the hardware simulation unit with the first reference state information configured and input from the outside to determine whether to send a hit signal.

[0168] Through the scheme shown in the above-mentioned embodiment of the present application, the first reference state information input from the outside can be received, and the simplicity of the hit detection logic can be ensured, thereby ensuring that the hit detection function can be reliably executed.

[0169] Based on the solutions provided in the above embodiments of the present application, in some embodiments, the above Figure 3 The illustrated embodiment further includes the following steps: displaying a configuration interface; and receiving first reference state information configured in the configuration interface.

[0170] In an embodiment of the present application, the simulation tool may provide an interface for configuring the first reference state information so that the user can manually configure the first reference state information.

[0171] For example, combined Figure 7 For the software architecture shown, please refer to Figure 8 , which shows a software architecture diagram of a simulation test tool involved in this application. Figure 8As shown, the above-mentioned simulation test tool also includes: a parameter configuration unit 330; the above-mentioned parameter configuration unit 330 is used to display a configuration interface; obtain the above-mentioned first reference state information configured in the above-mentioned configuration interface; and input the obtained above-mentioned first reference state information into the above-mentioned hit detection unit 320a.

[0172] In an embodiment of the present application, the computer device may provide a display unit (such as a display) and an input unit (such as a keyboard, a mouse). At the same time, the developer / tester may pre-configure the above-mentioned parameter configuration unit 330 in a test platform built based on a simulation tool. The parameter configuration unit 330 may display a configuration interface in the display unit, receive the first reference state information configured by the developer / tester through the configuration interface, and input the first reference state information into the hit detection unit 320a.

[0173] Through the scheme shown in the above embodiment of the present application, the developer / tester can manually configure the first reference state information through the configuration interface, thereby supporting the developer / tester to customize the first reference state information and ensuring the flexibility of the trigger condition setting of the above save operation.

[0174] In the embodiment of the present application, the first reference state information may also be randomly determined by the simulation tool.

[0175] For example, Figure 6 For example, in some embodiments, the hit detection unit 320a is further configured to randomly determine the first reference state information before sending the hit signal to the save trigger unit 320b in response to the circuit state information matching the first reference state information. That is, the first reference state information can be determined by the hit detection unit 320a itself.

[0176] In a possible implementation, when a plurality of candidate circuit state information are set in the hit detection unit 320a, the hit detection unit 320a may randomly determine the first reference state information from the plurality of candidate circuit state information.

[0177] For example, a random identifier generator may be provided in the hit detection unit 320a, and the random identifier generator may randomly generate an identifier from identifiers of a plurality of candidate circuit state information, and the candidate circuit state information corresponding to the identifier is the first reference state information.

[0178] In another possible implementation, the hit detection unit 320a may also randomly generate the first reference state information according to the structural rules of the circuit state information; for example, taking the circuit state information as a sequence consisting of a number of state values / signal values ​​arranged in sequence, for each position in the sequence, the hit detection unit 320a may randomly generate the state value / signal value at the corresponding position, thereby obtaining the first reference state information.

[0179] For example, a random value generator may be set in the hit detection unit 320a. For each position in the sequence of the circuit state information, a different state machine / circuit element may correspond to each position. The value ranges of the state value / signal value corresponding to different state machines / circuit elements may also be different. The hit detection unit 320a may randomly determine a state value / signal value from the value range of the state value / signal value of the corresponding position through the random value generator, thereby obtaining the first reference state information. Specifically, assuming that the circuit state information is composed of the state values ​​of three state machines arranged in sequence, the value range of the state value of the first state machine is 0 to 3, the value range of the state value of the second state machine is 1 to 3, and the value range of the state value of the third state machine is 0 to 2; then the hit detection unit 320a may randomly determine the first state value in the first reference state information from 0 to 3, randomly determine the second state value in the first reference state information from 1 to 3, and randomly determine the third state value in the first reference state information from 0 to 2 through the random value generator.

[0180] In the scheme shown in the embodiment of the present application, the execution of the store operation can be triggered by the randomly determined first reference state information, thereby automatically triggering the test of the store function of the hardware simulation unit to ensure the efficiency of the test. At the same time, since the first reference state information corresponds to the operating state of the randomly determined hardware circuit, the randomness of the test process of the hardware simulation unit can be guaranteed, thereby ensuring the coverage of the context switching function test.

[0181] In another possible implementation, the first reference state information may also be randomly generated by the parameter configuration unit 330 and input into the hit detection unit 320a, wherein the manner in which the parameter configuration unit 330 randomly generates the first reference state information may be similar to the manner in which the hit detection unit 320a randomly generates the first reference state information, which will not be repeated here.

[0182] Based on the solutions provided by the above embodiments of the present application, in some embodiments, in the scenario of simulating the context switching function of the hardware chip, the test case corresponds to multiple processing tasks; Figure 3 The illustrated embodiment also includes the following steps:

[0183] Obtain the number of test tasks N, where N is less than or equal to the number of processing tasks corresponding to the test case, and N is a positive integer; the number of test tasks N is used to indicate that in the process of each of the N processing tasks corresponding to the test case being executed, the steps of triggering the hardware simulation unit to perform a save operation in response to the circuit state information matching the first reference state information are respectively executed.

[0184] In an embodiment of the present application, the process of running the above-mentioned test case once corresponds to a simulation process. During one simulation process, the hardware simulation unit can be triggered to perform multiple processing tasks, and the test platform can trigger a save operation during the execution of some or all of the processing tasks (i.e., the above-mentioned N processing tasks).

[0185] For example, combining Figure 6 For the software architecture shown, please refer to Fig. 9 , which shows a software architecture diagram of a simulation test tool involved in this application. Fig. 9 As shown, the above-mentioned hit detection unit 320a is also used to obtain the number of test tasks N (ie Fig. 9 cnt_X in the test case), the test task number N is the number of times the hit detection unit 320a sends the hit signal to the save trigger unit 320b during one run of the test case; N is less than or equal to the number of processing tasks corresponding to the test case, and N is a positive integer;

[0186] The hit detection unit 320a is used to execute the step of sending a hit signal to the save trigger unit 320b in response to the circuit state information matching the first reference state information during the process of the hardware simulation unit executing each of the N processing tasks corresponding to the test case.

[0187] In which, during each execution of the test case, the hardware simulation unit can execute multiple processing tasks (for example, M processing tasks, M is an integer greater than or equal to N), and the hit detection unit 320a can respectively detect whether the circuit state information matches the first reference state information on N of the M processing tasks.

[0188] For example, assuming that a test case corresponds to 10 processing tasks (corresponding to 10 contexts), during one execution of the test case, the number of test tasks N can be any value between 1 and 10.

[0189] Before a test case is executed once, the hit detection unit 320a can determine the number of test tasks N mentioned above. When the test case starts to be executed, the analysis platform triggers the hardware simulation unit to start execution from the first processing task through an excitation signal. At the same time, when each processing task starts to be executed, the analysis platform notifies the hit detection unit 320a of the information that the processing task starts to be executed. When the hardware simulation unit completes each processing task, it can also notify the hit detection unit 320a of the completion of the processing task directly or indirectly through the analysis platform. In this way, the hit detection unit 320a can understand the start of each run of the test case. time point and end time point, as well as the start execution time point and end execution time point of each processing task in the test case; through the above time points, the hit detection unit 320a can determine which processing task in the test case the processing task currently executed by the hardware simulation unit is, and determine whether the processing task belongs to the processing task that needs to be tested. When it is determined that the processing task currently executed by the hardware simulation unit is the processing task that needs to be tested, the hit detection unit 320a can obtain the circuit status information of the hardware simulation unit, and compare the obtained circuit status information with the first reference status information to determine whether a hit signal needs to be sent.

[0190] In an embodiment of the present application, during one execution of a test case, each of the above-mentioned N processing tasks can be limited to triggering the sending of a hit signal at most once; for example, when it is determined that the processing task currently executed by the hardware simulation unit is a processing task that needs to be tested, the hit detection unit 320a compares the acquired circuit state information with the first reference state information. If the comparison determines that the circuit state information matches the first reference state information, a hit signal is sent, and during the execution of the current processing task, the circuit state information is no longer acquired.

[0191] Through the scheme shown in the embodiment of the present application, for a test case, the condition detection and triggering process of the save operation can be executed in multiple processing tasks therein, so that multiple save operations can be triggered during the execution of a test case, thereby improving the testing efficiency of the save operation of the context switching function.

[0192] Based on the solution provided by the above embodiments of the present application, in some embodiments, in the scenario of simulating the context switching function of the hardware chip, the step of obtaining the number of test tasks N may include: receiving the configured number of test tasks N; or, randomly determining the number of test tasks N.

[0193] by Fig. 9 For example, in some embodiments, the hit detection unit 320a is used to receive the input of the above-mentioned test task number N, or randomly determine the above-mentioned test task number N.

[0194] In the embodiment of the present application, the number of test tasks N can be set by the outside of the hit detection unit 320a and input into the hit detection unit 320a. For example, the number of test tasks N can be set by the development / test personnel through Figure 8 The parameter configuration unit 330 in the example may manually set the parameter and input it into the hit detection unit 320a, or the parameter configuration unit 330 may randomly generate the parameter and input it into the hit detection unit 320a.

[0195] Alternatively, the above-mentioned test task number N can also be randomly determined by the hit detection unit 320a. For example, a random number generator is set in the hit detection unit 320a. Before each test case is run, the hit detection unit 320a can use the random number generator to randomly determine a value from 1 to M as the test task number N.

[0196] Through the scheme shown in the embodiment of the present application, the number of test tasks N can support input from the outside, as well as an internally randomly determined setting method, thereby ensuring the flexibility of setting the number of test tasks N.

[0197] Based on the solution provided by the above embodiments of the present application, in some embodiments, in the scenario of simulating the context switching function of the hardware chip, the above Figure 4 The method shown also includes: randomly determining N processing tasks from a plurality of processing tasks corresponding to the test case; or, receiving a task indication, the task indication being used to indicate the N processing tasks.

[0198] For the M processing tasks in the above test case, in addition to determining the number of processing tasks N that need to be tested, it is also necessary to determine which specific N processing tasks are to be tested. In the embodiment of the present application, the execution process of which processing tasks triggers the save operation can also be determined by external input or randomly.

[0199] by Fig. 9 For example, in some embodiments, the hit detection unit 320a is further used to randomly determine the N processing tasks from the processing tasks corresponding to the test case, or to receive an input task indication, where the task indication is used to indicate the N processing tasks.

[0200] In an embodiment of the present application, after determining the number of test tasks N, the hit detection unit 320a can randomly determine N processing tasks among the M processing tasks of the test case; for example, the M processing tasks are numbered from 0 to M-1. After determining the number of test tasks N, the hit detection unit 320a can use a random number generator to randomly determine N different numbers in the range of 0 to M-1 as the numbers of the N processing tasks.

[0201] Alternatively, the numbers of the N processing tasks may also be set by an external part of the hit detection unit 320a and input into the hit detection unit 320a. For example, the numbers may be set by a developer / tester through Figure 8 The parameter configuration unit 330 in the program may manually set and input the numbers of the N processing tasks, or the parameter configuration unit 330 may randomly generate the numbers of the N processing tasks and input them into the hit detection unit 320a.

[0202] Through the scheme shown in the embodiment of the present application, the number of test tasks N can support input from the outside, as well as an internally randomly determined setting method, thereby ensuring the flexibility of the processing tasks that trigger the save operation.

[0203] In the embodiment of the present application, among the above-mentioned N processing tasks, the first reference state information corresponding to different processing tasks may be the same or different.

[0204] The N processing tasks and the first reference state information can be set accordingly. In addition, various setting methods of the number of test tasks N, the N processing tasks and the first reference state information can be used in combination.

[0205] For example, when the above-mentioned number of test tasks N, N processing tasks and first reference status information are manually set by the development / testing personnel, the development / testing personnel can set the above-mentioned N processing tasks through the configuration interface displayed by the parameter configuration unit 330, and set the first reference status information for each of the N processing tasks.

[0206] For another example, when the above-mentioned number of test tasks N and N processing tasks are manually set by the development / testing personnel, the development / testing personnel can set the above-mentioned N processing tasks through the configuration interface displayed by the parameter configuration unit 330 and input the hit detection unit 320a. The hit detection unit 320a or the parameter configuration unit 330 can randomly set the corresponding first reference state information for the N processing tasks.

[0207] For another example, when the above-mentioned number of test tasks N and the first reference state information are manually set by the development / tester, the development / tester can set the above-mentioned number of test tasks N and the first reference state information used for each test through the configuration interface displayed by the parameter configuration unit 330. The hit detection unit 320a or the parameter configuration unit 330 can randomly select N processing tasks from the M processing tasks of the test case according to the number of test tasks N, and randomly associate the N processing tasks with the first reference state information used for each test. Subsequently, during the execution of each task processing of the N processing tasks, the hit detection unit 320a can obtain the circuit state information of the hardware simulation unit, and compare it with the first reference state information associated with the current processing task to determine whether to send a hit signal.

[0208] For another example, when the above-mentioned first reference state information is manually set by the developer / tester, the developer / tester can set one or more first reference state information through the configuration interface displayed by the parameter configuration unit 330, and the hit detection unit 320a or the parameter configuration unit 330 can randomly select N processing tasks from the M processing tasks of the test case, and randomly associate each of the N processing tasks with a first reference state information set by the developer / tester.

[0209] The schemes shown in the above embodiments can be implemented as a ContextSwitch verification method and device for an integrated IP chip that combines software and hardware, based on the complex business scenarios of the software, and combined with the randomness of hardware verification to realize context switch verification in large systems. The basic principle of this scheme is: the way of triggering the Context Switch event by configuring the STORE and RESUME registers in the software is converted to a hardware verification platform (Testbench). Among them, the process of implementing the Context Switch verification method by combining the software and hardware can be as follows:

[0210] S1, prepare the software's Context Switch scenario-related test cases;

[0211] S2, cancel the configuration operation of Context STORE and RESUME registers in the test case;

[0212] S3, executing the test case during the hardware verification process; the stimulus function unit 310 transmits the stimulus signal generated during the test case execution process to the hardware simulation unit;

[0213] S4, the hardware verification environment (i.e., the trigger function unit 320) configures the Context Store register;

[0214] S5, the hardware simulation unit executes the Context Store process;

[0215] S6, after the Store process is completed, the hardware simulation unit automatically determines whether Resume is needed. If necessary, the hardware automatically writes the value of the need_resume register to 1 (ie, need_resume = 1);

[0216] S7, when the next Context is executed, the hardware verification environment queries the need_resume register; if the value of the need_resume register is 1, the Context Resume register is configured in the hardware verification environment; the hardware simulation unit executes the Context Resume process, and then continues to execute the task of the Context;

[0217] Among them, Context Switch only changes the execution time and order of the Context in the test case, and does not affect the execution result of the test case; at the end of the test case, that is, after all the Context in the test case is executed, the final result of the execution of the hardware simulation unit is compared with the final result of the execution of the reference model.

[0218] In order to achieve the above objectives, this application adopts the following technical solutions:

[0219] On the one hand, a scheme to control the random triggering of context switch in hardware verification environment is proposed, please refer to Fig.10 , which shows a process framework diagram of a hardware simulation test involved in the present application. The verification environment construction process of the hardware simulation test can be as follows:

[0220] Step 1, establish a hit detection unit; wherein, the hit detection unit can generate or determine various constraints according to demand (waiting for the state value of some key state machines inside the hardware), which type of constraints to use can be flexibly controlled by simulation parameters, and then wait for the state of the hardware simulation unit to meet the constraints. If store_flag=0, write store_flag=1.

[0221] Step 2: Establish a save trigger unit; the save trigger unit can wait for store_flag=1, trigger a store operation on the hardware simulation unit, and then write store_flag=0 to interrupt the task (context) currently executed by the hardware simulation unit.

[0222] Step 3: Establish a recovery trigger unit; the recovery trigger unit can wait for the task executed inside the hardware simulation unit to end, check the task status information task_finish=1&&need_resume=1 of the hardware simulation unit, and then trigger the resume operation on the hardware simulation unit to resume the previously interrupted task.

[0223] Step 4: After the test case is executed, compare the processing results of the hardware simulation unit with the expected results output by the reference model.

[0224] On the other hand, a method for randomly triggering Context Switch multiple times in a hardware verification environment is proposed. Please refer to Fig.11 , which shows a process framework diagram of another hardware simulation test involved in the present application. The process of the hardware simulation test can be as follows:

[0225] Step 1, the hit detection unit obtains the number of ContextSwitch times in one test case run from the simulation parameter cnt_X; for the same test case, cnt_X can be configured to different values; wherein, when cnt_X is not passed in from the outside, the hardware verification environment (such as the hit detection unit) randomly determines cnt_X; cnt_X can control the number of context switches that occur during one simulation process.

[0226] Step 2, the hit detection unit obtains the constraint condition for the occurrence of Context Switch (i.e., the first reference state information mentioned above) from the simulation parameter cond_X, waits for the state of execution of the hardware circuit to satisfy the constraint condition, and sends store_flag=1 to the save trigger unit; for the same test case, cond_X can be configured to different values; wherein, when cond_X is not transmitted externally, the hardware verification environment (such as the hit detection unit) randomly determines cond_X; optionally, cond_X can control in a simulation process, in which state the specified state machine in the hardware-related sample occurs context switch.

[0227] Step 3: Save the trigger unit as a loop unit, and trigger the store operation by configuring the store register when store_flag=1 is received.

[0228] Step 4: The recovery trigger unit is a cyclic unit. When task_finish=1&&need_resume=1 is received, the resume operation is triggered by configuring the resume register.

[0229] The above scheme of the present application provides a context switch random triggering method combining software and hardware; wherein random constraints can be added independently, the simulation flexibly controls the constraint selection, and the number of times the context switch can be continuously triggered in one simulation is controllable.

[0230] Based on the above Figure 3 or Figure 4 In the embodiment shown, in some embodiments, when the specified function includes turning on or off the function of part of the computing core, the status information includes circuit status information; the circuit status information is used to indicate the operating status of the hardware circuit in the hardware chip simulated by the hardware simulation unit; the above step 430 can be implemented as: in response to the circuit status information matching the third reference status information, triggering the hardware simulation unit to perform the operation of turning on or off part of the computing core; the third reference status information is used to indicate the specified operating status of the hardware circuit.

[0231] Among them, in the scenario of simulating and testing the function of turning on or off some computing cores, the simulation tool can compare the circuit state information with the third reference state information. When the above circuit state information is the same as the third reference state information, or the similarity is greater than a preset similarity threshold, it can be considered that the operating state of the hardware circuit in the hardware chip simulated by the above hardware simulation unit meets the predetermined state, and the simulation tool can trigger the hardware simulation unit to turn on or off some computing cores.

[0232] In an embodiment of the present application, the way in which the hardware simulation unit turns on or off some computing cores (such as turning on some computing cores, the number of computing cores turned on, turning off some computing cores, the number of computing cores turned off, etc.) triggered by the simulation tool can be randomly determined by the simulation tool, or can be manually set by the tester.

[0233] Among them, the circuit state information used in the scenario of simulating the function of turning on or off some computing cores and the circuit state information used in the scenario of simulating the context switching function may have the same information type and format or may be different.

[0234] Please refer to Fig.12 , which shows a block diagram of a simulation test device provided by an exemplary embodiment of the present application, the simulation test device can implement the above Figure 4 All or part of the steps in the corresponding method embodiments. Fig.12 As shown, the simulation test device may include:

[0235] The stimulus function module 1201 is used to trigger the hardware simulation unit to execute the processing task corresponding to the test case; the hardware simulation unit is written in a hardware description language and is used to simulate the hardware chip;

[0236] A trigger function module 1202 is used to obtain status information output by the hardware simulation unit, where the status information is used to indicate the real-time status of the hardware simulation unit executing the processing task;

[0237] The trigger function module 1202 is further used to trigger the hardware simulation unit to execute the specified function of the hardware chip in response to the state information matching the reference state information; the reference state information is used to indicate the specified state corresponding to the specified function;

[0238] Among them, if the output result of the hardware simulation unit executing the processing task is normal, it means that the designated function of the hardware chip has passed the test.

[0239] The functions of the above-mentioned incentive function module 1201 can be referred to in the above-mentioned embodiment. Figure 3 , Figures 5 to 9 For the functions of the trigger function module 1202, please refer to the corresponding embodiments in the above embodiments. Figure 3 , Figures 5 to 9 Description of the trigger function unit 320 in .

[0240] In a possible implementation, the designated function includes a context switching function, and the state information includes at least one of circuit state information and task state information; the circuit state information is used to indicate the running state of a hardware circuit in a hardware chip simulated by the hardware simulation unit; and the task state information is used to indicate the execution state of the processing task in the hardware simulation unit;

[0241] The trigger function module 1202 is used to:

[0242] In response to the circuit state information matching the first reference state information, triggering the hardware simulation unit to perform a context switching save operation; the save operation includes pausing the first task being executed and saving the task state of the first task; the first reference state information is used to indicate the specified operating state of the hardware circuit;

[0243] In response to the task status information matching the second reference status information, the hardware simulation unit is triggered to perform a context switch recovery operation; the recovery operation includes resuming execution of the first task based on the saved task status of the first task; the second reference status information is used to indicate the running status specified by the processing task.

[0244] In a possible implementation manner, the circuit state information includes one or more of the following information:

[0245] state values ​​of one or more state machines simulated by the hardware simulation unit;

[0246] The hardware simulation unit simulates signal values ​​of one or more circuit elements.

[0247] In a possible implementation, the task status information includes:

[0248] The task status identifier is used to indicate whether the hardware simulation unit has completed the execution of the second task, where the second task is a processing task performed by the hardware simulation unit after the saving operation.

[0249] In a possible implementation, the task status information further includes:

[0250] The recovery requirement flag is used to indicate whether the first task has a requirement to resume execution in the hardware simulation unit.

[0251] In a possible implementation, the recovery requirement flag is set by the hardware simulation unit when the hardware simulation unit determines whether to perform the save operation.

[0252] In a possible implementation, the trigger function module 1202 includes:

[0253] a hit detection submodule, configured to generate a hit signal in response to the circuit state information matching the first reference state information;

[0254] A save trigger submodule, configured to trigger the hardware simulation unit to perform the save operation in response to the hit signal;

[0255] The recovery trigger submodule is used to trigger the hardware simulation unit to perform the recovery operation in response to the task state information matching the second reference state information.

[0256] For the functions of the hit detection submodule, please refer to the corresponding Figures 6 to 9 For the description of the hit detection unit 320a in FIG. 1 , please refer to the corresponding embodiment in the above embodiment for the function of the save trigger submodule. Figures 6 to 9 The description of the save trigger unit 320b in the above embodiment is provided for the function of the restore trigger submodule. Figures 6 to 9 Description of the recovery trigger unit 320c in.

[0257] In a possible implementation manner, the hit detection submodule is further configured to receive the configured first reference state information, or to randomly determine the first reference state information.

[0258] In a possible implementation, the test case corresponds to a plurality of the processing tasks;

[0259] The hit detection submodule is also used to obtain the number of test tasks N, where N is less than or equal to the number of processing tasks corresponding to the test case, and N is a positive integer; the number of test tasks N is used to indicate that during the execution of each of the N processing tasks corresponding to the test case, the steps of triggering the hardware simulation unit to perform the saving operation in response to the matching of the circuit state information with the first reference state information are respectively executed.

[0260] In a possible implementation, the hit detection submodule is used to receive the configured number N of test tasks, or to randomly determine the number N of test tasks.

[0261] In a possible implementation, the hit detection submodule is further used to randomly determine N processing tasks from the multiple processing tasks corresponding to the test case, or to receive a task indication, where the task indication is used to indicate the N processing tasks.

[0262] In a possible implementation, the designated function includes turning on or off a function of a portion of a computing core, and the state information includes circuit state information; the circuit state information is used to indicate an operating state of a hardware circuit in a hardware chip simulated by the hardware simulation unit;

[0263] The trigger function module is used to trigger the hardware simulation unit to execute the operation of turning on or off part of the computing core in response to the circuit state information matching the third reference state information; the third reference state information is used to indicate the specified operating state of the hardware circuit.

[0264] Please refer to Fig.13 , Fig.1313 is a schematic diagram of the structure of a computer device provided by an exemplary embodiment of the present application. The computer device 1300 includes a central processing unit (CPU) 1301, a system memory 1304 including a random access memory (RAM) 1302 and a read-only memory (ROM) 1303, and a system bus 1305 connecting the system memory 1304 and the central processing unit 1301. The computer device 1300 also includes a basic input / output system (I / O system) 1306 that helps transmit information between various devices in the computer, and a large-capacity storage device 1307 for storing an operating system 1313, application programs 1314 and other program modules 1315.

[0265] The basic input / output system 1306 includes a display 1308 for displaying information and an input device 1309 such as a mouse and a keyboard for user inputting information. The display 1308 and the input device 1309 are connected to the central processing unit 1301 through an input / output controller 1310 connected to the system bus 1305. The basic input / output system 1306 may also include an input / output controller 1310 for receiving and processing inputs from a plurality of other devices such as a keyboard, a mouse, or an electronic stylus. Similarly, the input / output controller 1310 also provides output to a display screen, a printer, or other types of output devices.

[0266] The mass storage device 1307 is connected to the central processing unit 1301 through a mass storage controller (not shown) connected to the system bus 1305. The mass storage device 1307 and its associated computer readable medium provide non-volatile storage for the computer device 1300. That is, the mass storage device 1307 may include a computer readable medium (not shown) such as a hard disk or a CD-ROM (Compact Disc Read-Only Memory) drive.

[0267] Without loss of generality, the computer-readable medium may include computer storage media and communication media. Computer storage media include volatile and non-volatile, removable and non-removable media implemented by any method or technology for storing information such as computer-readable instructions, data structures, program modules or other data. Computer storage media include RAM (Random Access Memory), ROM (Read-Only Memory), EPROM (Erasable Programmable Read-Only Memory), EEPROM (Electrically Erasable Programmable Read-Only Memory), flash memory or other solid-state storage technologies, CD-ROM, DVD (Digital Video Disc) or other optical storage, cassettes, tapes, disk storage or other magnetic storage devices. Of course, those skilled in the art will appreciate that the computer storage media is not limited to the above. The above-mentioned system memory 1304 and mass storage device 1307 can be collectively referred to as memory.

[0268] The computer device 1300 can be connected to the Internet or other network devices through a network interface unit 1311 connected to the system bus 1305 .

[0269] The memory also includes one or more programs / instructions, which are stored in the memory. The central processing unit 1301 implements all or part of the steps in the methods shown in the above-mentioned embodiments of the present application by executing the one or more programs / instructions.

[0270] In an exemplary embodiment, a computer program product is also provided, the computer program product includes computer instructions, the computer instructions are stored in a computer-readable storage medium. The processor of the computer device reads and executes the computer instructions from the computer-readable storage medium to implement all or part of the steps of the method shown in the above embodiments of the present application.

[0271] In an exemplary embodiment, a computer-readable storage medium is further provided, in which instructions are stored. The instructions are loaded and executed by a processor to implement all or part of the steps of the method shown in the above-mentioned embodiments of the present application.

[0272] A person skilled in the art will understand that all or part of the steps of implementing the above embodiments may be accomplished by hardware or by calling related hardware through a program, and the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a disk or an optical disk, etc.

[0273] The above are only optional embodiments of the present application and are not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application should be included in the protection scope of the present application.

Claims

1. A simulation test method, characterized in that: The method comprises: triggering a hardware simulation unit to execute at least one processing task corresponding to the test case; the hardware simulation unit is written in a hardware description language and is used to simulate a hardware chip; Acquire status information output by the hardware simulation unit, wherein the status information is used to indicate a real-time status of the hardware simulation unit executing the processing task; In response to the state information matching the reference state information, triggering the hardware simulation unit to execute a specified function of the hardware chip; the reference state information is used to indicate a specified state corresponding to the specified function; Among them, if the output result of the hardware simulation unit executing the processing task is normal, it means that the designated function of the hardware chip has passed the test.

2. The method according to claim 1, characterized in that The designated function includes a context switching function, and the state information includes at least one of circuit state information and task state information; the circuit state information is used to indicate the running state of the hardware circuit in the hardware chip simulated by the hardware simulation unit; the task state information is used to indicate the execution state of the processing task in the hardware simulation unit; In response to the state information matching the reference state information, triggering the hardware simulation unit to execute a specified function of the hardware chip includes: In response to the circuit state information matching the first reference state information, triggering the hardware simulation unit to perform a context switching save operation; the save operation includes pausing the first task being executed and saving the task state of the first task; the first reference state information is used to indicate the specified operating state of the hardware circuit; In response to the task status information matching the second reference status information, the hardware simulation unit is triggered to perform a context switch recovery operation; the recovery operation includes resuming execution of the first task based on the saved task status of the first task; the second reference status information is used to indicate the running status specified by the processing task.

3. The method according to claim 2, characterized in that The circuit status information includes one or more of the following information: state values ​​of one or more state machines simulated by the hardware simulation unit; The hardware simulation unit simulates signal values ​​of one or more circuit elements.

4. The method according to claim 2, characterized in that: The task status information includes: The task status identifier is used to indicate whether the hardware simulation unit has completed the execution of the second task, where the second task is a processing task performed by the hardware simulation unit after the saving operation.

5. The method according to claim 4, characterized in that The task status information also includes: The recovery requirement flag is used to indicate whether the first task has a requirement to resume execution in the hardware simulation unit.

6. The method according to claim 5, characterized in that The recovery requirement flag is set by the hardware simulation unit when the hardware simulation unit determines whether to perform the saving operation.

7. The method according to any one of claims 2 to 6, characterized in that: In response to the circuit state information matching the first reference state information, triggering the hardware simulation unit to perform a context switching save operation includes: generating a hit signal in response to the circuit state information matching the first reference state information; In response to the hit signal, the hardware simulation unit is triggered to perform the save operation.

8. The method according to claim 7, characterized in that The method further comprises: The configured first reference state information is received, or the first reference state information is determined randomly.

9. The method according to claim 2, characterized in that: The test case corresponds to a plurality of the processing tasks; the method further comprises: Obtain the number of test tasks N, where N is less than or equal to the number of the processing tasks corresponding to the test case, and N is a positive integer; the number of test tasks N is used to indicate that in the process of each of the N processing tasks corresponding to the test case being executed, in response to the circuit state information matching the first reference state information, the step of triggering the hardware simulation unit to perform the save operation is executed respectively.

10. The method according to claim 9, characterized in that The obtaining of the number of test tasks N includes: Receive the configured number N of test tasks; or, The number N of test tasks is determined randomly.

11. The method according to claim 9, characterized in that The method further comprises: Randomly determine N of the processing tasks from the multiple processing tasks corresponding to the test case; or, A task indication is received, where the task indication is used to indicate N of the processing tasks.

12. The method according to claim 1, characterized in that The designated function includes a function of turning on or off a part of the computing core, and the state information includes circuit state information; the circuit state information is used to indicate the running state of the hardware circuit in the hardware chip simulated by the hardware simulation unit; In response to the state information matching the reference state information, triggering the hardware simulation unit to execute a specified function of the hardware chip includes: In response to the circuit state information matching the third reference state information, triggering the hardware simulation unit to execute an operation of turning on or off a portion of the computing cores; The third reference state information is used to indicate a specified operating state of the hardware circuit.

13. A simulation test device, characterized in that: The device comprises: The stimulus function module is used to trigger the hardware simulation unit to execute the processing task corresponding to the test case; the hardware simulation unit is written in a hardware description language and is used to simulate the hardware chip; A trigger function module, used for obtaining status information output by the hardware simulation unit, wherein the status information is used for indicating a real-time status of the hardware simulation unit executing the processing task; The trigger function module is further used to trigger the hardware simulation unit to execute a specified function of the hardware chip in response to the state information matching the reference state information; the reference state information is used to indicate a specified state corresponding to the specified function; Among them, if the output result of the hardware simulation unit executing the processing task is normal, it means that the designated function of the hardware chip has passed the test.

14. A computer device, characterized in that: The computer device includes a processor and a memory, wherein instructions are stored in the memory, and the instructions are executed by the processor to implement the simulation test method according to any one of claims 1 to 12.

15. A computer-readable storage medium, characterized in that: The storage medium stores instructions, and the instructions are executed by a processor of a computer device to implement the simulation test method according to any one of claims 1 to 12.

16. A computer program product, characterized in that The computer program product includes computer instructions, which are stored in a computer-readable storage medium; the computer instructions are read and executed by a processor of a computer device to implement the simulation test method as described in any one of claims 1 to 12.