Processor testing method, device, electronic device and readable storage medium

By using preset configuration files to generate and execute instruction flows, the problem of inefficient construction of instruction flows in processor unit test verification is solved, and a more efficient test process is achieved.

CN118642905BActive Publication Date: 2024-11-12BEIJING INSTITUTE OF OPEN SOURCE CHIP
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411112100.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-08-14
Publication Date
2024-11-12
Estimated Expiration
2044-08-14

AI Technical Summary

Technical Problem

In the prior art, processor unit test verification requires manual construction of instruction flows, resulting in low work efficiency.

Method used

Generate instruction streams through preset configuration files and execute instruction streams using a virtual processor to obtain the processor's test results, avoiding manual construction of instruction streams.

Benefits of technology

Improves the work efficiency of processor unit test verification and reduces the time overhead of manually building instruction flows.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118642905B_ABST
    Figure CN118642905B_ABST
Patent Text Reader

Abstract

The present application provides a processor testing method, device, electronic device and readable storage medium, which relate to the field of processor testing technology. Firstly, according to the parameters corresponding to each instruction attribute in a preset configuration file, instructions corresponding to each instruction attribute are generated and an instruction stream is formed. Then, the instruction stream is executed by a preset virtual processor to obtain the test result of the processor, so as to realize unit test verification of the processor. In this process, there is no need to manually construct the instruction stream, which improves work efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of processor testing, and in particular to a processor testing method, device, electronic device and readable storage medium. Background Art

[0002] The unit testing (UT) verification of the processor (CPU, Central Processing Unit) is to test and verify the modules of the processor, such as the test and verification of the control module and execution module of the processor, and the test and verification of the decoding module, renaming module, and reordering module in the control module of the processor.

[0003] Unit test verification of a processor requires construction of an instruction stream. In the prior art, workers manually construct the instruction stream for unit test verification of the processor.

[0004] In the process of implementing the present application, the inventors found that there are at least the following problems in the prior art: since the staff manually constructs the instruction stream for unit testing and verification of the processor, the work efficiency is low. Summary of the invention

[0005] The embodiments of the present application provide a test method, device, electronic device and readable storage medium for a processor to solve the problem of low work efficiency in the prior art due to the manual construction of the instruction stream for unit test verification of the processor by the staff.

[0006] In a first aspect, an embodiment of the present application provides a method for testing a processor, the method comprising:

[0007] According to the parameters corresponding to each instruction attribute in the preset configuration file, the instructions corresponding to each instruction attribute are generated and an instruction stream is formed; the configuration file includes the corresponding relationship between the instruction attribute and the parameters; the parameters of the instruction attribute are positively correlated with the number of instructions corresponding to the instruction attribute;

[0008] Executing the instruction stream through a preset virtual processor to obtain a test result of the processor;

[0009] The virtual processor is a program for simulating a processor generated according to a preset code, and the preset code is used to describe the working mechanism of the processor.

[0010] In a second aspect, an embodiment of the present application further provides a processor testing device, the device comprising:

[0011] A generation module, used to generate instructions corresponding to each instruction attribute and form an instruction stream according to the parameters corresponding to each instruction attribute in a preset configuration file; the configuration file includes the corresponding relationship between the instruction attributes and the parameters; the parameters of the instruction attributes are positively correlated with the number of instructions corresponding to the instruction attributes;

[0012] A first acquisition module, used for executing the instruction stream through a preset virtual processor to acquire a test result of the processor;

[0013] The virtual processor is a program for simulating a processor generated according to a preset code, and the preset code is used to describe the working mechanism of the processor.

[0014] In a third aspect, an embodiment of the present application further provides an electronic device, including a processor;

[0015] a memory for storing instructions executable by the processor;

[0016] The processor is configured to execute the instructions to implement the method of the first aspect.

[0017] In a fourth aspect, an embodiment of the present application further provides a computer-readable storage medium, which, when instructions in the computer-readable storage medium are executed by a processor of an electronic device, enables the electronic device to execute the method of the first aspect.

[0018] In an embodiment of the present application, firstly, instructions corresponding to each instruction attribute are generated and an instruction stream is formed according to the parameters corresponding to each instruction attribute in a preset configuration file, and then the instruction stream is executed by a preset virtual processor to obtain the test result of the processor to realize unit test verification of the processor. In this process, there is no need to manually construct the instruction stream, thereby improving work efficiency.

[0019] The above description is only an overview of the technical solution of the present application. In order to more clearly understand the technical means of the present application, it can be implemented in accordance with the contents of the specification. In order to make the above and other purposes, features and advantages of the present application more obvious and easy to understand, the specific implementation methods of the present application are listed below. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0021] Figure 1It is a flowchart of a test method for a processor provided by an embodiment of the present invention;

[0022] Figure 2 is a flowchart of another processor testing method provided by an embodiment of the present invention;

[0023] Figure 3 is a block diagram of a processor testing device provided by an embodiment of the present invention;

[0024] Figure 4 is a block diagram of an electronic device provided by an embodiment of the present invention;

[0025] Figure 5 is a block diagram of another electronic device according to another embodiment of the present invention. DETAILED DESCRIPTION

[0026] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0027] The terms "first", "second", etc. in the specification and claims of the present application are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable under appropriate circumstances, so that the embodiments of the present application can be implemented in an order other than those illustrated or described here, and the objects distinguished by "first", "second", etc. are generally a class, and the number of objects is not limited. For example, the first object can be one or more. In addition, the term "and / or" in the specification and claims is used to describe the association relationship of associated objects, indicating that three kinds of relationships can exist, for example, A and / or B can be represented: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the front and back associated objects are a kind of "or" relationship. In the embodiment of the present application, the term "multiple" refers to two or more, and other quantifiers are similar.

[0028] The following describes in detail the processor testing method provided in the embodiment of the present application through specific embodiments and application scenarios in conjunction with the accompanying drawings.

[0029] Figure 1 is a flowchart of a method for testing a processor provided in an embodiment of the present application, such as Figure 1 As shown, the method may include:

[0030] Step 101, according to the parameters corresponding to each instruction attribute in the preset configuration file, generate instructions corresponding to each instruction attribute and form an instruction stream; the configuration file includes the corresponding relationship between the instruction attribute and the parameters; the parameters of the instruction attribute are positively correlated with the number of instructions corresponding to the instruction attribute.

[0031] It should be noted that the number of instructions corresponding to the instruction attribute is the number of instructions corresponding to the instruction attribute generated according to the parameter corresponding to the instruction attribute in the preset configuration file; the parameter corresponding to the instruction attribute may be the weight corresponding to the instruction attribute, such as 50%; in the configuration file, the instruction attribute and the parameter are one-to-one corresponding; the instruction stream refers to a series of instructions executed by the processor in sequence or in a specific logical order during the execution of a computer program, and specifically, the instruction stream may be an instruction stream used for unit test verification of the processor;

[0032] Instruction attributes are classification attributes of instructions, including the first instruction type, whether the type is memory access, whether the type is related to immediate values, the second instruction type (basic instruction type), the functional category of the instruction, the number of source operands, whether the destination operand can be a 0 register, whether the type is related to the control and status register (csr, Control and Status Register), the interactive mode type of the instruction, the number of micro-instructions (μop, i.e. micro op, micro-operation), and the type related to the micro-architecture, etc.

[0033] Among them, the first instruction type includes INT, FP, V, C, B, K, JMP, etc. INT instructions are integer instructions, which refer to instructions for processing fixed-point numbers, mainly including integer addition instructions, integer subtraction instructions, etc. FP instructions are floating-point instructions, which refer to instructions for processing floating-point numbers (i.e. real numbers). These instructions usually include floating-point addition, subtraction, multiplication, division and other operations; V instructions are vector instructions, which refer to instructions for processing vector data. In modern processors, these instructions are used to perform vector operations, such as vector addition, vector multiplication, etc., and are usually used for graphics processing and scientific computing; C instructions are compressed instructions, i.e. 16 binary bits (bit) instructions, which are compressed forms of 32-bit instructions; BK instructions include bit operation (B) instructions and scalar encryption (K) instructions; JMP instructions are jump instructions, including unconditional jump instructions and conditional jump instructions, which are used to change the execution order of the program and directly jump to the specified address to continue execution;

[0034] The types of memory access include LOAD, STORE, and NORMAL. The LOAD instruction is used to read data from the memory into the processor's register; the STORE instruction is used to write data from the processor's register to the memory; the NORMAL instruction refers to the instruction that performs conventional arithmetic or logical operations, such as addition, subtraction, logical AND, logical OR, etc.

[0035] The types related to immediate values ​​include imm_correlated and imm_uncorrelated. The imm_correlated instruction is an instruction with one or more immediate operands in the instruction; the imm_uncorrelate instruction is an instruction with no immediate operands in the instruction.

[0036] The second instruction type (basic instruction type) includes R, I, S, B, U, J, V, CR, CSS, CI, CL, CS, CA, CB, CJ, and N. The R instruction is a register type instruction, namely R-Type (Register), involving two register operands and a target register; the I instruction is an immediate type instruction, namely I-Type (Immediate) instruction, involving a register operand and an immediate number; the S instruction is a storage type instruction, namely S-Type (Store) instruction, which is usually used to store data from a register to memory; the B instruction is used for conditional jumps; the U instruction is used for long immediate numbers; the J instruction is used for unconditional jumps; the V instruction is a vector type instruction, namely V-Type (Vector) instruction, which is used to process vector data; the CR instruction is a compressed register instruction; the CSS instruction is a compressed stack-relative store instruction; the CI instruction is a compressed immediate instruction; the CL instruction is a compressed load instruction; the CS instruction is a compressed store instruction. store instruction; CA instruction is a compressed arithmetic instruction; CB instruction is a compressed branch instruction; CJ instruction is a compressed jump instruction; N instruction is an illegal instruction;

[0037] The functional categories of instructions include atomic, arithmetic, logical, comparison & branch, shift, control, etc. Atomic instructions refer to instructions that can ensure that only one processor can perform these operations at any time in a multi-processor system. Atomic operations are usually used to manage shared resources and prevent data competition. These operations include atomic exchange, atomic comparison and exchange, atomic addition, etc. Arithmetic instructions are used to perform basic mathematical operations, such as addition, subtraction, multiplication, division, and modulo operations; Logical instructions are used to perform logical operations, including logical AND, logical OR, logical NOT, logical XOR, etc. R), etc. These operations do not involve numerical calculations, but bit operations, and are often used for bit operations and logical decisions of control flow; Compare & Branch instructions include comparison instructions and branch instructions. Compare instructions are used to compare two values ​​and set the processor's status flags according to the comparison results. Branch instructions change the execution flow of the program according to these status flags; Shift instructions are used to perform bit shift operations on data, including logical left shift, logical right shift, arithmetic right shift, etc. These operations can be used for data format conversion, numerical multiplication and division simplification, etc.; Control instructions are used to control the execution flow and status management of the program. This includes system calls, exception handling, instruction synchronization, etc.;

[0038] The number of source operands includes 0, 1, 2, 3, etc. Instructions with 0 source operands do not require any input operands and are usually used to perform operations that do not require input data; instructions with 1 source operand only require one input operand; instructions with 2 source operands require two input operands and involve operations on two operands; instructions with 3 source operands require three input operands;

[0039] The types of instructions that can or cannot use the destination operand as register 0 include instructions whose destination operand is register 0 and instructions whose destination operand is not register 0. In some processor architectures, certain registers (such as register 0) may have special uses or be reserved and are not allowed to be used as destination operands. If the destination operand of an instruction can be register 0, this usually means that the result of the instruction will be stored in register 0.

[0040] Whether it is related to the control and status register includes control and status register related, control and status register not related. If an instruction is CSR related, it means that it directly operates or depends on the control and status register;

[0041] The interactive mode types of instructions include floating point-fixed point, vector-fixed point, vector-floating point, etc. The floating point-fixed point (Floating-Point to Integer) instruction involves the conversion between floating point numbers (i.e. real numbers) and fixed point numbers (i.e. integers); the vector-fixed point (Vector to Integer) instruction involves the conversion between vector data (i.e. a set of numerical values) and fixed point numbers; the vector-floating point (Vector to Floating-Point) instruction involves the conversion between vector data and floating point numbers;

[0042] The number of split microinstructions includes 0, 1, 2, 3, 4, 5, 6, etc. The number of split microinstructions is the number of microinstructions that an instruction can be split into. For example, the number of split microinstructions of an instruction is 2, which is used to represent that the instruction can be split into 2 microinstructions. For example, a multiplication and addition instruction can be split into two microinstructions of multiplication and addition for execution.

[0043] The microarchitecture-related types are attributes extracted from the processor's design microarchitecture, that is, attributes customized according to different processor design schemes. For example, instructions related to some signals in the register transfer level (RTL) microarchitecture belong to the microarchitecture-related type of instructions.

[0044] In some embodiments, the preset configuration file may be a pre-set initial configuration file.

[0045] In an embodiment of the present application, according to the parameters corresponding to each instruction attribute in the preset configuration file, instructions corresponding to each instruction attribute are generated and an instruction stream is formed, and then the instruction stream is executed by the preset virtual processor to obtain the test result of the processor.

[0046] Step 102: Execute the instruction stream through a preset virtual processor to obtain a test result of the processor.

[0047] The virtual processor is a program for simulating a processor generated according to a preset code, and the preset code is used to describe the working mechanism of the processor.

[0048] Specifically, the preset code may be a register transfer level code in a Verilog (a hardware description language) code; the virtual processor is a program for simulating a processor compiled and generated by a simulator according to the preset code; and the test result is information of a signal generated by executing an instruction stream by the virtual processor.

[0049] It should be noted that the instruction stream is executed by the virtual processor to simulate the execution of the instruction stream by the processor.

[0050] In the embodiment of the present application, the instruction stream is executed by a preset virtual processor to obtain the test result of the processor to implement unit test verification of the processor.

[0051] To summarize, in an embodiment of the present application, firstly, according to the parameters corresponding to each instruction attribute in the preset configuration file, instructions corresponding to each instruction attribute are generated and an instruction stream is formed, and then the instruction stream is executed by a preset virtual processor to obtain the test result of the processor to realize unit test verification of the processor, and in this process, there is no need to manually construct the instruction stream, thereby improving work efficiency.

[0052] Figure 2 is a flowchart of the specific steps of a processor testing method provided in an embodiment of the present application, such as Figure 2 As shown, the method may include:

[0053] Step 201, according to a preset number of instruction generation, according to the parameters corresponding to each instruction attribute in a preset configuration file, generate instructions corresponding to each instruction attribute to form an instruction stream including the number of instructions generated; the configuration file includes the corresponding relationship between the instruction attributes and the parameters; the parameters of the instruction attributes are positively correlated with the number of instructions corresponding to the instruction attributes.

[0054] It should be noted that the number of instructions generated, that is, the number of instructions that need to be generated, is equal to the number of instructions in the instruction stream.

[0055] In an embodiment of the present application, by generating a preset number of instructions and according to the parameters corresponding to each instruction attribute in a preset configuration file, an instruction stream including the number of instructions generated is formed, and then the instruction stream is executed by a preset virtual processor to obtain the test result of the processor.

[0056] Step 202: Execute the instruction stream through a preset virtual processor to obtain a test result of the processor.

[0057] The virtual processor is a program for simulating a processor generated according to a preset code, and the preset code is used to describe the working mechanism of the processor.

[0058] The implementation of this step is similar to the implementation process of the above sub-step 102, and will not be repeated here.

[0059] Optionally, in some embodiments, the method further comprises the following steps:

[0060] Step 203: sum the parameters corresponding to each instruction attribute in the configuration file to obtain a parameter sum.

[0061] In the embodiment of the present application, the parameter corresponding to each instruction attribute in the configuration file is summed to obtain the parameter sum, and then the parameter corresponding to the instruction attribute is divided by the parameter sum to obtain the usage probability of the instruction attribute.

[0062] Step 201 specifically includes the following sub-steps:

[0063] Sub-step 2011: Divide the parameter corresponding to the instruction attribute by the sum of the parameters to obtain the usage probability of the instruction attribute.

[0064] It should be noted that the usage probability of an instruction attribute is positively correlated with the number of instructions corresponding to the generated instruction attribute; the usage probability of an instruction attribute is positively correlated with the parameter corresponding to the instruction attribute.

[0065] In an embodiment of the present application, the usage probability of the instruction attribute is obtained by dividing the parameter corresponding to the instruction attribute by the sum of the parameters, and then in each instruction generation cycle, the first target instruction attribute is determined from the instruction attributes according to the usage probability of each instruction attribute.

[0066] Sub-step 2012: In each instruction generation cycle, according to the usage probability of each of the instruction attributes, a first target instruction attribute is determined from the instruction attributes, and a randomization function is called to randomly select instructions of the first target instruction attribute from a preset instruction library corresponding to the first target instruction attribute; the number of the instruction generation cycles is equal to the number of instructions generated.

[0067] It should be noted that each instruction attribute in the configuration file has a preset instruction library, and the instruction attribute corresponds to the preset instruction library one by one. The preset instruction library corresponding to the instruction attribute includes multiple instructions corresponding to the instruction attribute.

[0068] Specifically, the randomization function may be a "randomize()" function; in each instruction generation cycle, an instruction with a first target instruction attribute is generated.

[0069] In an embodiment of the present application, by determining a first target instruction attribute from the instruction attributes according to the usage probability of each instruction attribute in each instruction generation cycle, and calling a randomization function, randomly selecting instructions of the first target instruction attribute from a preset instruction library corresponding to the first target instruction attribute, and then forming an instruction stream according to the instructions of the first target instruction attribute generated in each instruction generation cycle.

[0070] Sub-step 2013: forming the instruction stream according to the instructions of the first target instruction attribute generated in each instruction generation cycle.

[0071] In the embodiment of the present application, an instruction stream is formed by generating instructions of the first target instruction attribute according to each instruction generation cycle, and then the instruction stream is executed by a preset virtual processor to obtain a test result of the processor.

[0072] Taking sub-steps 2011 to 2012 as examples, for example, the configuration file includes the correspondence between INT and INT parameters (50%), the correspondence between FP and FP parameters (30%), the correspondence between LOAD and LOAD parameters (20%), the correspondence between STORE and STORE parameters (20%), the correspondence between imm_correlated and imm_correlated parameters (70%), and the correspondence between imm_uncorrelated and imm_uncorrelated parameters (10%).

[0073] The sum of the parameters is 200% (obtained by 50%+30%+20%+20%+70%+10%), so the probability of using INT is 0.25 (obtained by 50% divided by 200%), the probability of using FP is 0.15 (obtained by 30% divided by 200%), the probability of using LOAD is 0.10 (obtained by 20% divided by 200%), the probability of using STORE is 0.10 (obtained by 20% divided by 200%), the probability of using imm_correlated is 0.35 (obtained by 70% divided by 200%), and the probability of using imm_uncorrelated is 0.05 (obtained by 10% divided by 200%).

[0074] In each instruction generation cycle, the first target instruction attribute is determined from the instruction attributes according to the usage probability of each instruction attribute, that is, in each instruction generation cycle, the probability of INT becoming the first target instruction attribute is 0.25, the probability of FP becoming the first target instruction attribute is 0.15, the probability of LOAD becoming the first target instruction attribute is 0.10, the probability of STORE becoming the first target instruction attribute is 0.10, the probability of imm_correlated becoming the first target instruction attribute is 0.35, and the probability of imm_uncorrelated becoming the first target instruction attribute is 0.05.

[0075] For example, the preset instruction library corresponding to INT includes integer addition instructions and integer subtraction instructions. If INT becomes the first target instruction attribute in the first instruction generation cycle, the randomization function is called to randomly select instructions with the first target instruction attribute from the preset instruction library corresponding to INT, such as randomly selecting integer addition instructions.

[0076] Assuming that the number of instructions generated is 100, there are a total of 100 instruction generation cycles. In each instruction generation cycle, an instruction with the first target instruction attribute is generated. Finally, a total of 100 instructions are generated, and the 100 instructions are formed into an instruction stream, which includes the 100 instructions.

[0077] The instruction stream can be obtained by executing sub-steps 2011 to 2012.

[0078] Optionally, in some embodiments, the method further comprises the following steps:

[0079] Step 204: Call a randomization function to randomly select the instruction generation quantity from a preset quantity range.

[0080] For example, the preset quantity range is 100 to 1000, and the randomization function is called to randomly select 999 instructions to generate from the preset quantity range.

[0081] In an embodiment of the present application, by calling a randomization function, the number of instructions to be generated is randomly selected from a preset number range, and then according to the preset number of instructions to be generated and the parameters corresponding to each instruction attribute in the preset configuration file, instructions corresponding to each instruction attribute are generated to form an instruction stream including the number of instructions to be generated.

[0082] Optionally, in some embodiments, after step 202, the method further includes the following steps:

[0083] Step 205: According to the test result, obtain a preset coverage rate of the virtual processor executing the instruction stream and a signal coverage rate of each preset signal.

[0084] In an embodiment of the present application, by obtaining the preset coverage rate of the virtual processor execution instruction stream and the signal coverage rate of each preset signal according to the test results, and then judging whether the current test of the processor is valid by comparing the preset coverage rate with the first threshold, that is, when the preset coverage rate is less than the first threshold, it is determined that the current test of the processor is invalid; when the preset coverage rate is greater than or equal to the first threshold, it is determined that the current test of the processor is valid; and when the preset coverage rate is less than the first threshold, the preset signal with a signal coverage rate less than the second threshold is determined as the target signal, and from the preset correspondence between the instruction attribute and the preset signal, the second target instruction attribute corresponding to the target signal is obtained, and the parameter of the second target instruction attribute in the configuration file is increased by the preset value to form a configuration file for the next test of the processor for the next test.

[0085] Optionally, in some embodiments, the preset coverage includes switching coverage, function coverage and row coverage.

[0086] It should be noted that toggle coverage is a test coverage indicator used to measure the impact of changes in specific inputs or conditions on system behavior during the test process, and mainly focuses on the impact of changes in inputs or states on processor behavior; function coverage is a test coverage indicator used to measure whether the test cases cover all functional points of the processor's module, and mainly focuses on whether each functional point of the processor's module is tested; line coverage is a test coverage indicator, which indicates the proportion of the number of lines of code executed in the source code to the total number of lines of code during the test process.

[0087] In an embodiment of the present application, each preset coverage rate corresponds to a first threshold value, that is, the switching coverage rate has a first threshold value corresponding to the switching coverage rate, the functional coverage rate has a first threshold value corresponding to the functional coverage rate, and the line coverage rate has a first threshold value corresponding to the line coverage rate. According to the test results, the switching coverage rate, functional coverage rate and line coverage rate of the virtual processor executing the instruction stream can be obtained.

[0088] Optionally, in some embodiments, step 205 includes the following sub-steps:

[0089] Sub-step 2051: using a preset electronic design automation tool, according to the test result, obtaining a preset coverage rate of a preset virtual processor executing the instruction stream and a signal coverage rate of each preset signal.

[0090] It should be noted that Electronic Design Automation (EDA) tools are a type of software and hardware tools used to assist in the design and manufacture of electronic systems. Their main functions include circuit design and simulation, PCB automatic layout and routing, logic compilation, simplification, segmentation, synthesis, optimization, layout, routing and simulation.

[0091] There are multiple preset signals, and the preset signals are signals generated when the processor executes instructions. The signal coverage of the preset signals is used to measure whether the states of each signal line in the processor design are fully tested during the test process. For example, a signal usually has two states, namely high level (1) and low level (0). The signal coverage focuses on whether these signal states are fully explored in the test. If the high level and low level states of the preset signal are both in the test results, the signal coverage of the preset signal is 100%; the signal coverage of the preset signal can also be defined in other forms.

[0092] In an embodiment of the present application, the test results are analyzed by an electronic design automation tool to obtain a preset coverage rate of a preset virtual processor execution instruction stream and a signal coverage rate of each preset signal, and then by comparing the preset coverage rate with a first threshold, it is determined whether the current test of the processor is valid, that is, when the preset coverage rate is less than the first threshold, the current test of the processor is determined to be invalid; when the preset coverage rate is greater than or equal to the first threshold, the current test of the processor is determined to be valid; and when the preset coverage rate is less than the first threshold, a preset signal having a signal coverage rate less than a second threshold is determined as a target signal, and from a preset correspondence between the instruction attribute and the preset signal, a second target instruction attribute corresponding to the target signal is obtained, and the parameter of the second target instruction attribute in the configuration file is increased by a preset value to form a configuration file for the next test of the processor for the next test.

[0093] Step 206: When the preset coverage is less than the first threshold, determine that the current test of the processor is invalid, determine the preset signal whose signal coverage is less than the second threshold as the target signal, and obtain the first target instruction attribute corresponding to the target signal from the preset correspondence between the instruction attribute and the preset signal, and increase the parameter of the first target instruction attribute in the configuration file by a preset value to form a configuration file for the next test of the processor to perform the next test.

[0094] It should be noted that if the preset coverage rate is less than the first threshold, it means that the preset coverage rate has not reached the expected value. In this case, it can be judged that the current test of the processor is invalid and the instruction stream needs to be readjusted and retested. After multiple processor tests, the preset coverage rate is greater than or equal to the first threshold, that is, the preset coverage rate reaches the expected value. In this case, it can be judged that the test of the processor is valid. The staff can analyze the test results of the processor to obtain the actual situation of the processor module.

[0095] The parameter of the second target instruction attribute in the configuration file is increased by a preset value to form a configuration file for the next test of the processor, that is, the configuration file for the next test of the processor is formed after the parameter of the second target instruction attribute in the configuration file of the current test is updated. For example, in the current configuration file (configuration file A), the parameter of the second target instruction attribute is 50%, and the preset value is 10%. Then, the parameter of the second target instruction attribute in configuration file A is increased by the preset value to obtain the configuration file for the next test of the processor (configuration file B). In configuration file B, the parameter of the second target instruction attribute is 60% (obtained by adding 50% to 10%).

[0096] In the preset correspondence between instruction attributes and preset signals, one instruction attribute corresponds to one or more preset signals, or: one preset signal corresponds to one or more instruction attributes. When the number of second target instruction attributes corresponding to the target signal is multiple, the parameter of each second target instruction attribute in the configuration file is increased by the preset value.

[0097] The preset correspondence between instruction attributes and preset signals can be preset by staff. In other embodiments, the preset correspondence between instruction attributes and preset signals can be obtained from a preset processor test. Specifically, the test results are obtained through a preset processor test, and the test results are analyzed through an electronic design automation tool to obtain a coverage file of the preset virtual processor executing the instruction stream, the coverage file including the preset coverage and the signal coverage of each preset signal, and then the coverage file is analyzed through a python script to obtain the preset correspondence between the instruction attributes and the preset signals.

[0098] Specifically, the second threshold may be 100%.

[0099] In an embodiment of the present application, by determining that the current test of the processor is invalid when the preset coverage is less than the first threshold, the preset signal with a signal coverage less than the second threshold is determined as the target signal, and the second target instruction attribute corresponding to the target signal is obtained from the preset correspondence between the instruction attribute and the preset signal, and the parameter of the second target instruction attribute in the configuration file is increased by the preset value to form a configuration file for the next test of the processor to perform the next test of the processor, that is, according to the parameter corresponding to each instruction attribute in the new configuration file, the instruction corresponding to each instruction attribute is generated and an instruction stream is formed, and then the instruction stream is executed through the preset virtual processor to obtain a new test result of the processor. Since the parameter of the second target instruction attribute is increased, the probability of using the second target instruction attribute is increased, and then the number of instructions of the second target instruction attribute is increased, thereby increasing the possibility of generating the target signal when the instruction of the second target instruction attribute is executed, that is, the possibility of improving the signal coverage of the target signal is increased.

[0100] For example, according to the parameter corresponding to each instruction attribute a1 in the preset configuration file (configuration file A), the instruction corresponding to each instruction attribute a1 is generated and the instruction stream a2 is formed, the instruction stream a2 is executed by the preset virtual processor, and the test result of the processor (test result a3) is obtained, and according to the test result a3, the preset coverage a4 of the virtual processor executing the instruction stream a2 and the signal coverage a5 of each preset signal are obtained, and when the preset coverage a4 is less than the first threshold, it is determined that the current test of the processor (test H1) is invalid, and the preset signal whose signal coverage a5 is less than the second threshold is determined as the target signal a6, and the second target instruction attribute a7 corresponding to the target signal a6 is obtained from the preset corresponding relationship between the instruction attribute and the preset signal;

[0101] The parameter of the second target instruction attribute a7 in the configuration file A is increased by a preset value to form a configuration file (configuration file B) for the next test of the processor, so as to perform the next test (test H2) of the processor, that is, according to the parameter corresponding to each instruction attribute b1 in the preset configuration file (configuration file B), the instruction corresponding to each instruction attribute b1 is generated and an instruction stream b2 is formed, the instruction stream b2 is executed by a preset virtual processor, and the test result of the processor (test result b3) is obtained, and according to the test result b3, the preset coverage rate b4 of the virtual processor executing the instruction stream b2 and the signal coverage rate b5 of each preset signal are obtained, and when the preset coverage rate b4 is less than the first threshold, the current test of the processor is determined (test result b4). H2) is invalid, the preset signal whose signal coverage b5 is less than the second threshold is determined as the target signal b6, and the second target instruction attribute b7 corresponding to the target signal b6 is obtained from the preset correspondence between the instruction attribute and the preset signal, and the parameter of the second target instruction attribute b7 in the configuration file B is increased by the preset value to form a configuration file (configuration file C) for the next test of the processor, so as to perform the next test of the processor (test H3), ..., and so on, until the current preset coverage is greater than or equal to the first threshold, that is, the preset coverage reaches the expected value, it can be judged that the current test of the processor is valid, and the staff can analyze the current test results of the processor to know the true situation of the processor module.

[0102] Step 207: When the preset coverage is greater than or equal to a first threshold, determine that the current test of the processor is valid.

[0103] In an embodiment of the present application, by determining that the current test of the processor is valid when the preset coverage is greater than or equal to the first threshold, it is indicated that the preset coverage reaches the expected value. The staff can analyze the test results of the processor this time to obtain the actual situation of the processor module.

[0104] It should be noted that after confirming that the current test of the processor is valid, the staff can cover a small number of uncovered preset signals through directional testing to improve the preset coverage rate.

[0105] By executing steps 205 to 207, it is possible to determine whether the current test of the processor is valid, and if the current test of the processor is invalid, update the configuration file and perform the next test of the processor to improve the preset coverage.

[0106] Optionally, in some embodiments, after step 205, the method further includes the following steps:

[0107] Step 208: When the preset coverage rate corresponding to the current test of the processor is the same as the preset coverage rate corresponding to the historical test of the processor, determine that the current test of the processor is valid.

[0108] In some embodiments, when preset coverage rates of multiple (for example, three) consecutive tests of a processor are the same, it is determined that the current test of the processor is valid.

[0109] In an embodiment of the present application, the validity of the current test of the processor is determined when the preset coverage corresponding to the current test of the processor is the same as the preset coverage corresponding to the historical test of the processor. That is, after multiple tests of the processor, the preset coverage has not changed, indicating that the preset coverage has been increased to a larger value. At this time, it can be determined that the current test of the processor is valid. The staff can analyze the test results of the processor this time to understand the actual situation of the processor module to avoid repeated testing of the processor with the same preset coverage, thereby improving work efficiency.

[0110] Optionally, in some embodiments, the preset coverage is a row coverage; after step 205, the method further includes the following steps:

[0111] Step 209: When the preset coverage is less than the first threshold, call a randomization function to randomly generate new parameters for each of the instruction attributes in the configuration file to form a configuration file for the next test so as to perform the next test.

[0112] It should be noted that the configuration file for the next test of the processor includes new parameters for each instruction attribute.

[0113] For example, the current configuration file (configuration file C) includes parameters for each instruction attribute. The randomization function is called to randomly generate new parameters for each instruction attribute in configuration file C to obtain the configuration file (configuration file D) for the next test of the processor. Configuration file D includes new parameters for each instruction attribute.

[0114] In an embodiment of the present application, by calling a randomization function when a preset coverage rate is less than a first threshold value, new parameters for each instruction attribute in the configuration file are randomly generated to form a configuration file for the next test so as to perform the next test, thereby improving the line coverage rate by testing the processor multiple times based on different configuration files.

[0115] In the related technology, the open source instruction generator is only suitable for the full-link test of the entire processor core (integration test, IT, Integration Testing), and is not suitable for the unit test verification of the processor. The staff manually constructs the instruction stream for the unit test verification of the processor, which is time-consuming. Especially for multiple unit test verifications of the processor, in each unit test verification of the processor, the staff needs to manually rebuild the instruction stream for the unit test verification of the processor, which results in time consumption and reduces work efficiency.

[0116] Through the embodiments of the present application, an instruction generator for unit test verification of the processor can be implemented, that is, according to the parameters corresponding to each instruction attribute in the preset configuration file, instructions corresponding to each instruction attribute are generated and an instruction stream is formed, and based on the instruction stream formed by the instruction generator for unit test verification of the processor, through multiple regression tests, the preset coverage reaches the expected value, and the regression test is stopped at this time. In this process, no manual processing by staff is required, which improves work efficiency.

[0117] The embodiment of the present application also provides a processor testing platform (system) using the aforementioned processor testing method. The specific implementation process of the processor testing platform is similar to the implementation process of the aforementioned processor testing method, which will not be repeated here.

[0118] To summarize, in an embodiment of the present application, firstly, according to the parameters corresponding to each instruction attribute in the preset configuration file, instructions corresponding to each instruction attribute are generated and an instruction stream is formed, and then the instruction stream is executed by a preset virtual processor to obtain the test result of the processor to realize unit test verification of the processor, and in this process, there is no need to manually construct the instruction stream, thereby improving work efficiency.

[0119] refer to Figure 3 , which shows a processor testing device provided in an embodiment of the present application, the device comprising:

[0120] A generating module 301 is used to generate instructions corresponding to each instruction attribute and form an instruction stream according to the parameters corresponding to each instruction attribute in a preset configuration file; the configuration file includes the corresponding relationship between the instruction attribute and the parameters; the parameters of the instruction attribute are positively correlated with the number of instructions corresponding to the instruction attribute;

[0121] A first acquisition module 302 is used to execute the instruction stream through a preset virtual processor to obtain a test result of the processor;

[0122] The virtual processor is a program for simulating a processor generated according to a preset code, and the preset code is used to describe the working mechanism of the processor.

[0123] Optionally, the generating module 301 specifically includes:

[0124] The generation submodule is used to generate instructions corresponding to each instruction attribute according to a preset instruction generation quantity and a parameter corresponding to each instruction attribute in the configuration file, so as to form an instruction stream including instructions of the instruction generation quantity.

[0125] Optionally, the device further comprises:

[0126] A second acquisition module is used to sum the parameters corresponding to each instruction attribute in the configuration file to obtain a parameter sum;

[0127] Generate submodules, including:

[0128] an acquisition unit, configured to divide the parameter corresponding to the instruction attribute by the sum of the parameters to obtain a usage probability of the instruction attribute;

[0129] The processing unit is used to determine a first target instruction attribute from the instruction attributes according to the usage probability of each of the instruction attributes in each instruction generation cycle, and call a randomization function to randomly select an instruction of the first target instruction attribute from a preset instruction library corresponding to the first target instruction attribute; the number of the instruction generation cycles is equal to the number of instruction generation;

[0130] A generation unit is used to form the instruction stream according to the instructions of the first target instruction attribute generated in each instruction generation cycle.

[0131] Optionally, the device further comprises:

[0132] The selection module is used to call the randomization function to randomly select the instruction generation quantity from a preset quantity range.

[0133] Optionally, the device further comprises:

[0134] A third acquisition module, configured to acquire, according to the test result, a preset coverage rate of the instruction stream executed by the virtual processor and a signal coverage rate of each preset signal;

[0135] A first processing module is used to determine that the current test of the processor is invalid when the preset coverage rate is less than the first threshold value, determine the preset signal whose signal coverage rate is less than the second threshold value as the target signal, and obtain a second target instruction attribute corresponding to the target signal from a preset correspondence between the instruction attribute and the preset signal, and increase the parameter of the second target instruction attribute in the configuration file by a preset value to form a configuration file for the next test of the processor, so as to perform the next test;

[0136] The first determination module is used to determine that the current test of the processor is valid when the preset coverage is greater than or equal to a first threshold.

[0137] Optionally, the third acquisition module specifically includes:

[0138] The acquisition submodule is used to acquire, through a preset electronic design automation tool and according to the test result, a preset coverage rate of the instruction stream executed by a preset virtual processor and a signal coverage rate of each preset signal.

[0139] Optionally, the device further comprises:

[0140] The second determination module is used to determine that the current test of the processor is valid when a preset coverage rate corresponding to the current test of the processor is the same as the preset coverage rate corresponding to the historical test of the processor.

[0141] Optionally, the preset coverage includes switching coverage, function coverage and row coverage.

[0142] Optionally, the preset coverage rate is a row coverage rate; and the device further includes:

[0143] The second processing module is used to call a randomization function when the preset coverage is less than a first threshold, randomly generate new parameters for each instruction attribute in the configuration file, and form a configuration file for the next test to perform the next test.

[0144] In summary, in the embodiments of the present application, firstly, according to the parameters corresponding to each instruction attribute in the preset configuration file, the instructions corresponding to each instruction attribute are generated and an instruction stream is formed, and then the instruction stream is executed by the preset virtual processor to obtain the test result of the processor to realize the unit test verification of the processor, and in this process, there is no need to manually construct the instruction stream, which improves work efficiency.

[0145] Figure 4is a block diagram of an electronic device 600 according to an exemplary embodiment. For example, the electronic device 600 may be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, a fitness device, a personal digital assistant, etc.

[0146] Reference Figure 4 , the electronic device 600 may include one or more of the following components: a processing component 602 , a memory 604 , a power component 606 , a multimedia component 608 , an audio component 610 , an input / output (I / O) interface 612 , a sensor component 614 , and a communication component 616 .

[0147] The processing component 602 generally controls the overall operation of the electronic device 600, such as operations associated with display, phone calls, data communications, camera operations, and recording operations. The processing component 602 may include one or more processors 620 to execute instructions to complete all or part of the steps of the above-mentioned method. In addition, the processing component 602 may include one or more modules to facilitate the interaction between the processing component 602 and other components. For example, the processing component 602 may include a multimedia module to facilitate the interaction between the multimedia component 608 and the processing component 602.

[0148] The memory 604 is used to store various types of data to support the operation of the electronic device 600. Examples of such data include instructions for any application or method operating on the electronic device 600, contact data, phone book data, messages, pictures, multimedia, etc. The memory 604 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.

[0149] The power supply component 606 provides power to the various components of the electronic device 600. The power supply component 606 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to the electronic device 600.

[0150] The multimedia component 608 includes a screen that provides an output interface between the electronic device 600 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundaries of the touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 608 includes a front camera and / or a rear camera. When the electronic device 600 is in an operating mode, such as a shooting mode or a multimedia mode, the front camera and / or the rear camera may receive external multimedia data. Each front camera and rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.

[0151] The audio component 610 is used to output and / or input audio signals. For example, the audio component 610 includes a microphone (MIC), and when the electronic device 600 is in an operation mode, such as a call mode, a recording mode, and a voice recognition mode, the microphone is used to receive an external audio signal. The received audio signal can be further stored in the memory 604 or sent via the communication component 616. In some embodiments, the audio component 610 also includes a speaker for outputting audio signals.

[0152] I / O interface 612 provides an interface between processing component 602 and peripheral interface modules, such as keyboards, click wheels, buttons, etc. These buttons may include but are not limited to: home button, volume button, start button, and lock button.

[0153] The sensor assembly 614 includes one or more sensors for providing various aspects of status assessment for the electronic device 600. For example, the sensor assembly 614 can detect the open / closed state of the electronic device 600, the relative positioning of the components, such as the display and keypad of the electronic device 600, and the sensor assembly 614 can also detect the position change of the electronic device 600 or a component of the electronic device 600, the presence or absence of contact between the user and the electronic device 600, the orientation or acceleration / deceleration of the electronic device 600, and the temperature change of the electronic device 600. The sensor assembly 614 may include a proximity sensor configured to detect the presence of a nearby object without any physical contact. The sensor assembly 614 may also include an optical sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 614 may also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.

[0154] The communication component 616 is used to facilitate wired or wireless communication between the electronic device 600 and other devices. The electronic device 600 can access a wireless network based on a communication standard, such as WiFi, a carrier network (such as 2G, 3G, 4G or 5G), or a combination thereof. In an exemplary embodiment, the communication component 616 receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 616 also includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.

[0155] In an exemplary embodiment, the electronic device 600 may be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components to implement a processor testing method provided in an embodiment of the present application.

[0156] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is also provided, such as a memory 604 including instructions, and the instructions can be executed by a processor 620 of an electronic device 600 to perform the above method. For example, the non-transitory storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.

[0157] Figure 5 is a block diagram of an electronic device 700 according to an exemplary embodiment. For example, the electronic device 700 may be provided as a server. Figure 5 The electronic device 700 includes a processing component 722, which further includes one or more processors, and a memory resource represented by a memory 732 for storing instructions that can be executed by the processing component 722, such as an application. The application stored in the memory 732 may include one or more modules, each corresponding to a set of instructions. In addition, the processing component 722 is configured to execute instructions to perform a processor testing method provided in an embodiment of the present application.

[0158] The electronic device 700 may also include a power supply component 726 configured to perform power management of the electronic device 700, a wired or wireless network interface 750 configured to connect the electronic device 700 to a network, and an input / output (I / O) interface 758. The electronic device 700 may operate based on an operating system stored in the memory 732, such as Windows Server™, Mac OS X™, Unix™, Linux™, FreeBSD™ or the like.

[0159] An embodiment of the present application also provides a computer program product, including a computer program, and when the computer program is executed by a processor, the processor testing method is implemented.

[0160] Those skilled in the art will readily appreciate other embodiments of the present application after considering the specification and practicing the application disclosed herein. The present application is intended to cover any variations, uses or adaptations of the present application, which follow the general principles of the present application and include common knowledge or customary techniques in the art that are not disclosed in the present application. The specification and examples are intended to be exemplary only, and the true scope and spirit of the present application are indicated by the following claims.

[0161] It should be understood that the present application is not limited to the precise structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present application is limited only by the appended claims.

[0162] The above description is only a preferred embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application should be included in the protection scope of the present application.

[0163] The above is a detailed introduction to a processor testing method, device, electronic device and computer-readable storage medium provided by the present application. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea. At the same time, for a person skilled in the art, according to the idea of ​​the present application, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.

Claims

1. A method for testing a processor, characterized in that: The method comprises: According to the parameters corresponding to each instruction attribute in the preset configuration file, the instructions corresponding to each instruction attribute are generated and an instruction stream is formed; the configuration file includes the corresponding relationship between the instruction attribute and the parameters; the parameters of the instruction attribute are positively correlated with the number of instructions corresponding to the instruction attribute; Executing the instruction stream through a preset virtual processor to obtain a test result of the processor; The virtual processor is a program for simulating a processor generated according to a preset code, and the preset code is used to describe the working mechanism of the processor; After executing the instruction stream through a preset virtual processor to obtain a test result of the processor, the method further includes: According to the test result, a preset coverage rate of the virtual processor executing the instruction stream and a signal coverage rate of each preset signal are obtained; the preset signal is a signal generated when the processor executes the instruction; In the case where the preset coverage is less than the first threshold, it is determined that the current test of the processor is invalid, the preset signal whose signal coverage is less than the second threshold is determined as the target signal, and a second target instruction attribute corresponding to the target signal is obtained from a preset correspondence between the instruction attribute and the preset signal, and a parameter of the second target instruction attribute in the configuration file is increased by a preset value to form a configuration file for a next test of the processor, so as to perform the next test; When the preset coverage is greater than or equal to a first threshold, it is determined that the current test of the processor is valid.

2. The method according to claim 1, characterized in that The step of generating, according to the parameters corresponding to each instruction attribute in the preset configuration file, instructions corresponding to each instruction attribute and forming an instruction stream includes: According to the preset instruction generation quantity, according to the parameter corresponding to each instruction attribute in the configuration file, an instruction corresponding to each instruction attribute is generated to form an instruction stream including the instruction generation quantity instructions.

3. The method according to claim 2, characterized in that The method further comprises: Sum the parameters corresponding to each instruction attribute in the configuration file to obtain a parameter sum; The method of generating an instruction corresponding to each instruction attribute according to a preset instruction generation quantity and a parameter corresponding to each instruction attribute in the configuration file to form an instruction stream including the instruction generation quantity instructions includes: Dividing the parameter corresponding to the instruction attribute by the sum of the parameters to obtain the usage probability of the instruction attribute; In each instruction generation cycle, according to the usage probability of each of the instruction attributes, a first target instruction attribute is determined from the instruction attributes, and a randomization function is called to randomly select an instruction of the first target instruction attribute from a preset instruction library corresponding to the first target instruction attribute; the number of the instruction generation cycles is equal to the number of instruction generation; The instruction stream is formed according to the instructions of the first target instruction attribute generated in each instruction generation cycle.

4. The method according to claim 2, characterized in that: The method further comprises: A randomization function is called to randomly select the instruction generation quantity from a preset quantity range.

5. The method according to claim 1, characterized in that The step of obtaining a preset coverage rate of a preset virtual processor executing the instruction stream and a signal coverage rate of each preset signal according to the test result includes: By using a preset electronic design automation tool and according to the test result, a preset coverage rate of the instruction stream executed by a preset virtual processor and a signal coverage rate of each preset signal are obtained.

6. The method according to claim 1, characterized in that After obtaining the preset coverage rate of the instruction stream executed by the preset virtual processor and the signal coverage rate of each preset signal according to the test result, the method further includes: When a preset coverage rate corresponding to a current test of the processor is the same as a preset coverage rate corresponding to a historical test of the processor, it is determined that the current test of the processor is valid.

7. The method according to claim 1, characterized in that The preset coverage includes switching coverage, function coverage and row coverage.

8. A processor testing device, characterized in that: The device comprises: A generation module, used to generate instructions corresponding to each instruction attribute and form an instruction stream according to the parameters corresponding to each instruction attribute in a preset configuration file; the configuration file includes the corresponding relationship between the instruction attributes and the parameters; the parameters of the instruction attributes are positively correlated with the number of instructions corresponding to the instruction attributes; A first acquisition module, used for executing the instruction stream through a preset virtual processor to acquire a test result of the processor; The virtual processor is a program for simulating a processor generated according to a preset code, and the preset code is used to describe the working mechanism of the processor; The device also includes: A third acquisition module is used to acquire, according to the test result, a preset coverage rate of the virtual processor executing the instruction stream and a signal coverage rate of each preset signal; the preset signal is a signal generated when the processor executes the instruction; A first processing module is used to determine that the current test of the processor is invalid when the preset coverage rate is less than the first threshold value, determine the preset signal whose signal coverage rate is less than the second threshold value as the target signal, and obtain a second target instruction attribute corresponding to the target signal from a preset correspondence between the instruction attribute and the preset signal, and increase the parameter of the second target instruction attribute in the configuration file by a preset value to form a configuration file for the next test of the processor, so as to perform the next test; The first determination module is used to determine that the current test of the processor is valid when the preset coverage is greater than or equal to a first threshold.

9. An electronic device, characterized in that: include: processor; a memory for storing instructions executable by the processor; The processor is configured to execute the instructions to implement the method according to any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that: When the instructions in the computer-readable storage medium are executed by a processor of an electronic device, the electronic device is enabled to perform the method as claimed in any one of claims 1 to 7.