Processor function verification method, device and medium
By performing processor state analysis from the dimension of the instruction in vector CPU verification, combined with simulation and reference log information, the problem that the collaborative simulation solution cannot verify the vector CPU function is solved, and the automatic verification of vector processors and product quality assurance is realized.
Patent Information
- Application Number
- CN202311865385.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-29
- Publication Date
- 2024-11-05
- Estimated Expiration
- 2043-12-29
AI Technical Summary
The existing co-simulation co-simulation solution cannot effectively verify the function of the vector CPU, resulting in the failure of Trace Log comparison and the wrong judgment results.
By determining test case information, executing target test instructions, obtaining simulation tracking log information, and combining reference log recording information for processor status analysis, making judgments from the dimensions of the instructions, generating processor status analysis results, and outputting function verification error prompt information or Continue running the signal.
It realizes effective verification of vector processor functions, ensures the quality of processor products, and avoids erroneous judgments caused by single log text judgment standards in traditional co-sim solutions.
Smart Images

Figure CN117827563B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer processor technology, and in particular to a processor function verification method, device and medium. Background Art
[0002] In order to meet the growing demand for computing and processing, one of the difficulties in the design of modern central processing units (CPUs) is to further improve their computing capabilities. The introduction of vector parallel computing capabilities is the core idea of the current mainstream CPU architectures, which mainly further develops and improves Scalable Vector Extensions (SVE) in the latest architecture.
[0003] Like the verification of other components of CPU design, the verification of Vector components also needs to consider the register (RTL) code coverage and the completeness of test cases. However, due to the characteristics of Vector parallel computing, the verification methods and ideas of Vector components are not exactly the same as those of other CPU components. At present, in the verification process of CPU, in addition to the Universal Verification Methodology (UVM) commonly used in RTL, the co-simulation co-simulation method is mainly used for verification. In co-sim, an assumption is made: that is, the execution instruction stream sequence and state changes generated by the same program in two environments are completely consistent. This assumption is not a problem in previous CPU designs. Whether it is an in-order CPU or an out-of-order CPU, their performance at the architecture level is completely consistent, that is, the performance level of the trace log (Trace Log) should be completely consistent. However, after the introduction of Vector parallel computing, this assumption is no longer valid. Because in the process of parallel computing, the Single Instruction Multiple Data (SIMD) method is used, so although it is the same instruction, the state changes of the CPU system may be diverse. Due to the inconsistency of status updates, if the traditional co-sim judgment criteria are used, this will cause the Trace Log comparison to fail and result in erroneous judgment results. Summary of the invention
[0004] In view of this, the present application provides a processor function verification method, device and medium to solve the problem that the existing collaborative simulation co-sim solution cannot verify the vector CPU function.
[0005] In a first aspect, the present application provides a processor function verification method, comprising:
[0006] Determine test case information, wherein the test case information is used to test the processor system for simulation operation;
[0007] The test processor system executes a target test instruction, wherein the target test instruction is at least one but not all instructions in the test case information;
[0008] Acquire simulation tracking log information generated by the test processor system executing target test instructions;
[0009] After collecting the simulation tracking log information corresponding to the target test instruction, generating a simulation clock pause message, wherein the simulation clock pause message is used to notify the test processor system to pause operation;
[0010] Based on the simulation tracking log information corresponding to the target test instruction, combined with the reference log record information corresponding to the target test instruction, a processor state analysis is performed to obtain a processor state analysis result corresponding to the target test instruction;
[0011] If the processor state analysis result is a processor state change abnormal result, outputting processor function verification error prompt information based on the processor state change abnormal result;
[0012] If the processor state analysis result is a normal result of the processor state change, then based on the normal result of the processor state change, the test processor system is triggered by a clock excitation signal to continue running the test case information.
[0013] In a second aspect, the present application provides a processor function verification device, comprising:
[0014] A test case determination module, used to determine test case information, wherein the test case information is used to test the processor system for simulation operation;
[0015] A simulation operation module, used for testing the processor system to execute a target test instruction, wherein the target test instruction is at least one but not all instructions in the test case information;
[0016] A simulation tracking log information acquisition module, used to acquire simulation tracking log information generated by the test processor system executing the target test instruction;
[0017] A simulation clock pause module, used for generating a simulation clock pause message after collecting the simulation tracking log information corresponding to the target test instruction, wherein the simulation clock pause message is used for notifying the test processor system to pause operation;
[0018] A processor state analysis module, used to perform processor state analysis based on the simulation tracking log information corresponding to the target test instruction and in combination with the reference log record information corresponding to the target test instruction, to obtain a processor state analysis result corresponding to the target test instruction;
[0019] A verification failure prompt module, configured to output processor function verification error prompt information based on the abnormal processor state change result when the processor state analysis result is an abnormal processor state change result;
[0020] The function verification result module is used to trigger the test processor system to continue to run the test case information through a clock excitation signal based on the normal result of the processor state change when the processor state analysis result is a normal result of the processor state change.
[0021] In a third aspect, the present application further provides a computer storage medium storing a computer program, which, when executed by a processor, implements the steps of the processor function verification method described in the present application.
[0022] The above-mentioned technical solution provided in the embodiment of the present application is used to perform simulation operation on the test processor system after determining the test case information. The test processor system executes the target test instruction, and obtains the simulation tracking log information generated by the test processor system executing the target test instruction, so as to realize the collection of the simulation tracking log information, and generate a simulation clock pause message after collecting the simulation tracking log information corresponding to the target test instruction. The simulation clock pause message is used to notify the test processor system to suspend the operation, and then the processor state analysis can be performed based on the simulation tracking log information corresponding to the target test instruction and the reference log record information corresponding to the target test instruction, so as to make a judgment from the dimension of the instruction and obtain the processor state analysis result corresponding to the target test instruction. If the processor state If the analysis result is an abnormal result of the processor state change, then based on the abnormal result of the processor state change, a processor function verification error prompt information is output; if the processor state analysis result is a normal result of the processor state change, then based on the normal result of the processor state change, the test processor system is triggered by a clock excitation signal to continue running the test case information, thereby realizing automatic verification of the processor. Compared with the traditional collaborative simulation co-sim verification scheme, the embodiment of the present application makes judgments from the dimension of instructions and no longer uses a single log text as the judgment standard. It solves the problem that the vector CPU function cannot be verified due to the existing collaborative simulation co-sim scheme using a single log text as the judgment standard, and can effectively verify the vector processor function and determine the product quality of the processor. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and, together with the description, serve to explain the principles of the invention.
[0024] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0025] Figure 1 A schematic diagram of the state change caused by executing instruction LD1W on the first platform provided by the prior art;
[0026] Figure 2 A schematic diagram of state changes caused by executing instruction LD1W on the second platform provided by the prior art;
[0027] Figure 3 A schematic diagram of a process flow of a processor function verification method provided in an embodiment of the present application;
[0028] Figure 4 This is a schematic diagram of storing an execution instruction and the resulting state change information through a dictionary structure in an example of the present application;
[0029] Figure 5 A schematic diagram of a processor verification method using a real-time comparison method provided for an example of this application;
[0030] Figure 6 A schematic diagram of a method for implementing processor verification in a quasi-real-time manner provided for an example of this application;
[0031] Figure 7 A structural block diagram of a processor function verification device provided in an embodiment of the present application;
[0032] Figure 8 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0033] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.
[0034] The disclosure below provides many different embodiments or examples to implement different structures of the present invention. In order to simplify the disclosure of the present invention, the parts and settings of specific examples are described below. Of course, they are only examples, and the purpose is not to limit the present invention. In addition, the present invention can repeat reference numbers and / or letters in different examples. This repetition is for the purpose of simplification and clarity, and does not itself indicate the relationship between the various embodiments and / or settings discussed.
[0035] In related technologies, Vector computing is usually introduced into CPU design to improve CPU computing power and meet the growing needs of graphics, images, audio and video processing, as well as the computing power requirements of edge / cloud computing and machine learning. However, the introduction of Vector computing into CPU design requires consideration of many factors, including: the length Vlen of the Vector, the number of lanes for parallel computing, the layout of the pipeline, the throughput of the Load Store Unit (LSU), and the resulting increase in power consumption and area. Therefore, the design of Vector is not achieved overnight, and it requires repeated modifications and iterations during the design process, and requires differentiated design based on specific CPU specifications and application scenario requirements.
[0036] In order to ensure the product quality of the CPU, it is usually necessary to verify the designed CPU function, such as using the co-sim method for verification. The main core idea is to run the same test case in the CPU RTL simulation environment to be tested and the golden instruction simulator at the same time, and compare the trace log information generated by both parties through post-comparison or real-time comparison to determine whether the CPU design has flaws or errors. Among them, the golden instruction simulator is a golden model that has been repeatedly verified and is recognized as a reliable reference object. However, after the introduction of Vector parallel computing, because the CPU uses the Single Instruction Multiple Data (SIMD) method in the process of parallel computing, although it is the same instruction, the state changes of the CPU system may be diverse. For example, through the Vector instruction, multiple units (Elements) in a Vector register are stored in the specified memory space, or loaded from the specified memory space to the specified Vector register. Although the final result is the same, the access order of the memory space reflected in the Trace Log may not necessarily be the same. For example, taking the state changes generated by the same instruction LD1W of the same test case on different platforms as an example, such as Figure 1As shown, the state change caused by executing instruction LD1W on the first platform is from 00000001 to 00000002, then to 00000003 and 00000004, while the state change caused by executing instruction LD1W on the first platform is from 00000002 to 00000003, then to 00000004 and 00000003, as shown in Figure 2 As shown in the figure, although the final results of the two platforms after executing instruction LD1W are 00000004, 00000003, 00000002 and 00000001, due to the inconsistency of state updates, if the traditional co-sim judgment criteria are used, the Trace Log comparison will fail, resulting in incorrect judgment results.
[0037] In order to solve the above technical problems, the embodiments of the present application provide a processor function verification method, device and medium to improve and optimize the existing collaborative simulation co-sim verification method to ensure that the verification method remains effective in the test environment of the CPU that supports Vector.
[0038] Reference Figure 3 , shows a schematic flow chart of the steps of a processor function verification method provided by an embodiment of the present application. Figure 3 As shown, the processor function verification method provided by the embodiment of the present application may specifically include the following steps:
[0039] Step 310: determine test case information, where the test case information is used to test the processor system for simulation operation.
[0040] Among them, the test processor system refers to the processor system that needs to be tested currently. The test processor system can output Trace Log information. For example, when a newly designed CPU system is used as a test processor system, relevant simulation code can be added in the CPU's execution transaction commit (Commit) phase or instruction retire (Retire) phase, so that the CPU system as a test processor system can output the instruction sequence of the CPU operation, and can output the CPU state change after each instruction is executed as Trace Log information. It should be noted that the CPU state change may include general register updates, system control status register CSR updates, memory unit updates, etc., and this embodiment does not limit this; the test case information may refer to a test case, such as a test case written manually for a specific test function, or a random test case automatically generated by automated software, and this embodiment does not limit this.
[0041] Specifically, in order to verify the processor function of the test processor system, this embodiment can select one or more test cases from a pre-generated test case set for the test processing system before testing, and the information of the selected test cases can be determined as test case information. For example, in the case where the test processing system is a CPU system to be tested, simulation tools such as VCS or Verilator can be used to compile the RTL of the CPU system to be tested in combination with some peripheral IPs to generate a simulation environment that can be run, so that the CPU RTL simulation model corresponding to the simulation environment can be determined as the CPU system to be tested as a test processing system; then, for the CPU system to be tested, a specified test case for verifying the CPU function can be obtained to determine the information of the specified test case as test case information. Among them, the peripheral IP can include a serial port, a memory model, etc., which is not limited in this embodiment; the specified test case can refer to a specified test case, which can specifically include a Vector test case, so that the Vector test case can be used to verify the Vectored CPU function in the future, and the automatic verification of the Vectored CPU function can be realized.
[0042] Step 320, the test processor system executes a target test instruction, where the target test instruction is at least one but not all instructions in the test case information;
[0043] Step 330, obtaining simulation tracking log information generated by the test processor system executing the target test instruction;
[0044] Specifically, in order to verify the processor function, after determining the test case information, the present embodiment can allow the test processor system to load the instructions in the test case information and run them, so that the test processor system generates its own tracking log information, and the tracking log information can be used as simulation tracking log information. Therefore, the present embodiment can obtain the simulation log information generated by the test processor system executing the target test instruction to realize the collection of simulation log information.
[0045] Step 340: after collecting the simulation tracking log information corresponding to the target test instruction, generate a simulation clock pause message, wherein the simulation clock pause message is used to notify the test processor system to pause operation.
[0046] Specifically, after obtaining the simulation log information generated by the test processor system executing the target test instruction, this embodiment can determine whether the simulation tracking log information corresponding to the target test instruction has been collected; if the simulation tracking log information corresponding to the target test instruction has not been collected, the simulation tracking log information generated by the test processor system executing the same target test instruction can continue to be obtained until the simulation tracking log information corresponding to the same target test instruction is collected. It is considered that the simulation tracking log information corresponding to the target test instruction is collected, so that the simulation tracking log information corresponding to the target test instruction can be analyzed and compared based on the simulation tracking log information corresponding to the target test instruction and the reference log record information corresponding to the target test instruction, that is, step 350 is executed.
[0047] Among them, the reference log recording information may refer to the log recording information used as a reference, which can be specifically used to determine the processor state changes that need to be achieved after the target test instruction is executed. For example, the reference log recording information may be the log recording information generated after the processor reference model system executes the target test instruction. The log recording information can be used to determine the CPU state changes of the processor reference model system after the target test instruction is executed.
[0048] It should be noted that the processor reference model system refers to a reference system that can be used as a reference system for designing a processor, such as a golden instruction model ISS. The golden instruction model ISS can be a golden instruction model ISS specified by some specific instruction set architecture, or it can be a product provided by a commercial manufacturer. Of course, it can also be a golden instruction model ISS developed by itself and has been repeatedly verified. This embodiment does not limit this.
[0049] For example, a mature commercial CPU system provided by a commercial manufacturer can be used as a golden model system; the golden model system supports the Trace Log function, can output the instruction sequence of the CPU operation, and can output the CPU state changes after each instruction is executed. Specifically, it can be used to load the test case specified in the test case information to run and generate corresponding log information as reference log information. The reference log information can include reference log record information corresponding to each test instruction in the test case information, such as reference log record information corresponding to the target test instruction. The reference log record information can be used to determine the CPU state changes after the target test instruction is executed. The target test instruction is an instruction in the test case information.
[0050] Step 350, performing processor state analysis based on the simulation tracking log information corresponding to the target test instruction and combining the reference log record information corresponding to the target test instruction to obtain a processor state analysis result corresponding to the target test instruction;
[0051] Specifically, after obtaining the target test instruction generated by the test processor system executing the target test instruction, the present embodiment can analyze and compare the simulation tracking log information with the reference log record information corresponding to the target test instruction, and compare the CPU state change of the test processor system after the target test instruction is executed with the CPU state change generated after the processor reference model system executes the target test instruction in units of instructions, and analyze whether the CPU state change of the test processor system after the target test instruction is executed is normal, so that when the CPU state change of the test processor system after the target test instruction is executed is consistent with the CPU state change generated after the processor reference model system executes the target test instruction, it can be considered that the target test instruction The corresponding simulation tracking log information is verified through log comparison. If the CPU state change of the test processor system after the target test instruction is executed is normal, a normal processor state change result is generated as the processor state analysis result corresponding to the target test instruction, and then the process jumps to step 370 for execution. If the CPU state change of the test processor system after the target test instruction is executed is inconsistent with the CPU state change generated after the processor reference model system executes the target test instruction, it can be considered that the log comparison verification has failed, and the CPU state change of the test processor system after the target test instruction is abnormal, and an abnormal processor state change result is generated as the processor state analysis result corresponding to the target test instruction, and then the process jumps to step 360.
[0052] Step 360: If the processor state analysis result is a processor state change abnormal result, output processor function verification error prompt information based on the processor state change abnormal result.
[0053] Step 370: If the processor state analysis result is a normal result of the processor state change, based on the normal result of the processor state change, trigger the test processor system to continue to run the test case information through a clock excitation signal.
[0054] Specifically, after obtaining the processor state analysis result corresponding to the target test instruction, this embodiment can determine whether the test processor system can pass the trace log comparison verification corresponding to the target test instruction based on the processor state analysis result. For example, when the processor state analysis result is a normal result of the processor state change, it can be considered that the test processor system can pass the trace log comparison verification corresponding to the target test instruction, and based on the normal result of the processor state change, the test processor system can be triggered by a clock excitation signal to continue running the test case information until the test processor system executes all the test instructions in the test case information and outputs the processor function verification result, that is, when the test processor system passes the trace log comparison verification corresponding to all the test instructions in the test case information, the verification pass result is determined as the processor function verification result corresponding to the test processor system, thereby realizing the automatic verification of the processor; and when the processor state analysis result is an abnormal result of the processor state change, that is, when the test processor system cannot pass the trace log comparison verification corresponding to the target test instruction, such as when the test processor cannot pass the comparison verification corresponding to a certain test instruction in the test case information, a processor function verification error prompt information can be generated based on the abnormal result of the processor state change, and the processor function verification error prompt information can be output to assist designers in quickly locating faults.
[0055] In summary, after determining the test case information, the embodiment of the present application obtains the simulation tracking log information generated by the test processor system executing the target test instruction, and the target test instruction is the instruction in the test case information, so as to generate a simulation clock pause message after collecting the simulation tracking log information corresponding to the target test instruction. The simulation clock pause message is used to notify the test processor system to suspend operation, and then the processor state analysis can be performed based on the simulation tracking log information corresponding to the target test instruction and the reference log record information corresponding to the target test instruction, that is, judging from the dimension of the instruction to obtain the processor state analysis result corresponding to the target test instruction. If the processor state analysis result is an abnormal result of the processor state change, then based on the processor state change Abnormal result, output processor function verification error prompt information, if the processor state analysis result is a normal result of the processor state change, then based on the normal result of the processor state change, the test processor system is triggered by a clock excitation signal to continue running the test case information, thereby realizing automatic verification of the processor. Compared with the traditional collaborative simulation co-sim verification scheme, the embodiment of the present application makes judgments from the dimension of instructions, and no longer uses a single log text as the judgment standard, thereby improving and optimizing the collaborative simulation co-sim verification method, thereby solving the problem that the existing collaborative simulation co-sim scheme uses a single log text as the judgment criterion and cannot verify the vector CPU function, and can effectively verify the vector processor function and determine the product quality of the processor.
[0056] The following is an illustrative description of the embodiments of the present application, but it should be noted that the implementation of the present application may have the features described below, but the following description does not constitute a limitation on the scope of protection of the embodiments of the present application.
[0057] In some optional embodiments of the present application, the test case information may include one or more instructions as test instructions, so that the test processing system can generate corresponding simulation tracking log information by loading and running the test instructions. Optionally, the test case information in this embodiment includes at least one test instruction, and the target test instruction is an instruction in the test case information. Optionally, the processor function verification method provided in this embodiment may also include, after obtaining the simulation tracking log information generated by the test processor system executing the target test instruction, extracting the instruction operation record data corresponding to the target test instruction from the simulation tracking log information; based on the instruction operation record data, determining whether the simulation tracking log information corresponding to the same target test instruction has been collected; and determining whether the simulation tracking log information corresponding to the target test instruction has been collected after the simulation tracking log information corresponding to the same target test instruction has been collected. After collecting the simulation tracking log information corresponding to the target test instruction, a simulation clock pause message can be generated to notify the test processor system to suspend operation through the simulation clock pause message, so that by comparing the simulation tracking log information corresponding to the same target test instruction and the reference log record information, it can be determined whether the processor state change of the test processor system after the target test instruction is executed is normal, and the processor state analysis result corresponding to the target test instruction can be produced.
[0058] For example, after determining the test case information, a clock excitation signal can be sent to the test processor system as needed to trigger the test processing system to load the test case in the test case information, so that the test processor system executes the target test instruction and outputs the simulation tracking log information in real time, so that the simulation tracking log information generated by the test processor system executing the target test instruction can be obtained by monitoring, and the collection of the simulation tracking log information is realized. After collecting the simulation tracking log information generated by the test processor system executing the same target test instruction, the instruction operation record data corresponding to the target test instruction can be extracted from the simulation tracking log information, so as to compare and analyze the instruction operation record data corresponding to the target test instruction with the instruction operation record parameters corresponding to the target test instruction, that is, to perform log comparison analysis based on the instruction as a unit, and analyze the CPU state change of the test processor system after the target test instruction is executed, no longer using a single log text as the judgment standard, and not considering the time sequence information, but judging from the dimension of the instruction, by comparing the tracking log information corresponding to the same instruction in the test process, the processor state change of the test processor system after the instruction is executed is determined, that is, the same target test instruction and the corresponding effect log are compared and analyzed as a unified whole, and the processor state analysis result corresponding to the target test instruction is obtained.
[0059] Among them, the effect log corresponding to the target test instruction may include one or more log output data corresponding to the target test instruction. For example, when the target test instruction is a Vector instruction, if the Vector instruction is run in SIMD mode, the effect log corresponding to the Vector instruction may include multiple log output data. This embodiment does not limit this.
[0060] During the execution of Vector instructions, due to the use of SIMD, a single instruction processes multiple data in parallel, and the processing results of these multiple data may be inconsistent in order. Because different CPU designs and different RTL implementations may produce clock differences, and according to the instruction set specification, the same LSU instruction's operation on the memory Memory is random. In order to achieve this differential comparison, this embodiment can remove the clock-related information in the tracking log information through the comparison tool, such as removing the relevant information of the clock clk, but retain the order information of the instruction and the final state information generated by the instruction, so as to compare and analyze the same instruction and its corresponding effect log as a unified whole based on the order information of the instruction and the final state information generated by the instruction, that is, analyze the processor state changes after the instruction is executed with the instruction as a unit, and obtain the processor state analysis result.
[0061] In an optional implementation, this embodiment performs processor state analysis based on the simulation tracking log information corresponding to the target test instruction in combination with the reference log recording information corresponding to the target test instruction to obtain a processor state analysis result corresponding to the target test instruction, which may specifically include: deleting or skipping the clock-related information in the simulation tracking log information and the clock-related information in the reference log recording information, respectively, to obtain instruction execution-related information in the simulation tracking log information and instruction execution reference information in the reference log recording information, wherein the instruction execution-related information includes instruction execution sequence information and instruction generation target state information; based on the instruction execution sequence information, comparing the instruction generation target state information with the instruction execution processor state parameters recorded in the instruction execution reference information to obtain the processor state analysis result.
[0062] Among them, clock-related information may refer to time information related to the clock signal, and in the present application, clock-related information may also refer to time information; instruction execution-related information may refer to information related to instruction execution retained after removing clock-related information from the simulation tracking log information, and may specifically include instruction execution sequence information and instruction generation target state information; instruction execution sequence information may be instruction sequence information; instruction generation target state information may be the final state information generated by the instruction, and may specifically be used to determine the final processor state after the instruction is executed, such as determining the test processor state of the test processor system after executing a certain target test instruction. Instruction execution reference information may refer to reference information related to instruction execution retained after removing clock-related information from the reference log record information, and may specifically include instruction execution sequence information and instruction execution processor state parameters, which may be used to determine the processor state generated after the instruction is executed in the processor reference model system, and the processor state may be used as a reference to verify whether the test processor system can correctly execute the test instruction.
[0063] Specifically, after deleting or skipping the clock-related information in the simulation tracking log information and the clock-related information in the reference log record information, this embodiment can, based on the instruction execution sequence information, for each target test instruction, compare the instruction generation target state information corresponding to the target test instruction with the instruction execution processor state parameters, that is, compare the instruction generation target state information corresponding to the same target test instruction with the instruction execution processor state parameters to determine the processor state analysis result corresponding to the target test instruction based on the comparison result. Specifically, when the target state information generated by the instruction is the same as the state parameter of the processor executing the instruction, it can be considered that the test processor state change of the test processor system after executing the target test instruction is consistent with the corresponding processor state change of the processor reference model system after executing the target test instruction, and then the comparison result can be considered as the log comparison passing result, and a normal processor state change result is generated as the processor state analysis result; and when the target state information generated by the instruction is different from the state parameter of the processor executing the instruction, it can be considered that the test processor state change of the test processor system after executing the target test instruction is inconsistent with the corresponding processor state change of the processor reference model system after executing the target test instruction, and then the comparison result can be considered as the log comparison failing result, and an abnormal processor state change result is generated as the processor state analysis result.
[0064] It can be seen that after determining the test case information, this embodiment can load the test case specified by the test case information through the test processor system to run and generate simulation tracking log information. After the test processor system generates the simulation tracking log information trace_log1, it can obtain the simulation tracking log information generated by the test processor system executing the target test instruction through monitoring, realize the collection of simulation tracking log information, and determine whether the (one or at least two) simulation tracking log information corresponding to the same target test instruction are collected completely. When the simulation tracking log information corresponding to the same target test instruction is complete, a simulation clock pause message is generated, and the simulation clock information can be sent to the clock module to notify the clock model to pause the clock signal output to the test processor system, so that the test processor system is in a paused state, retaining the current field information, and can be collected through Trace log real-time comparison component extracts instruction operation record data corresponding to the target test instruction from the simulation tracking log information, and uses the extracted instruction operation record data to analyze and compare with the instruction operation record parameters in the reference log record information, that is, in units of instructions, the complete log information from the test processor system and the reference log record information from the processor reference model system are analyzed and compared, and then the comparison result can be used as the processor state analysis result corresponding to the target test instruction, so as to control the test process of the test processor system in real time according to the comparison result.
[0065] Specifically, if the comparison result is that the log comparison of the two instructions passes, a clock recovery message can be generated and sent to the clock module to notify the clock model to restore the clock signal output to the test processor system, allowing the test processor system to continue running until the verification is completed normally or an error is detected.
[0066] If an error is detected, such as by comparing the complete log information from the test processor system with the reference log record information from the processor reference model system, it is found that the test processor state change after the test processor system executes the target test instruction is inconsistent with the corresponding processor state change after the processor reference model system executes the target test instruction, it can be determined that the processor state change of the test processor system after executing the instruction is abnormal, and an abnormal processor state change result is generated, and the abnormal processor state change result can be determined as a processor state analysis result. Based on the abnormal processor state change result, the test processor system operation is suspended, the scene is saved, and further fault location is awaited.
[0067] In some optional embodiments of the present application, based on the simulation tracking log information corresponding to the target test instruction, combined with the reference log record information corresponding to the target test instruction, the processor state analysis is performed to obtain the processor state analysis result corresponding to the target test instruction, which may specifically include: extracting the instruction operation record parameters corresponding to the target test instruction from the reference log record information; using the instruction operation record data to determine the test processor state change; if the test processor state change is consistent with the processor state change corresponding to the instruction operation record parameter, then generating a normal processor state change result, and determining the normal processor state change result as the processor state analysis result; if the test processor state change is inconsistent with the processor state change corresponding to the instruction operation record parameter, then generating an abnormal processor state change result, and determining the abnormal processor state change result as the processor state analysis result. Among them, the instruction operation record data can refer to the operation record data corresponding to the instruction execution record, specifically the final state information generated by the instruction, and the final state information can be used to represent the final processor state after the instruction is executed; the processor state change corresponding to the instruction operation record parameter can refer to the processor state change corresponding to the processor reference model system after the target test instruction is executed. When the test processor state change is consistent with the processor state change corresponding to the instruction operation record parameter, it can be considered that the test processor system can pass the verification when executing the target test instruction, that is, the verification is passed, and then a clock recovery message can be generated, and the clock recovery message can be sent to the clock module to notify the clock model to recover the clock signal output to the test processor system, so that the test processor system continues to run the test case information until the verification ends normally or an error is detected; when the test processor state change is inconsistent with the processor state change corresponding to the instruction operation record parameter, it can be considered that an exception occurs in the test processor system when executing the target test instruction, that is, an error occurs in the processor function verification, and then a processor state change exception result can be generated, and the processor state change exception result can be determined as a processor state analysis result, so that the exception tracking information can be output based on the processor state change exception result as the processor function verification result, so that the error prompt information can be given through the processor function verification result as the processor function verification error prompt information, which can assist RTL designers to quickly locate faults.
[0068] In one embodiment of the present application, the processor function verification error prompt information may include the index position, timestamp, instruction content and state change information of the log record TraceRecord, so that RTL personnel can quickly locate the position in the fault file according to the timestamp recorded in the processor function verification error prompt information. For example, they can quickly locate the position in the fault file according to the clock cycle information recorded in the timestamp, and can combine the relevant registers, memory units and CSR information to analyze and locate the problem, improve test efficiency, and ensure the product quality of the CPU. Among them, the index position may refer to the position of the test instruction in the entire execution instruction sequence, such as the first instruction, the 100th instruction, etc.; the timestamp may refer to the clock cycle information inside the CPU when the CPU executes the test instruction, such as the clock cycle number may be used to record the timestamp, that is, how many clock cycles the CPU has run when the instruction is executed, and this embodiment does not impose any restrictions on this; the instruction content may refer to the operation code and operand of the test instruction itself, such as addition, multiplication, or load (Load) / store (Store), etc., and this embodiment does not impose any specific restrictions on this; the state change information may be used to determine the processor state change, and the processor state change may refer to the state change generated by the CPU after the test instruction is executed, which may specifically include: the value of the CPU register changes, the value of the memory unit changes, the change of the CPU state control register CSR, etc., and this embodiment does not impose any specific restrictions on this.
[0069] For example, in the case of Figure 4In the case where the dictionary structure shown is used to store the log records Trace Record in the trace log Trace Log, that is, an execution instruction and the resulting state change information are stored through the dictionary structure, and the test instructions that need to be executed in the test case information can be recorded through the trace log Trace Log instruction sequence, indexed in the order of execution time, and the test instructions can include instruction 1, instruction 2, instruction 3, instruction 4, instruction 5...instruction n; instruction n can refer to the nth test instruction that needs to be executed in the test case information, and n is an integer greater than zero. For the entire Trace Log instruction sequence, for each instruction in the Trace Log instruction sequence, the instruction and its effect log can be compared and analyzed as a unified whole, so as to perform the following judgments on each instruction: first, the time information can be skipped, such as the instruction submission time of the target test instruction can be skipped and not used as a judgment factor; then, instruction operation record data such as instruction memory address, instruction binary code, readable assembly code, CPU status register, updated register set and updated memory set can be extracted from a specific instruction record, so as to perform analysis and comparison based on the instruction operation record data, such as comparing the memory address of the value based on the instruction memory address to achieve comparison of the instruction address, and comparing the instruction content of the value based on the instruction binary code to achieve comparison of the instruction binary encoding, and comparing the CPU status control register, etc., so that when the items such as the instruction memory address, the instruction binary code, the readable assembly code and the CPU status register are consistent, the register set and the memory update list can be compared in a set manner based on the updated register set and the updated memory set recorded in the instruction record, such as comparing according to the attributes of the set to achieve comparison of ordinary register update sets, and comparing of memory update sets.
[0070] The comparison of register and memory update lists in a set manner essentially does not consider the order of these log information. The judgment standard is no longer based on a single log text, but on the dimension of instructions. During the real-time comparison process, one instruction can correspond to multiple log outputs. For example, the test instruction mov x15, #0 has only two log information; while another test instruction ld2b The log information of {z0.b, z1.b}, p0 / z, [x0] can be as many as 52. This embodiment determines the target test instruction corresponding to the simulation tracking log information to identify a test instruction and the corresponding effect log, and then compares and divides the identified test instruction and its effect log as a unified whole, that is, based on the simulation tracking log information corresponding to the target test instruction, the processor state analysis is performed in combination with the reference log record information corresponding to the target test instruction, so as to support the high-performance CPU verification of Vector capabilities. For example, the traditional co-sim verification method can be improved and optimized by defining an instruction behavior set to ensure the continuous effectiveness of the co-sim verification method in the test environment of the CPU supporting Vector. It provides an enhanced co-sim solution for the verification of high-performance CPUs supporting Vector capabilities, and can achieve RTL coverage testing by combining various test cases to improve test efficiency. At the same time, the CPU automation verification process can be realized through the expansion of co-sim, thereby accelerating the product launch cycle.
[0071] For example, the specified test cases can be loaded and run respectively through the test processor system and the golden model system ISS as the processor reference model system, and the trace log Trace Log information can be saved to a file. For example, the trace log generated by the test platform Dut_tb of the test processor system can be used as simulation trace log information and stored in the simulation log file log1, and the trace log generated by the golden platform Golden_tb of the golden model system ISS can be used as reference log record information and stored in the simulation reference log file log2. Then, based on the simulation reference log file log2 and the simulation log file log1, the two log files can be analyzed in real-time or quasi-real-time comparison to determine whether the test processor system is working normally. When the test processor system is detected to be working abnormally, the first instruction position of the problem in the test platform Dut_tb can be located based on the processor function verification error prompt information, which is conducive to reproducing the fault and assisting CPU designers in fault reproduction and location.
[0072] In an optional implementation of the present application, the reference log file log2 generated by the golden model system ISS and the simulation log file log2 generated by the test platform Dut_tb can be used as two designated log files. For example, in actual engineering implementation, the two designated log files can be obtained through the test case name, and then the instruction logs of the two files can be loaded into two lists. For example, when using the python list structure to store the instruction sequence, the first log array sample_trace[] can be used to store the instruction sequence of the test platform Dut_tb, and the second log array refer_trace[] can be used to store the instruction sequence of the golden platform Golden_tb; then the number of instructions in the two files can be compared to determine whether there is an error; if the two files have the same number of instructions, If the number of instructions is different, it can be determined that an error has occurred and an error can be reported. If the number of instructions in the two files is the same, the detailed information corresponding to each instruction in the log file can be obtained for comparison. For example, when using Python's dict data structure to store detailed instruction information, if refer_fields represents an instruction in the golden platform Golden_tb, and sample_fields represents an instruction in the test platform Dut_tb, then based on the sample_fields recorded in the simulation log file log2 and the refer_fields recorded in the reference log file log2, a strict comparison method can be used to compare the content and order of appearance of each information field in the instruction one by one, so as to realize instruction-level log comparison based on instructions.
[0073] Of course, in addition to completing instruction-level log comparison by strictly comparing the content and order of appearance of each information field in the instruction one by one, this embodiment can also use other judgment methods to implement instruction-level log comparison, such as using a set judgment method and Python's set comparison operation to compare the content of the log information field and ignore the order to implement instruction-level log comparison.
[0074] In some optional embodiments of the present application, after determining the test case information, the test processor system and the processor reference model system can be simultaneously loaded and run the test case specified by the test case information based on the test case information, and the simulation tracking log information trace_log1 generated by the test processor system lock and the reference log record information trace_log2 generated by the processor reference model system can be output in real time, and through real-time comparison, when problems are found, the test processor system and the processor reference model system are promptly notified, the co-sim process is stopped, the scene is saved, and further problem analysis is performed. In this co-sim process, the test processor system and the processor reference model system are synchronized to a certain extent, and the clock handshake message between the test processor system and the processor reference model system is used to achieve synchronization between the test processor system and the processor reference model system, so that the current scene information can be saved, providing more means for fault location. Among them, the clock handshake message can include various messages generated by using the clock signal, such as a simulation clock pause message, a clock recovery message, and a reference clock pause message; the reference clock pause message can be used to notify the processor reference model system to pause operation; the simulation clock pause message is used to notify the test processor system to pause operation; the clock recovery message can be used not only to notify the test processor system to continue to run, but also to notify the processor reference model system that generates the reference log record information to continue to run. Optionally, the simulation clock pause message and the reference clock pause message can be the same message, so as to achieve synchronous operation of the test processing system and the processor reference model system.
[0075] In an optional embodiment of the present application, based on the normal result of the processor state change, the test processor system is triggered to continue running the test case information through a clock excitation signal, which may specifically include: determining whether the test processor system has executed all the test instructions in the test case information based on the normal result of the processor change; and generating a clock recovery message when the test processor system has not executed all the test instructions, wherein the clock recovery message is used to generate the clock excitation signal, and the clock excitation signal is used for the test processor system to perform simulation operation.
[0076] Optionally, the clock excitation signal in this embodiment can be used not only to continue the operation of the test processor system, but also to trigger the processor reference model system that generates the reference log record information to continue running. Further, the processor verification method provided in the embodiment of the present application can also include: loading the instruction sequence in the test case information through the processor reference model system, the instruction sequence includes the target test instruction; obtaining the reference log record information generated by the processor reference model system executing the target test instruction; after collecting the reference log record information corresponding to the target test instruction, generating a reference clock pause message, the reference clock pause message is used to notify the processor reference model system to suspend operation, and the reference log information includes the reference log record information corresponding to the target test instruction.
[0077] For example, after determining the test case information, the golden model system ISS, which is the processor reference model system, can load the instruction sequence in the test case information and run it to output the first Trace Log information as the reference log record information Trace Log2; the real-time comparison component of the Trace log will capture this reference log record information Trace Log2, and then send a reference clock pause message to notify the clock module in the front to pause the clock signal of the golden model system ISS, such as Figure 5As shown, the golden platform Golden_tb of the golden model system ISS is in a paused state, and the test platform Dut_tb of the test processor system can also load the instructions in the test case information to run, generating the first Trace Log information of the test processor system itself as the simulation trace log information trace_log1; after receiving the simulation trace log information trace_log1 from the test platform Dut_tb, the real-time comparison component of the Trace log can send a simulation clock pause message to notify the clock module in front to pause the clock signal of the test platform Dut_tb, so that the test platform Dut_tb is also in a paused state to retain the current field information. The real-time comparison component of the trace log performs a comparative analysis of the logs after collecting the simulation trace log information trace_log1 from the test platform Dut_tb and the reference log record information Trace Log2 from the golden platform Golden_tb, that is, after receiving the two logs from the two platforms, the logs are compared and analyzed from the judgment dimension of the instructions; if the comparison results of the two logs pass, a clock recovery message is generated to notify the clock module to restore the clock signal to the golden platform Golden_tb and the test platform Dut_tb through the clock recovery message, so that the golden platform Golden_tb and the test platform Dut_tb continue to run until the verification is normally completed or an error is detected.
[0078] Of course, in addition to using real-time comparison to complete instruction-level log comparison, this embodiment can also use other comparison methods to complete instruction-level log comparison, such as using quasi-real-time comparison to complete instruction-level log comparison, so as to make full use of computing resources, eliminate the information synchronization between the golden platform Golden_tb and the test platform Dut_tb, and reduce the requirement for the golden model system ISS to run test cases every time, thereby greatly improving test efficiency without any adverse effect on the effect of co-sim.
[0079] In an optional embodiment of the present application, the processor verification method provided in the embodiment of the present application may further include, after determining the test case information: obtaining the reference log information corresponding to the completion of all the test case information; and extracting the reference log record information corresponding to the target test instruction from the reference log information.
[0080] Specifically, after determining the test case information, this embodiment can first allow the golden model system ISS, which is the processor reference model system, to run all the test cases in the test case information, and can retain all the TraceLogs in the files of each specified test case, as the reference log information corresponding to the test case information being run completely. For example, the file used to store the reference log information can be named after the test case name, and this embodiment does not limit this. Subsequently, as needed, the test processor system can load the test case specified in the test case information, and output the Trace Log information in real time as simulation trace log information, which is transmitted to the signal comparison system, so that the signal comparison system can perform log analysis and comparison based on the simulation trace log and instructions as units, so that the test process of the test processor system can be controlled in real time according to the comparison results; if an error is found, the operation of the test processor system is suspended, the scene is saved, and further fault location is awaited.
[0081] For example, when the Trace Log file sequence is pre-generated by the golden model system ISS, the instruction level comparison of the processor verification method can be implemented in a quasi-real-time manner, which may specifically include the following steps:
[0082] Operation step 1: After selecting a test case, you can select the log information corresponding to the test case from the Trace Log file sequence pre-generated by the golden model system ISS, and load the log information corresponding to the test case through the real-time comparison component of the Trace Log, such as Figure 6 As shown, at the same time, the test platform Dut_tb of the test processor system can also load the specified test case to run, and generate the first Trace Log information of the test processor system itself as the simulation trace log information trace_log1.
[0083] Operation step 2, after receiving the simulation trace log information trace_log1 from the test platform Dut_tb, the real-time comparison component of the Trace log can determine whether the simulation trace log information corresponding to the same target test instruction has been collected; when the simulation trace log information corresponding to the same target test instruction has been collected, a true clock pause message can be sent to notify the clock module in the front to pause the clock signal of the test platform Dut_tb, so that the test platform Dut_tb is also in a paused state to retain the current field information.
[0084] Operation step 3, the real-time comparison component of Trace log analyzes and compares the simulation trace log information trace_log1 from the test platform Dut_tb and the reference log record information Trace Log2 from the golden platform Golden_tb in units of instructions, that is, performs instruction-level log judgment from the dimension of instructions, so that when the effect logs corresponding to the same instruction are the same, it is considered that the log comparison corresponding to the instruction passes, thereby improving the analysis and judgment standard for the uncertain state of Vector instructions; if the comparison result between the simulation trace log information trace_log1 and the reference log record information Trace Log2 is a result that the two logs pass the comparison, a clock recovery message can be sent to the clock module to notify the clock module to restore the clock signal to the test platform Dut_tb through the clock recovery message, so that the test platform Dut_tb continues to run;
[0085] In step 4, repeat steps 1 to 3 until the verification is completed normally or an error is detected.
[0086] It can be seen that this embodiment first allows the golden model system ISS, which serves as the processor reference model system, to run all the test cases in the test case information, generate reference log information corresponding to the test case information, and obtain the simulation tracking log information generated by the test processor system executing the target test instruction during the simulation operation of the test processor system, so that after collecting the simulation tracking log information corresponding to the target test instruction, the reference log record information corresponding to the target test instruction can be extracted from the reference log information corresponding to the test case information, and compared with the simulation tracking log information generated by the target test instruction, thereby optimizing the real-time log comparison scheme, eliminating the action of running the golden model system ISS multiple times, and changing the source of the comparison log information from the reference log record information generated in real time by the golden model system ISS to reading from the historical tracking log file, thereby simplifying the verification process, saving verification resources, and accelerating the verification progress.
[0087] In addition, after collecting the simulation trace log information corresponding to the target test instruction, this embodiment generates a simulation clock pause message to notify the test processor system to suspend operation through the simulation clock pause message. Subsequently, the processor state analysis can be performed based on the simulation trace log information corresponding to the target test instruction and the reference log record information corresponding to the target test instruction, so as to make a judgment from the dimension of the instruction instead of using a single log text as the judgment standard. This provides an enhanced co-sim solution for the verification of high-performance CPUs that support vector capabilities, and can achieve RTL coverage testing by determining test case information and combining various test cases, thereby improving test efficiency and ensuring the product quality of the CPU. At the same time, the expansion of co-sim realizes the automated verification process of the CPU, speeding up the product launch cycle. This can not only be applied to the development and verification of high-performance CPUs, but can also be used in the development of CPU behavior simulators in reverse. By utilizing the Trace Log information of existing commercial CPUs, a golden instruction simulator ISS corresponding to the instruction set architecture can be developed. This embodiment does not impose any restrictions on this.
[0088] It should be noted that, for the purpose of simple description, the method embodiments are expressed as a series of action combinations, but those skilled in the art should be aware that the embodiments of the present application are not limited to the described order of actions, because according to the embodiments of the present application, certain steps may be performed in other orders or simultaneously.
[0089] like Figure 7 As shown, the embodiment of the present application also provides a processor function verification device, including the following modules:
[0090] A test case determination module 710, used to determine test case information, wherein the test case information is used to test the processor system for simulation operation;
[0091] A simulation operation module 720, used to test that the processor system executes a target test instruction, wherein the target test instruction is at least one but not all instructions in the test case information;
[0092] The simulation tracking log information acquisition module 730 is used to acquire the simulation tracking log information generated by the test processor system executing the target test instruction;
[0093] A simulation clock pause module 740, configured to generate a simulation clock pause message after collecting the simulation tracking log information corresponding to the target test instruction, wherein the simulation clock pause message is used to notify the test processor system to pause operation;
[0094] A processor state analysis module 750 is used to perform processor state analysis based on the simulation tracking log information corresponding to the target test instruction and in combination with the reference log record information corresponding to the target test instruction to obtain a processor state analysis result corresponding to the target test instruction;
[0095] A verification failure prompt module 760 is used to output processor function verification error prompt information based on the abnormal processor state change result when the processor state analysis result is an abnormal processor state change result;
[0096] The function verification result module 770 is used to trigger the test processor system to continue to run the test case information through a clock excitation signal based on the normal result of the processor state change when the processor state analysis result is a normal result of the processor state change.
[0097] In an optional implementation of the present application, the test case information includes at least one test instruction, and the at least one test instruction includes a target test instruction, and the target test instruction is an instruction in the test case information. Optionally, the processor function verification device may also include the following modules:
[0098] An operation record data extraction module, used to extract instruction operation record data corresponding to the target test instruction from the simulation tracking log information;
[0099] The simulation tracking log information determination module is used to determine whether the simulation tracking log information corresponding to the same target test instruction has been collected based on the instruction operation record data; if the simulation tracking log information corresponding to the same target test instruction has been collected, it is determined that the simulation tracking log information corresponding to the target test instruction has been collected.
[0100] Optionally, the processor state analysis module 750 includes:
[0101] An instruction operation record parameter submodule, used to extract instruction operation record parameters corresponding to the target test instruction from the reference log record information;
[0102] A state change determination submodule, used to determine a state change of a test processor using the instruction operation record data;
[0103] A processor state change normal submodule, used to generate a processor state change normal result when the test processor state change is consistent with the processor state change corresponding to the instruction operation record parameter, and determine the processor state change normal result as the processor state analysis result;
[0104] The processor state change exception submodule is used to generate a state change exception result when the test processor state change is inconsistent with the processor state change corresponding to the instruction operation record parameter, and determine the state change exception result as the processor state analysis result.
[0105] Optionally, the processor state analysis module 750 includes:
[0106] An execution judgment submodule is used to determine whether the test processor system has executed all the test instructions in the test case information according to the normal result of the processor change;
[0107] The clock recovery submodule is used to generate a clock recovery message when the test processor system has not executed all the test instructions. The clock recovery message is used to generate the clock excitation signal, and the clock excitation signal is used for the test processor system to perform simulation operation.
[0108] In an optional implementation of the present application, the processor state analysis module 750 includes:
[0109] A clock related information submodule is used to delete or skip the clock related information in the simulation tracking log information and the clock related information in the reference log record information, respectively, to obtain the instruction execution related information in the simulation tracking log information and the instruction execution reference information in the reference log record information, wherein the instruction execution related information includes instruction execution sequence information and instruction generation target state information;
[0110] The processor state comparison submodule is used to compare the instruction generation target state information with the instruction execution processor state parameters recorded in the instruction execution reference information based on the instruction execution sequence information to obtain the processor state analysis result.
[0111] In an optional implementation manner of the present application, the processor function verification device may further include the following modules:
[0112] A reference log information acquisition module, used to obtain the reference log information corresponding to the completion of all the test case information, such as the reference log information acquisition module can obtain the reference log information corresponding to the completion of all the test case information after the test case determination module determines the test case information;
[0113] The reference log record information extraction module is used to extract the reference log record information corresponding to the target test instruction from the reference log information.
[0114] Optionally, the clock excitation signal in the embodiment of the present application is also used to trigger the processor reference model system that generates the reference log record information to continue running, and the processor function verification device may also include the following modules:
[0115] A processor reference model system module, used to load the instruction sequence in the test case information through the processor reference model system, wherein the instruction sequence includes the target test instruction;
[0116] A reference log information acquisition module, used to acquire reference log record information generated by the processor reference model system executing a target test instruction;
[0117] The reference clock pause module is used to generate a reference clock pause message after collecting the reference log record information corresponding to the target test instruction, and the reference clock pause message is used to notify the processor reference model system to suspend operation.
[0118] For example, before the analysis and comparison submodule uses the instruction operation record data and the instruction operation record parameters for analysis and comparison, the processor reference model system module can load and run the instruction sequence in the test case information through the processor reference model system, so that the processor reference model system can generate log information during operation as reference log information, so that the reference log information generated by the processor reference model system can be monitored. After monitoring the reference log information generated by the processor reference model system, the reference log information generated by the processor reference model system can be collected, so that after collecting the reference log record information corresponding to the target test instruction, a reference clock pause message can be generated through the reference clock pause module, so that the processor reference model system can be notified to pause operation through the reference clock pause message.
[0119] In a specific implementation, the above-mentioned processor function verification device can be integrated into an electronic device, so that the electronic device serves as a processor function verification device, by determining the test case information, and executing the target test instruction through the test processor system based on the test case information, the target test instruction is at least one and not all instructions in the test case information, and obtaining the simulation tracking log information generated by the test processor system executing the target test instruction, to realize the collection of simulation tracking log information, after collecting the simulation tracking log information corresponding to the target test instruction, generating a simulation clock pause message, the simulation clock pause message is used to notify the test processor system to suspend operation, and then based on the simulation tracking log information corresponding to the target test instruction, combined with the reference log record information corresponding to the target test instruction, the processor state analysis is performed to make a judgment from the dimension of the instruction, To the processor state analysis result corresponding to the target test instruction, if the processor state analysis result is an abnormal result of the processor state change, then based on the abnormal result of the processor state change, a processor function verification error prompt information is output; if the processor state analysis result is a normal result of the processor state change, then based on the normal result of the processor state change, the test processor system is triggered by a clock excitation signal to continue running the test case information, thereby realizing automatic verification of the processor. Compared with the traditional collaborative simulation co-sim verification scheme, the embodiment of the present application makes judgments from the dimension of instructions, and no longer uses a single log text as the judgment standard. It solves the problem that the existing collaborative simulation co-sim scheme uses a single log text as the judgment standard and is unable to verify the vector CPU function, and can effectively verify the vector processor function and determine the product quality of the processor.
[0120] The present embodiment also provides an electronic device, comprising at least one communication interface; at least one bus connected to the at least one communication interface; at least one processor connected to the at least one bus; at least one memory connected to the at least one bus, wherein the processor is configured to: determine test case information, the test case information is used to test a processor system for simulation operation; execute a target test instruction through the test processor system, the target test instruction is at least one and not all instructions in the test case information, and obtain simulation tracking log information generated by the test processor system executing the target test instruction; after collecting the simulation tracking log information corresponding to the target test instruction, generate a simulation clock pause message, the simulation clock pause message is used to notify the test processor system to suspend operation; based on the simulation tracking log information corresponding to the target test instruction, perform processor state analysis in combination with reference log record information corresponding to the target test instruction to obtain a processor state analysis result corresponding to the target test instruction; if the processor state analysis result is an abnormal processor state change result, then based on the abnormal processor state change result, output a processor function verification error prompt message; if the processor state analysis result is a normal processor state change result, then based on the normal processor state change result, trigger the test processor system to continue running the test case information through a clock excitation signal.
[0121] It should be noted that the electronic device provided in this embodiment can be composed of two or more physical entities, or it can be composed of one physical entity. For example, the electronic device can be a personal computer (PC), a computer, a server, etc., and the embodiment of the present application does not impose specific restrictions on this.
[0122] For example, Figure 8As shown, an embodiment of the present application provides an electronic device, including a processor 111, a communication interface 112, a memory 113 and a communication bus 114, wherein the processor 111, the communication interface 112, and the memory 113 communicate with each other through the communication bus 114, and the memory 113 is used to store computer programs; when the processor 111 is used to execute the program stored in the memory 113, the steps of the processor function verification method provided by any of the aforementioned method embodiments are implemented, including: determining test case information, the test case information is used to test the processor system for simulation operation; executing a target test instruction by testing the processor system, the target test instruction is at least one of the test case information and non-all instructions; obtaining the simulation tracking log information generated by the test processor system executing the target test instruction; performing processor state analysis based on the simulation tracking log information corresponding to the target test instruction in combination with the reference log record information corresponding to the target test instruction, and obtaining the processor state analysis result corresponding to the target test instruction; if the processor state analysis result is an abnormal result of the processor state change, then based on the abnormal result of the processor state change, outputting processor function verification error prompt information; if the processor state analysis result is a normal result of the processor state change, then based on the normal result of the processor state change, triggering the test processor system to continue running the test case information through a clock excitation signal.
[0123] An embodiment of the present application also provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the steps of the processor function verification method provided in any of the aforementioned method embodiments are implemented.
[0124] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0125] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a general hardware platform, and of course, can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the relevant technology can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.
[0126] It should be understood that the terms used herein are only for the purpose of describing specific example embodiments and are not intended to be limiting. Unless the context clearly indicates otherwise, the singular forms "one", "an" and "said" as used herein may also be meant to include plural forms. The terms "include", "comprise", "contain", and "have" are inclusive and therefore specify the existence of stated features, steps and / or operations, but do not exclude the existence or addition of one or more other features, steps, operations, and / or combinations thereof. The method steps, processes, and operations described herein are not interpreted as necessarily requiring them to be performed in the specific order described or illustrated, unless the execution order is clearly indicated. It should also be understood that additional or alternative steps may be used.
[0127] The foregoing is merely a specific embodiment of the present invention, which enables those skilled in the art to understand or implement the present invention. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but rather to the widest scope consistent with the principles and novel features claimed herein.
Claims
1. A processor function verification method, It is characterized in that include: Determine test case information, wherein the test case information is used to test the processor system for simulation operation; The test processor system executes a target test instruction, wherein the target test instruction is at least one but not all instructions in the test case information; Acquire simulation tracking log information generated by the test processor system executing target test instructions; After collecting the simulation tracking log information corresponding to the target test instruction, generating a simulation clock pause message, wherein the simulation clock pause message is used to notify the test processor system to pause operation; Based on the simulation tracking log information corresponding to the target test instruction, combined with the reference log record information corresponding to the target test instruction, a processor state analysis is performed to obtain a processor state analysis result corresponding to the target test instruction; If the processor state analysis result is a processor state change abnormal result, outputting processor function verification error prompt information based on the processor state change abnormal result; If the processor state analysis result is a normal result of the processor state change, based on the normal result of the processor state change, triggering the test processor system to continue to run the test case information through a clock excitation signal; Among them, the processor state analysis is performed based on the simulation tracking log information corresponding to the target test instruction in combination with the reference log recording information corresponding to the target test instruction to obtain the processor state analysis result corresponding to the target test instruction, including: deleting or skipping the clock-related information in the simulation tracking log information and the clock-related information in the reference log recording information respectively, to obtain the instruction execution-related information in the simulation tracking log information and the instruction execution reference information in the reference log recording information, the instruction execution-related information including instruction execution sequence information and instruction generation target state information; based on the instruction execution sequence information, the instruction generation target state information is compared with the instruction execution processor state parameters recorded in the instruction execution reference information to obtain the processor state analysis result.
2. The method according to claim 1, It is characterized in that After acquiring the simulation tracking log information generated by the test processor system executing the target test instruction, it also includes: Extracting instruction operation record data corresponding to the target test instruction from the simulation tracking log information; Based on the instruction operation record data, determining whether the simulation tracking log information corresponding to the same target test instruction has been collected; In the case where the simulation tracing log information corresponding to the same target test instruction is collected, it is determined that the simulation tracing log information corresponding to the target test instruction is collected.
3. The method according to claim 2, It is characterized in that Based on the simulation tracking log information corresponding to the target test instruction, combined with the reference log record information corresponding to the target test instruction, a processor state analysis is performed to obtain a processor state analysis result corresponding to the target test instruction, including: Extracting instruction operation record parameters corresponding to the target test instruction from the reference log record information; Determining a test processor state change using the instruction operation record data; If the test processor state change is consistent with the processor state change corresponding to the instruction operation record parameter, a normal processor state change result is generated, and the normal processor state change result is determined as the processor state analysis result; If the test processor state change is inconsistent with the processor state change corresponding to the instruction operation record parameter, a processor state change abnormal result is generated, and the processor state change abnormal result is determined as the processor state analysis result.
4. The method according to claim 1, It is characterized in that The step of triggering the test processor system to continue to run the test case information based on the normal result of the processor state change through a clock excitation signal includes: Based on the normal result of the processor change, determining whether the test processor system has executed all the test instructions in the test case information; In the case that the test processor system has not executed all the test instructions, a clock recovery message is generated, and the clock recovery message is used to generate the clock excitation signal, and the clock excitation signal is used for the test processor system to perform simulation operation.
5. The method according to any one of claims 1 to 4, It is characterized in that After determining the test case information, the method further includes: Obtain reference log information corresponding to when all the test case information is executed; The reference log record information corresponding to the target test instruction is extracted from the reference log information.
6. The method according to any one of claims 1 to 4, It is characterized in that The clock excitation signal is also used to trigger the processor reference model system that generates the reference log record information to continue running, and before the simulation tracking log information corresponding to the target test instruction is combined with the reference log record information corresponding to the target test instruction to perform processor state analysis, it also includes: Loading the instruction sequence in the test case information through the processor reference model system, wherein the instruction sequence includes the target test instruction; Acquire reference log record information generated by the processor reference model system executing a target test instruction; After collecting the reference log record information corresponding to the target test instruction, a reference clock pause message is generated, where the reference clock pause message is used to notify the processor reference model system to pause operation.
7. A processor function verification device, It is characterized in that include: A test case determination module, used to determine test case information, wherein the test case information is used to test the processor system for simulation operation; A simulation operation module, used for testing the processor system to execute a target test instruction, wherein the target test instruction is at least one but not all instructions in the test case information; A simulation tracking log information acquisition module, used to acquire simulation tracking log information generated by the test processor system executing the target test instruction; A simulation clock pause module, used for generating a simulation clock pause message after collecting the simulation tracking log information corresponding to the target test instruction, wherein the simulation clock pause message is used for notifying the test processor system to pause operation; A processor state analysis module, used to perform processor state analysis based on the simulation tracking log information corresponding to the target test instruction and in combination with the reference log record information corresponding to the target test instruction, to obtain a processor state analysis result corresponding to the target test instruction; A verification failure prompt module, configured to output processor function verification error prompt information based on the abnormal processor state change result when the processor state analysis result is an abnormal processor state change result; A function verification result module is used to trigger the test processor system to continue to run the test case information through a clock excitation signal based on the normal result of the processor state change when the processor state analysis result is a normal result of the processor state change; Wherein, the processor state analysis module includes: a clock related information submodule and a processor state comparison submodule; The clock-related information submodule is used to delete or skip the clock-related information in the simulation tracking log information and the clock-related information in the reference log record information, respectively, to obtain the instruction execution-related information in the simulation tracking log information and the instruction execution reference information in the reference log record information, wherein the instruction execution-related information includes the instruction execution sequence information and the instruction generation target state information; The processor state comparison submodule is used to compare the instruction generation target state information with the instruction execution processor state parameters recorded in the instruction execution reference information based on the instruction execution sequence information to obtain the processor state analysis result.
8. The device according to claim 7, It is characterized in that Also includes: An operation record data extraction module, used to extract instruction operation record data corresponding to the target test instruction from the simulation tracking log information; The simulation tracking log information determination module is used to determine whether the simulation tracking log information corresponding to the same target test instruction has been collected based on the instruction operation record data; if the simulation tracking log information corresponding to the same target test instruction has been collected, it is determined that the simulation tracking log information corresponding to the target test instruction has been collected.
9. A computer-readable storage medium having a computer program stored thereon, It is characterized in that When the computer program is executed by a processor, the steps of the processor function verification method according to any one of claims 1 to 6 are implemented.
