WO2020113526A1 - Chip verification method and device - Google Patents

Chip verification method and device Download PDF

Info

Publication number
WO2020113526A1
WO2020113526A1 PCT/CN2018/119613 CN2018119613W WO2020113526A1 WO 2020113526 A1 WO2020113526 A1 WO 2020113526A1 CN 2018119613 W CN2018119613 W CN 2018119613W WO 2020113526 A1 WO2020113526 A1 WO 2020113526A1
Authority
WO
WIPO (PCT)
Prior art keywords
test
instruction
chip
use case
control parameter
Prior art date
Application number
PCT/CN2018/119613
Other languages
French (fr)
Chinese (zh)
Inventor
杨鸿志
Original Assignee
华为技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 华为技术有限公司 filed Critical 华为技术有限公司
Priority to CN201880099920.XA priority Critical patent/CN113168364A/en
Priority to PCT/CN2018/119613 priority patent/WO2020113526A1/en
Publication of WO2020113526A1 publication Critical patent/WO2020113526A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/22Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing
    • G06F11/26Functional testing
    • G06F11/263Generation of test inputs, e.g. test vectors, patterns or sequences ; with adaptation of the tested hardware for testability with external testers
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01RMEASURING ELECTRIC VARIABLES; MEASURING MAGNETIC VARIABLES
    • G01R31/00Arrangements for testing electric properties; Arrangements for locating electric faults; Arrangements for electrical testing characterised by what is being tested not provided for elsewhere
    • G01R31/28Testing of electronic circuits, e.g. by signal tracer
    • G01R31/317Testing of digital circuits
    • G01R31/3181Functional testing
    • G01R31/3183Generation of test inputs, e.g. test vectors, patterns or sequences
    • G01R31/318385Random or pseudo-random test pattern
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/22Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing
    • G06F11/26Functional testing
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01RMEASURING ELECTRIC VARIABLES; MEASURING MAGNETIC VARIABLES
    • G01R31/00Arrangements for testing electric properties; Arrangements for locating electric faults; Arrangements for electrical testing characterised by what is being tested not provided for elsewhere
    • G01R31/28Testing of electronic circuits, e.g. by signal tracer
    • G01R31/317Testing of digital circuits
    • G01R31/31707Test strategies

Definitions

  • This application relates to the field of electronic technology, in particular to a chip verification method and device.
  • a "constraint-based random test template” method is generally used to verify whether there is a problem with the chip.
  • This method first defines a test template.
  • the test template includes an instruction set and instruction constraints, and then randomizes the instruction set according to the instruction constraints.
  • the generated instruction combination forms an instruction sequence, and an instruction use case is generated based on the instruction sequence and the default control parameters.
  • the control parameters are parameters used to control different instructions in the instruction sequence when they are run. Therefore, the different function values of the function points of the chip to be verified are output after the instruction case of the chip to be verified is run, and the test coverage is obtained according to the ratio of the number of output function values and the number of function values expected to be obtained, and the verification personnel analyzes Test coverage.
  • test coverage is not as expected, modify the instruction set in the test template according to the analysis results. For example, increase the instruction set in the instruction set to test the function corresponding to the function value that is not output, thereby improving the test coverage. ,Through the operation instruction use case of the chip to be verified once, until the test coverage reaches the expected, and there are no defects in the process of running the instruction use case, it proves that the chip to be verified is no problem; If the test coverage is in the process of running the instruction use case When the rate reaches the expected level and a bug occurs, the verification stops, and the technician repairs the defect of the chip to be verified according to the bug.
  • the embodiments of the present application provide a chip verification method and device, which are used to solve the problems of verifying whether there is a problem with the chip in the prior art, requiring verification personnel to participate, more cumbersome operations, and lower verification efficiency.
  • the present application provides a chip verification method, which includes determining a random value; selecting a corresponding instruction sequence in a test template based on the random value, the test template including multiple instructions; repeating execution based on the instruction sequence The following steps:
  • the first chip When the test coverage obtained when the first chip runs the actual test instruction use case is greater than a preset value, the first chip is controlled to run the actual test instruction use case multiple times, and if there is a defect bug, it ends, otherwise the traversal is performed again A step of a control parameter in the preset control parameter set that has not been traversed.
  • the verification device or component used to verify the chip determines a random value
  • an instruction series is generated based on the random value
  • the instruction sequence and the traversed different control parameters are respectively formed into different actual test instruction use cases
  • Different actual test command use cases generated based on different control parameters and the same instruction sequence can be used to verify the verification chip (ie, the first chip), and when the first chip runs an actual test command use case to obtain a test coverage greater than a preset value
  • the first chip can be further controlled to continue to run the actual instruction test instruction use case multiple times until a bug is detected in the chip to be verified. Therefore, the verification efficiency of the chip can be improved, and no personnel is required in the whole process, and the verification efficiency and accuracy can be improved.
  • a random value when a random value is determined, a random value may be randomly generated first; based on the random value, a corresponding instruction sequence is selected in the test template, and generated according to the selected instruction sequence and default control parameters A simulation test instruction use case; when the test coverage obtained when the first chip runs the simulation test instruction use case is greater than a preset value, the generated random value is used as a random value determined above.
  • the test coverage obtained after the first chip runs the instruction sequence composed of the instruction sequence obtained based on the random value and the default control parameters is greater than the preset value, it can be determined that the random value is a better random value, and the better The random number is used as the random number used in the subsequent generation of actual test instruction use cases, which can further improve the test accuracy.
  • the selecting a corresponding instruction in the test template based on the random value to obtain an instruction sequence includes: calculating a plurality of instruction index values based on the random value, and based on the calculated plurality of instructions The index value selects the corresponding instruction sequence in the test template.
  • the execution may return to determine other random values, and then continue to determine the instruction sequence based on the determined other random values, based on other random
  • the command sequence determined by the value is combined with different control parameters to generate different actual test command use cases, and the first chip continues to be tested until the bug is tested.
  • control parameters in the process of chip verification, if the control parameters cannot be traversed, it returns to the step of determining other random values, so as to enter the next new test cycle, so that the verification process can automatically cycle.
  • M M test coverages are obtained respectively; when it is determined that at least N test coverages among the M test coverages are greater than a preset value, the random value generated is determined as a determined random value.
  • the determined random value may also be stored in a random number set, which may be used to provide randomness when verifying the second chip Value.
  • a chip such as a second chip
  • the default control parameter may be a control parameter in the preset control parameter set, or may not be a control parameter in the preset control parameter set, and may be selected according to needs Default control parameters.
  • test coverage may be determined by at least one of the following ways:
  • a load instruction is used to read the memory of the first chip to obtain a test coverage, which is used as the test coverage of the first chip to run the actual test instruction use case.
  • the present application provides another chip verification method, including determining a control parameter; selecting a corresponding instruction sequence in a test template based on an unused random value, the test template including multiple instructions; according to the selection The instruction sequence and the control parameters to generate an actual test instruction use case; when the test coverage obtained when the first chip runs the actual test instruction use case is greater than a preset value, the first chip is controlled to run the actual test The instruction use case is repeated many times, and it ends if there is a bug, otherwise, the step of selecting the corresponding instruction sequence based on other unused random values is executed again.
  • a combination of command series generated based on the control parameter and different random values is used to obtain different actual test command use cases, which can be used based on the same control parameter
  • different actual test command use cases generated with different random values to verify the verification chip ie, the first chip
  • the control of the first A chip continues to run the actual command test command use case multiple times until a bug in the chip to be verified is tested. Therefore, it is possible to perform cyclic verification during chip verification without personnel involvement, thereby improving verification efficiency and verification accuracy.
  • a control parameter when a control parameter is determined, a control parameter may be randomly selected; a corresponding instruction sequence is selected in a test template using a corresponding random value, and a simulation test instruction is generated based on the instruction sequence and the control parameter Use case; when the test coverage obtained when the first chip runs the simulation test instruction use case is greater than a preset value, the selected control parameter is used as a control parameter determined above.
  • the control parameter Since the test coverage obtained after the first chip runs the instruction sequence obtained based on the corresponding random value and the instruction use case generated by the control parameter is greater than the preset value, it can be determined that the control parameter is a better control parameter, and the better The random value of is used as the control parameter for the subsequent generation of actual test instruction use cases, which can further improve the test accuracy.
  • the selecting a corresponding instruction sequence in the test template based on an unused random value includes: calculating a plurality of instruction index values based on an unused random value, and based on the calculated The multiple instruction index values select corresponding instruction sequences in the test template.
  • the determined control parameter may also be stored in a control parameter set, which may be used to provide control when verifying the second chip parameter.
  • the verification chip has a bug, it proves that the selected control parameters are more optimized. Therefore, storing the determined control parameters in the control parameter set can enable the continuous learning and accumulation of better control parameters in the control parameter set, so as to verify other chips. (For example, the second chip), priority can be given to providing better control parameters, so as to reduce the time for searching and determining control parameters when verifying the second chip, and further improve the verification efficiency.
  • test coverage may be determined by at least one of the following ways:
  • a load instruction is used to read the memory of the first chip to obtain a test coverage, which is used as the test coverage of the first chip to run the actual test instruction use case.
  • the present application further provides an apparatus having the functions related to the above-mentioned first aspect or second aspect.
  • the function can be realized by hardware, or can also be realized by hardware executing corresponding software.
  • the hardware or software includes one or more modules corresponding to the above functions.
  • the structure of the device may include a processing unit and a storage unit, and may also include a communication unit, etc. These units may perform the corresponding in the first aspect or the second aspect example.
  • the structure of the device may include a processor and a memory, the processor and the memory are coupled, and the memory stores necessary program instructions and data.
  • the memory is used to store a computer program; the processor is configured to execute the computer program stored in the memory to complete the corresponding function in the first aspect or the second aspect described above.
  • the present application also provides a computer storage medium that stores computer-executable instructions, which when used by the computer are used to cause the computer to execute the above-mentioned first
  • a computer storage medium that stores computer-executable instructions, which when used by the computer are used to cause the computer to execute the above-mentioned first
  • the present application also provides a computer program product containing instructions that, when run on a device, cause the device to perform the method mentioned in any of the possible designs in the first aspect above, or cause The device performs the method mentioned in any possible design of the second aspect above.
  • the present application further provides an apparatus, which may be a chip connected to a memory, and used to read and execute program instructions stored in the memory to implement any of the first aspect A method mentioned in a possible design, or a method mentioned in any possible design of the second aspect above.
  • FIG. 1 is a schematic diagram of an existing verification framework for verifying chips
  • FIG. 2 is a schematic diagram of a verification framework for verifying a chip provided by an embodiment of the present application
  • FIG. 3 is a specific flowchart of a method for verifying a chip provided by an embodiment of the present application
  • FIG. 4 is a schematic diagram of a process of selecting a corresponding instruction sequence according to a random value provided by an embodiment of the present application
  • FIG. 5 is a flowchart of a complete method for chip verification provided by an embodiment of the present application.
  • FIG. 6 is a specific flowchart of another method for verifying a chip provided by an embodiment of the present application.
  • FIG. 8 is a schematic structural diagram of a first device provided by an embodiment of this application.
  • FIG. 9 is a schematic structural diagram of a second device provided by an embodiment of the present application.
  • the embodiments of the present application provide a chip verification method and device, to solve the problems that the verification chip in the prior art has bugs, requires personnel participation, is cumbersome to operate, and has low verification efficiency.
  • the method and the device are based on the same inventive concept. Since the principles of the method and the device to solve the problem are similar, the implementation of the device and the method can be referred to each other, and the repetition is not repeated here.
  • the R&D personnel When developing a new chip, the R&D personnel need to verify the various functions of the chip. Only after the verification is successful can the chip be put on the market.
  • verifying the function of the chip one of the most critical issues is to verify whether there is a bug in the chip. If there is a bug, the verification personnel needs to analyze the bug, find out the cause of the bug, and continue to work on the chip after solving the cause of the bug. verification.
  • the verification of the chip can be the verification of the "memory consistency" of the chip, the interruption of the CPU, the exception, the page table and virtualization, branch prediction, instruction fetching, decoding, decomposition of micro-operations, distribution, transmission, write back, instructions Whether there are bugs in submission and rollback can also be used to verify all SOC systems including CPU.
  • Random number which is a value randomly generated by some random algorithm, can be a 64-bit hexadecimal number, based on the hexadecimal number can use a preset algorithm to calculate a set of digital sequence, the digital sequence It can be used as a sequence of instruction index values; a random algorithm refers to the use of a random function, and the return value of the random function directly or indirectly affects the execution flow or execution result of the algorithm.
  • Test template refers to a test instruction library generated in advance by testers based on experience, used to store instruction sets and instruction constraints.
  • the instruction set contains at least one instruction, which includes various kinds of pre-programmed by testers for different chips. Different instructions, different instructions can constitute an instruction sequence, and an instruction sequence can be combined with different control parameters used to test the chip to be tested to form a test instruction use case; the instruction constraints include constraints for selecting instructions, that is, calculation instructions Index value function.
  • Control parameters used to control the parameters used by different instructions in the instruction sequence during operation.
  • different test parameters can be set for the chips to be verified to achieve different The purpose of the test points are tested.
  • Test instruction use cases are generated operating programs that can directly affect the chip to be verified. Usually, when the chip to be verified runs the running program, if there is a problem, a bug is usually triggered.
  • the test instruction use case is composed of an instruction sequence and control parameters. The process of running the instruction use case of the chip to be verified is to use the instructions in the instruction use case to access the corresponding address in the chip to be verified to obtain the corresponding data in the chip. Control parameter indication.
  • Test coverage refers to the ratio of the number of tested different function values output by the chip to be verified after running the test instruction use case and the number of expected function values.
  • the instruction index value is an index value calculated by using a preset algorithm according to a random value. Based on different instruction index values, corresponding instructions can be indexed in the test template.
  • the schematic diagram of the existing verification framework includes a random instruction generator, and the random instruction generator includes a random value generator and a test template. And instruction generation module.
  • the test template includes an instruction set and instruction constraints.
  • the instruction set is pre-defined.
  • the instruction set contains multiple instructions; instruction constraints store some constraints for generating instruction index values; the instruction generation module is used for The instruction index value generated according to the instruction constraint indexes the instruction from the instruction set, and finally obtains the instruction sequence.
  • the random number generator is used to randomly generate a random value.
  • the random value here can also be called a "seed", which can be a 64-bit hexadecimal Numerical value
  • the random number generator will generate multiple instruction index values according to the "seed” and the constraint conditions in the instruction constraints, and then the instruction generation module selects corresponding multiple instructions from the instruction set according to the multiple instruction index values to form an instruction sequence ,
  • the instruction sequence and the default control parameters are combined into an instruction use case, and output to the target chip (that is, the chip to be verified), the instruction use case is run by the chip to be verified, and then with the help of eda (electronic design automation) "Assert" or "test coverage” and other functions to collect the test coverage of the target chip when running the instruction use case, and then the "coverage analysis tool” will store the collected test coverage and other information into a folder.
  • eda electronic design automation
  • Subsequent verification personnel can modify or improve the instruction set in the test template according to the test coverage and other information stored in the file; during the process of verifying the instruction use case of the target chip, if there is a bug, the verification is stopped, and the verification personnel can bug analysis.
  • assertion refers to the inspection of the non-conformance when running the instruction use case.
  • an assertion will occur, that is, an error will be reported, and the verification will stop.
  • the random number generator is randomly selected A "seed" is 123.
  • the randomly selected instruction sequence in the test template is instruction A, instruction E, instruction F, and then instruction A, instruction E, instruction F and the default control parameters are combined into a test command use case and output to the target chip.
  • the test coverage obtained by the target chip running the test command use case is collected by the eda tool. If the collected test coverage information is 70%, if the target chip needs to verify 10 functions, 3 of them have not been verified. At this time, the verification personnel can modify or improve the test template according to the 3 unverified functions.
  • the framework of FIG. 1 can be modified in the solution of this embodiment, to avoid excessive manual modification and perfection by verification personnel, so as to improve verification efficiency and verification accuracy.
  • the verification framework diagram implemented in the embodiment of the present application may be as shown in FIG. 2 and includes an adaptive instruction generator including an adaptive expert system controller, a random value generator, an instruction generation module, and a performance monitoring unit counter.
  • the adaptive expert system controller includes a test template and a control parameter template.
  • the test template includes an instruction set and instruction constraints.
  • the control parameter template includes a control parameter set. The control parameters in the control parameter set are used to control different instructions in the instruction sequence.
  • the specific parameters used during operation can be the addresses that need to be accessed on the chip to be generated according to the control parameters; the random number generator can randomly generate "seeds", and the instruction constraints and "seeds" in the instruction constraints It can generate multiple instruction index values, and the instruction generation module indexes multiple instructions in the instruction set according to the multiple instruction index values to generate the instruction sequence; the performance monitoring unit counter can automatically count whether the test coverage rate of the instruction sequence when the chip to be verified runs The preset value, if the preset value can be reached, the counter of the performance monitoring unit is triggered to increase by 1.
  • an embodiment of the present application provides a chip verification method, which is applicable to the adaptive instruction generator shown in FIG. 2.
  • a verification provided by an embodiment of the present application
  • the specific process of the chip method includes:
  • Step 300 Determine a random value.
  • the random number generator in the adaptive command generator randomly generates a random value, and based on the random value, selects the corresponding command sequence from the test template in the adaptive command generator, in After generating a simulation test instruction use case according to the instruction sequence and the default control parameters, let the chip to be verified run the simulation test instruction use case, and after the chip to be verified runs the simulation test instruction use case, determine that the chip to be verified runs the simulation test Whether the test coverage obtained when instructing the use case is greater than a preset value, and if it is greater than the preset value, the random value is used as the random value determined in step 300.
  • the default control parameter may be a control parameter in a preset control parameter set.
  • the adaptive expert system controller can read the default control parameters in the chip to be verified according to the storage address of the default control parameters.
  • Obtaining the test coverage of the chip to be verified after running the simulation test instruction use case can be obtained in at least one of the following three ways:
  • Method 1 Use the MRS (move to general) purpose register from the system register in the adaptive expert system controller to read the PMU (performance monitors unit) register to obtain test coverage ;
  • Method 2 Use the MRS instruction in the adaptive expert system controller to read special registers to obtain test coverage
  • Method 3 Use the load instruction in the adaptive expert system controller to read the memory of the chip to be verified to obtain the test coverage.
  • the MRS instruction when the MRS instruction is used to read the PMU register to obtain the test coverage, the test coverage information obtained by running the simulation test instruction use case of the chip to be verified will be stored in the PMU register; the MRS instruction is used to read the special register When the test coverage is obtained by way, the test coverage information obtained by the chip to be verified running the simulation test instruction use case will be stored in the special register.
  • each special register has a clear function
  • the MRS read has the function of storing the test coverage You can obtain the test coverage by using the special register of the test; when you use the load instruction to read the memory of the chip to be verified to obtain the test coverage, the test coverage information obtained by the chip to be verified running the simulation test instruction use case will be stored in the In the memory of the chip to be verified, when this method is used to obtain test coverage, there is no need to add new PMU registers and special registers, which can save resources.
  • a corresponding instruction sequence is selected from the test template based on a random value, and multiple instruction index values may be calculated based on the random value first, and then based on the calculated multiple instruction index values in the adaptive In the test template of the command generator, select the corresponding command sequence.
  • FIG. 4 it is a schematic diagram of a process of selecting a corresponding instruction sequence according to a random value provided by an embodiment of the present application.
  • X is a selected random value
  • the instruction sequence (Z1, Z2, Z3...Zn) can be indexed in the test template according to the instruction index value sequence (Y1, Y2, Y3...Yn).
  • the adaptive command generator may control the chip to be verified to continue to run The simulation test instruction use case M times. After determining that there are N test coverages greater than a preset value in the obtained M test coverages, the generated random value is finally used as the random value determined in step 300 above. M is greater than or equal to N. In this way, it can ensure that the selected random value is more excellent, which can be defined as a good random value or a good "seed".
  • the chip to be verified can be controlled to continue to run the simulation test Instruct the use case 5 times, and the 5 test coverages obtained are 85%, 88%, 90%, 91%, 79%. Since 4 of the 5 test coverages obtained are greater than the preset value of 80%, you can The random value of the instruction sequence that generates the simulation test instruction use case is regarded as a good random value, that is, a good "seed". The good "seed" can then be used as the real "seed” used in generating actual test instruction use cases.
  • Step 301 The adaptive expert system controller selects a corresponding instruction sequence in a test template based on the random value, and the test template includes multiple instructions.
  • the corresponding instruction sequence is selected in the test template based on the random value.
  • the process of selecting the corresponding instruction sequence in the test template based on the random value and selecting a random value from the test template based on the random value The process of the corresponding instruction sequence is the same, and will not be repeated here.
  • Step 302 The adaptive expert system controller repeats the following steps based on the selected instruction sequence:
  • Different control parameters in the preset control parameter set here can be preset according to different functions of the chip to be verified, for example, for the chip A to be verified, some control parameters of the chip A to be verified can be preset, when verifying the chip A to be verified, Store some control parameters preset for the chip A to be verified in the preset control parameter set; some control parameters of the chip B to be verified will be preset for the chip B to be verified.
  • the preset control parameters The set stores some control parameters preset for the chip B to be verified.
  • control parameter is in the preset control parameter set A control parameter that has not been used before the actual test instruction use case is generated this time. This is to prevent the chip to be verified from repeatedly running some of the same instruction use cases and avoid wasting time.
  • the chip to be verified After generating an actual test instruction use case, let the chip to be verified run the actual test instruction use case to obtain the test coverage obtained after the chip to be verified runs the actual test instruction use case.
  • the test coverage obtained by the chip to be verified running the instruction use case is obtained
  • the rate is the same as the above method for obtaining the test coverage after the use case of the simulation test instruction to be verified by the chip to be verified, which will not be repeated here.
  • the random value of the instruction sequence that generates the actual test instruction use case may be stored in a random number set, and the random number set
  • the random number in can be used to provide excellent random numbers when verifying other target chips, which can save time for verifying other target chips.
  • control parameters that are not traversed may return to the step of determining other random values, and then repeat steps 301 and 302, Until the chip to be verified has a bug.
  • the method for verifying the chip first determines a random value, then selects the corresponding command sequence based on the random value, then traverses the control parameters, and generates an actual test command use case according to the command series and the traversed control parameters, when to be verified
  • the chip to be verified is controlled to run the actual test command use case multiple times. If a bug occurs, the verification is stopped, and if there is no bug, the control parameters are continued to be traversed.
  • the preset conditions cyclically verify the chip to be verified, so that no personnel is required to participate, the operation is simple, and the verification efficiency can be improved.
  • an embodiment of the present application also provides a flowchart of a complete method for chip verification.
  • the flowchart of this example may specifically include:
  • Step 500 The random number generator randomly selects a random number X, based on the random number X, uses a preset algorithm to calculate a set of digital sequences, which can be used as an instruction index value sequence, and then uses the instruction index value sequence from the test The corresponding instructions are selected in sequence from the template to form an instruction sequence;
  • the adaptive expert system controller combines the obtained command sequence (Z1, Z2, Z3...Zn) with the default control parameters to generate a simulation test command use case. Specifically, it can be read from the storage address according to the default control parameters The default control parameters, and then use the default control parameters and the instruction sequence obtained above (Z1, Z2, Z3...Zn) to generate the simulation test instruction use case, and then let the target chip run the simulation test instruction use case;
  • Step 502 the performance monitoring unit counter obtains the test coverage rate output by the target chip after running the simulation test instruction use case
  • step 503 the counter of the performance monitoring unit determines whether the test coverage output by the target chip after running the simulated test instruction use case is greater than a preset value. If so, step 504 is executed; otherwise, in step 500, the adaptive expert system controller triggers a random command
  • the generator randomly selects other values of X and continues to perform steps 500 to 502; it should be noted here that the random number X returned to step 500 is the X that has not been selected before, such as the first step based on the selected X1. After 500 to step 502, if step 500 is returned to again, X2 is selected, and steps 500 to 502 are executed again based on X2.
  • a simulation test instruction use case is a good simulation test instruction use case for target chip verification.
  • One of the criteria for the determination is whether the test coverage obtained when the target chip runs the simulation test instruction use case reaches a preset value, if it can be achieved
  • the preset value indicates that the simulation test instruction use case is a good simulation test instruction use case.
  • the target chip runs a simulation test instruction use case to obtain a test coverage of 10%, which means that it is necessary to verify the target chip
  • the function of verification The simulation test command use case is only verified to 10%. If a random value in the simulation test command use case with a test coverage rate of 10% is used to generate the instruction sequence, the actual test generated by the instruction sequence and the traversed control parameters is used to generate the instruction sequence.
  • the instruction use case verifies whether the chip has bugs, and the verification efficiency is low, so it is necessary to first determine that the simulation test instruction use case is a better simulation test instruction use case.
  • Step 504 the adaptive expert system controller continues to control the target chip to run the simulation test instruction use case M times, and the performance monitoring unit counter obtains M test coverage results respectively output by the M runs;
  • Step 505 if there are N test coverage results among the M test coverage results that are all greater than the preset value, then step 506 is executed; otherwise, return to step 500, the adaptive expert system controller triggers the random command generator to randomly select other X
  • the random number X returned to step 500 is the X that has not been selected before. For example, after performing step 500 to step 502 based on the selected X1 for the first time, If you return to step 500 again, X2 will be selected, and steps 500 to 502 will be executed again based on X2.
  • M may be 5, and N may be 3.
  • the adaptive expert system controller determines whether the simulated test instruction use case is a good simulated test instruction use case according to the state of the performance monitoring unit counter. If the performance monitoring unit counter is increased by 1, then It can be determined that the simulation test instruction use case is a good simulation test instruction use case. Since the target chip only runs the simulation test instruction use case once, in order to further determine that the simulation test instruction use case is indeed a better simulation test instruction use case, so Continue to control the target chip to run the simulation test instruction use case M times. If there are N results out of the M test coverage results obtained that are greater than a preset value, the simulation test instruction use case is determined to be a better instruction use case.
  • Step 506 the adaptive expert system controller triggers the random command generator to re-execute the operation in step 500 according to the random number X, index the command sequence (Z1, Z2, Z3...Zn) in the test template, and judge the control parameters Whether a control parameter that has not been traversed can be traversed in the collection, which can specifically be judged whether a storage address that has not been traversed can be traversed in the address set of the storage address corresponding to each control parameter, and if so, step 507 is executed, Otherwise, returning to step 500, the adaptive expert system controller triggers the random command generator to randomly select other values of X, and then continues to perform steps 500 to 502; it should be noted here that returning to the random number X selected in step 500 is not previously done.
  • the selected X for example, after performing steps 500 to 502 based on the selected X1 for the first time, if step 500 is returned to again, X2 is selected, and steps 500 to 502 are executed again based on X2.
  • Step 507 the adaptive expert system controller generates an actual test instruction use case based on the instruction sequence (Z1, Z2, Z3...Zn) and the traversed control parameters;
  • Step 508 after the adaptive expert system controller controls the target chip to run the actual test instruction use case, the performance monitoring unit counter obtains the test coverage rate output by the target chip to run the actual test instruction use case;
  • step 509 the counter of the performance monitoring unit determines whether the test coverage rate output by the target chip after running the actual test instruction use case is greater than a preset value. If yes, step 510 is executed; otherwise, step 506 is returned to;
  • Step 510 the adaptive expert system controller continues to control the target chip to run the actual test instruction use case K times;
  • step 511 the adaptive expert system controller determines whether a bug occurs in the actual test instruction use case when the target chip runs K times, and if yes, the test ends; otherwise, returns to step 506.
  • the selected random value X may be stored, or may be corresponding to the selected random value X
  • the storage address of the storage so that in the subsequent testing of other chips, these good random values can be preferentially stored, or the good random values can be obtained according to the storage address of the stored priority random values, thereby reducing the cost of finding good random values Time to improve the efficiency of finding good random values.
  • an embodiment of the present application also provides a chip verification method, which is applicable to the adaptive instruction generator shown in FIG. 2.
  • a chip verification method which is applicable to the adaptive instruction generator shown in FIG. 2.
  • FIG. 6 another method provided by the embodiment of the present application
  • the specific process of a method for verifying a chip includes:
  • Step 600 Determine a control parameter.
  • the adaptive expert system controller first randomly selects a control parameter, uses the corresponding random value to select the corresponding instruction sequence in the test template, and generates a simulation test based on the instruction sequence and the control parameter Instruction use case; when the test coverage obtained when the chip to be verified obtained by the performance monitoring unit counter runs the simulation test instruction use case is greater than a preset value, the selected control parameter is used as the control parameter determined in step 600.
  • a randomly selected control parameter may be selected from a preset control parameter set.
  • the control parameters in the preset control parameter set may be different.
  • a plurality of instruction index values may be calculated based on an unused random value, and then based on the calculated plurality of instruction indexes The value selects the corresponding command sequence in the test template of the adaptive command generator.
  • the corresponding random value here may be a randomly generated random value that has not been used before.
  • test coverage rate of the chip to be verified after running the simulation test instruction use case is the same as the method of obtaining the test coverage rate of the chip to be verified after running the analog test instruction use case in the method of FIG. 3, and details are not repeated here.
  • the adaptive command generator may control the chip to be verified to run the Simulate test command use cases M times, after determining that there are N test coverages greater than a preset value in the obtained M test coverages, then finally use the control parameters in the simulation test command use cases as the control parameters determined in step 600 above,
  • M is greater than or equal to N. In this way, the selected control parameter can be guaranteed to be more excellent, and can be defined as an excellent control parameter.
  • Step 601 Select a corresponding instruction sequence in a test template based on an unused random value.
  • the test template includes multiple instructions.
  • a plurality of instruction index values are calculated based on an unused random value, and a corresponding instruction sequence is selected in the test template based on the calculated plurality of instruction index values.
  • Step 602 Generate an actual test instruction use case according to the selected instruction sequence and the control parameter.
  • test coverage is obtained in the same way as in FIG.
  • the coverage method is the same, and will not be repeated here.
  • Step 603 The performance monitoring unit counter obtains the test coverage obtained when the target chip runs the actual test instruction use case when it is greater than a preset value, and the adaptive expert system controller controls the target chip to run the actual test instruction use case multiple times, if If there is a bug, it is over, otherwise the step of selecting the corresponding instruction sequence based on other unused random values is executed again.
  • control parameter that generates the actual test instruction use case may be marked in the preset control parameter set, and the preset control parameter set
  • the control parameters marked in can be used to provide excellent control parameters when verifying other target chips, which can save time for verifying other target chips.
  • Another method for verifying the chip first determines a control parameter, then generates an actual test command use case based on an unused random value and the control parameter, and obtains test coverage obtained by running the actual test command use case for the chip to be verified After the rate is greater than the preset value, control the chip to be verified to run the actual test instruction use case multiple times. If there is a bug, stop the verification. If there is no bug, continue to use other unused random values to select the corresponding instruction sequence. Some preset conditions cyclically verify the chip to be verified, so that no personnel is needed, the operation is simple, and the verification efficiency can be improved.
  • the embodiment of the present application further provides a flowchart of another complete method of chip verification.
  • the flowchart of this example may specifically include:
  • Step 700 The adaptive expert system controller randomly selects a control parameter P from the preset control parameter set; specifically, it may randomly select a storage address from the address set of the storage address corresponding to each control parameter, and store the selected storage address according to the selected storage The address obtains the control parameter P;
  • Step 701 The random number generator randomly selects a random number X, and based on the random number X, a set of number sequences is calculated using a preset algorithm, and the set of number sequences can be used as an instruction index value sequence, and then the instruction generation module uses the instruction index value The sequence selects the corresponding instructions in sequence from the test template to form an instruction sequence;
  • Step 702 The adaptive expert system controller combines the obtained instruction sequence (Z1, Z2, Z3...Zn) with the control parameter P to generate a simulation test instruction use case, and then controls the target chip to run the simulation test instruction use case;
  • Step 703 The performance monitoring unit counter obtains the test coverage rate output by the target chip after running the simulation test instruction use case
  • Step 704 The performance monitoring unit counter determines whether the test coverage output by the target chip after running the simulation test instruction use case is greater than a preset value. If so, step 705 is performed; otherwise, steps 710-711-702 are performed, using the generated in step 700 Random value X and randomly selected other control parameters P generate simulation test command use cases; it should be noted here that the random control parameter P selected in step 711 is P that has not been selected before, such as selecting P1 in step 701, If step 710 is executed, P2 will be selected.
  • Step 705 The adaptive expert system controller continues to let the target chip run the simulation test instruction use case M times, and the performance monitoring unit counter obtains M test coverage results respectively output by the M runs.
  • Step 706 If there are N test coverage results among the M test coverage results that are all greater than a preset value, determine that the previously randomly selected control parameter P is a good control parameter, and if the control parameter P is fixed, step 707 is performed; otherwise Perform steps 710 to 711 to 702, use the random value X generated in step 700 and randomly selected other control parameters P to generate a simulation test command use case; here it needs to be noted that the random control parameter P selected in step 711 is not previously available The selected P, for example, P1 is selected in step 701, and if step 710 is executed, P2 is selected.
  • M may be 5, and N may be 3.
  • Step 707 the random number generator re-executes the operation in step 700, that is, re-randomly selects other numbers X that have not been previously selected.
  • the random number X selected in step 700 is not selected before.
  • X such as X1 selected in step 700 for the first time, if step 700 is executed again, X2 will be selected, and a new instruction sequence (Z1, Z2, Z3....Zn)' will be re-indexed in the test template based on X2, and Combine the re-indexed new instruction sequence with the determined good control parameters P to generate actual test instruction use cases, control the target chip to run the actual test instruction use cases to obtain test coverage, and determine whether the test coverage is greater than the pre-test Set value, if yes, go to step 708; otherwise return to step 701, randomly select other random value X and continue to perform steps 702 to 706; it needs to be explained here that returning to the other random value X selected in step 701 is not before
  • the selected X for example, selects X
  • Step 708 The adaptive expert system controller continues to control the target chip to run the actual test instruction use case K times;
  • Step 709 The adaptive expert system controller determines whether there is a bug in the actual test instruction use case when the target chip runs K times, and if so, the test ends; otherwise, returns to step 700;
  • Step 710 The instruction generation module uses the random number X in step 701 to generate an instruction use case
  • Step 711 The adaptive expert system controller randomly generates unused control parameters P.
  • the control parameter P may be marked in the preset control parameter set, or the parameter set The storage address corresponding to the control parameter P in the corresponding address set is marked, so that in subsequent verification of other chips, the control parameter with the mark in the preset control parameter set may be preferentially selected, or the preset The storage address with a mark in the address set corresponding to the parameter set obtains the excellent control parameters according to the selected storage address, thereby reducing the time spent in searching for the excellent control parameters and improving the efficiency of finding the excellent control parameters.
  • the embodiments of the present application provide two methods for verifying the chip. Both methods need to set some preset conditions to cyclically verify the chip, thereby eliminating the need for personnel to participate and improving the verification efficiency.
  • the embodiments of the present application further provide an apparatus for implementing the method for verifying a chip as shown in FIG. 3 or FIG. 5.
  • the device 800 includes: a processing unit 801 and a storage unit 802, wherein the storage unit 802 is used to store program code; and the processing unit 801, when the program code is executed by the processing unit 801
  • the processing unit 801 can perform the steps 300 to 302 shown in FIG. 3, or the steps 500 to 511 shown in FIG. 5, or the processing unit 801 can perform the steps shown in FIG. 600 to step 603, or perform steps 700 to 711 shown in FIG.
  • a random value is determined, and then the corresponding instruction sequence is selected based on the random value, and the following steps are repeatedly performed based on the instruction sequence: first, traverse a control parameter that has not been traversed, and then according to the selected instruction
  • the control parameters obtained through the sequence and traversal generate an actual test command use case; when the test coverage obtained when the chip is run from the actual test command use case is greater than a preset value, the chip is run the actual test command use case multiple times, if a defect occurs The bug ends, otherwise, the step of traversing a control parameter that has not been traversed in the preset control parameter set is performed again. In this way, when verifying the chip, verification can be performed cyclically according to preset conditions, without the need for human involvement, and the operation is simple, thereby improving verification efficiency.
  • the device uses the device provided in the embodiment of the present application, determine a control parameter, and then select corresponding instruction sequences based on different random values, and repeat the following steps based on each selected instruction sequence: generate an actual test instruction with the determined control parameters Use case; when the test coverage obtained when the chip runs the actual test instruction use case is greater than the preset value, make the chip run the actual test instruction use case multiple times, if there is a defect bug, it will end, otherwise use another random value to determine The combination of the instruction sequence and the control parameters generates the actual test instruction use case steps. In this way, when verifying the chip, verification can be performed cyclically according to preset conditions, without the need for human involvement, and the operation is simple, thereby improving verification efficiency.
  • the division of the units in the embodiments of the present application is schematic, and is only a division of logical functions. In actual implementation, there may be another division manner.
  • the functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units may be integrated into one unit.
  • the above integrated unit may be implemented in the form of hardware or software functional unit.
  • the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it may be stored in a computer-readable storage medium.
  • the technical solution of the present application essentially or part of the contribution to the existing technology or all or part of the technical solution can be embodied in the form of a software product, the computer software product is stored in a storage medium , Including several instructions to enable a computer device (which may be a personal computer, server, or network device, etc.) or processor to execute all or part of the steps of the methods described in the embodiments of the present application.
  • the aforementioned storage media include: U disk, mobile hard disk, read-only memory (ROM), random access memory (random access memory, RAM), magnetic disk or optical disk and other media that can store program codes .
  • the apparatus 900 includes: a processor 901, and optionally, a memory 902.
  • the processor 901 may be a central processor (central processing unit, CPU), network processor (network processor, NP) or a combination of CPU and NP.
  • the processor 901 may further include a hardware chip.
  • the hardware chip may be an application-specific integrated circuit (ASIC), a programmable logic device (PLD) or a combination thereof.
  • the PLD may be a complex programmable logic device (complex programmable logic device (CPLD), a field programmable logic gate array (field-programmable gate array, FPGA), a general array logic (generic array logic, GAL), or any combination thereof.
  • the processor 901 and the memory 902 are connected to each other.
  • the processor 901 and the memory 902 are connected to each other through a bus 903;
  • the bus 903 may be a peripheral component interconnection standard (Peripheral Component Interconnect, PCI) bus or an extended industry standard architecture (Extended Industry Standard Architecture) , EISA) bus and so on.
  • PCI peripheral component interconnection standard
  • EISA Extended Industry Standard Architecture
  • the bus can be divided into an address bus, a data bus, and a control bus. For ease of representation, only a thick line is used in FIG. 9, but it does not mean that there is only one bus or one type of bus.
  • the device shown in FIG. 9 may be the adaptive command generator in FIG. 2 or a control component or control unit in the adaptive command generator in FIG. 2.
  • the processing unit 801 in FIG. 8 described above may be implemented based on the processor 901 herein, and the storage unit 802 may be implemented based on the memory 902 herein.
  • the processor 901 and the memory 902 please refer to the detailed description of the foregoing method embodiments, and details are not repeated here.
  • the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware. Moreover, the present application may take the form of a computer program product implemented on one or more computer usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer usable program code.
  • computer usable storage media including but not limited to disk storage, CD-ROM, optical storage, etc.
  • These computer program instructions may also be stored in a computer-readable memory that can guide a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture including an instruction device, the instructions
  • the device implements the functions specified in one block or multiple blocks of the flowchart one flow or multiple flows and/or block diagrams.
  • These computer program instructions can also be loaded onto a computer or other programmable data processing device, so that a series of operating steps are performed on the computer or other programmable device to produce computer-implemented processing, which is executed on the computer or other programmable device
  • the instructions provide steps for implementing the functions specified in one block or multiple blocks of the flowchart one flow or multiple flows and/or block diagrams.

Abstract

The present application provides a chip verification method and device, for use in solving the problems in the prior art that personnel need to participate when verifying whether a bug exists in a chip, operation is complex, and verification efficiency is low. The method comprises: method I, selecting a corresponding instruction sequence on the basis of a determined random numerical value, and then repeatedly executing steps that satisfy a condition; method II, after determining a control parameter, and after generating an actual instruction example according to the instruction sequence selected on the basis of an unused random numerical value and the determined control parameter, repeatedly executing the steps that satisfy the condition. Therefore, in a chip verification process, it is not necessary for personnel to participate, the operation is simple, and the verification efficiency can be improved.

Description

一种芯片验证方法和装置Chip verification method and device 技术领域Technical field
本申请涉及电子技术领域,特别涉及一种芯片验证方法和装置。This application relates to the field of electronic technology, in particular to a chip verification method and device.
背景技术Background technique
随着大规模集成电路和多线程多核处理器的发展,验证芯片是否存在问题的需求越来越大,比如验证片上系统(system on chip,SOC)上的中央处理器(central processing unit,CPU)的缓存和SOC中其他器件的缓存(cache)一致性就是验证芯片是否存在问题的一个方面。With the development of large-scale integrated circuits and multi-threaded multi-core processors, there is an increasing demand for verifying whether the chip has problems, such as verifying the central processing unit (CPU) on the system on chip (SOC) The consistency of the cache of other devices and the cache of other devices in the SOC is one aspect to verify whether there is a problem with the chip.
现有技术中,一般采用“基于约束的随机测试模板”方式验证芯片是否存在问题,该方式首先通过定义一个测试模板,测试模板中包括指令集合和指令约束,然后在指令集合中根据指令约束随机产生指令组合构成指令序列,基于指令序列和默认的控制参数来生成指令用例,控制参数是用于控制指令序列中不同指令在运行时所使用的参数。从而由待验证芯片运行指令用例后输出待验证芯片的功能点被测试到的不同功能值,根据输出的功能值的数量与预期需要得到的功能值的数量的比值得到测试覆盖率,验证人员分析测试覆盖率,如果测试覆盖率未达到预期,则根据分析结果对测试模板中的指令集合进行修改,比如增加指令集合中用于测试没有输出的功能值对应的功能的指令,进而提高测试覆盖率,通过待验证芯片一次一次的运行指令用例,直到测试覆盖率达到预期、且运行指令用例的过程中没有出现缺陷(bug),则证明待验证芯片没问题;如果运行指令用例的过程中测试覆盖率达到预期且出现bug,则验证停止,技术人员根据出现的bug修复待验证芯片的缺陷。In the prior art, a "constraint-based random test template" method is generally used to verify whether there is a problem with the chip. This method first defines a test template. The test template includes an instruction set and instruction constraints, and then randomizes the instruction set according to the instruction constraints. The generated instruction combination forms an instruction sequence, and an instruction use case is generated based on the instruction sequence and the default control parameters. The control parameters are parameters used to control different instructions in the instruction sequence when they are run. Therefore, the different function values of the function points of the chip to be verified are output after the instruction case of the chip to be verified is run, and the test coverage is obtained according to the ratio of the number of output function values and the number of function values expected to be obtained, and the verification personnel analyzes Test coverage. If the test coverage is not as expected, modify the instruction set in the test template according to the analysis results. For example, increase the instruction set in the instruction set to test the function corresponding to the function value that is not output, thereby improving the test coverage. ,Through the operation instruction use case of the chip to be verified once, until the test coverage reaches the expected, and there are no defects in the process of running the instruction use case, it proves that the chip to be verified is no problem; If the test coverage is in the process of running the instruction use case When the rate reaches the expected level and a bug occurs, the verification stops, and the technician repairs the defect of the chip to be verified according to the bug.
采用“基于约束的随机测试模板”验证方法验证芯片是否存在问题时,由于需要验证人员参与,操作较繁琐,验证效率较低。When the "constraint-based random test template" verification method is used to verify whether there is a problem with the chip, due to the need for verification personnel to participate, the operation is cumbersome and the verification efficiency is low.
发明内容Summary of the invention
本申请实施例提供了一种芯片验证方法和装置,用于解决现有技术中验证芯片是否存在问题时,需要验证人员参与,操作较繁琐,验证效率较低的问题。The embodiments of the present application provide a chip verification method and device, which are used to solve the problems of verifying whether there is a problem with the chip in the prior art, requiring verification personnel to participate, more cumbersome operations, and lower verification efficiency.
第一方面,本申请提供了一种芯片验证方法,包括确定一个随机数值;基于该随机数值在测试模板中选择对应的指令序列,所述测试模板包括多个指令;基于所述指令序列重复执行以下步骤:In the first aspect, the present application provides a chip verification method, which includes determining a random value; selecting a corresponding instruction sequence in a test template based on the random value, the test template including multiple instructions; repeating execution based on the instruction sequence The following steps:
遍历预设的控制参数集合中一个未被遍历过的控制参数,根据选择的所述指令序列和遍历得到的控制参数生成一个实际测试指令用例;Traverse a control parameter in the preset control parameter set that has not been traversed, and generate an actual test command use case according to the selected instruction sequence and the control parameter obtained by traversing;
当获取第一芯片运行该实际测试指令用例时得到的测试覆盖率大于预设值时,控制所述第一芯片运行所述实际测试指令用例多次,若出现缺陷bug则结束,否则再次执行遍历所述预设的控制参数集合中一个未被遍历过的控制参数的步骤。When the test coverage obtained when the first chip runs the actual test instruction use case is greater than a preset value, the first chip is controlled to run the actual test instruction use case multiple times, and if there is a defect bug, it ends, otherwise the traversal is performed again A step of a control parameter in the preset control parameter set that has not been traversed.
在上述方法中,用于验证芯片的验证装置或部件确定了一个随机数值后,基于该随机数值生成指令系列,并将该指令序列与遍历到的不同控制参数分别组成不同实际测试指令用例,进而可以使用基于不同控制参数和同一指令序列生成的不同实际测试指令用例对待 验证芯片(即第一芯片)进行验证,且当第一芯片运行一个实际测试指令用例得到的测试覆盖率大于预设值时,可以进而控制该第一芯片继续运行该实际指令测试指令用例多次,直到测试出待验证芯片出现bug为止。因此可以提高对芯片的验证效率,且全程无需人员参与,验证效率和准确性都可以得到提升。In the above method, after the verification device or component used to verify the chip determines a random value, an instruction series is generated based on the random value, and the instruction sequence and the traversed different control parameters are respectively formed into different actual test instruction use cases, and then Different actual test command use cases generated based on different control parameters and the same instruction sequence can be used to verify the verification chip (ie, the first chip), and when the first chip runs an actual test command use case to obtain a test coverage greater than a preset value Then, the first chip can be further controlled to continue to run the actual instruction test instruction use case multiple times until a bug is detected in the chip to be verified. Therefore, the verification efficiency of the chip can be improved, and no personnel is required in the whole process, and the verification efficiency and accuracy can be improved.
在一种可能的设计中,确定一个随机数值时,可以先随机生成一个随机数值;基于该随机数值在所述测试模板中选择对应的指令序列,根据选择的所述指令序列与默认控制参数生成模拟测试指令用例;当获取所述第一芯片运行该模拟测试指令用例时得到的测试覆盖率大于预设值时,则将生成的该随机数值作为上述确定的一个随机数值。In a possible design, when a random value is determined, a random value may be randomly generated first; based on the random value, a corresponding instruction sequence is selected in the test template, and generated according to the selected instruction sequence and default control parameters A simulation test instruction use case; when the test coverage obtained when the first chip runs the simulation test instruction use case is greater than a preset value, the generated random value is used as a random value determined above.
由于第一芯片运行基于该随机数值得到的指令序列和默认控制参数组成的指令用例后得到的测试覆盖率大于预设值,所以可以确定该随机数值为一个较好的随机数值,将该较好的随机数值作为后续生成实际测试指令用例使用的随机数,可以进一步地提高测试准确性。Since the test coverage obtained after the first chip runs the instruction sequence composed of the instruction sequence obtained based on the random value and the default control parameters is greater than the preset value, it can be determined that the random value is a better random value, and the better The random number is used as the random number used in the subsequent generation of actual test instruction use cases, which can further improve the test accuracy.
在一种可能的设计中,所述基于该随机数值在测试模板中选择对应的指令得到指令序列,包括:基于所述随机数值计算多个指令索引值,并基于计算得到的所述多个指令索引值在所述测试模板中选择对应的指令序列。In a possible design, the selecting a corresponding instruction in the test template based on the random value to obtain an instruction sequence includes: calculating a plurality of instruction index values based on the random value, and based on the calculated plurality of instructions The index value selects the corresponding instruction sequence in the test template.
在上述方法中,给出了如何基于随机数值得到指令序列,由于基于随机数值计算得到的指令索引值选择对应的指令序列,从而使选择指令的方法更为简单,易操作。In the above method, how to obtain the instruction sequence based on the random value is given. Since the instruction index value calculated based on the random value is used to select the corresponding instruction sequence, the method for selecting the instruction is simpler and easier to operate.
在一种可能的设计中,若在所述控制参数集合中遍历不到未被遍历的控制参数,则可以返回执行确定其他随机数值,然后基于确定的其他随机数值继续确定指令序列,基于其他随机数值确定的指令序列再与不同控制参数组合生成不同实际测试指令用例,对第一芯片继续测试,直至测试到Bug为止。In a possible design, if the control parameters that are not traversed are not traversed in the control parameter set, the execution may return to determine other random values, and then continue to determine the instruction sequence based on the determined other random values, based on other random The command sequence determined by the value is combined with different control parameters to generate different actual test command use cases, and the first chip continues to be tested until the bug is tested.
在上述方法中,在芯片验证的过程中,如果遍历不到控制参数了,则返回执行确定其他随机数值的步骤,从而进入到下一个新的测试循环,使验证过程能够自动循环运行。In the above method, in the process of chip verification, if the control parameters cannot be traversed, it returns to the step of determining other random values, so as to enter the next new test cycle, so that the verification process can automatically cycle.
在一种可能的设计中,还可以在获取所述第一芯片运行该模拟测试指令用例时得到的测试覆盖率大于预设值后,继续控制所述第一芯片运行所述模拟测试指令用例M次,分别得到M个测试覆盖率;当确定所述M个测试覆盖率中存在至少N个测试覆盖率大于预设值时,再确定将生成的该随机数值作为确定的一个随机数值,其中所述M和N均为正整数,且M>=N。In a possible design, after obtaining the test coverage obtained when the first chip runs the simulation test instruction use case is greater than a preset value, continue to control the first chip to run the simulation test instruction use case M M test coverages are obtained respectively; when it is determined that at least N test coverages among the M test coverages are greater than a preset value, the random value generated is determined as a determined random value. Both M and N are positive integers, and M>=N.
这样能够保证确定出的随机数值更为优化,为后续生成测试效果更好的实际测试指令用例提供好的基础。This can ensure that the determined random value is more optimized, and provide a good basis for subsequent generation of actual test instruction use cases with better test results.
在一种可能的设计中,若测试过程中第一芯片出现bug,还可以将确定的所述随机数值存储至随机数集合中,所述随机数集合可以用于在验证第二芯片时提供随机数值。In a possible design, if a bug occurs on the first chip during the test, the determined random value may also be stored in a random number set, which may be used to provide randomness when verifying the second chip Value.
这样由于验证芯片出现bug,则证明选取的随机数值比较优化,因此将选取的随机数值存储到随机数集合中,可以使得在随机数集合中不断学习积累较为优良的随机数值,从而再为验证其他芯片(比如第二芯片)时可以优先提供优良的随机数值,以减少验证第二芯片时查找确定随机数值的时间,进一步提高验证效率。In this way, due to a bug in the verification chip, it proves that the selected random value is more optimized. Therefore, storing the selected random value in the random number set can continuously learn and accumulate better random values in the random number set, so as to verify other A chip (such as a second chip) may preferentially provide an excellent random value, so as to reduce the time for searching and determining a random value when verifying the second chip, and further improve the verification efficiency.
在一种可能的设计中,所述默认控制参数可以为所述预设的控制参数集合中的一个控制参数,当然也可以不是预设的控制参数集合中的一个控制参数,可以根据需要来选择默认控制参数。In a possible design, the default control parameter may be a control parameter in the preset control parameter set, or may not be a control parameter in the preset control parameter set, and may be selected according to needs Default control parameters.
在一种可能的设计中,所述测试覆盖率可以但不限于通过下列方式中的至少一种确定:In a possible design, the test coverage may be determined by at least one of the following ways:
使用读系统状态寄存器到通用寄存器MRS指令读取性能监控单元PMU寄存器得到测试覆盖率,作为所述第一芯片运行该实际测试指令用例的测试覆盖率;或Use the read system status register to general register MRS instruction to read the performance monitoring unit PMU register to obtain the test coverage, as the test coverage of the first chip to run the actual test instruction use case; or
使用MRS指令读取特殊寄存器得到测试覆盖率,作为所述第一芯片运行该实际测试指令用例的测试覆盖率;或Use the MRS instruction to read the special register to obtain the test coverage, as the test coverage of the first chip running the actual test instruction use case; or
使用装入指令读取所述第一芯片的内存得到测试覆盖率,作为所述第一芯片运行该实际测试指令用例的测试覆盖率。A load instruction is used to read the memory of the first chip to obtain a test coverage, which is used as the test coverage of the first chip to run the actual test instruction use case.
第二方面,本申请提供了另一种芯片验证方法,包括确定一个控制参数;基于一个未使用过的随机数值在测试模板中选择对应的指令序列,所述测试模板包括多个指令;根据选择的所述指令序列和所述控制参数生成一个实际测试指令用例;获取第一芯片运行该实际测试指令用例时得到的测试覆盖率大于预设值时,控制所述第一芯片运行所述实际测试指令用例多次,若出现缺陷bug则结束,否则再次执行基于其他未使用过的随机数值选择对应的指令序列的步骤。In the second aspect, the present application provides another chip verification method, including determining a control parameter; selecting a corresponding instruction sequence in a test template based on an unused random value, the test template including multiple instructions; according to the selection The instruction sequence and the control parameters to generate an actual test instruction use case; when the test coverage obtained when the first chip runs the actual test instruction use case is greater than a preset value, the first chip is controlled to run the actual test The instruction use case is repeated many times, and it ends if there is a bug, otherwise, the step of selecting the corresponding instruction sequence based on other unused random values is executed again.
在上述方法中,用于验证芯片的验证装置或部件确定了一个控制参数后,基于该控制参数与不同的随机数值生成的指令系列组合分别得到不同实际测试指令用例,进而可以使用基于同一控制参数和不同随机数值生成的不同实际测试指令用例对待验证芯片(即第一芯片)进行验证,且当第一芯片运行一个实际测试指令用例得到的测试覆盖率大于预设值时,可以继续控制该第一芯片继续运行该实际指令测试指令用例多次,直到测试出待验证芯片出现bug为止。因此可以在芯片验证时,进行循环验证,无需人员参与,从而可以提高验证效率和验证准确性。In the above method, after a verification device or component for verifying a chip determines a control parameter, a combination of command series generated based on the control parameter and different random values is used to obtain different actual test command use cases, which can be used based on the same control parameter And different actual test command use cases generated with different random values to verify the verification chip (ie, the first chip), and when the test coverage obtained by running an actual test command use case on the first chip is greater than the preset value, the control of the first A chip continues to run the actual command test command use case multiple times until a bug in the chip to be verified is tested. Therefore, it is possible to perform cyclic verification during chip verification without personnel involvement, thereby improving verification efficiency and verification accuracy.
在一种可能的设计中,确定一个控制参数时,可以先随机选择一个控制参数;使用相应随机数值在测试模板中选择对应的指令序列,基于所述指令序列与所述控制参数生成模拟测试指令用例;当获取所述第一芯片运行该模拟测试指令用例时得到的测试覆盖率大于预设值时,则将选择的所述控制参数作为上述确定的一个控制参数。In a possible design, when a control parameter is determined, a control parameter may be randomly selected; a corresponding instruction sequence is selected in a test template using a corresponding random value, and a simulation test instruction is generated based on the instruction sequence and the control parameter Use case; when the test coverage obtained when the first chip runs the simulation test instruction use case is greater than a preset value, the selected control parameter is used as a control parameter determined above.
由于第一芯片运行基于相应随机数值得到的指令序列和该控制参数生成的指令用例后得到的测试覆盖率大于预设值,所以可以确定该控制参数为一个较好的控制参数,将该较好的随机数值作为后续生成实际测试指令用例使用的控制参数,可以进一步地提高测试准确性。Since the test coverage obtained after the first chip runs the instruction sequence obtained based on the corresponding random value and the instruction use case generated by the control parameter is greater than the preset value, it can be determined that the control parameter is a better control parameter, and the better The random value of is used as the control parameter for the subsequent generation of actual test instruction use cases, which can further improve the test accuracy.
在一种可能的设计中,所述基于一个未使用过的随机数值在测试模板中选择对应的指令序列,包括:基于一个未使用过的随机数值计算多个指令索引值,并基于计算得到的所述多个指令索引值在所述测试模板中选择对应的指令序列。In a possible design, the selecting a corresponding instruction sequence in the test template based on an unused random value includes: calculating a plurality of instruction index values based on an unused random value, and based on the calculated The multiple instruction index values select corresponding instruction sequences in the test template.
在上述方法中,给出了如何基于随机数值得到指令序列,由于基于随机数值计算得到的指令索引值选择对应的指令序列,从而使选择指令的方法更为简单,易操作。In the above method, how to obtain the instruction sequence based on the random value is given. Since the instruction index value calculated based on the random value is used to select the corresponding instruction sequence, the method for selecting the instruction is simpler and easier to operate.
在一种可能的设计中,还可以在获取所述第一芯片运行该模拟测试指令用例时得到的测试覆盖率大于预设值后,继续控制所述第一芯片运行所述模拟测试指令用例M次,分别得到的M个测试覆盖率;当确定所述M个测试覆盖率中存在至少N个测试覆盖率大于预设值时,再确定将选择的所述控制参数作为确定的一个控制参数,其中所述M和N均为正整数,且M>=N。In a possible design, after obtaining the test coverage obtained when the first chip runs the simulation test instruction use case is greater than a preset value, continue to control the first chip to run the simulation test instruction use case M At each time, M test coverages obtained separately; when it is determined that at least N test coverages among the M test coverages are greater than a preset value, then determine the selected control parameter as a determined control parameter, Wherein M and N are both positive integers, and M>=N.
这样能够保证确定出的控制参数更为优良,为后续生成测试效果更好的实际测试指令用例提供好的基础。This can ensure that the determined control parameters are more excellent, and provide a good basis for subsequent generation of actual test command use cases with better test results.
在一种可能的设计中,若测试过程中第一芯片出现bug,还可以将确定的所述控制参 数存储至控制参数集合中,所述控制参数集合可以用于在验证第二芯片时提供控制参数。In a possible design, if a bug occurs on the first chip during the test, the determined control parameter may also be stored in a control parameter set, which may be used to provide control when verifying the second chip parameter.
这样由于验证芯片出现bug,则证明选取的控制参数比较优化,因此将确定的控制参数存储进控制参数集合,可以使得在控制参数集合中不断学习积累较为优良的控制参数,从而再为验证其他芯片(比如第二芯片)时可以优先提供较为优良的控制参数,以减少验证第二芯片时查找确定控制参数的时间,进一步提高验证效率。In this way, because the verification chip has a bug, it proves that the selected control parameters are more optimized. Therefore, storing the determined control parameters in the control parameter set can enable the continuous learning and accumulation of better control parameters in the control parameter set, so as to verify other chips. (For example, the second chip), priority can be given to providing better control parameters, so as to reduce the time for searching and determining control parameters when verifying the second chip, and further improve the verification efficiency.
在一种可能的设计中,所述测试覆盖率可以但不限于通过下列方式中的至少一种确定:In a possible design, the test coverage may be determined by at least one of the following ways:
使用读系统状态寄存器到通用寄存器MRS指令读取性能监控单元PMU寄存器得到测试覆盖率,作为所述第一芯片运行该实际测试指令用例的测试覆盖率;或Use the read system status register to general register MRS instruction to read the performance monitoring unit PMU register to obtain the test coverage, as the test coverage of the first chip to run the actual test instruction use case; or
使用MRS指令读取特殊寄存器得到测试覆盖率,作为所述第一芯片运行该实际测试指令用例的测试覆盖率;或Use the MRS instruction to read the special register to obtain the test coverage, as the test coverage of the first chip running the actual test instruction use case; or
使用装入指令读取所述第一芯片的内存得到测试覆盖率,作为所述第一芯片运行该实际测试指令用例的测试覆盖率。A load instruction is used to read the memory of the first chip to obtain a test coverage, which is used as the test coverage of the first chip to run the actual test instruction use case.
第三方面,本申请还提供了一种装置,该装置具有实现上述第一方面或第二方面涉及的功能。所述功能可以通过硬件实现,也可以通过硬件执行相应的软件实现。所述硬件或软件包括一个或多个与上述功能相对应的模块。In a third aspect, the present application further provides an apparatus having the functions related to the above-mentioned first aspect or second aspect. The function can be realized by hardware, or can also be realized by hardware executing corresponding software. The hardware or software includes one or more modules corresponding to the above functions.
在一个可能的设计中,所述装置的结构中可以包括处理单元和存储单元,还可以包括通信单元等,这些单元可以执行上述第一方面或第二方面示例中的相应。比如所述装置的结构中可以包括处理器和存储器,所述处理器和存储器耦合,所述存储器保存必要的程序指令和数据。所述存储器用于存储计算机程序;所述处理器被配置为执行所述存储器中存储的计算机程序,以完成上述第一方面或第二方面中的相应功能。In a possible design, the structure of the device may include a processing unit and a storage unit, and may also include a communication unit, etc. These units may perform the corresponding in the first aspect or the second aspect example. For example, the structure of the device may include a processor and a memory, the processor and the memory are coupled, and the memory stores necessary program instructions and data. The memory is used to store a computer program; the processor is configured to execute the computer program stored in the memory to complete the corresponding function in the first aspect or the second aspect described above.
第四方面,本申请还提供了一种计算机存储介质,所述计算机存储介质中存储有计算机可执行指令,所述计算机可执行指令在被所述计算机调用时用于使所述计算机执行上述第一方面中任一可能的设计中所提及的方法,或执行上述第二方面中任一可能的设计中所提及的方法。According to a fourth aspect, the present application also provides a computer storage medium that stores computer-executable instructions, which when used by the computer are used to cause the computer to execute the above-mentioned first The method mentioned in any possible design in one aspect, or performing the method mentioned in any possible design in the second aspect above.
第五方面,本申请还提供了一种包含指令的计算机程序产品,当其在装置上运行时,使得所述装置执行上述第一方面中任一可能的设计中所提及的方法,或使得所述装置执行上述第二方面中任一可能的设计中所提及的方法。In a fifth aspect, the present application also provides a computer program product containing instructions that, when run on a device, cause the device to perform the method mentioned in any of the possible designs in the first aspect above, or cause The device performs the method mentioned in any possible design of the second aspect above.
第六方面,本申请还提供了一种装置,所述装置可以为芯片,所述芯片与存储器相连,用于读取并执行所述存储器中存储的程序指令,以实现上述第一方面中任一可能的设计中所提及的方法,或实现上述第二方面中任一可能的设计中所提及的方法。According to a sixth aspect, the present application further provides an apparatus, which may be a chip connected to a memory, and used to read and execute program instructions stored in the memory to implement any of the first aspect A method mentioned in a possible design, or a method mentioned in any possible design of the second aspect above.
附图说明BRIEF DESCRIPTION
图1为现有的用于验证芯片的验证框架示意图;FIG. 1 is a schematic diagram of an existing verification framework for verifying chips;
图2为本申请实施例提供的用于验证芯片的验证框架示意图;2 is a schematic diagram of a verification framework for verifying a chip provided by an embodiment of the present application;
图3为本申请实施例提供的一种验证芯片的方法的具体流程图;FIG. 3 is a specific flowchart of a method for verifying a chip provided by an embodiment of the present application;
图4为本申请实施例提供的一种根据随机数值选择对应的指令序列的过程示意图;4 is a schematic diagram of a process of selecting a corresponding instruction sequence according to a random value provided by an embodiment of the present application;
图5为本申请实施例提供的一种芯片验证的完整方法流程图;5 is a flowchart of a complete method for chip verification provided by an embodiment of the present application;
图6为本申请实施例提供的另一种验证芯片的方法的具体流程图;6 is a specific flowchart of another method for verifying a chip provided by an embodiment of the present application;
图7为本申请实施例提供的另一种芯片验证的完整方法流程图;7 is a flowchart of another complete method of chip verification provided by an embodiment of the present application;
图8为本申请实施例提供的第一种装置结构示意图;8 is a schematic structural diagram of a first device provided by an embodiment of this application;
图9为本申请实施例提供的第二种装置结构示意图。9 is a schematic structural diagram of a second device provided by an embodiment of the present application.
具体实施方式detailed description
下面将结合附图对本申请实施例作进一步地详细描述。The embodiments of the present application will be further described in detail below with reference to the drawings.
本申请实施例提供一种芯片验证方法及装置,用以解决现有技术中存在的验证芯片是否存在bug时,需要人员参与,操作繁琐,验证效率低的问题。其中,方法和装置是基于同一发明构思的,由于方法及装置解决问题的原理相似,因此装置与方法的实施可以相互参见,重复之处不再赘述。The embodiments of the present application provide a chip verification method and device, to solve the problems that the verification chip in the prior art has bugs, requires personnel participation, is cumbersome to operate, and has low verification efficiency. Among them, the method and the device are based on the same inventive concept. Since the principles of the method and the device to solve the problem are similar, the implementation of the device and the method can be referred to each other, and the repetition is not repeated here.
研发人员在开发一款新的芯片时,需要对芯片的各个功能进行验证,验证成功后,才能将该芯片投入到市场。对芯片的功能进行验证时,最关键的一个问题就是验证芯片是否存在bug,如果存在bug则需要验证人员对bug进行分析,找出出现bug的原因,解决完出现bug的原因后继续对芯片进行验证。其中对芯片的验证,可以是验证芯片的“内存一致性”、CPU的中断、异常、页表及虚拟化、分支预测、取指、译码、分解微操作、分发、发射、写回、指令提交以及回退等方面是否存在bug,也可以用来验证包含CPU的所有SOC系统。When developing a new chip, the R&D personnel need to verify the various functions of the chip. Only after the verification is successful can the chip be put on the market. When verifying the function of the chip, one of the most critical issues is to verify whether there is a bug in the chip. If there is a bug, the verification personnel needs to analyze the bug, find out the cause of the bug, and continue to work on the chip after solving the cause of the bug. verification. Among them, the verification of the chip can be the verification of the "memory consistency" of the chip, the interruption of the CPU, the exception, the page table and virtualization, branch prediction, instruction fetching, decoding, decomposition of micro-operations, distribution, transmission, write back, instructions Whether there are bugs in submission and rollback can also be used to verify all SOC systems including CPU.
在介绍本申请实施例之前,首先对于本申请实施例涉及的几个关键概念进行定义描述,以便于更好理解本申请实施例的实施过程。Before introducing the embodiments of the present application, first, several key concepts involved in the embodiments of the present application are defined and described, so as to better understand the implementation process of the embodiments of the present application.
1)、随机数值,为采用一些随机算法随机生成的数值,可以是一个64位的十六进制数,基于该十六进制数可以使用预设算法计算得到一组数字序列,该数字序列可以作为指令索引值序列;随机算法指使用了随机函数,且随机函数的返回值直接或者间接的影响了算法的执行流程或执行结果。1) Random number, which is a value randomly generated by some random algorithm, can be a 64-bit hexadecimal number, based on the hexadecimal number can use a preset algorithm to calculate a set of digital sequence, the digital sequence It can be used as a sequence of instruction index values; a random algorithm refers to the use of a random function, and the return value of the random function directly or indirectly affects the execution flow or execution result of the algorithm.
2)、测试模板,指测试人员预先根据经验生成的测试指令库,用于存储指令集合和指令约束,所述指令集合包含至少一个指令,里面包括有测试人员针对不同芯片预先编写好的各种不同的指令,不同的指令可以构成一个指令序列,一个指令序列又可以与不同的用于测试待验证芯片的控制参数组成测试指令用例;所述指令约束中包含选取指令的约束,也就是计算指令索引值的函数。2). Test template refers to a test instruction library generated in advance by testers based on experience, used to store instruction sets and instruction constraints. The instruction set contains at least one instruction, which includes various kinds of pre-programmed by testers for different chips. Different instructions, different instructions can constitute an instruction sequence, and an instruction sequence can be combined with different control parameters used to test the chip to be tested to form a test instruction use case; the instruction constraints include constraints for selecting instructions, that is, calculation instructions Index value function.
3)、控制参数,用于控制指令序列中不同指令在运行时所使用的参数,为了能够测试到不同待验证芯片的不同测试点,可以针对待验证芯片设置不同的测试参数,以达到对不同测试点均测试到的目的。3). Control parameters, used to control the parameters used by different instructions in the instruction sequence during operation. In order to be able to test different test points of different chips to be verified, different test parameters can be set for the chips to be verified to achieve different The purpose of the test points are tested.
4)、测试指令用例,为生成的能够直接作用于待验证芯片的运行程序,通常待验证芯片在运行该运行程序时,如果存在问题,通常会触发bug。测试指令用例由指令序列和控制参数组成,待验证芯片运行指令用例的过程,就是用指令用例中的指令访问待验证芯片中的相应地址以获取芯片中的相应数据,该地址由指令序列中的控制参数指示。4). Test instruction use cases are generated operating programs that can directly affect the chip to be verified. Usually, when the chip to be verified runs the running program, if there is a problem, a bug is usually triggered. The test instruction use case is composed of an instruction sequence and control parameters. The process of running the instruction use case of the chip to be verified is to use the instructions in the instruction use case to access the corresponding address in the chip to be verified to obtain the corresponding data in the chip. Control parameter indication.
5)、测试覆盖率,指待验证芯片在运行测试指令用例后输出的被测试到的不同功能值的数量与预期需要得到的功能值的数量的比值。5). Test coverage refers to the ratio of the number of tested different function values output by the chip to be verified after running the test instruction use case and the number of expected function values.
6)、指令索引值,为根据随机数值使用预设的算法计算出的索引值,基于不同指令索引值可以在测试模板中索引到对应的指令。6). The instruction index value is an index value calculated by using a preset algorithm according to a random value. Based on different instruction index values, corresponding instructions can be indexed in the test template.
7)、多个,是指两个或两个以上。7) Multiple means two or more.
8)、在本申请的描述中,“第一”、“第二”等词汇,仅用于区分描述的目的,而不能理解为指示或暗示相对重要性,也不能理解为指示或暗示顺序。8) In the description of this application, the words "first" and "second" are only used to distinguish the description, and cannot be understood as indicating or implying relative importance, or as indicating or implying the order.
目前对于芯片的验证,通常基于图1所示的验证框架图进行验证处理,如图1所示,现有验证框架示意图包括随机指令发生器,随机指令发生器又包括随机数值发生器、测试模板以及指令生成模块。其中,测试模板中包括指令集合和指令约束,该指令集合为预先定义好的,指令集合中包含多个指令;指令约束中会存储一些约束条件,用于生成指令索引值;指令生成模块用于根据指令约束生成的指令索引值从所述指令集合中索引指令,最终得到指令序列。在验证一个待验证芯片是否存在问题时,随机数值发生器用于随机生成一个随机数值,也可以将这里的随机数值称为一个“种子”,该“种子”可以为一个64位十六进制的数值,随机数值发生器会根据该“种子”以及指令约束中的约束条件生成多个指令索引值,然后指令生成模块根据多个指令索引值从指令集合中选择对应的多个指令,组成指令序列,将该指令序列与默认的控制参数组合成一个指令用例,并输出给目标芯片(即待验证芯片),由待验证芯片运行该指令用例,然后借助eda(electronic design automation,电子设计自动化)工具的“断言”或“测试覆盖率”等功能来收集目标芯片运行该指令用例时的测试覆盖率,再由“覆盖率分析工具”将收集到的测试覆盖率等信息存储到一个文件夹中。后续验证人员可以根据该文件中存储的测试覆盖率等信息修改或改进测试模板中的指令集合;在目标芯片验证运行该指令用例的过程中,如果存在bug,则停止验证,验证人员可以对该bug进行分析。At present, for chip verification, verification processing is usually performed based on the verification framework shown in FIG. 1. As shown in FIG. 1, the schematic diagram of the existing verification framework includes a random instruction generator, and the random instruction generator includes a random value generator and a test template. And instruction generation module. Among them, the test template includes an instruction set and instruction constraints. The instruction set is pre-defined. The instruction set contains multiple instructions; instruction constraints store some constraints for generating instruction index values; the instruction generation module is used for The instruction index value generated according to the instruction constraint indexes the instruction from the instruction set, and finally obtains the instruction sequence. When verifying whether there is a problem with a chip to be verified, the random number generator is used to randomly generate a random value. The random value here can also be called a "seed", which can be a 64-bit hexadecimal Numerical value, the random number generator will generate multiple instruction index values according to the "seed" and the constraint conditions in the instruction constraints, and then the instruction generation module selects corresponding multiple instructions from the instruction set according to the multiple instruction index values to form an instruction sequence , The instruction sequence and the default control parameters are combined into an instruction use case, and output to the target chip (that is, the chip to be verified), the instruction use case is run by the chip to be verified, and then with the help of eda (electronic design automation) "Assert" or "test coverage" and other functions to collect the test coverage of the target chip when running the instruction use case, and then the "coverage analysis tool" will store the collected test coverage and other information into a folder. Subsequent verification personnel can modify or improve the instruction set in the test template according to the test coverage and other information stored in the file; during the process of verifying the instruction use case of the target chip, if there is a bug, the verification is stopped, and the verification personnel can bug analysis.
需要说明的是,断言是指在运行指令用例时,对不符合预期情况的检查,当不符合预期情况发生时,会出现断言,也就是报错,验证停止。It should be noted that the assertion refers to the inspection of the non-conformance when running the instruction use case. When the non-conformity occurs, an assertion will occur, that is, an error will be reported, and the verification will stop.
为了便于理解现有技术对芯片验证的方法,以下进行举例说明。In order to facilitate understanding of the method for verifying the chip in the prior art, the following is an example.
比如,测试模板中的指令集合中有10个指令,指令A、指令B、指令C、指令D、指令E、指令F、指令G、指令H、指令I、指令J,随机数值发生器随机选取了一个“种子”为123,根据指令约束中的指令约束条件以及“种子”123,在测试模板中随机选取的指令序列为指令A,指令E,指令F,然后将指令A,指令E,指令F和默认控制参数组合成测试指令用例输出给目标芯片,目标芯片运行该测试指令序列后,借助eda工具收集目标芯片运行该测试指令用例得到的测试覆盖率,如果收集到的测试覆盖率信息为70%,若目标芯片需要验证10个功能,则有3个没有验证到,这时验证人员可以根据3个未验证到的功能对测试模板进行修改或改进。For example, there are 10 instructions in the instruction set in the test template, instruction A, instruction B, instruction C, instruction D, instruction E, instruction F, instruction G, instruction H, instruction I, instruction J, the random number generator is randomly selected A "seed" is 123. According to the instruction constraint conditions in the instruction constraint and "seed" 123, the randomly selected instruction sequence in the test template is instruction A, instruction E, instruction F, and then instruction A, instruction E, instruction F and the default control parameters are combined into a test command use case and output to the target chip. After the target chip runs the test command sequence, the test coverage obtained by the target chip running the test command use case is collected by the eda tool. If the collected test coverage information is 70%, if the target chip needs to verify 10 functions, 3 of them have not been verified. At this time, the verification personnel can modify or improve the test template according to the 3 unverified functions.
为了提高芯片验证的效率,在本实施例的方案中可以对图1的框架进行修改,避免过多依赖于验证人员的人为修改完善,从而意在提高验证效率和验证准确度。In order to improve the efficiency of chip verification, the framework of FIG. 1 can be modified in the solution of this embodiment, to avoid excessive manual modification and perfection by verification personnel, so as to improve verification efficiency and verification accuracy.
本申请实施例所实施的验证框架图可以如图2所示,包括自适应指令发生器,该自适应指令发生器包括自适应专家系统控制器、随机数值发生器、指令生成模块以及性能监控单元计数器。其中,自适应专家系统控制器包括测试模板和控制参数模板,测试模板中包括指令集合和指令约束,控制参数模板中包括控制参数集合,控制参数集合中的控制参数用于控制指令序列中不同指令在运行时所使用的参数,具体实现可以是根据控制参数生成指令需要在待验证芯片上访问的地址;随机数值发生器能够随机生成“种子”,且指令约束中的指令约束条件和“种子”能够生成多个指令索引值,指令生成模块根据多个指令索引值在指令集合中索引多个指令,生成指令序列;性能监控单元计数器能够自动统计待验证芯片运行指令序列时的测试覆盖率是否达到预设值,如果能够达到预设值则触发该性能监控单元计数器加1。The verification framework diagram implemented in the embodiment of the present application may be as shown in FIG. 2 and includes an adaptive instruction generator including an adaptive expert system controller, a random value generator, an instruction generation module, and a performance monitoring unit counter. The adaptive expert system controller includes a test template and a control parameter template. The test template includes an instruction set and instruction constraints. The control parameter template includes a control parameter set. The control parameters in the control parameter set are used to control different instructions in the instruction sequence. The specific parameters used during operation can be the addresses that need to be accessed on the chip to be generated according to the control parameters; the random number generator can randomly generate "seeds", and the instruction constraints and "seeds" in the instruction constraints It can generate multiple instruction index values, and the instruction generation module indexes multiple instructions in the instruction set according to the multiple instruction index values to generate the instruction sequence; the performance monitoring unit counter can automatically count whether the test coverage rate of the instruction sequence when the chip to be verified runs The preset value, if the preset value can be reached, the counter of the performance monitoring unit is triggered to increase by 1.
基于图2所示的验证框架,本申请实施例提供了一种芯片验证的方法,适用于图2所 示的自适应指令发生器,参阅图3所示,本申请实施例提供的一种验证芯片的方法的具体流程,包括:Based on the verification framework shown in FIG. 2, an embodiment of the present application provides a chip verification method, which is applicable to the adaptive instruction generator shown in FIG. 2. Referring to FIG. 3, a verification provided by an embodiment of the present application The specific process of the chip method includes:
步骤300、确定一个随机数值。Step 300: Determine a random value.
在一种可选的实施方式中,自适应指令发生器中的随机数值发生器随机生成一个随机数值,基于该随机数值,从自适应指令发生器中的测试模板中选择对应的指令序列,在根据该指令序列与默认的控制参数生成模拟测试指令用例后,让待验证芯片运行该模拟测试指令用例,当该待验证芯片运行完该模拟测试指令用例后,确定该待验证芯片运行该模拟测试指令用例时得到的测试覆盖率是否大于预设值,如果大于预设值,则将该随机数值作为步骤300中确定的随机数值。In an alternative embodiment, the random number generator in the adaptive command generator randomly generates a random value, and based on the random value, selects the corresponding command sequence from the test template in the adaptive command generator, in After generating a simulation test instruction use case according to the instruction sequence and the default control parameters, let the chip to be verified run the simulation test instruction use case, and after the chip to be verified runs the simulation test instruction use case, determine that the chip to be verified runs the simulation test Whether the test coverage obtained when instructing the use case is greater than a preset value, and if it is greater than the preset value, the random value is used as the random value determined in step 300.
示例性的,默认的控制参数可以为在预设的控制参数集合中的一个控制参数。具体的,自适应专家系统控制器可以根据默认的控制参数的存储地址在待验证芯片中读取默认的控制参数。Exemplarily, the default control parameter may be a control parameter in a preset control parameter set. Specifically, the adaptive expert system controller can read the default control parameters in the chip to be verified according to the storage address of the default control parameters.
获取待验证芯片运行该模拟测试指令用例后的测试覆盖率,可以通过以下三种方式中的至少一种来获取:Obtaining the test coverage of the chip to be verified after running the simulation test instruction use case can be obtained in at least one of the following three ways:
方式一、使用自适应专家系统控制器中的MRS(move to general purpose register from system register,读系统状态寄存器到通用寄存器)指令读取PMU(performance monitors unit,性能监控单元)寄存器,获取测试覆盖率;Method 1: Use the MRS (move to general) purpose register from the system register in the adaptive expert system controller to read the PMU (performance monitors unit) register to obtain test coverage ;
方式二、使用自适应专家系统控制器中的MRS指令读取特殊寄存器,获取测试覆盖率;Method 2: Use the MRS instruction in the adaptive expert system controller to read special registers to obtain test coverage;
方式三、使用自适应专家系统控制器中的装入指令读取该待验证芯片的内存,获取测试覆盖率。Method 3: Use the load instruction in the adaptive expert system controller to read the memory of the chip to be verified to obtain the test coverage.
需要说明的是,使用MRS指令读取PMU寄存器的方式获取测试覆盖率时,待验证芯片运行该模拟测试指令用例得到的测试覆盖率信息会存储在PMU寄存器中;使用MRS指令读取特殊寄存器的方式获取测试覆盖率时,待验证芯片运行该模拟测试指令用例得到的测试覆盖率信息会存储在特殊寄存器中,由于每个特殊寄存器有明确的功能,所以用MRS读取具有存储测试覆盖率功能的特殊寄存器就可以获取到测试覆盖率;使用装入指令读取该待验证芯片的内存的方式获取测试覆盖率时,待验证芯片运行该模拟测试指令用例得到的测试覆盖率信息会存储在该待验证芯片的内存中,使用该方法获取测试覆盖率时,无需添加新的PMU寄存器和特殊寄存器,可以节省资源。It should be noted that when the MRS instruction is used to read the PMU register to obtain the test coverage, the test coverage information obtained by running the simulation test instruction use case of the chip to be verified will be stored in the PMU register; the MRS instruction is used to read the special register When the test coverage is obtained by way, the test coverage information obtained by the chip to be verified running the simulation test instruction use case will be stored in the special register. Since each special register has a clear function, the MRS read has the function of storing the test coverage You can obtain the test coverage by using the special register of the test; when you use the load instruction to read the memory of the chip to be verified to obtain the test coverage, the test coverage information obtained by the chip to be verified running the simulation test instruction use case will be stored in the In the memory of the chip to be verified, when this method is used to obtain test coverage, there is no need to add new PMU registers and special registers, which can save resources.
在一种可选的实施方式中,基于随机数值从测试模板中选择对应的指令序列,可以首先基于该随机数值计算多个指令索引值,然后基于计算得到的该多个指令索引值在自适应指令发生器的测试模板中选择对应的指令序列。In an optional embodiment, a corresponding instruction sequence is selected from the test template based on a random value, and multiple instruction index values may be calculated based on the random value first, and then based on the calculated multiple instruction index values in the adaptive In the test template of the command generator, select the corresponding command sequence.
为了便于理解根据随机数值选择对应的指令序列,下面进行举例说明。In order to facilitate understanding of the selection of the corresponding instruction sequence according to the random value, an example will be described below.
如图4所示,为本申请实施例提供的一种根据随机数值选择对应的指令序列的过程示意图。图4中,X为选取的随机数值,X可以为一个64位的十六进制数,基于预设的第一函数Y=f1(X)分别计算得到一串数字序列(Y1,Y2,Y3….Yn),其中基于X作求取Y1时,X作为函数Y=f1(X)的初始输入值,在后续计算Y2、Y3….Yn时,每次将上一次的计算结果值作为函数Y=f1(X)的输入值。然后将数字序列(Y1,Y2,Y3….Yn)作为指令索引值序列,基于预设的第二函数Z=f2(Y)分别计算各个指令索引值Y在测试模板中能够索引到的指令Z,因此可以根据指令索引值序列(Y1,Y2,Y3….Yn)在测试模板 中索引到指令序列(Z1,Z2,Z3….Zn)。As shown in FIG. 4, it is a schematic diagram of a process of selecting a corresponding instruction sequence according to a random value provided by an embodiment of the present application. In Figure 4, X is a selected random value, X can be a 64-bit hexadecimal number, based on the preset first function Y = f1 (X), respectively calculated a series of digital sequences (Y1, Y2, Y3 ….Yn), where X1 is obtained based on X, X is used as the initial input value of the function Y=f1(X), and in the subsequent calculation of Y2, Y3….Yn, the value of the last calculation result is used as a function each time Y = input value of f1(X). Then take the number sequence (Y1, Y2, Y3...Yn) as the sequence of instruction index values, and calculate the instruction Z that can be indexed in the test template for each instruction index value Y based on the preset second function Z = f2 (Y) Therefore, the instruction sequence (Z1, Z2, Z3...Zn) can be indexed in the test template according to the instruction index value sequence (Y1, Y2, Y3...Yn).
这里需要说明,基于随机数字使用预设算法计算得到一组数字序列,这里的预设算法Y=f1(X)可以是根据指令约束得到的。It should be noted here that a set of number sequences is calculated based on a random number using a preset algorithm, and the preset algorithm Y=f1(X) here may be obtained according to instruction constraints.
在一种可选的实施方式中,性能监控单元计数器在获取待验证芯片运行该模拟测试指令用例时得到的测试覆盖率大于预设值后,自适应指令发生器可以控制该待验证芯片继续运行该模拟测试指令用例M次,在得到的M个测试覆盖率中确定存在N个测试覆盖率均大于预设值后,再最终将生成的随机数值作为上述步骤300中确定的随机数值,这里的M大于等于N。这样,可以保证选取的随机数值更具有优良性,可以定义为一个优良的随机数值,或是一个优良的“种子”。In an optional embodiment, after the performance monitoring unit counter obtains the test coverage obtained when the chip to be verified runs the simulation test instruction use case is greater than a preset value, the adaptive command generator may control the chip to be verified to continue to run The simulation test instruction use case M times. After determining that there are N test coverages greater than a preset value in the obtained M test coverages, the generated random value is finally used as the random value determined in step 300 above. M is greater than or equal to N. In this way, it can ensure that the selected random value is more excellent, which can be defined as a good random value or a good "seed".
比如,预设值为80%,M为5,N为3,获取待验证芯片运行一个模拟测试指令用例得到的测试覆盖率为90%之后,则可以再控制该待验证芯片继续运行该模拟测试指令用例5次,得到的5个测试覆盖率为85%,88%,90%,91%,79%,由于得到的5个测试覆盖率中有4个大于预设值80%,则就可以将生成该模拟测试指令用例的指令序列的随机数值作为一个优良的随机数值,也就是优良的“种子”。优良“种子”后续就可以作为生成实际测试指令用例时所使用的真实“种子”。For example, if the preset value is 80%, M is 5, and N is 3, after the test coverage obtained by running a simulation test command use case of the chip to be verified is 90%, the chip to be verified can be controlled to continue to run the simulation test Instruct the use case 5 times, and the 5 test coverages obtained are 85%, 88%, 90%, 91%, 79%. Since 4 of the 5 test coverages obtained are greater than the preset value of 80%, you can The random value of the instruction sequence that generates the simulation test instruction use case is regarded as a good random value, that is, a good "seed". The good "seed" can then be used as the real "seed" used in generating actual test instruction use cases.
步骤301、自适应专家系统控制器基于该随机数值在测试模板中选择对应的指令序列,所述测试模板包括多个指令。Step 301: The adaptive expert system controller selects a corresponding instruction sequence in a test template based on the random value, and the test template includes multiple instructions.
在确定了随机数值以后,基于该随机数值在测试模板中选择对应的指令序列,这里基于随机数值在测试模板中选择对应的指令序列的过程和确定一个随机数值时基于随机数值从测试模板中选择对应的指令序列的过程是一样的,不再重复赘述。After the random value is determined, the corresponding instruction sequence is selected in the test template based on the random value. Here, the process of selecting the corresponding instruction sequence in the test template based on the random value and selecting a random value from the test template based on the random value The process of the corresponding instruction sequence is the same, and will not be repeated here.
步骤302、自适应专家系统控制器基于选择的指令序列重复执行以下步骤:Step 302: The adaptive expert system controller repeats the following steps based on the selected instruction sequence:
遍历预设的控制参数集合中一个未被遍历过的控制参数,根据选择的指令序列和遍历得到的控制参数生成一个实际测试指令用例;当获取待验证芯片运行该实际测试指令用例时得到的测试覆盖率大于预设值时,控制该待验证芯片运行该指令用例多次,若出现bug则结束,否则再次执行遍历该预设的控制参数集合中一个未被遍历过的控制参数的步骤。Traverse a control parameter in the set of preset control parameters that has not been traversed, and generate an actual test command use case based on the selected command sequence and the control parameters obtained by the traversal; obtain the test obtained when the actual test command use case is run by the chip to be verified When the coverage rate is greater than the preset value, the chip to be verified is controlled to run the instruction use case multiple times, and if a bug occurs, it ends, otherwise, the step of traversing a control parameter in the preset control parameter set that has not been traversed is executed again.
这里的预设的控制参数集合中的不同控制参数可以根据待验证芯片的不同功能预先设置,比如针对待验证芯片A可以预先设置一些待验证芯片A的控制参数,在验证待验证芯片A时,在预设控制参数集合中存储针对待验证芯片A预先设置的一些控制参数;针对待验证芯片B会预先设置一些待验证芯片B的控制参数,在验证待验证芯片B时,在预设控制参数集合中存储针对待验证芯片B预先设置的一些控制参数。Different control parameters in the preset control parameter set here can be preset according to different functions of the chip to be verified, for example, for the chip A to be verified, some control parameters of the chip A to be verified can be preset, when verifying the chip A to be verified, Store some control parameters preset for the chip A to be verified in the preset control parameter set; some control parameters of the chip B to be verified will be preset for the chip B to be verified. When verifying the chip B to be verified, the preset control parameters The set stores some control parameters preset for the chip B to be verified.
遍历预设的控制参数集合中一个未被遍历过的控制参数,也就是在每次根据选择的指令序列和控制参数生成一个实际测试指令用例的时候,该控制参数是预设的控制参数集合中的一个在本次生成实际测试指令用例之前未使用过的控制参数,这样做是为了防止待验证芯片重复运行一些相同的指令用例,避免浪费时间。Traverse a control parameter in the preset control parameter set that has not been traversed, that is, each time a real test command use case is generated according to the selected command sequence and control parameter, the control parameter is in the preset control parameter set A control parameter that has not been used before the actual test instruction use case is generated this time. This is to prevent the chip to be verified from repeatedly running some of the same instruction use cases and avoid wasting time.
生成一个实际测试指令用例后,让待验证芯片运行该实际测试指令用例,获取待验证芯片运行该实际测试指令用例后得到的测试覆盖率,这里获取待验证芯片运行该指令用例后得到的测试覆盖率,与上述获取待验证芯片运行模拟测试指令用例后的测试覆盖率的方式相同,这里不再重复赘述。After generating an actual test instruction use case, let the chip to be verified run the actual test instruction use case to obtain the test coverage obtained after the chip to be verified runs the actual test instruction use case. Here, the test coverage obtained by the chip to be verified running the instruction use case is obtained The rate is the same as the above method for obtaining the test coverage after the use case of the simulation test instruction to be verified by the chip to be verified, which will not be repeated here.
一种可能的实施方式中,在待验证芯片运行实际测试指令用例时,如果出现bug,则可以将生成该实际测试指令用例的指令序列的随机数值存储到一个随机数集合中,该随机 数集合中的随机数可以用于在验证其他目标芯片时提供优良的随机数值,这样可以为验证其他目标芯片更好的节省时间。In a possible implementation manner, when a chip to be verified runs an actual test instruction use case, if a bug occurs, the random value of the instruction sequence that generates the actual test instruction use case may be stored in a random number set, and the random number set The random number in can be used to provide excellent random numbers when verifying other target chips, which can save time for verifying other target chips.
在一种可选的实施方式中,如果在预设的控制参数集合中遍历不到未被遍历的控制参数,则可以返回执行确定其他随机数值的步骤,然后再重复执行步骤301和步骤302,直至待验证芯片出现bug为止。In an optional embodiment, if the control parameters that are not traversed cannot be traversed in the preset control parameter set, it may return to the step of determining other random values, and then repeat steps 301 and 302, Until the chip to be verified has a bug.
以上提供的验证芯片的方法,首先确定一个随机数值,然后基于该随机数值选择对应的指令序列,再遍历控制参数,根据该指令系列和遍历到的控制参数生成一个实际测试指令用例,当待验证芯片运行该实际测试指令用例得到的测试覆盖率大于预设值时,控制待验证芯片运行该实际测试指令用例多次,若出现bug则停止验证,若未出现bug则继续遍历控制参数,通过一些预设条件,循环验证待验证芯片,从而不需要人员参与,操作简便,能够提高验证效率。The method for verifying the chip provided above first determines a random value, then selects the corresponding command sequence based on the random value, then traverses the control parameters, and generates an actual test command use case according to the command series and the traversed control parameters, when to be verified When the test coverage obtained by the chip running the actual test command case is greater than the preset value, the chip to be verified is controlled to run the actual test command use case multiple times. If a bug occurs, the verification is stopped, and if there is no bug, the control parameters are continued to be traversed. The preset conditions cyclically verify the chip to be verified, so that no personnel is required to participate, the operation is simple, and the verification efficiency can be improved.
基于上述图3所示的实施例,本申请实施例还提供了一种芯片验证的完整方法流程图,参阅图5所示,该示例的流程图具体可以包括:Based on the embodiment shown in FIG. 3 above, an embodiment of the present application also provides a flowchart of a complete method for chip verification. Referring to FIG. 5, the flowchart of this example may specifically include:
步骤500,随机数值发生器随机选择一个随机数字X,基于该随机数字X使用预设算法计算得到一组数字序列,该组数字序列可以作为指令索引值序列,然后使用该指令索引值序列从测试模板中依次选取对应的指令,组成一个指令序列;Step 500: The random number generator randomly selects a random number X, based on the random number X, uses a preset algorithm to calculate a set of digital sequences, which can be used as an instruction index value sequence, and then uses the instruction index value sequence from the test The corresponding instructions are selected in sequence from the template to form an instruction sequence;
步骤501,自适应专家系统控制器将上述得到的指令序列(Z1,Z2,Z3….Zn)结合默认控制参数生成一个模拟测试指令用例,具体地,可以为根据默认控制参数的存储地址读取默认控制参数,然后使用该默认控制参数和上述得到的指令序列(Z1,Z2,Z3….Zn)结合生成该模拟测试指令用例,然后让目标芯片运行该模拟测试指令用例;In step 501, the adaptive expert system controller combines the obtained command sequence (Z1, Z2, Z3...Zn) with the default control parameters to generate a simulation test command use case. Specifically, it can be read from the storage address according to the default control parameters The default control parameters, and then use the default control parameters and the instruction sequence obtained above (Z1, Z2, Z3...Zn) to generate the simulation test instruction use case, and then let the target chip run the simulation test instruction use case;
步骤502,性能监控单元计数器获取目标芯片运行该模拟测试指令用例后输出的测试覆盖率; Step 502, the performance monitoring unit counter obtains the test coverage rate output by the target chip after running the simulation test instruction use case;
步骤503,性能监控单元计数器判断目标芯片运行该模拟测试指令用例后输出的测试覆盖率是否大于预设值,如果是,执行步骤504,否则返回步骤500中,自适应专家系统控制器触发随机指令发生器随机选择其他X值后继续执行步骤500~步骤502;这里需要说明的是,再次返回步骤500选择的随机数字X是以前没有被选择过的X,比如第一次基于选择的X1执行步骤500~步骤502后,如果再次返回步骤500,则会选择X2,基于X2再次执行步骤500~步骤502。In step 503, the counter of the performance monitoring unit determines whether the test coverage output by the target chip after running the simulated test instruction use case is greater than a preset value. If so, step 504 is executed; otherwise, in step 500, the adaptive expert system controller triggers a random command The generator randomly selects other values of X and continues to perform steps 500 to 502; it should be noted here that the random number X returned to step 500 is the X that has not been selected before, such as the first step based on the selected X1. After 500 to step 502, if step 500 is returned to again, X2 is selected, and steps 500 to 502 are executed again based on X2.
判定一个模拟测试指令用例对于目标芯片验证时是否是一个好的模拟测试指令用例,判定的标准之一为目标芯片运行该模拟测试指令用例时得到的测试覆盖率是否达到预设值,如果能够达到预设值,则可以说明该模拟测试指令用例为一个较好的模拟测试指令用例,比如,目标芯片运行一个模拟测试指令用例后得到的测试覆盖率为10%,也就是说验证目标芯片时需要验证的功能该模拟测试指令用例只验证到了10%,如果用测试覆盖率为10%的模拟测试指令用例中的随机数值生成指令序列,再用该指令序列和遍历到的控制参数生成的实际测试指令用例验证芯片是否存在bug,则验证效率低,所以需要先确定该模拟测试指令用例是一个较好的模拟测试指令用例。Determine whether a simulation test instruction use case is a good simulation test instruction use case for target chip verification. One of the criteria for the determination is whether the test coverage obtained when the target chip runs the simulation test instruction use case reaches a preset value, if it can be achieved The preset value indicates that the simulation test instruction use case is a good simulation test instruction use case. For example, the target chip runs a simulation test instruction use case to obtain a test coverage of 10%, which means that it is necessary to verify the target chip The function of verification The simulation test command use case is only verified to 10%. If a random value in the simulation test command use case with a test coverage rate of 10% is used to generate the instruction sequence, the actual test generated by the instruction sequence and the traversed control parameters is used to generate the instruction sequence. The instruction use case verifies whether the chip has bugs, and the verification efficiency is low, so it is necessary to first determine that the simulation test instruction use case is a better simulation test instruction use case.
步骤504,自适应专家系统控制器继续控制目标芯片运行该模拟测试指令用例M次,性能监控单元计数器获取M次运行分别输出的M个测试覆盖率结果; Step 504, the adaptive expert system controller continues to control the target chip to run the simulation test instruction use case M times, and the performance monitoring unit counter obtains M test coverage results respectively output by the M runs;
步骤505,如果M个测试覆盖率结果中存在N个测试覆盖率结果均大于预设值,则执行步骤506;否则返回步骤500中,自适应专家系统控制器触发随机指令发生器随机选择 其他X值后继续执行步骤500~步骤502;这里需要说明的是,再次返回步骤500选择的随机数字X是以前没有被选择过的X,比如第一次基于选择的X1执行步骤500~步骤502后,如果再次返回步骤500,则会选择X2,基于X2再次执行步骤500~步骤502。 Step 505, if there are N test coverage results among the M test coverage results that are all greater than the preset value, then step 506 is executed; otherwise, return to step 500, the adaptive expert system controller triggers the random command generator to randomly select other X After the value, continue to perform steps 500 to 502; here it needs to be explained that the random number X returned to step 500 is the X that has not been selected before. For example, after performing step 500 to step 502 based on the selected X1 for the first time, If you return to step 500 again, X2 will be selected, and steps 500 to 502 will be executed again based on X2.
其中,M>=N,比如M可以为5,N可以为3。Where M>=N, for example, M may be 5, and N may be 3.
这里需要说明的是,在步骤503中,自适应专家系统控制器根据性能监控单元计数器的状态确定该模拟测试指令用例是否为一个较好的模拟测试指令用例,若性能监控单元计数器加1,则可以确定该模拟测试指令用例是一个较好的模拟测试指令用例,由于目标芯片只运行了一次该模拟测试指令用例,为了进一步确定该模拟测试指令用例确实为一个较好的模拟测试指令用例,所以继续控制目标芯片运行M次该模拟测试指令用例,如果得到的M个测试覆盖率的结果中存在N个结果大于预设值,则确定该模拟测试指令用例为较好的指令用例。It should be noted here that in step 503, the adaptive expert system controller determines whether the simulated test instruction use case is a good simulated test instruction use case according to the state of the performance monitoring unit counter. If the performance monitoring unit counter is increased by 1, then It can be determined that the simulation test instruction use case is a good simulation test instruction use case. Since the target chip only runs the simulation test instruction use case once, in order to further determine that the simulation test instruction use case is indeed a better simulation test instruction use case, so Continue to control the target chip to run the simulation test instruction use case M times. If there are N results out of the M test coverage results obtained that are greater than a preset value, the simulation test instruction use case is determined to be a better instruction use case.
步骤506,自适应专家系统控制器触发随机指令发生器根据随机数字X重新执行步骤500中的操作,在测试模板中索引到指令序列(Z1,Z2,Z3….Zn),并判断在控制参数集合中是否可以遍历到一个未被遍历的控制参数,具体可以为判断在各个控制参数对应的存储地址的地址集合中是否可以遍历到一个未被遍历的存储地址,如果是,则执行步骤507,否则返回步骤500中,自适应专家系统控制器触发随机指令发生器随机选择其他X值后继续执行步骤500~步骤502;这里需要说明的是,再次返回步骤500选择的随机数字X是以前没有被选择过的X,比如第一次基于选择的X1执行步骤500~步骤502后,如果再次返回步骤500,则会选择X2,基于X2再次执行步骤500~步骤502。 Step 506, the adaptive expert system controller triggers the random command generator to re-execute the operation in step 500 according to the random number X, index the command sequence (Z1, Z2, Z3...Zn) in the test template, and judge the control parameters Whether a control parameter that has not been traversed can be traversed in the collection, which can specifically be judged whether a storage address that has not been traversed can be traversed in the address set of the storage address corresponding to each control parameter, and if so, step 507 is executed, Otherwise, returning to step 500, the adaptive expert system controller triggers the random command generator to randomly select other values of X, and then continues to perform steps 500 to 502; it should be noted here that returning to the random number X selected in step 500 is not previously done. The selected X, for example, after performing steps 500 to 502 based on the selected X1 for the first time, if step 500 is returned to again, X2 is selected, and steps 500 to 502 are executed again based on X2.
步骤507,自适应专家系统控制器基于指令序列(Z1,Z2,Z3….Zn)和遍历到的该控制参数生成一个实际测试指令用例; Step 507, the adaptive expert system controller generates an actual test instruction use case based on the instruction sequence (Z1, Z2, Z3...Zn) and the traversed control parameters;
步骤508,自适应专家系统控制器控制目标芯片运行该实际测试指令用例后,性能监控单元计数器获取目标芯片运行该实际测试指令用例输出的测试覆盖率; Step 508, after the adaptive expert system controller controls the target chip to run the actual test instruction use case, the performance monitoring unit counter obtains the test coverage rate output by the target chip to run the actual test instruction use case;
步骤509,性能监控单元计数器判断目标芯片运行该实际测试指令用例后输出的测试覆盖率是否大于预设值,如果是,执行步骤510,否则返回继续执行步骤506;In step 509, the counter of the performance monitoring unit determines whether the test coverage rate output by the target chip after running the actual test instruction use case is greater than a preset value. If yes, step 510 is executed; otherwise, step 506 is returned to;
步骤510,自适应专家系统控制器继续控制目标芯片运行该实际测试指令用例K次; Step 510, the adaptive expert system controller continues to control the target chip to run the actual test instruction use case K times;
步骤511,自适应专家系统控制器确定所述目标芯片运行K次该实际测试指令用例的过程中是否出现bug,如果是,则测试结束;否则返回继续执行步骤506。In step 511, the adaptive expert system controller determines whether a bug occurs in the actual test instruction use case when the target chip runs K times, and if yes, the test ends; otherwise, returns to step 506.
上述执行完步骤504后,如果M个测试覆盖率结果中存在N个测试覆盖率结果均大于预设值时,则可以将选择的该随机数值X存储,也可以将选择的该随机数值X对应的存储地址进行存储,这样在后续对其他芯片进行测试时,可以优先选择存储的这些优良随机数值,或者根据存储的优先随机数值的存储地址获取到优良随机数值,从而降低寻找优良随机数值时花费的时间,提高寻找优良随机数值的效率。After performing the above step 504, if there are N test coverage results among the M test coverage results that are all greater than a preset value, the selected random value X may be stored, or may be corresponding to the selected random value X The storage address of the storage, so that in the subsequent testing of other chips, these good random values can be preferentially stored, or the good random values can be obtained according to the storage address of the stored priority random values, thereby reducing the cost of finding good random values Time to improve the efficiency of finding good random values.
基于图2所示的验证框架,本申请实施例还提供了一种芯片验证的方法,适用于图2所示的自适应指令发生器,参阅图6所示,本申请实施例提供的另一种验证芯片的方法的具体流程,包括:Based on the verification framework shown in FIG. 2, an embodiment of the present application also provides a chip verification method, which is applicable to the adaptive instruction generator shown in FIG. 2. Referring to FIG. 6, another method provided by the embodiment of the present application The specific process of a method for verifying a chip includes:
步骤600、确定一个控制参数。Step 600: Determine a control parameter.
在一种可选的实施方式中,首先自适应专家系统控制器随机选择一个控制参数,使用相应随机数值在测试模板中选择对应的指令序列,基于所述指令序列与所述控制参数生成模拟测试指令用例;当性能监控单元计数器获取到的待验证芯片运行该模拟测试指令用例 时得到的测试覆盖率大于预设值时,将选择的所述控制参数作为步骤600中确定的控制参数。In an optional embodiment, the adaptive expert system controller first randomly selects a control parameter, uses the corresponding random value to select the corresponding instruction sequence in the test template, and generates a simulation test based on the instruction sequence and the control parameter Instruction use case; when the test coverage obtained when the chip to be verified obtained by the performance monitoring unit counter runs the simulation test instruction use case is greater than a preset value, the selected control parameter is used as the control parameter determined in step 600.
示例性的,随机选择的一个控制参数可以是在预先设置的一个控制参数集合中选择的,针对不同的待验证芯片,预先设置的控制参数集合中的控制参数可能不同。Exemplarily, a randomly selected control parameter may be selected from a preset control parameter set. For different chips to be verified, the control parameters in the preset control parameter set may be different.
在一种可选的实施方式中,使用相应随机数值从测试模板中选择对应的指令序列,可以基于一个未使用过的随机数值计算多个指令索引值,然后基于计算得到的该多个指令索引值在自适应指令发生器的测试模板中选择对应的指令序列。In an optional embodiment, using a corresponding random value to select a corresponding instruction sequence from the test template, a plurality of instruction index values may be calculated based on an unused random value, and then based on the calculated plurality of instruction indexes The value selects the corresponding command sequence in the test template of the adaptive command generator.
这里的相应随机数值,可以是随机生成的一个之前未使用过的随机数值。The corresponding random value here may be a randomly generated random value that has not been used before.
这里获取待验证芯片运行该模拟测试指令用例后的测试覆盖率,与图3的方法中获取待验证芯片运行模拟测试指令用例后的测试覆盖率的方式相同,这里不再重复赘述。Here, the test coverage rate of the chip to be verified after running the simulation test instruction use case is the same as the method of obtaining the test coverage rate of the chip to be verified after running the analog test instruction use case in the method of FIG. 3, and details are not repeated here.
在一种可选的实施方式中,性能监控单元计数器在获取待验证芯片运行该模拟测试指令用例时得到的测试覆盖率大于预设值后,自适应指令发生器可以控制该待验证芯片运行该模拟测试指令用例M次,在得到的M个测试覆盖率中确定存在N个测试覆盖率大于预设值后,再最终将该模拟测试指令用例中的控制参数作为上述步骤600确定的控制参数,这里的M大于等于N。这样,可以保证选取的控制参数更具有优良性,可以定义为一个优良的控制参数。In an alternative embodiment, after the performance monitoring unit counter obtains the test coverage obtained when the chip to be verified runs the simulation test instruction use case is greater than a preset value, the adaptive command generator may control the chip to be verified to run the Simulate test command use cases M times, after determining that there are N test coverages greater than a preset value in the obtained M test coverages, then finally use the control parameters in the simulation test command use cases as the control parameters determined in step 600 above, Here, M is greater than or equal to N. In this way, the selected control parameter can be guaranteed to be more excellent, and can be defined as an excellent control parameter.
步骤601、基于一个未使用过的随机数值在测试模板中选择对应的指令序列,所述测试模板包括多个指令。Step 601: Select a corresponding instruction sequence in a test template based on an unused random value. The test template includes multiple instructions.
在一种可选的实施方式中,基于一个未使用过的随机数值计算多个指令索引值,并基于计算得到的所述多个指令索引值在所述测试模板中选择对应的指令序列。In an optional embodiment, a plurality of instruction index values are calculated based on an unused random value, and a corresponding instruction sequence is selected in the test template based on the calculated plurality of instruction index values.
步骤602、根据选择的所述指令序列和所述控制参数生成一个实际测试指令用例。Step 602: Generate an actual test instruction use case according to the selected instruction sequence and the control parameter.
这里生成实际测试指令用例的目的是让目标芯片运行该实际测试指令用例,得到测试覆盖率,同样,得到测试覆盖率的方式与图3的方法中获取待验证芯片运行模拟测试指令用例后的测试覆盖率的方式相同,这里不再重复赘述。The purpose of generating actual test instruction use cases here is to let the target chip run the actual test instruction use cases to obtain test coverage. Similarly, the test coverage is obtained in the same way as in FIG. The coverage method is the same, and will not be repeated here.
步骤603、性能监控单元计数器获取目标芯片运行该实际测试指令用例时得到的测试覆盖率大于预设值时,自适应专家系统控制器控制所述目标芯片运行所述实际测试指令用例多次,若出现bug则结束,否则再次执行基于其他未使用过的随机数值选择对应的指令序列的步骤。Step 603: The performance monitoring unit counter obtains the test coverage obtained when the target chip runs the actual test instruction use case when it is greater than a preset value, and the adaptive expert system controller controls the target chip to run the actual test instruction use case multiple times, if If there is a bug, it is over, otherwise the step of selecting the corresponding instruction sequence based on other unused random values is executed again.
在一种可能的实施方式中,当待验证芯片运行该实际测试指令用例时出现bug,则可以在预设控制参数集合中对生成该实际测试指令用例的控制参数进行标记,预设控制参数集合中进行标记的控制参数可以用于在验证其它目标芯片时提供优良的控制参数,这样可以为验证其它目标芯片更好的节省时间。In a possible implementation manner, when a bug occurs when the chip to be verified runs the actual test instruction use case, the control parameter that generates the actual test instruction use case may be marked in the preset control parameter set, and the preset control parameter set The control parameters marked in can be used to provide excellent control parameters when verifying other target chips, which can save time for verifying other target chips.
以上提供的另一种验证芯片的方法,首先确定一个控制参数,然后基于一个未使用过的随机数值和该控制参数生成实际测试指令用例,获取待验证芯片运行该实际测试指令用例得到的测试覆盖率大于预设值后,控制待验证芯片运行该实际测试指令用例多次,如果出现bug则停止验证,如果未出现bug则继续使用其他未使用过的随机数值选择对应的指令序列的步骤,通过一些预设条件,循环验证待验证芯片,从而不需要人员参与,操作简便,能够提高验证效率。Another method for verifying the chip provided above first determines a control parameter, then generates an actual test command use case based on an unused random value and the control parameter, and obtains test coverage obtained by running the actual test command use case for the chip to be verified After the rate is greater than the preset value, control the chip to be verified to run the actual test instruction use case multiple times. If there is a bug, stop the verification. If there is no bug, continue to use other unused random values to select the corresponding instruction sequence. Some preset conditions cyclically verify the chip to be verified, so that no personnel is needed, the operation is simple, and the verification efficiency can be improved.
基于上述图6所示的实施例,本申请实施例还提供了另一种芯片验证的完整方法流程图,参阅图7所示,该示例的流程图具体可以包括:Based on the embodiment shown in FIG. 6 above, the embodiment of the present application further provides a flowchart of another complete method of chip verification. Referring to FIG. 7, the flowchart of this example may specifically include:
步骤700、自适应专家系统控制器在预设的控制参数集合中随机选取一个控制参数P;具体可以为在各个控制参数对应的存储地址的地址集合中随机选取一个存储地址,根据该选取的存储地址获取该控制参数P;Step 700: The adaptive expert system controller randomly selects a control parameter P from the preset control parameter set; specifically, it may randomly select a storage address from the address set of the storage address corresponding to each control parameter, and store the selected storage address according to the selected storage The address obtains the control parameter P;
步骤701、随机数值发生器随机选择一个随机数字X,基于该随机数字X使用预设算法计算得到一组数字序列,该组数字序列可以作为指令索引值序列,然后指令生成模块使用该指令索引值序列从测试模板中依次选取对应的指令,组成一个指令序列;Step 701: The random number generator randomly selects a random number X, and based on the random number X, a set of number sequences is calculated using a preset algorithm, and the set of number sequences can be used as an instruction index value sequence, and then the instruction generation module uses the instruction index value The sequence selects the corresponding instructions in sequence from the test template to form an instruction sequence;
步骤702、自适应专家系统控制器将上述得到的指令序列(Z1,Z2,Z3….Zn)结合控制参数P生成一个模拟测试指令用例,然后控制目标芯片运行该模拟测试指令用例;Step 702: The adaptive expert system controller combines the obtained instruction sequence (Z1, Z2, Z3...Zn) with the control parameter P to generate a simulation test instruction use case, and then controls the target chip to run the simulation test instruction use case;
步骤703、性能监控单元计数器获取目标芯片运行该模拟测试指令用例后输出的测试覆盖率;Step 703: The performance monitoring unit counter obtains the test coverage rate output by the target chip after running the simulation test instruction use case;
步骤704、性能监控单元计数器判断目标芯片运行该模拟测试指令用例后输出的测试覆盖率是否大于预设值,如果是,执行步骤705,否则执行步骤710~711~702,使用步骤700中生成的随机数值X和随机选择的其他控制参数P生成模拟测试指令用例;这里需要说明的是,在步骤711中选择的随机控制参数P是以前没有被选择过的P,比如在步骤701中选择P1,如果执行步骤710时,则会选择P2。Step 704: The performance monitoring unit counter determines whether the test coverage output by the target chip after running the simulation test instruction use case is greater than a preset value. If so, step 705 is performed; otherwise, steps 710-711-702 are performed, using the generated in step 700 Random value X and randomly selected other control parameters P generate simulation test command use cases; it should be noted here that the random control parameter P selected in step 711 is P that has not been selected before, such as selecting P1 in step 701, If step 710 is executed, P2 will be selected.
步骤705、自适应专家系统控制器继续让目标芯片运行该模拟测试指令用例M次,性能监控单元计数器获取M次运行分别输出的M个测试覆盖率结果。Step 705: The adaptive expert system controller continues to let the target chip run the simulation test instruction use case M times, and the performance monitoring unit counter obtains M test coverage results respectively output by the M runs.
步骤706、如果M个测试覆盖率结果中存在N个测试覆盖率结果均大于预设值,确定之前随机选择的控制参数P为良好的控制参数,固定该控制参数P,则执行步骤707;否则执行步骤710~711~702,使用步骤700中生成的随机数值X和随机选择的其他控制参数P生成模拟测试指令用例;这里需要说明的是,在步骤711中选择的随机控制参数P是以前没有被选择过的P,比如在步骤701中选择P1,如果执行步骤710时,则会选择P2。Step 706: If there are N test coverage results among the M test coverage results that are all greater than a preset value, determine that the previously randomly selected control parameter P is a good control parameter, and if the control parameter P is fixed, step 707 is performed; otherwise Perform steps 710 to 711 to 702, use the random value X generated in step 700 and randomly selected other control parameters P to generate a simulation test command use case; here it needs to be noted that the random control parameter P selected in step 711 is not previously available The selected P, for example, P1 is selected in step 701, and if step 710 is executed, P2 is selected.
其中,M>=N,比如M可以为5,N可以为3。Where M>=N, for example, M may be 5, and N may be 3.
步骤707、随机数值发生器重新执行步骤700中的操作,即重新随机选择其他之前未选择过的数字X,这里需要说明的是,再次执行步骤700选择的随机数字X是以前没有被选择过的X,比如第一次执行步骤700选择的X1,如果再次执行步骤700,则会选择X2,基于X2在测试模板中重新索引到新的指令序列(Z1,Z2,Z3….Zn)',并将重新索引到的新的指令序列与确定的良好的控制参数P结合生成实际测试指令用例,控制所述目标芯片运行该实际测试指令用例后得到测试覆盖率,并判断该测试覆盖率是否大于预设值,如果是,则执行步骤708;否则返回步骤701中,随机选择其他随机数值X后继续执行步骤702~706;这里需要说明的是,再次返回步骤701选择的其它随机数值X是以前没有被选择过的X,比如第一次选择X1,如果再次返回步骤701,则会选择X2。 Step 707, the random number generator re-executes the operation in step 700, that is, re-randomly selects other numbers X that have not been previously selected. It should be noted here that the random number X selected in step 700 is not selected before. X, such as X1 selected in step 700 for the first time, if step 700 is executed again, X2 will be selected, and a new instruction sequence (Z1, Z2, Z3....Zn)' will be re-indexed in the test template based on X2, and Combine the re-indexed new instruction sequence with the determined good control parameters P to generate actual test instruction use cases, control the target chip to run the actual test instruction use cases to obtain test coverage, and determine whether the test coverage is greater than the pre-test Set value, if yes, go to step 708; otherwise return to step 701, randomly select other random value X and continue to perform steps 702 to 706; it needs to be explained here that returning to the other random value X selected in step 701 is not before The selected X, for example, selects X1 for the first time, and if it returns to step 701 again, X2 will be selected.
步骤708、自适应专家系统控制器继续控制目标芯片运行该实际测试指令用例K次;Step 708: The adaptive expert system controller continues to control the target chip to run the actual test instruction use case K times;
步骤709、自适应专家系统控制器确定所述目标芯片运行K次该实际测试指令用例的过程中是否出现bug,如果是,则测试结束;否则返回继续执行步骤700;Step 709: The adaptive expert system controller determines whether there is a bug in the actual test instruction use case when the target chip runs K times, and if so, the test ends; otherwise, returns to step 700;
步骤710、指令生成模块使用步骤701中的随机数字X生成指令用例; Step 710. The instruction generation module uses the random number X in step 701 to generate an instruction use case;
步骤711、自适应专家系统控制器随机生成未使用过的控制参数P。Step 711: The adaptive expert system controller randomly generates unused control parameters P.
上述执行完步骤706后,如果M个测试覆盖率结果中存在N个测试覆盖率结果均大于预设值时,则可以在预设控制参数集合中将该控制参数P进行标记,或者对参数集合对应的地址集合中该控制参数P对应的存储地址进行标记,这样在后续对其他芯片进行验证 时,可以优先选择预设控制参数集合中带有所述标记的控制参数,或者优先选择在预设参数集合对应的地址集合中带有标记的存储地址,根据选择的存储地址获取到优良的控制参数,从而降低寻找优良控制参数时花费的时间,提高寻找优良控制参数的效率。After performing step 706 above, if N test coverage results out of the M test coverage results are all greater than the preset value, the control parameter P may be marked in the preset control parameter set, or the parameter set The storage address corresponding to the control parameter P in the corresponding address set is marked, so that in subsequent verification of other chips, the control parameter with the mark in the preset control parameter set may be preferentially selected, or the preset The storage address with a mark in the address set corresponding to the parameter set obtains the excellent control parameters according to the selected storage address, thereby reducing the time spent in searching for the excellent control parameters and improving the efficiency of finding the excellent control parameters.
本申请实施例提供了两种验证芯片的方法,两种方法均需要通过设置一些预设条件,循环验证芯片,从而不需要人员参与,提高验证效率。The embodiments of the present application provide two methods for verifying the chip. Both methods need to set some preset conditions to cyclically verify the chip, thereby eliminating the need for personnel to participate and improving the verification efficiency.
基于以上实施例,本申请实施例还提供了一种装置,该装置用于实现如图3或图5所示的验证芯片的方法。参阅图8所示,该装置800包括:处理单元801和存储单元802,其中所述存储单元802,用于存储程序代码;所述处理单元801,当所述程序代码被所述处理单元801执行时,使得所述处理单元801可以执行图3所示的步骤300至步骤302,或执行图5所示的步骤500至步骤511,或使得所述处理单元801可以执行如图6所示的步骤600至步骤603,或执行图7所示的步骤700至步骤711。Based on the above embodiments, the embodiments of the present application further provide an apparatus for implementing the method for verifying a chip as shown in FIG. 3 or FIG. 5. Referring to FIG. 8, the device 800 includes: a processing unit 801 and a storage unit 802, wherein the storage unit 802 is used to store program code; and the processing unit 801, when the program code is executed by the processing unit 801 When the processing unit 801 can perform the steps 300 to 302 shown in FIG. 3, or the steps 500 to 511 shown in FIG. 5, or the processing unit 801 can perform the steps shown in FIG. 600 to step 603, or perform steps 700 to 711 shown in FIG.
采用本申请实施例提供的装置,确定一个随机数值,再基于该随机数值选择对应的指令序列,基于该指令序列重复执行以下步骤:首先遍历一个未被遍历过的控制参数,然后根据选择的指令序列和遍历得到的控制参数生成一个实际测试指令用例;当获取芯片运行该实际测试指令用例时得到的测试覆盖率大于预设值时,使该芯片运行该实际测试指令用例多次,若出现缺陷bug则结束,否则再次执行遍历所述预设的控制参数集合中一个未被遍历过的控制参数的步骤。这样在验证芯片时,可以根据预设条件循环验证,无需人员参与,操作简单,从而可以提高验证效率。Using the device provided by the embodiment of the present application, a random value is determined, and then the corresponding instruction sequence is selected based on the random value, and the following steps are repeatedly performed based on the instruction sequence: first, traverse a control parameter that has not been traversed, and then according to the selected instruction The control parameters obtained through the sequence and traversal generate an actual test command use case; when the test coverage obtained when the chip is run from the actual test command use case is greater than a preset value, the chip is run the actual test command use case multiple times, if a defect occurs The bug ends, otherwise, the step of traversing a control parameter that has not been traversed in the preset control parameter set is performed again. In this way, when verifying the chip, verification can be performed cyclically according to preset conditions, without the need for human involvement, and the operation is simple, thereby improving verification efficiency.
或者,采用本申请实施例提供的装置,确定一个控制参数,再基于不同随机数值分别选择对应的指令序列,基于每次选择的指令序列重复执行以下步骤:和确定的控制参数生成一个实际测试指令用例;当获取芯片运行该实际测试指令用例时得到的测试覆盖率大于预设值时,使该芯片运行该实际测试指令用例多次,若出现缺陷bug则结束,否则再次执行使用其他随机数值确定的指令序列和该控制参数组合生成实际测试指令用例的步骤。这样在验证芯片时,可以根据预设条件循环验证,无需人员参与,操作简单,从而可以提高验证效率。Or, using the device provided in the embodiment of the present application, determine a control parameter, and then select corresponding instruction sequences based on different random values, and repeat the following steps based on each selected instruction sequence: generate an actual test instruction with the determined control parameters Use case; when the test coverage obtained when the chip runs the actual test instruction use case is greater than the preset value, make the chip run the actual test instruction use case multiple times, if there is a defect bug, it will end, otherwise use another random value to determine The combination of the instruction sequence and the control parameters generates the actual test instruction use case steps. In this way, when verifying the chip, verification can be performed cyclically according to preset conditions, without the need for human involvement, and the operation is simple, thereby improving verification efficiency.
需要说明的是,本申请实施例中对单元的划分是示意性的,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式。在本申请的实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。It should be noted that the division of the units in the embodiments of the present application is schematic, and is only a division of logical functions. In actual implementation, there may be another division manner. The functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units may be integrated into one unit. The above integrated unit may be implemented in the form of hardware or software functional unit.
所述集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)或处理器(processor)执行本申请各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(read-only memory,ROM)、随机存取存储器(random access memory,RAM)、磁碟或者光盘等各种可以存储程序代码的介质。If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it may be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application essentially or part of the contribution to the existing technology or all or part of the technical solution can be embodied in the form of a software product, the computer software product is stored in a storage medium , Including several instructions to enable a computer device (which may be a personal computer, server, or network device, etc.) or processor to execute all or part of the steps of the methods described in the embodiments of the present application. The aforementioned storage media include: U disk, mobile hard disk, read-only memory (ROM), random access memory (random access memory, RAM), magnetic disk or optical disk and other media that can store program codes .
基于以上实施例,本申请实施例还提供了一种装置,参阅图9所示,该装置900包括:处理器901,可选的,还包括存储器902,所述处理器901可以是中央处理器(central processing unit,CPU),网络处理器(network processor,NP)或者CPU和NP的组合。所 述处理器901还可以进一步包括硬件芯片。上述硬件芯片可以是专用集成电路(application-specific integrated circuit,ASIC),可编程逻辑器件(programmable logic device,PLD)或其组合。上述PLD可以是复杂可编程逻辑器件(complex programmable logic device,CPLD),现场可编程逻辑门阵列(field-programmable gate array,FPGA),通用阵列逻辑(generic array logic,GAL)或其任意组合。Based on the above embodiment, an embodiment of the present application further provides an apparatus. Referring to FIG. 9, the apparatus 900 includes: a processor 901, and optionally, a memory 902. The processor 901 may be a central processor (central processing unit, CPU), network processor (network processor, NP) or a combination of CPU and NP. The processor 901 may further include a hardware chip. The hardware chip may be an application-specific integrated circuit (ASIC), a programmable logic device (PLD) or a combination thereof. The PLD may be a complex programmable logic device (complex programmable logic device (CPLD), a field programmable logic gate array (field-programmable gate array, FPGA), a general array logic (generic array logic, GAL), or any combination thereof.
所述处理器901以及所述存储器902之间相互连接。可选的,所述处理器901以及所述存储器902通过总线903相互连接;所述总线903可以是外设部件互连标准(Peripheral Component Interconnect,PCI)总线或扩展工业标准结构(Extended Industry Standard Architecture,EISA)总线等。所述总线可以分为地址总线、数据总线、控制总线等。为便于表示,图9中仅用一条粗线表示,但并不表示仅有一根总线或一种类型的总线。The processor 901 and the memory 902 are connected to each other. Optionally, the processor 901 and the memory 902 are connected to each other through a bus 903; the bus 903 may be a peripheral component interconnection standard (Peripheral Component Interconnect, PCI) bus or an extended industry standard architecture (Extended Industry Standard Architecture) , EISA) bus and so on. The bus can be divided into an address bus, a data bus, and a control bus. For ease of representation, only a thick line is used in FIG. 9, but it does not mean that there is only one bus or one type of bus.
图9所示的装置可以是图2中的自适应指令发生器,也可以是图2中自适应指令发生器中的一个控制部件或控制单元。上述图8中的处理单元801可以基于这里的处理器901来实现,存储单元802可以基于这里的存储器902来实现。处理器901和存储器902的具体作用和执行原理,请参照上述方法实施例的详细阐述,这里不再重复赘述。The device shown in FIG. 9 may be the adaptive command generator in FIG. 2 or a control component or control unit in the adaptive command generator in FIG. 2. The processing unit 801 in FIG. 8 described above may be implemented based on the processor 901 herein, and the storage unit 802 may be implemented based on the memory 902 herein. For specific functions and execution principles of the processor 901 and the memory 902, please refer to the detailed description of the foregoing method embodiments, and details are not repeated here.
本领域内的技术人员应明白,本申请的实施例可提供为方法、系统、或计算机程序产品。因此,本申请可采用完全硬件实施例、完全软件实施例、或结合软件和硬件方面的实施例的形式。而且,本申请可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器、CD-ROM、光学存储器等)上实施的计算机程序产品的形式。Those skilled in the art should understand that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware. Moreover, the present application may take the form of a computer program product implemented on one or more computer usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer usable program code.
本申请是参照根据本申请实施例的方法、设备(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。This application is described with reference to flowcharts and/or block diagrams of methods, devices (systems), and computer program products according to embodiments of the application. It should be understood that each flow and/or block in the flowchart and/or block diagram and a combination of the flow and/or block in the flowchart and/or block diagram may be implemented by computer program instructions. These computer program instructions can be provided to the processor of a general-purpose computer, special-purpose computer, embedded processing machine, or other programmable data processing device to produce a machine that enables the generation of instructions executed by the processor of the computer or other programmable data processing device An apparatus for realizing the functions specified in one block or multiple blocks of one flow or multiple flows of a flowchart and/or one block or multiple blocks of a block diagram.
这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。These computer program instructions may also be stored in a computer-readable memory that can guide a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture including an instruction device, the instructions The device implements the functions specified in one block or multiple blocks of the flowchart one flow or multiple flows and/or block diagrams.
这些计算机程序指令也可装载到计算机或其他可编程数据处理设备上,使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。These computer program instructions can also be loaded onto a computer or other programmable data processing device, so that a series of operating steps are performed on the computer or other programmable device to produce computer-implemented processing, which is executed on the computer or other programmable device The instructions provide steps for implementing the functions specified in one block or multiple blocks of the flowchart one flow or multiple flows and/or block diagrams.
显然,本领域的技术人员可以对本申请实施例进行各种改动和变型而不脱离本申请实施例的范围。这样,倘若本申请实施例的这些修改和变型属于本申请权利要求及其等同技术的范围之内,则本申请也意图包含这些改动和变型在内。Obviously, those skilled in the art can make various modifications and variations to the embodiments of the present application without departing from the scope of the embodiments of the present application. In this way, if these modifications and variations of the embodiments of the present application fall within the scope of the claims of the present application and their equivalent technologies, the present application is also intended to include these modifications and variations.

Claims (28)

  1. 一种芯片验证方法,其特征在于,包括:A chip verification method is characterized by including:
    确定一个随机数值;Determine a random value;
    基于该随机数值在测试模板中选择对应的指令序列,所述测试模板包括多个指令;Select a corresponding instruction sequence in the test template based on the random value, the test template includes multiple instructions;
    基于所述指令序列重复执行以下步骤:Repeat the following steps based on the instruction sequence:
    遍历预设的控制参数集合中一个未被遍历过的控制参数,根据选择的所述指令序列和遍历得到的控制参数生成一个实际测试指令用例;Traverse a control parameter in the preset control parameter set that has not been traversed, and generate an actual test command use case according to the selected instruction sequence and the control parameter obtained by traversing;
    当获取第一芯片运行该实际测试指令用例时得到的测试覆盖率大于预设值时,控制所述第一芯片运行所述实际测试指令用例多次,若出现缺陷bug则结束,否则再次执行遍历所述预设的控制参数集合中一个未被遍历过的控制参数的步骤。When the test coverage obtained when the first chip runs the actual test instruction use case is greater than a preset value, the first chip is controlled to run the actual test instruction use case multiple times, and if there is a defect bug, it ends, otherwise the traversal is performed again A step of a control parameter in the preset control parameter set that has not been traversed.
  2. 如权利要求1所述的方法,其特征在于,所述确定一个随机数值,包括:The method of claim 1, wherein the determining a random value comprises:
    随机生成一个随机数值;Randomly generate a random value;
    基于该随机数值在所述测试模板中选择对应的指令序列,根据选择的所述指令序列与默认控制参数生成模拟测试指令用例;Select a corresponding instruction sequence in the test template based on the random value, and generate a simulation test instruction use case according to the selected instruction sequence and default control parameters;
    当获取所述第一芯片运行该模拟测试指令用例时得到的测试覆盖率大于预设值时,将生成的该随机数值作为确定的一个随机数值。When the test coverage obtained when the first chip runs the simulation test instruction use case is greater than a preset value, the generated random value is used as a determined random value.
  3. 如权利要求1或2所述的方法,其特征在于,所述基于该随机数值在测试模板中选择对应的指令得到指令序列,包括:The method according to claim 1 or 2, wherein the selecting a corresponding instruction in the test template based on the random value to obtain an instruction sequence includes:
    基于所述随机数值计算多个指令索引值,并基于计算得到的所述多个指令索引值在所述测试模板中选择对应的指令序列。A plurality of instruction index values are calculated based on the random value, and a corresponding instruction sequence is selected in the test template based on the calculated plurality of instruction index values.
  4. 如权利要求1~3任一所述的方法,其特征在于,若再次执行遍历所述预设的控制参数集合中一个未被遍历过的控制参数的步骤之后,还包括:The method according to any one of claims 1 to 3, characterized in that, if the step of traversing a control parameter in the preset control parameter set that has not been traversed is performed again, the method further includes:
    若在所述控制参数集合中遍历不到未被遍历的控制参数,则返回执行确定其他随机数值的步骤。If the control parameters that are not traversed cannot be traversed in the control parameter set, then return to the step of determining other random values.
  5. 如权利要求2所述的方法,其特征在于,将生成的该随机数值作为确定的一个随机数值之前,还包括:The method according to claim 2, wherein before using the generated random value as a determined random value, the method further comprises:
    当获取所述第一芯片运行该模拟测试指令用例时得到的测试覆盖率大于预设值后,控制所述第一芯片运行所述模拟测试指令用例M次,分别得到M个测试覆盖率;When the test coverage obtained when the first chip runs the simulation test instruction use case is greater than a preset value, control the first chip to run the simulation test instruction use case M times to obtain M test coverages respectively;
    确定所述M个测试覆盖率中存在至少N个测试覆盖率大于预设值;所述M和N均为正整数,且M>=N。It is determined that at least N of the M test coverage ratios are greater than a preset value; both M and N are positive integers, and M>=N.
  6. 如权利要求1或2所述的方法,其特征在于,还包括:The method according to claim 1 or 2, further comprising:
    若出现bug,将确定的所述随机数值存储至随机数集合中,所述随机数集合用于在验证第二芯片时提供随机数值。If a bug occurs, the determined random value is stored in a random number set, and the random number set is used to provide a random value when verifying the second chip.
  7. 如权利要求2所述的方法,其特征在于,所述默认控制参数为所述预设的控制参数集合中的一个控制参数。The method of claim 2, wherein the default control parameter is a control parameter in the preset control parameter set.
  8. 如权利要求1~7任一所述的方法,其特征在于,所述测试覆盖率通过下列方式中的至少一种确定:The method according to any one of claims 1 to 7, wherein the test coverage is determined by at least one of the following ways:
    使用读系统状态寄存器到通用寄存器MRS指令读取性能监控单元PMU寄存器得到测试覆盖率,作为所述第一芯片运行该实际测试指令用例的测试覆盖率;或Use the read system status register to general register MRS instruction to read the performance monitoring unit PMU register to obtain the test coverage, as the test coverage of the first chip to run the actual test instruction use case; or
    使用MRS指令读取特殊寄存器得到测试覆盖率,作为所述第一芯片运行该实际测试指令用例的测试覆盖率;或Use the MRS instruction to read the special register to obtain the test coverage, as the test coverage of the first chip running the actual test instruction use case; or
    使用装入指令读取所述第一芯片的内存得到测试覆盖率,作为所述第一芯片运行该实际测试指令用例的测试覆盖率。A load instruction is used to read the memory of the first chip to obtain a test coverage, which is used as the test coverage of the first chip to run the actual test instruction use case.
  9. 一种芯片验证方法,其特征在于,包括:A chip verification method is characterized by including:
    确定一个控制参数;Determine a control parameter;
    基于一个未使用过的随机数值在测试模板中选择对应的指令序列,所述测试模板包括多个指令;Select a corresponding instruction sequence in a test template based on an unused random value, the test template includes multiple instructions;
    根据选择的所述指令序列和所述控制参数生成一个实际测试指令用例;Generating an actual test instruction use case according to the selected instruction sequence and the control parameters;
    获取第一芯片运行该实际测试指令用例时得到的测试覆盖率大于预设值时,控制所述第一芯片运行所述实际测试指令用例多次,若出现缺陷Bug则结束,否则再次执行基于其他未使用过的随机数值选择对应的指令序列的步骤。When the test coverage obtained when the first chip runs the actual test instruction use case is greater than a preset value, the first chip is controlled to run the actual test instruction use case multiple times, and if a bug occurs, it is ended, otherwise the execution based on other The unused random values select the steps of the corresponding instruction sequence.
  10. 如权利要求9所述的方法,其特征在于,所述确定一个控制参数,包括:The method of claim 9, wherein the determining a control parameter comprises:
    随机选择一个控制参数;Randomly select a control parameter;
    使用相应随机数值在测试模板中选择对应的指令序列,基于所述指令序列与所述控制参数生成模拟测试指令用例;Use a corresponding random value to select a corresponding instruction sequence in the test template, and generate a simulation test instruction use case based on the instruction sequence and the control parameters;
    当获取所述第一芯片运行该模拟测试指令用例时得到的测试覆盖率大于预设值时,将选择的所述控制参数作为确定的一个控制参数。When the test coverage obtained when the first chip runs the simulation test instruction use case is greater than a preset value, the selected control parameter is used as a determined control parameter.
  11. 如权利要求9或10所述的方法,其特征在于,所述基于一个未使用过的随机数值在测试模板中选择对应的指令序列,包括:The method according to claim 9 or 10, wherein the selecting a corresponding instruction sequence in the test template based on an unused random value includes:
    基于一个未使用过的随机数值计算多个指令索引值,并基于计算得到的所述多个指令索引值在所述测试模板中选择对应的指令序列。A plurality of instruction index values are calculated based on an unused random value, and a corresponding instruction sequence is selected in the test template based on the calculated plurality of instruction index values.
  12. 如权利要求10所述的方法,其特征在于,将选择的所述控制参数作为确定的一个控制参数之前,还包括:The method according to claim 10, wherein before using the selected control parameter as a determined control parameter, the method further comprises:
    当获取所述第一芯片运行该模拟测试指令用例时得到的测试覆盖率大于预设值后,控制所述第一芯片运行所述模拟测试指令用例M次,分别得到的M个测试覆盖率;When the test coverage obtained when the first chip runs the simulation test instruction use case is greater than a preset value, control the first chip to run the simulation test instruction use case M times, and obtain M test coverages respectively;
    确定所述M个测试覆盖率中存在至少N个测试覆盖率大于预设值;所述M和N均为正整数,且M>=N。It is determined that at least N of the M test coverage ratios are greater than a preset value; both M and N are positive integers, and M>=N.
  13. 如权利要求9或10所述的方法,其特征在于,还包括:The method according to claim 9 or 10, further comprising:
    若出现bug,将确定的所述控制参数存储至控制参数集合中,所述控制参数集合用于在验证第二芯片时提供控制参数。If a bug occurs, the determined control parameters are stored in a control parameter set, which is used to provide control parameters when verifying the second chip.
  14. 如权利要求9~13任一所述的方法,其特征在于,所述测试覆盖率通过下列方式中的至少一种确定:The method according to any one of claims 9 to 13, wherein the test coverage is determined by at least one of the following ways:
    使用读系统状态寄存器到通用寄存器MRS指令读取性能监控单元PMU寄存器得到测试覆盖率,作为所述第一芯片运行该实际测试指令用例的测试覆盖率;或Use the read system status register to general register MRS instruction to read the performance monitoring unit PMU register to obtain the test coverage, as the test coverage of the first chip to run the actual test instruction use case; or
    使用MRS指令读取特殊寄存器得到测试覆盖率,作为所述第一芯片运行该实际测试指令用例的测试覆盖率;或Use the MRS instruction to read the special register to obtain the test coverage, as the test coverage of the first chip running the actual test instruction use case; or
    使用装入指令读取所述第一芯片的内存得到测试覆盖率,作为所述第一芯片运行该实际测试指令用例的测试覆盖率。A load instruction is used to read the memory of the first chip to obtain a test coverage, which is used as the test coverage of the first chip to run the actual test instruction use case.
  15. 一种装置,其特征在于,包括:处理器和存储器,所述处理器与存储器耦合;An apparatus is characterized by comprising: a processor and a memory, the processor and the memory are coupled;
    所述存储器,用于存储计算机程序;The memory is used to store computer programs;
    所述处理器,用于执行所述存储器中存储的计算机程序,以使得所述装置执行确定一个随机数值;基于该随机数值在测试模板中选择对应的指令序列,所述测试模板包括多个指令;基于所述指令序列重复执行以下步骤:遍历预设的控制参数集合中一个未被遍历过的控制参数,根据选择的所述指令序列和遍历得到的控制参数生成一个实际测试指令用例;当获取第一芯片运行该实际测试指令用例时得到的测试覆盖率大于预设值时,控制所述第一芯片运行所述实际测试指令用例多次,若所述第一芯片出现缺陷bug则结束,否则再次执行遍历所述预设的控制参数集合中一个未被遍历过的控制参数的步骤。The processor is configured to execute a computer program stored in the memory to cause the device to execute determining a random value; based on the random value, a corresponding instruction sequence is selected in a test template, and the test template includes multiple instructions ; Repeat the following steps based on the instruction sequence: traverse a control parameter in the preset control parameter set that has not been traversed, and generate an actual test instruction use case according to the selected instruction sequence and the control parameters obtained by traversal; When the test coverage obtained when the first chip runs the actual test instruction use case is greater than a preset value, the first chip is controlled to run the actual test instruction use case multiple times, and if the first chip has a defect bug, it ends, otherwise The step of traversing a control parameter that has not been traversed in the preset control parameter set is performed again.
  16. 如权利要求15所述的装置,其特征在于,所述处理器确定一个随机数值时,具体用于:The apparatus according to claim 15, wherein the processor is specifically used to:
    随机生成一个随机数值;Randomly generate a random value;
    基于该随机数值在所述测试模板中选择对应的指令序列,根据选择的所述指令序列与默认控制参数生成模拟测试指令用例;Select a corresponding instruction sequence in the test template based on the random value, and generate a simulation test instruction use case according to the selected instruction sequence and default control parameters;
    当获取所述第一芯片运行该模拟测试指令用例时得到的测试覆盖率大于预设值时,将生成的该随机数值作为确定的一个随机数值。When the test coverage obtained when the first chip runs the simulation test instruction use case is greater than a preset value, the generated random value is used as a determined random value.
  17. 如权利要求15或16所述的装置,其特征在于,所述处理器基于该随机数值在测试模板中选择对应的指令序列时,具体用于:The device according to claim 15 or 16, wherein when the processor selects the corresponding instruction sequence in the test template based on the random value, it is specifically used to:
    基于所述随机数值计算多个指令索引值,并基于计算得到的所述多个指令索引值在所述测试模板中选择对应的指令序列。A plurality of instruction index values are calculated based on the random value, and a corresponding instruction sequence is selected in the test template based on the calculated plurality of instruction index values.
  18. 如权利要求15~17任一所述的装置,其特征在于,所述处理器还用于:The apparatus according to any one of claims 15 to 17, wherein the processor is further used to:
    若在所述控制参数集合中遍历不到未被遍历的控制参数,则返回执行确定其他随机数值的步骤。If the control parameters that are not traversed cannot be traversed in the control parameter set, then return to the step of determining other random values.
  19. 如权利要求16所述的装置,其特征在于,所述处理器还用于:The apparatus of claim 16, wherein the processor is further configured to:
    将生成的该随机数值作为确定的一个随机数值之前,获取所述第一芯片运行该模拟测试指令用例时得到的测试覆盖率大于预设值后,控制所述第一芯片运行所述模拟测试指令用例M次,分别得到M个测试覆盖率;Before using the generated random value as a determined random value, after obtaining the test coverage obtained when the first chip runs the simulation test instruction use case is greater than a preset value, control the first chip to run the simulation test instruction Use cases M times, get M test coverage respectively;
    确定所述M个测试覆盖率中存在至少N个测试覆盖率大于预设值;所述M和N均为正整数,且M>=N。It is determined that at least N of the M test coverage ratios are greater than a preset value; both M and N are positive integers, and M>=N.
  20. 如权利要求15或16所述的装置,其特征在于,所述处理器还用于:The apparatus according to claim 15 or 16, wherein the processor is further used to:
    若所述第一芯片出现bug,将确定的所述随机数值存储至随机数集合中,所述随机数集合用于在验证第二芯片时提供随机数值。If the first chip has a bug, the determined random value is stored in a random number set, and the random number set is used to provide a random value when verifying the second chip.
  21. 如权利要求15~20任一所述的装置,其特征在于,所述测试覆盖率通过下列方式中的至少一种确定:The device according to any one of claims 15 to 20, wherein the test coverage is determined by at least one of the following ways:
    所述处理器使用读系统状态寄存器到通用寄存器MRS指令读取性能监控单元PMU寄存器得到测试覆盖率,作为所述第一芯片运行该实际测试指令用例的测试覆盖率;或The processor uses the read system status register to general register MRS instruction to read the performance monitoring unit PMU register to obtain the test coverage, as the test coverage of the first chip running the actual test instruction use case; or
    所述处理器使用MRS指令读取特殊寄存器得到测试覆盖率,作为所述第一芯片运行该实际测试指令用例的测试覆盖率;或The processor uses the MRS instruction to read the special register to obtain the test coverage, which is used as the test coverage of the first chip to run the actual test instruction use case; or
    所述处理器使用装入指令读取所述第一芯片的内存得到测试覆盖率,作为所述第一芯片运行该实际测试指令用例的测试覆盖率。The processor uses the load instruction to read the memory of the first chip to obtain the test coverage, which is used as the test coverage of the first chip to run the actual test instruction use case.
  22. 一种装置,其特征在于,包括:处理器和存储器,所述处理器与存储器耦合;An apparatus is characterized by comprising: a processor and a memory, the processor and the memory are coupled;
    所述存储器,用于存储计算机程序;The memory is used to store computer programs;
    所述处理器,用于执行所述存储器中存储的计算机程序,以使得所述装置执行确定一个控制参数;基于一个未使用过的随机数值在测试模板中选择对应的指令序列,所述测试模板包括多个指令;根据选择的所述指令序列和所述控制参数生成一个实际测试指令用例;获取第一芯片运行该实际测试指令用例时得到的测试覆盖率大于预设值时,控制所述第一芯片运行所述实际测试指令用例多次,若所述第一芯片出现缺陷Bug则结束,否则再次执行基于其他未使用过的随机数值选择对应的指令序列的步骤。The processor is configured to execute a computer program stored in the memory to cause the device to execute determining a control parameter; select a corresponding instruction sequence in a test template based on an unused random value, and the test template Including a plurality of instructions; generating an actual test instruction use case according to the selected instruction sequence and the control parameters; when the test coverage obtained when the first chip runs the actual test instruction use case is greater than a preset value, controlling the first A chip runs the actual test instruction use case multiple times, and ends if the first chip has a bug, otherwise it executes the step of selecting the corresponding instruction sequence based on other unused random values.
  23. 如权利要求22所述的装置,其特征在于,所述处理器确定一个控制参数时,具体用于:The apparatus of claim 22, wherein the processor is specifically used to:
    随机选择一个控制参数;Randomly select a control parameter;
    使用相应随机数值在测试模板中选择对应的指令序列,基于所述指令序列与所述控制参数生成模拟测试指令用例;当获取所述第一芯片运行该模拟测试指令用例时得到的测试覆盖率大于预设值时,将选择的所述控制参数作为确定的一个控制参数。Use the corresponding random value to select the corresponding instruction sequence in the test template, and generate a simulation test instruction use case based on the instruction sequence and the control parameters; when the first chip is acquired to run the simulation test instruction use case, the test coverage obtained is greater than When the value is preset, the selected control parameter is used as a determined control parameter.
  24. 如权利要求22或23所述的装置,其特征在于,所述处理器基于一个未使用过的随机数值在测试模板中选择对应的指令序列时,具体用于:The device according to claim 22 or 23, characterized in that when the processor selects the corresponding instruction sequence in the test template based on an unused random value, it is specifically used to:
    基于一个未使用过的随机数值计算多个指令索引值,并基于计算得到的所述多个指令索引值在所述测试模板中选择对应的指令序列。A plurality of instruction index values are calculated based on an unused random value, and a corresponding instruction sequence is selected in the test template based on the calculated plurality of instruction index values.
  25. 如权利要求23所述的装置,其特征在于,所述处理器还用于:The apparatus of claim 23, wherein the processor is further configured to:
    将选择的所述控制参数作为确定的一个控制参数之前,获取所述第一芯片运行该模拟测试指令用例时得到的测试覆盖率大于预设值后,控制所述第一芯片运行所述模拟测试指令用例M次,分别得到的M个测试覆盖率;Before using the selected control parameter as a determined control parameter, after obtaining the test coverage obtained when the first chip runs the simulation test instruction use case is greater than a preset value, control the first chip to run the simulation test Instruction M use cases M times, respectively obtained M test coverage;
    确定所述M个测试覆盖率中存在至少N个测试覆盖率大于预设值;所述M和N均为正整数,且M>=N。It is determined that at least N of the M test coverage ratios are greater than a preset value; both M and N are positive integers, and M>=N.
  26. 如权利要求24或25所述的装置,其特征在于,所述处理器还用于:The apparatus according to claim 24 or 25, wherein the processor is further used to:
    若所述第一芯片出现bug,将确定的所述控制参数存储至控制参数集合中,所述控制参数集合用于在验证第二芯片时提供控制参数。If the first chip has a bug, the determined control parameters are stored in a control parameter set, and the control parameter set is used to provide control parameters when verifying the second chip.
  27. 如权利要求22~26任一所述的装置,其特征在于,所述测试覆盖率通过下列方式中的至少一种确定:The device according to any one of claims 22 to 26, wherein the test coverage is determined by at least one of the following ways:
    所述处理器使用读系统状态寄存器到通用寄存器MRS指令读取性能监控单元PMU寄存器得到测试覆盖率,作为所述第一芯片运行该实际测试指令用例的测试覆盖率;或The processor uses the read system status register to general register MRS instruction to read the performance monitoring unit PMU register to obtain the test coverage, as the test coverage of the first chip running the actual test instruction use case; or
    所述处理器使用MRS指令读取特殊寄存器得到测试覆盖率,作为所述第一芯片运行该实际测试指令用例的测试覆盖率;或The processor uses the MRS instruction to read the special register to obtain the test coverage, which is used as the test coverage of the first chip to run the actual test instruction use case; or
    所述处理器使用装入指令读取所述第一芯片的内存得到测试覆盖率,作为所述第一芯片运行该实际测试指令用例的测试覆盖率。The processor uses the load instruction to read the memory of the first chip to obtain the test coverage, which is used as the test coverage of the first chip to run the actual test instruction use case.
  28. 一种计算机可读存储介质,其特征在于,包括程序或指令,当所述程序或指令在计算机上运行时,如权利要求1-14中任意一项所述的方法被执行。A computer-readable storage medium, characterized in that it includes a program or instruction, and when the program or instruction runs on a computer, the method according to any one of claims 1-14 is executed.
PCT/CN2018/119613 2018-12-06 2018-12-06 Chip verification method and device WO2020113526A1 (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201880099920.XA CN113168364A (en) 2018-12-06 2018-12-06 Chip verification method and device
PCT/CN2018/119613 WO2020113526A1 (en) 2018-12-06 2018-12-06 Chip verification method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2018/119613 WO2020113526A1 (en) 2018-12-06 2018-12-06 Chip verification method and device

Publications (1)

Publication Number Publication Date
WO2020113526A1 true WO2020113526A1 (en) 2020-06-11

Family

ID=70973436

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2018/119613 WO2020113526A1 (en) 2018-12-06 2018-12-06 Chip verification method and device

Country Status (2)

Country Link
CN (1) CN113168364A (en)
WO (1) WO2020113526A1 (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2023216077A1 (en) * 2022-05-09 2023-11-16 华为技术有限公司 Attestation method, apparatus and system
CN115308518B (en) * 2022-10-10 2022-12-23 杭州三海电子有限公司 Parameter measurement sequence determination method and system for burn-in circuit
CN115576821B (en) * 2022-10-20 2024-01-19 沐曦科技(成都)有限公司 Verification method and device, electronic equipment and storage medium
CN116362057B (en) * 2023-05-08 2023-11-10 上海奎芯集成电路设计有限公司 Random verification method, device, electronic equipment and storage medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102902834A (en) * 2011-07-29 2013-01-30 炬力集成电路设计有限公司 Verification method and verification system of SOC (System on Chip)
CN107704384A (en) * 2017-09-14 2018-02-16 郑州云海信息技术有限公司 A kind of convergent method and system of speed-up chip functional verification
US20180136277A1 (en) * 2014-04-18 2018-05-17 Breker Verification Systems Scheduling Of Scenario Models For Execution Within Different Computer Threads And Scheduling Of Memory Regions For Use With The Scenario Models

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102902834A (en) * 2011-07-29 2013-01-30 炬力集成电路设计有限公司 Verification method and verification system of SOC (System on Chip)
US20180136277A1 (en) * 2014-04-18 2018-05-17 Breker Verification Systems Scheduling Of Scenario Models For Execution Within Different Computer Threads And Scheduling Of Memory Regions For Use With The Scenario Models
CN107704384A (en) * 2017-09-14 2018-02-16 郑州云海信息技术有限公司 A kind of convergent method and system of speed-up chip functional verification

Also Published As

Publication number Publication date
CN113168364A (en) 2021-07-23

Similar Documents

Publication Publication Date Title
WO2020113526A1 (en) Chip verification method and device
JP4266226B2 (en) Design verification system and method using checker validated selectively
US8719789B2 (en) Measuring coupling between coverage tasks and use thereof
CN109032879B (en) Multi-core processor memory access data detection and verification system and method
JP7029873B2 (en) Artificial intelligence chip test methods, equipment, equipment, and storage media
US8892386B2 (en) Method and apparatus for post-silicon testing
US8365114B2 (en) Logic modification synthesis
US10592703B1 (en) Method and system for processing verification tests for testing a design under test
US10394699B1 (en) Method and system for reusing a refinement file in coverage grading
Tsai et al. Integrated adaptive reasoning testing framework with automated fault detection
US11132286B1 (en) Dynamic reordering of test case execution
Marynowski et al. Testing MapReduce-based systems
US10579761B1 (en) Method and system for reconstructing a graph presentation of a previously executed verification test
CN115176233B (en) Performing tests in deterministic order
Friedler et al. Effective post-silicon failure localization using dynamic program slicing
US11514219B1 (en) System and method for assertion-based formal verification using cached metadata
Hsieh et al. On application of data mining in functional debug
Lin et al. A probabilistic analysis method for functional qualification under mutation analysis
CN109933948B (en) Form verification method, device, form verification platform and readable storage medium
Ali et al. Parallel path delay fault simulation for multi/many-core processors with SIMD units
JP2014164646A (en) Logic verification method for information processor and program
US10733345B1 (en) Method and system for generating a validation test
Keng et al. Automated debugging of missing assumptions
US11442839B2 (en) Runtime metrics based test ordering
WO2019142266A1 (en) Test case generation device, test case generation method, and test case generation program

Legal Events

Date Code Title Description
NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 18942071

Country of ref document: EP

Kind code of ref document: A1