Chip verification method and device, electronic equipment and storage medium
By generating and executing to-be-verified tasks containing instructions and verification data, and using emulators and simulators to compare results, the problem of operational anomaly detection for chip processors under high computing power requirements is solved, ensuring its stability in multi-core scenarios. run.
Patent Information
- Application Number
- CN202310258165.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-10
- Publication Date
- 2024-09-10
AI Technical Summary
In computing tasks with high computing power requirements, it is difficult for chip processors to continue running and operation abnormalities are difficult to detect. Effective multi-core operation scenario verification methods are needed to ensure stable operation.
By generating multiple tasks to be verified, each task includes instructions and verification data, and obtaining and executing these tasks based on the same instruction address, using emulators and simulators to obtain simulation results and simulation results, and comparing them to determine the verification results, quickly Positioning instruction or data stampede phenomenon.
It achieves effective verification of the chip processor, ensures its continuous and stable operation in multi-core scenarios, improves the efficiency of operation anomaly detection, and avoids missed operations due to data trampling.
Smart Images

Figure HDA0004130611110000021 
Figure HDA0004130611110000041 
Figure HDA0004130611110000031
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computer technology, and in particular to the field of chip technology. Background Art
[0002] With the rise of artificial intelligence, the demand for computing power of chip processors has also increased. When faced with computing tasks with large computing volume, it is difficult to detect computing anomalies of chip processors due to the large amount of computing. Therefore, in order to ensure that the chip processor can run continuously and stably, it is particularly important to verify the multi-core operation scenario of the chip processor. Summary of the invention
[0003] The present disclosure provides a chip verification method, apparatus, device, storage medium and program product.
[0004] According to one aspect of the present disclosure, a chip verification method is provided, including: generating a plurality of tasks to be verified based on verification information used for chip verification, each of the plurality of tasks to be verified comprising an instruction and verification data related to the instruction, and the instruction fetch addresses corresponding to the plurality of tasks to be verified are the same; based on the instruction fetch addresses, obtaining a plurality of instructions and a plurality of verification data of the plurality of tasks to be verified; and executing the plurality of tasks to be verified using the plurality of instructions and the plurality of verification data to obtain verification results.
[0005] According to another aspect of the present disclosure, a chip verification device is provided, including: an emulator; a simulator; and a processor, configured to: generate multiple tasks to be verified based on verification information used for chip verification, each of the multiple tasks to be verified includes instructions and verification data related to the instructions, and the multiple tasks to be verified have the same instruction fetch addresses; control the emulator to obtain multiple instructions and multiple verification data of each task to be verified based on the instruction fetch addresses; control the emulator to execute multiple tasks to be verified using multiple instructions and multiple verification data to obtain simulation results, and control the simulator to execute multiple tasks to be verified to obtain simulation results; and compare the simulation results with the simulation results to obtain verification results.
[0006] Another aspect of the present disclosure provides an electronic device, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the method shown in the embodiment of the present disclosure.
[0007] According to another aspect of an embodiment of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions is provided, wherein the computer instructions are used to enable a computer to execute the method shown in the embodiment of the present disclosure.
[0008] According to another aspect of an embodiment of the present disclosure, a computer program product is provided, including a computer program / instruction, wherein the computer program / instruction implements the steps of the method shown in the embodiment of the present disclosure when executed by a processor.
[0009] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present disclosure, nor is it intended to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0010] The accompanying drawings are used to better understand the present solution and do not constitute a limitation of the present disclosure.
[0011] Figure 1 The application scenario of the chip verification method according to the embodiment of the present disclosure is schematically shown;
[0012] Figure 2 The flowchart of the chip verification method according to the embodiment of the present disclosure is schematically shown;
[0013] Figure 3 A flowchart of generating a task to be verified according to an embodiment of the present disclosure is schematically shown;
[0014] Figure 4 A schematic diagram schematically shows a chip verification method according to an embodiment of the present disclosure;
[0015] Figure 5 A block diagram schematically shows a chip verification device according to an embodiment of the present disclosure; and
[0016] Figure 6 A block diagram schematically illustrates an example electronic device that may be used to implement an embodiment of the present disclosure. DETAILED DESCRIPTION
[0017] The following is a description of exemplary embodiments of the present disclosure in conjunction with the accompanying drawings, including various details of the embodiments of the present disclosure to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present disclosure. Similarly, for the sake of clarity and conciseness, descriptions of well-known functions and structures are omitted in the following description.
[0018] The present disclosure provides a chip verification method, which generates multiple tasks to be verified based on verification information used for chip verification, each of the multiple tasks to be verified includes an instruction and verification data related to the instruction, and the multiple tasks to be verified have the same instruction fetch addresses; based on the instruction fetch addresses, multiple instructions and multiple verification data of the multiple tasks to be verified are obtained; and the multiple tasks to be verified are executed using the multiple instructions and the multiple verification data to obtain verification results.
[0019] The following will be combined Figure 1 The application scenarios of the chip verification method are described.
[0020] Figure 1 The application scenario of the chip verification method according to the embodiment of the present disclosure is schematically shown.
[0021] like Figure 1 As shown, the application scenario 100 includes a random instruction generator 110 , an emulator 120 and a simulator 130 .
[0022] According to an embodiment of the present disclosure, the chip may be a processor chip, and verification of the processor chip is implemented using the random instruction generator 110 , the emulator 120 , and the simulator 130 .
[0023] According to an embodiment of the present disclosure, the random instruction generator 110 can generate a test case for chip verification. For example, the test case includes multiple test tasks, and each test task can be considered as a kernel file. For example, by simulating a processor chip to run the kernel, the correctness of different functions of the processor chip can be verified. For example, the kernel can include read and write instructions, and by simulating a processor chip to run the kernel, it can be verified whether the processor chip has the correct read and write functions.
[0024] Each kernel can include an executable and link format (elf) file and a binary (bin) file. The .elf file is an executable binary file, which includes information such as symbol tables and assembly codes. Part of the code segment, data segment, and custom segment extracted from the .elf file can be used to obtain a memory image file, namely the .bin file.
[0025] According to an embodiment of the present disclosure, in the chip design stage, the structure of the processor and peripheral circuit of the processor chip is designed so that the processor chip has multiple preset functions. The simulator 120 can simulate the structure of the processor and peripheral circuit to obtain a virtual processor and a virtual peripheral circuit. The virtual processor and the virtual peripheral circuit are used to verify whether they can realize the multiple preset functions of the processor chip. The simulator 130 can simulate the standard structure of the processor and peripheral circuit to a standard virtual processor and a standard virtual peripheral circuit. The standard virtual processor and the standard virtual peripheral circuit are used to realize the multiple preset functions of the processor chip.
[0026] According to an embodiment of the present disclosure, the random instruction generator 110 sends the .bin file to the simulator 120, and the simulator 120 runs the .bin file to verify whether the virtual processor and the virtual peripheral circuit can correctly implement the various preset functions of the processor chip. The random instruction generator 110 sends the .elf file to the simulator 130, and the simulator 130 runs the .elf file to output the standard results of the standard virtual processor and the standard virtual peripheral circuit processing the corresponding test task.
[0027] According to an embodiment of the present disclosure, by comparing the result output by the emulator 120 and the result output by the simulator 130 , it is determined whether the virtual processor and the virtual peripheral circuit simulated by the emulator 120 have a plurality of preset functions.
[0028] In the technical solution of the present disclosure, the collection, storage, use, processing, transmission, provision and disclosure of user personal information involved are in compliance with the provisions of relevant laws and regulations and do not violate public order and good morals.
[0029] In the technical solution of the present disclosure, the user's authorization or consent is obtained before obtaining or collecting the user's personal information.
[0030] The following will be combined Figure 2 The chip verification method provided by the present disclosure is described.
[0031] Figure 2 The flowchart of the chip verification method according to the embodiment of the present disclosure is schematically shown.
[0032] like Figure 2 As shown, the chip verification method 200 includes operations S210 to S230.
[0033] In operation S210 , a plurality of tasks to be verified are generated according to verification information for chip verification.
[0034] According to an embodiment of the present disclosure, the task to be verified may be a test case for chip verification. Each of the multiple tasks to be verified includes an instruction and verification data related to the instruction, and the instruction fetch addresses corresponding to the multiple tasks to be verified are the same. For example, each task to be verified includes a corresponding instruction, verification data related to the instruction, and an instruction fetch address.
[0035] According to an embodiment of the present disclosure, the verification information may be a source file for indicating instructions, verification data, and instruction fetch addresses. The verification information is compiled to obtain tasks to be verified. Each task to be verified may be a kernel.
[0036] Then, in operation S220 , a plurality of instructions and a plurality of verification data of a plurality of tasks to be verified are obtained based on the instruction fetch address.
[0037] According to an embodiment of the present disclosure, the instruction fetch address may be a memory address, for example, the instruction fetch address may be represented by an instruction counter (Program Counter, PC), and the PC value may indicate the address of the instruction in the memory. Each task to be verified is written to the memory address, and the corresponding task to be verified may be read by accessing the memory address during the verification process. Multiple tasks to be verified may include the same instruction fetch address, so multiple tasks to be verified may be written to the same memory address, and multiple tasks to be verified may be read by accessing the same memory address during the verification process.
[0038] In operation S230 , a plurality of tasks to be verified are executed using a plurality of instructions and a plurality of verification data to obtain a verification result.
[0039] According to an embodiment of the present disclosure, based on each instruction in a plurality of instructions and verification data corresponding to each instruction, the data to be verified corresponding to each instruction is executed. For example, the instruction is to write data A into the memory and write to address 0100, the verification data is data A, the operation of writing data A into the memory is executed, and the writing result is used as the verification result. When it is determined that data A is successfully written into the memory and the address is 0100, the task verification can be passed.
[0040] According to an embodiment of the present disclosure, when multiple tasks to be verified are generated, the same instruction fetch address is configured for each task to be verified, so that when executing the tasks to be verified, multiple tasks to be verified can be read from the same address of the memory. For example, the first task to be verified is written to the memory address 0010. During the verification process, the first task to be verified is read from the memory address 0010, and the first task to be verified is executed. When it is determined that the first task to be verified is completed, the second task to be verified is written to the memory address 0010, so that the second task to be verified covers the first task to be verified. During the verification process, the second task to be verified is read from the memory address 0010, and the second task to be verified is executed. According to this rule, multiple tasks to be verified are executed in sequence.
[0041] According to an embodiment of the present disclosure, multiple tasks to be verified may have different instructions and different verification data. If it is determined that multiple tasks to be verified have the same value address and different instructions and different verification data, it can be considered that instruction trampling occurs when executing multiple tasks to be verified.
[0042] According to the embodiments of the present disclosure, in the scenario of multi-kernel operation, after configuring the value addresses of multiple kernels to the same address, the operation processes of multiple kernels will have the same operation path. At this time, if it is determined that the operation process is abnormal, the abnormal kernel can be quickly located based on the tracking information of the multi-kernel operation.
[0043] The following will be combined Figure 3 The process of generating multiple tasks to be verified provided by the present disclosure is described.
[0044] Figure 3 The flowchart of generating a task to be verified according to an embodiment of the present disclosure is schematically shown.
[0045] like Figure 3 As shown, the multiple tasks to be verified may include N tasks to be verified, where N is an integer greater than 1, and the method 310 for generating multiple tasks to be verified may include operations S311 to S313.
[0046] In operation S311, the verification information is compiled to obtain the first task to be verified.
[0047] For example, the verification information is a source file written in C language. The source file is compiled to obtain tasks to be verified. Each task to be verified includes an .elf file and a .bin file. Each .elf file and the corresponding .bin file include the same instructions, verification data and instruction fetch addresses.
[0048] For example, the first task to be verified is the first file to be verified generated among the N tasks to be verified. The first task to be verified includes a corresponding first instruction, first verification data related to the first instruction, and an instruction fetch address.
[0049] Then, in operation S312, the instruction fetch address included in the first task to be verified is obtained.
[0050] In operation S313, for the nth task to be verified among the N tasks to be verified, an nth task to be verified is generated according to the instruction fetch address, the nth instruction related to the nth task to be verified and the nth verification data related to the nth instruction, where n=2, 3, ..., N.
[0051] According to an embodiment of the present disclosure, in the process of generating N tasks to be verified, the first task to be verified can be randomly generated according to the verification information. When generating the second task to be verified, the test case name corresponding to the second task to be verified is obtained, and the test case name is parsed. When it is determined that the test case name indicates an instruction trampling scene, the above N tasks to be verified can be considered as test cases for verifying the instruction trampling scene. At this time, the first value address included in the first task to be verified can be used as a reference to generate the second task to be verified, the third task to be verified, ..., and the Nth task to be verified in sequence.
[0052] For example, in the process of generating the second task to be verified, the second instruction used to generate the second task to be verified and the second verification data related to the second instruction can be randomly determined according to the verification information, the first instruction fetch address included in the first task to be verified is obtained, and the second instruction fetch address used to generate the second task to be verified is configured as the first instruction fetch address, and the second instruction fetch address, the second instruction and the second verification data related to the second instruction are compiled to obtain the second task to be verified. At this time, the second instruction fetch address included in the second task to be verified is the same as the first instruction fetch address included in the first task to be verified.
[0053] For example, in the process of generating the third task to be verified, the third instruction used to generate the third task to be verified and the third verification data related to the third instruction can be randomly determined according to the verification information, the third instruction fetch address used to generate the third task to be verified is configured as the first instruction fetch address, and the third instruction fetch address, the third instruction and the third verification data related to the third instruction are compiled to obtain the third task to be verified. At this time, the third instruction fetch address included in the third task to be verified is the same as the first instruction fetch address included in the first task to be verified.
[0054] According to the above method for generating tasks to be verified, the fourth task to be verified, the fifth task to be verified, ..., the Nth task to be verified can be generated in sequence. The value addresses of the N tasks to be verified obtained according to the above method for generating tasks to be verified are all the same. When the above N tasks to be verified are executed, an instruction trampling scene is formed.
[0055] According to an embodiment of the present disclosure, the instruction fetch address of the first generated task to be verified is used as a reference to generate the subsequent N-1 tasks to be verified in sequence, which can simplify the generation process of N tasks to be verified and reduce the process of generating the value address of each task to be verified.
[0056] According to an embodiment of the present disclosure, compiling verification information in operation S311 to obtain the first task to be verified may include: generating the first instruction using the first random seed; configuring a preset instruction fetch address for the first instruction; generating the first verification data related to the first instruction; and compiling the first instruction, the preset instruction fetch address and the first verification data to obtain the first task to be verified.
[0057] For example, the first instruction of the first task to be verified may be generated based on a random seed. The random seed may be an initial condition for generating a random number, and a random number may be generated by iterating the random seed. For example, the random seed may be the current time when the first instruction is generated.
[0058] For example, the first instruction may be generated by a random instruction generator based on a first random seed. The random instruction generator may be a software program controlled and executed by a processor. The first verification data may also be generated by the random instruction generator based on an operation rule indicated by the first instruction.
[0059] For example, by compiling the first instruction, presetting the instruction fetch address and the first verification data, the first task to be verified may be obtained, including a .elf file and a corresponding .bin file.
[0060] According to an embodiment of the present disclosure, in operation S313, generating the nth task to be verified according to the instruction fetch address, the nth instruction related to the nth task to be verified and the nth verification data related to the nth instruction includes: generating the nth verification data related to the nth instruction based on random parameters, the nth instruction being the same as the first instruction; and compiling the nth instruction, the instruction fetch address and the nth verification data to obtain the nth task to be verified.
[0061] According to an embodiment of the present disclosure, the nth instruction of the nth task to be verified may be the same as the first instruction of the first task to be verified. For example, the nth instruction may be generated based on the first random instruction used to generate the first instruction, and the same instruction may be generated based on the same random seed.
[0062] According to an embodiment of the present disclosure, the random parameter may be a randomly generated constraint parameter, and different verification data may be generated based on different constraint parameters. For example, the generated verification data may be all 0, all 1, or multiple random numbers, respectively. For example, in the process of generating the first verification data, the first constraint parameter is set so that the first verification data is all 0; in the process of generating the second verification data, the second constraint parameter is set so that the second verification data is all 1; in the process of generating the third verification data, the third constraint parameter is set so that the third verification data is a random number; in the process of generating the fourth verification data, the fourth constraint parameter is set so that the fourth verification data is a random number. According to the above generation method, the fifth verification data, the sixth verification data, ..., the Nth verification data may be generated in sequence, wherein the first constraint parameter, the second constraint parameter, ..., the Nth constraint parameter are different.
[0063] According to an embodiment of the present disclosure, the instruction fetches and instructions of the N tasks to be verified may be the same, but the verification data may be different. The different verification data included in the N tasks to be verified may cover the changes of various data characteristics.
[0064] According to an embodiment of the present disclosure, in the process of generating a task to be verified, the instruction for generating the task to be verified and the verification data related to the instruction can be determined respectively by different functions. For example, the same instruction can be generated by the same random seed, and different verification data can be generated by different random seeds.
[0065] For example, when generating the nth task to be verified, the nth random seed may be determined according to the random parameters; and the nth verification data related to the nth instruction may be generated using the nth random seed.
[0066] According to an embodiment of the present disclosure, N tasks to be verified may have the same instruction fetch address, different instructions, and different verification data. When it is determined that multiple tasks to be verified have the same value fetch address and the same instruction and have different verification data, it can be considered that data trampling occurs when executing multiple tasks to be verified.
[0067] For example, in the process of generating N tasks to be verified, the first task to be verified can be randomly generated according to the verification information. When generating the second task to be verified, the test case name corresponding to the second task to be verified is obtained, and the test case name is parsed. When it is determined that the test case name indicates a data trampling scenario, the above N tasks to be verified can be considered as test cases for verifying the data trampling scenario. At this time, the first value address and the first instruction included in the first task to be verified can be used as a reference to generate the second task to be verified, the third task to be verified, ..., and the Nth task to be verified in sequence.
[0068] For example, in the process of generating the second task to be verified, the second instruction fetch address used to generate the second task to be verified is configured as the first instruction fetch address, the second instruction is generated based on the first random instruction used to generate the first instruction, and the second verification data used to generate the second task to be verified is generated based on the second random seed, and the second instruction fetch address, the second instruction and the second verification data are compiled to obtain the second task to be verified. At this time, the second instruction fetch address and the second instruction included in the second task to be verified are respectively the same as the first instruction fetch address and the first instruction included in the first task to be verified.
[0069] For example, in the process of generating the third task to be verified, the third instruction fetch address used to generate the third task to be verified is configured as the first instruction fetch address, the third instruction is generated based on the first random instruction used to generate the first instruction, and the third verification data used to generate the third task to be verified is generated based on the third random seed, and the third instruction fetch address, the third instruction and the third verification data are compiled to obtain the third task to be verified. At this time, the third instruction fetch address and the third instruction included in the third task to be verified are respectively the same as the first instruction fetch address and the first instruction included in the first task to be verified.
[0070] According to the above method for generating tasks to be verified, the 4th task to be verified, the 5th task to be verified, ..., the Nth task to be verified can be generated in sequence, wherein the 2nd random seed, the 3rd random seed, ..., the Nth random seed are different. The value addresses and instructions of the N tasks to be verified obtained according to the above method for generating tasks to be verified are the same, but the verification data are different. When executing the above N tasks to be verified, a data stampede scenario is formed.
[0071] For example, when executing a task to be verified, the first task to be verified is written to the memory address 0010. During verification, a task to be verified is read from the memory address 0010 and the first task to be verified is executed. When it is determined that the first task to be verified is completed, the second task to be verified is written to the memory address 0010 so that the second task to be verified covers the first task to be verified. During verification, the second task to be verified is read from the memory address 0010 and the second task to be verified is executed. According to this rule, N tasks to be verified are executed in sequence.
[0072] According to the embodiments of the present disclosure, since the N tasks to be verified have the same instruction fetch address and instruction, it can be considered that data trampling occurs when executing the N tasks to be verified. In the face of a data trampling scenario, the tracking information of running the N tasks to be verified will record the same running path. When it is determined that an abnormality occurs in the operation process, the abnormality can be quickly located based on the tracking information, thereby avoiding the phenomenon of missing operations and the like due to ignoring multiple tasks to be verified in the data trampling scenario.
[0073] The following will be combined Figure 4The chip verification method provided by the present disclosure is described.
[0074] Figure 4 The figure schematically shows a chip verification method according to an embodiment of the present disclosure.
[0075] like Figure 4 As shown, the chip verification method 400 includes the operation process of a random instruction generator 410 , an emulator 420 and a simulator 430 .
[0076] According to an embodiment of the present disclosure, the random instruction generator 410 generates N tasks to be verified, and the N tasks to be verified may include N .bin files 411 , N .ini files 412 , and N .elf files 413 . For example, N tasks to be verified may be named with kernel index, for example, the .bin files of the N tasks to be verified are named kernel0.bin 411_1, kernel1.bin 411_2, kernel2.bin 411_3, …, kernelN-1.bin, the .ini files of the N tasks to be verified are named cfg_kernel0.ini 412_1, cfg_kernel1.ini 412_2, cfg_kernel2.ini412_3, …, cfg_kernelN-1.ini, and the .elf files of the N tasks to be verified are named kernel0.elf 413_1, kernel1.elf 413_2, kernel2.elf 412_3, …, kernelN-1.elf.
[0077] For example, when verifying the function of the processor chip to handle the instruction trampling scene, the N tasks to be verified include the same instruction fetch address and different instructions and verification data. When verifying the function of the processor chip to handle the data trampling scene, the N tasks to be verified include the same instruction fetch address and instruction and different verification data.
[0078] According to an embodiment of the present disclosure, the above Figure 2 In the illustrated embodiment, operation S220, based on the instruction fetch address, obtaining multiple instructions and multiple verification data of multiple tasks to be verified may include: writing the instruction fetch address into the verification environment; and in the verification environment, sequentially loading multiple instructions and multiple verification data of multiple tasks to be verified from the instruction fetch address.
[0079] According to an embodiment of the present disclosure, using multiple instructions and multiple verification data to execute multiple tasks to be verified, obtaining verification results includes: in a verification environment, based on multiple instructions, running multiple verification data in sequence to obtain simulation results; in a simulation environment, based on multiple instructions, running multiple verification data in sequence to obtain simulation results; and comparing the simulation results with the simulation results to obtain verification results
[0080] For example, the random instruction generator 410 sends N .bin files 411 and N .jni files 412 to the simulator 420. The N .bin files 411 are used to provide the simulator 420 with data for virtual processor execution, and the N .ini files 412 are used to write the instruction fetch address of each kernel into the simulator 420. The random instruction generator 410 sends N .elf files 413 to the simulator 430. The N .elf files 413 are used to provide the simulator 430 with data for standard processor execution.
[0081] For example, the simulator 420 provides a verification environment for chip verification. For example, the simulator 420 may provide a register-transfer level (RTL) verification environment.
[0082] For example, the simulator 420 may load kernel10.bin 411_1 and cfg_kernel0.ini 412_1 included in the first task to be verified from the random instruction generator 410. The simulator 420 loads kernel0.bin 411_1 to the instruction fetch address indicated by cfg_kernel0.ini 412_1, and runs kernel0.bin 411_1 to obtain the first simulation result kernel0_hw_trace.log&mem 421_1, and the first simulation result includes the first simulation trace information and the first simulation memory information. The simulator 420 may also send the first simulation result kernel0_hw_trace.log&mem 421_1 to the comparator 422.
[0083] For example, the simulator 430 may load kernel0.elf 413_1 included in the first task to be verified from the random instruction generator 410, and the simulator 430 runs kernel0.elf 413_1 to obtain the first simulation result kernel0_spike_trace.log&mem 431_1, the first simulation result including the first simulation trace information and the first simulation memory information. The simulator 430 may also send the first simulation result kernel0_spike_trace.log&mem 431_1 to the comparator 422 located in the emulator 420.
[0084] In the comparator 422, the first simulation trace information and the first simulation trace information are compared, and the first simulation memory information and the first simulation memory information are compared to determine the verification result of the processor information running the first task to be verified. When it is determined that the first simulation trace information is the same as the first simulation trace information and the first simulation memory information is the same as the first simulation memory information, it can be considered that the verification result is correct.
[0085] When the first task to be verified is completed, the virtual processor in the simulator 420 may send an interrupt signal. Under the instruction of the interrupt signal, the simulator 420 loads kernell.bin 411_2 and cfg_kernell.ini 412_2 included in the second task to be verified, thereby executing the second task to be verified and obtaining the second simulation result kernell_hw_trace.log&mem 422_1. When the first task to be verified is completed, the standard processor in the simulator 430 may send an interrupt signal. Under the instruction of the interrupt signal, the simulator 430 loads kernell.elf 413_2 included in the second task to be verified, thereby executing the second task to be verified and obtaining the second simulation result kernell_spike_trace.log&mem 431_2.
[0086] In the comparator 422, the second simulation trace information and the second simulation trace information are compared, and the second simulation memory information and the second simulation memory information are compared to determine the verification result of the processor information running the second task to be verified. When it is determined that the second simulation trace information is the same as the second simulation trace information and the second simulation memory information is the same as the second simulation memory information, the verification result can be considered correct.
[0087] According to this rule, by sequentially executing multiple tasks to be verified, multiple simulation results kernel2_hw_trace.log&mem 421_3, kernel3_hw_trace.log&mem, ..., kernelN-1_hw_trace.log&mem output by the simulator 420 and multiple simulation results kernel2_spike_trace.log&mem 431_3, kernel3_spike_trace.log&mem, ..., kernelN-1_spike_trace.log&mem output by the simulator 430 can be obtained in turn, thereby realizing the continuous operation of multiple tasks to be verified and the automatic comparison of multiple simulation results and multiple simulation results, thereby improving the verification efficiency. Using multiple tasks to be verified to realize instruction trampling and data trampling scenarios, by taking the first generated task to be verified as a reference, the method of generating subsequent multiple tasks to be verified can improve the verification reusability between verification platforms.
[0088] The following will be combined Figure 5 The chip verification device provided by the present disclosure is described.
[0089] Figure 5 The block diagram of a chip verification device according to an embodiment of the present disclosure is schematically shown.
[0090] like Figure 5 As shown, the chip verification device 500 includes an emulator 510 , a simulator 520 and a processor 530 .
[0091] According to an embodiment of the present disclosure, the processor 530 is configured as follows: based on the verification information used for chip verification, a plurality of tasks to be verified are generated, each of the plurality of tasks to be verified includes instructions and verification data related to the instructions, and the instruction fetch addresses corresponding to the plurality of tasks to be verified are the same; the simulator is controlled to obtain a plurality of instructions and a plurality of verification data of each task to be verified based on the instruction fetch address; the simulator is controlled to execute a plurality of tasks to be verified using the plurality of instructions and the plurality of verification data to obtain simulation results, and the simulator is controlled to execute a plurality of tasks to be verified to obtain simulation results; and the simulation results are compared with the simulation results to obtain verification results.
[0092] According to an embodiment of the present disclosure, the plurality of tasks to be verified include N tasks to be verified, where N is an integer greater than 1. The processor 530 is further configured to: compile verification information to obtain a first task to be verified; obtain an instruction fetch address included in the first task to be verified; and for an nth task to be verified among the N tasks to be verified, generate an nth task to be verified according to the instruction fetch address, an nth instruction related to the nth task to be verified, and an nth verification data related to the nth instruction, where n=2, 3, ..., N.
[0093] According to an embodiment of the present disclosure, the processor 530 is also configured to: generate a first instruction using a first random seed; configure a preset instruction fetch address for the first instruction; generate first verification data related to the first instruction; and compile the first instruction, the preset instruction fetch address and the first verification data to obtain a first task to be verified.
[0094] According to an embodiment of the present disclosure, the processor 530 is also configured to: generate nth verification data related to the nth instruction based on random parameters, the nth instruction is the same as the first instruction; and compile the nth instruction, instruction fetch address and nth verification data to obtain the nth task to be verified.
[0095] According to an embodiment of the present disclosure, the processor 530 is further configured to: determine an nth random seed according to the random parameter; and generate an nth verification data related to the nth instruction using the nth random seed.
[0096] According to an embodiment of the present disclosure, the present disclosure also provides an electronic device, a readable storage medium and a computer program product.
[0097] Figure 6 A block diagram of an example electronic device 600 that can be used to implement an embodiment of the present disclosure is schematically shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present disclosure described and / or required herein.
[0098] like Figure 6 As shown, the device 600 includes a computing unit 601, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 602 or a computer program loaded from a storage unit 608 into a random access memory (RAM) 603. In the RAM 603, various programs and data required for the operation of the device 600 can also be stored. The computing unit 601, the ROM 602, and the RAM 603 are connected to each other via a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.
[0099] A number of components in the device 600 are connected to the I / O interface 605, including: an input unit 606, such as a keyboard, a mouse, etc.; an output unit 607, such as various types of displays, speakers, etc.; a storage unit 608, such as a disk, an optical disk, etc.; and a communication unit 609, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 609 allows the device 600 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0100] The computing unit 601 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the computing unit 601 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The computing unit 601 performs the various methods and processes described above, such as a chip verification method. For example, in some embodiments, the chip verification method may be implemented as a computer software program, which is tangibly contained in a machine-readable medium, such as a storage unit 608. In some embodiments, part or all of the computer program may be loaded and / or installed on the device 600 via ROM 602 and / or communication unit 609. When the computer program is loaded into RAM 603 and executed by the computing unit 601, one or more steps of the chip verification method described above may be performed. Alternatively, in other embodiments, the computing unit 601 may be configured to perform the chip verification method in any other appropriate manner (e.g., by means of firmware).
[0101] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0102] The program code for implementing the method of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that the program code, when executed by the processor or controller, enables the functions / operations specified in the flow chart and / or block diagram to be implemented. The program code may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.
[0103] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0104] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).
[0105] The systems and techniques described herein may be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), and the Internet.
[0106] A computer system may include clients and servers. Clients and servers are generally remote from each other and usually interact through a communication network. The relationship of client and server is generated by computer programs running on respective computers and having a client-server relationship to each other.
[0107] The server can be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system. It solves the defects of difficult management and weak business scalability in traditional physical hosts and VPS services ("Virtual Private Server", or "VPS" for short). The server can also be a server of a distributed system, or a server combined with blockchain.
[0108] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps recorded in this disclosure can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution of this disclosure can be achieved, and this document is not limited here.
[0109] The above specific implementations do not constitute a limitation on the protection scope of the present disclosure. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present disclosure shall be included in the protection scope of the present disclosure.
Claims
1. A chip verification method, comprising: Generate a plurality of tasks to be verified according to verification information for chip verification, each of the plurality of tasks to be verified comprises an instruction and verification data related to the instruction, and the instruction fetch addresses corresponding to the plurality of tasks to be verified are the same; Based on the instruction fetch address, acquiring multiple instructions and multiple verification data of the multiple tasks to be verified; as well as The plurality of tasks to be verified are executed using the plurality of instructions and the plurality of verification data to obtain verification results.
2. The method according to claim 1, wherein: The plurality of tasks to be verified include N tasks to be verified, where N is an integer greater than 1; and generating the plurality of tasks to be verified according to the verification information required for chip verification includes: Compile the verification information to obtain the first task to be verified; Obtaining the instruction fetch address included in the first task to be verified; and For the nth task to be verified among the N tasks to be verified, the nth task to be verified is generated according to the instruction fetch address, the nth instruction related to the nth task to be verified and the nth verification data related to the nth instruction, where n=2, 3, ..., N.
3. The method according to claim 2, wherein: The compiling the verification information to obtain the first task to be verified includes: Generate the first instruction using the first random seed; Configuring a preset instruction fetch address for the first instruction; generating first verification data related to the first instruction; and The first instruction, the preset instruction fetch address and the first verification data are compiled to obtain the first task to be verified.
4. The method according to claim 3, wherein: The generating the nth task to be verified according to the instruction fetch address, the nth instruction related to the nth task to be verified and the nth verification data related to the nth instruction comprises: generating nth verification data associated with the nth instruction based on a random parameter, the nth instruction being the same as the first instruction; and Compile the nth instruction, the instruction fetch address and the nth verification data to obtain the nth task to be verified.
5. The method according to claim 4, wherein: The generating, based on the random parameter, the nth verification data related to the nth instruction comprises: Determining an nth random seed according to the random parameter; and Using the nth random seed, an nth verification data associated with the nth instruction is generated.
6. The method according to claim 1, wherein: The acquiring the plurality of instructions and the plurality of verification data of the plurality of tasks to be verified based on the instruction fetch address comprises: Writing the instruction fetch address into a verification environment; and In the verification environment, multiple instructions and multiple verification data of the multiple tasks to be verified are loaded in sequence from the instruction fetch address.
7. The method according to claim 6, wherein: The performing the plurality of tasks to be verified by using the plurality of instructions and the plurality of verification data to obtain the verification results comprises: In the verification environment, based on the multiple instructions, the multiple verification data are sequentially executed to obtain simulation results; In a simulation environment, based on the multiple instructions, the multiple verification data are sequentially executed to obtain simulation results; and The simulation result and the simulation result are compared to obtain a verification result.
8. A chip verification device, comprising: Emulator; Simulator; as well as Processor, configured as: Generate a plurality of tasks to be verified according to verification information for chip verification, each of the plurality of tasks to be verified comprises an instruction and verification data related to the instruction, and the instruction fetch addresses corresponding to the plurality of tasks to be verified are the same; Controlling the simulator to obtain multiple instructions and multiple verification data of each task to be verified based on the instruction fetch address; Controlling the simulator to execute the plurality of tasks to be verified using the plurality of instructions and the plurality of verification data to obtain simulation results, and controlling the simulator to execute the plurality of tasks to be verified to obtain simulation results; as well as The simulation result and the simulation result are compared to obtain a verification result.
9. The device according to claim 8, wherein: The plurality of tasks to be verified include N tasks to be verified, where N is an integer greater than 1; and the processor is further configured to: Compile the verification information to obtain the first task to be verified; Obtaining the instruction fetch address included in the first task to be verified; as well as For the nth task to be verified among the N tasks to be verified, the nth task to be verified is generated according to the instruction fetch address, the nth instruction related to the nth task to be verified and the nth verification data related to the nth instruction, where n=2, 3, ..., N.
10. The device according to claim 9, wherein: The processor is further configured to: Generate the first instruction using the first random seed; Configuring a preset instruction fetch address for the first instruction; generating first verification data related to the first instruction; and The first instruction, the preset instruction fetch address and the first verification data are compiled to obtain the first task to be verified.
11. The device according to claim 10, wherein: The processor is further configured to: generating nth verification data associated with the nth instruction based on a random parameter, the nth instruction being the same as the first instruction; and Compile the nth instruction, the instruction fetch address and the nth verification data to obtain the nth task to be verified.
12. The device according to claim 11, wherein: The processor is further configured to: Determining an nth random seed according to the random parameters; and Using the nth random seed, an nth verification data associated with the nth instruction is generated.
13. An electronic device comprising: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 7.
14. A non-transitory computer-readable storage medium storing computer instructions, wherein: The computer instructions are used to cause the computer to execute the method according to any one of claims 1-7.
15. A computer program product comprising a computer program / instructions, characterized in that When the computer program / instructions are executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.
Citation Information
Cited By
Instruction verification method and device, equipment and storage medium
CN121365631A
