A method, system and medium for automatically generating a scenario-configurable directional test set
The scenario-configurable automatic generation method of directional test sets solves the problem of directional test incentive development in processor core verification, realizes batch generation and centralized management, improves verification efficiency and management quality, and is suitable for various instruction set architectures. Processor core verification requirements.
Patent Information
- Application Number
- CN202111417864.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-25
- Publication Date
- 2024-09-20
- Estimated Expiration
- 2041-11-25
AI Technical Summary
In the existing technology, in processor core verification, the development problems of directional test incentives include large demand, complicated content, lack of unified development ideas and management problems, resulting in low verification efficiency.
A scenario-configurable directional test set automatic generation method is adopted to form seed templates and function sets through abstraction, generate configuration option menus and output menus, support batch or single test stimulus generation, and realize centralized management of test sets.
It improves the efficiency and management quality of processor core verification, is suitable for various instruction set architectures, supports new instruction set architecture expansion and scenario expansion, and meets different verification needs.
Smart Images

Figure CN114116478B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of processor core function verification, and in particular to a method, system and medium for automatically generating a scenario-configurable directional test set. Background Art
[0002] With the continuous development of computer technology and the increasing maturity of the processor chip industry, the design of processor cores has become more and more complex, resulting in increasing verification difficulty and workload. At present, the mainstream verification method divides the verification of processor cores into several stages: module-level verification, subsystem-level verification, and system-level verification. The later the verification of the processor core is, the higher the cost of detecting errors, so it is necessary to highlight design errors as early as possible. It can be seen that subsystem-level verification is particularly important. In the subsystem-level verification method, a large number of test stimuli that can be run in the bare metal environment need to be provided to test the correctness of the processor core function. These test stimuli that can be run in the logical environment are divided into two categories: targeted test stimuli and random test stimuli. Targeted test stimuli are used to specifically verify whether the processor core function conforms to the architecture and plan, while random test stimuli often act after targeted test stimuli, with the purpose of putting a lot of work pressure on the processor core, hoping to collide with the processor core operation state that was not planned in the previous verification work. For random test stimuli, each instruction set architecture provides corresponding generation tools, but for targeted test stimuli, manual development is still required. At present, the industry's manual development of targeted test stimuli mainly faces the following difficulties: 1) The verification work has a large demand for targeted test stimuli; 2) The content of processor core verification is very complicated, and test stimuli need to be customized for various functions; 3) There is no unified development idea for processor core verification based on different instruction set architectures; 4) The large number and variety of targeted test stimuli are difficult to manage as the verification work iterates. Summary of the invention
[0003] Technical problems to be solved by the present invention: In view of the above-mentioned problems of the prior art, a method, system and medium for automatically generating a scenario-configurable directional test set are provided. The present invention is applicable to the functional verification requirements of processor cores of various instruction set architectures, supports the expansion of new instruction set architectures directly on existing systems, and has strong applicability. The present invention supports test scenario selection, and can expand new scenarios on existing systems to achieve scenario configurability to meet various verification requirements. The present invention supports batch generation and single generation of directional test stimuli to meet different verification requirements. In addition, the present invention can realize centralized management of test sets in processor core verification work and improve the quality of verification management work.
[0004] In order to solve the above technical problems, the technical solution adopted by the present invention is:
[0005] A method for automatically generating a scenario-configurable directional test set, comprising:
[0006] 1) Based on the verification content of the processor core function verification requirements, the function set required for the seed template and the configuration options of each function in the function set, as well as the configuration order between each function, are abstracted;
[0007] 2) Based on the function set required to form the seed template, the configuration options of each function in the function set, and the configuration order between each function, construct seed templates corresponding to different scenarios;
[0008] 3) Generate a configuration option menu and a configuration output menu, provide a function set and a configuration option set for each function in the function set in the configuration option menu, and select the scene to be enabled in the configuration output menu;
[0009] 4) Write the test program segment. If the execution logic to be written in the test program segment has a corresponding seed module, select the corresponding seed module and inject data according to the requirements; otherwise, directly write the execution program;
[0010] 5) Generate test stimulus based on the configuration option menu, configuration output menu and test program segment.
[0011] Optionally, the seeds of the seed template in step 1) include functional seeds and other seeds, and the functional seeds are used to provide configuration execution logic templates and template valid switches for each function in a set of functions that need to form a template related to the verification content, and provide scenario descriptions and scenario valid switches; other seeds are used to provide execution logic templates and their corresponding valid switches that are independent of the verification content and related to the test stimulus construction.
[0012] Optionally, the function expression of the function set is:
[0013] Func={F0,F1,…,F k ,F k+1 ,…F K}
[0014] In the above formula, Func represents the function set required to verify the content, F0~F K is all K functions in the function set Func, F k represents any k-th function in the function set, F k+1 represents any k+1th function in the function set; the function expression of the configuration order between functions is (F0, F1, ..., F k ,F k+1 ,…F K ), indicating that the configuration order between functions satisfies:
[0015] F0→F1→…→F k →F k+1 →…→FK
[0016] The function expression of the configuration option set of any k-th function is:
[0017] F k Value = {F k V0(f k ),F k V1(f k ),…,F k V j (f k ),F k V j+1 (f k ),…,F k V J (f k )}
[0018] In the above formula, F k Value represents the configuration option set of the kth function, F k V0(f k )~F k V J (f k ) is the configuration option set F k All J configuration options in Value, F k V j (f k ) is the configuration option set F k Any j-th configuration option in Value, F k V j+1 (f k ) is the configuration option set F k Any j+1th configuration option in Value.
[0019] Optionally, step 2) includes: configuring execution logic templates for functions in the function set in the function seed of the seed module, and setting a macro definition switch for each execution logic template; constructing other execution logic templates related to the test stimulus construction and irrelevant to the verification content required for configuring the generation of test stimuli in other seeds of the seed module, setting a macro definition switch for each execution logic template, and constructing execution logic templates for the starting segment, self-checking segment, and ending segment in the general program segment in other seed parts.
[0020] Optionally, selecting a corresponding seed module in step 4) and injecting data according to demand specifically refers to selecting a corresponding seed module to call the part of the execution logic in the form of a macro definition.
[0021] Optionally, step 3) also includes providing a legal configuration path cluster in the configuration output menu, wherein the legal configuration path cluster refers to a path constructed by configuration options of some or all of the allowed functions in a configuration order between functions. When a test stimulus is generated based on the configuration option menu, the configuration output menu and the test program segment in step 5), the generated test stimulus meets the requirements of the legal configuration path cluster.
[0022] Optionally, step 3) also includes providing an illegal configuration path cluster in the configuration output menu, wherein the illegal configuration path cluster refers to a path constructed by configuration options of some or all functions that are not allowed according to the configuration order between functions; when generating test stimuli based on the configuration option menu, the configuration output menu and the test program segment in step 5), the generated test stimuli do not conform to the illegal configuration path cluster.
[0023] Optionally, step 5) includes:
[0024] 5.1) Determine the scenarios enabled in the configuration output menu and give the legal configuration path clusters. For each given legal configuration path cluster R V (m), generating a corresponding function configuration path cluster C(m), wherein the function configuration path cluster C(m) contains a legal configuration path cluster R V (m) Configuration options of configured functions and configuration options of functions described by the scenario. If there are unconfigured functions in the function configuration path cluster C(m), the unconfigured functions generate the corresponding default function set U(m), otherwise an empty default function set U(m) is generated;
[0025] 5.2) For the function configuration path cluster C(m), combine it with all possible configuration options of the functions in the default function set U(m) to obtain one or more complete function configuration paths L m ;
[0026] 5.3) Combine the illegal configuration path cluster with the complete functional configuration path L m Perform matching and delete the complete functional configuration path L that matches the illegal configuration path cluster m , configure the remaining complete functional path L m As the final fully functional configuration path;
[0027] 5.4) Generate test sets according to the final complete functional configuration paths, each complete functional configuration path corresponds to a test stimulus, so that the functional configuration described by the complete functional configuration path is inserted into the configuration reserved position before the test program segment during the process of generating the test stimulus.
[0028] In addition, the present invention also provides a scenario-configurable directed test set automatic generation system, including a microprocessor and a memory connected to each other, and the microprocessor is programmed or configured to execute the steps of the scenario-configurable directed test set automatic generation method.
[0029] In addition, the present invention also provides a computer-readable storage medium, which stores a computer program programmed or configured to execute the scenario-configurable directional test set automatic generation method.
[0030] Compared with the prior art, the present invention has the following advantages:
[0031] 1. The present invention is applicable to the processor core function verification requirements of various instruction set architectures, supports the expansion of new instruction set architectures on existing systems, and has strong applicability.
[0032] 2. The present invention supports test scenario selection and supports new scenario expansion on the existing system, which can make the scenario more configurable and adapt to various verification requirements.
[0033] 3. The present invention supports batch generation and single generation of directional test stimuli to meet different verification requirements, effectively improve the efficiency of test set generation, shorten verification time, and improve verification efficiency.
[0034] 4. The present invention can realize the centralized management of test sets in processor core verification work and improve the quality of verification management work. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] Figure 1 Schematic diagram of the basic flow of the method of the embodiment of the present invention.
[0036] Figure 2 Schematic diagram of the module structure of the system according to the embodiment of the present invention. DETAILED DESCRIPTION
[0037] The present invention is explained by taking the RISC-V processor core XXX virtual storage system function verification as an example. The described embodiment is only a part of the embodiments of the present invention, not all of the embodiments. Since this embodiment is only used to illustrate the implementation mode of the present invention, the verification content involved in the RISC-V processor core XXX virtual storage system function verification is only partially abstracted in this embodiment, and the actual verification requirements are not fully expanded.
[0038] like Figure 1 As shown, the scenario-configurable directional test set automatic generation method of this embodiment includes:
[0039] 1) Based on the verification content of the processor core function verification requirements, the function set required for the seed template and the configuration options of each function in the function set, as well as the configuration order between each function, are abstracted;
[0040] 2) Based on the function set required to form the seed template and the configuration options of each function in the function set, as well as the configuration order between the functions, construct seed templates corresponding to different scenarios, where a scenario is a configuration combination of multiple functions and is used to describe the configuration of multiple functions at a time;
[0041] 3) Generate a configuration option menu and a configuration output menu, provide a function set and a configuration option set for each function in the function set in the configuration option menu, and select the scene to be enabled in the configuration output menu;
[0042] 4) Write the test program segment. If the execution logic to be written in the test program segment has a corresponding seed module, select the corresponding seed module and inject data according to the requirements; otherwise, directly write the execution program;
[0043] 5) Generate test stimulus based on the configuration option menu, configuration output menu and test program segment.
[0044] In this embodiment, the seeds of the seed template in step 1) include functional seeds and other seeds. The functional seeds are used to provide configuration execution logic templates and template valid switches for each function in a set of functions that need to form a template related to the verification content, and provide scenario descriptions and scenario valid switches; other seeds are used to provide execution logic templates and their corresponding valid switches that are not related to the verification content but are related to the test stimulus construction.
[0045] In this embodiment, the function expression of the function set is:
[0046] Func={F0,F1,…,F k ,F k+1 ,…F K}
[0047] In the above formula, Func represents the function set required to verify the content, F0~F K is all K functions in the function set Func, F k represents any k-th function in the function set, F k+1 represents any k+1th function in the function set; the function expression of the configuration order between functions is (F0, F1, ..., F k ,F k+1 ,…F K ), indicating that the configuration order between functions satisfies:
[0048] F0→F1→…→F k →Fk+1 →…→F K
[0049] The function expression of the configuration option set of any k-th function is:
[0050] F k Value = {F k V0(f k ),F k V1(f k ),…,F k V j (f k ),F k V j+1 (f k ),…,F k V J (f k )}
[0051] In the above formula, F k Value represents the configuration option set of the kth function, F k V0(f k )~F k V J (f k ) is the configuration option set F k All J configuration options in Value, F k V j (f k ) is the configuration option set F k Any j-th configuration option in Value, F k V j+1 (f k ) is the configuration option set F k Any j+1th configuration option in Value.
[0052] Taking the RISC-V processor core XXX virtual storage system function verification as an example, the function set required for the verification content is specifically:
[0053] Func={TranslationM,WorkM,TableS,PTExwr}.
[0054] Among them, the function TranslationM represents the abstraction of the address translation scheme, and the configuration option set is:
[0055] TranslationValue={TranslationMsv32,TranslationMsv39,TranslationMsv48,TranslationMsv57,TranslationMsv64,bare,reseved}.
[0056] Among them, TranslationMsv32, TranslationMsv39, TranslationMsv48, TranslationMsv57, and TranslationMsv64 respectively represent the Msv32, Msv39, Msv48, Msv57, and Msv64 conversion schemes of the virtual memory system, bare means no conversion, and reved means the reserved state.
[0057] Function WorkM represents an abstraction of a processor's working mode, and its set of configuration options is:
[0058] WorkMValue={WorkMm, WorkMs, WorkMu}.
[0059] Among them, WorkMm, WorkMs, and WorkMu represent machine mode M mode, management mode S mode, and user mode U mode respectively;
[0060] Function TableS represents the number of translation page table levels during the translation table walk (TTW) process, and its configuration option set is:
[0061] TableSValue={TableS0, TableS1, TableS2, TableS3}.
[0062] Among them, TableS0, TableS1, TableS2, and TableS3 respectively represent the 1st, 2nd, 3rd, and 4th level page tables that need to be translated during the translation page table walk (TTW);
[0063] Function PTExwr represents the xwr attribute bit configuration in the page table entry (PTE), and its configuration option set is:
[0064] PTExwrValue={PTExwr000,PTExwr001,PTExwr010,PTExwr011,PTExwr100,PTExwr101,PTExwr110,PTExwr111}.
[0065] Among them, PTExwr000, PTExwr001, PTExwr010, PTExwr011, PTExwr100, PTExwr101, PTExwr110, and PTExwr111 respectively indicate that the xwr attribute bit configurations are 000, 001, 010, 011, 100, 101, 110, and 111.
[0066] In this embodiment, the configuration order between functions is: (TranslationM, WorkM, TableS, PTExwr).
[0067] In this embodiment, step 2) includes: constructing and configuring execution logic templates for functions in the function set in the function seed of the seed module, and setting a macro definition switch for each execution logic template; constructing other execution logic templates that are not related to the verification content and are related to the test stimulus construction in other seeds of the seed module for configuring the generation of test stimuli, setting a macro definition switch for each execution logic template, and constructing execution logic templates for the start segment, self-checking segment, and end segment in the general program segment in other seed parts. Designing scenarios according to verification requirements, step 2) in this embodiment constructs scenarios in the function seeds, including: SV39_S_Olevel2, which indicates that the function TranslationM is configured as TranslationMsv39, the function WorkM is configured as WorkMs, and the function TableS is configured as TableS2; constructing the scenario SV48_U_Olevel2 in the function seed, which indicates that the function TranslationM is configured as TranslationMsv48, the function WorkM is configured as WorkMu, and the function TableS is configured as TableS2.
[0068] In this embodiment, selecting the corresponding seed module in step 4) and injecting data according to requirements specifically refers to selecting the corresponding seed module to call the execution logic of this part in the form of macro definition, thereby reducing the amount of manual code writing; the distinction between functional seeds and other seeds is conducive to template management. The process of writing a test program segment also includes at least the following contents: the test module includes configuration reserved bits and a test program segment; the test program segment supports two writing modes: one is to select a template in the seed module and inject data according to requirements; the other is to directly write the execution program.
[0069] It should be noted that all configurations are given in the configuration output menu, but this method will reduce flexibility. In this embodiment, in order to achieve flexible specification of configuration options, in this embodiment, step 3) generates a configuration option menu and a configuration output menu, and gives the function set and the configuration option set F of each function in the function set Func in the configuration option menu. kValue, select the scene to be enabled in the configuration output menu. As an optional implementation, step 3) also includes providing a legal configuration path cluster in the configuration output menu, wherein the legal configuration path cluster refers to a path composed of configuration options of some or all functions that are allowed according to the configuration order between functions. When the test stimulus is generated based on the configuration option menu, the configuration output menu, and the test program segment in step 5), the generated test stimulus meets the legal configuration path cluster requirements. For example, in this embodiment, the legal configuration path cluster given in the configuration output menu is: R V (m), where m = {0, 1, ..., M}, M ≥ 0, where M is the number of legal configuration path clusters, and M can be configured as needed.
[0070] On the basis of realizing flexible specification of configuration options through legal configuration path clusters, in order to realize the exclusion of specific illegal configuration path clusters, the flexible specification of configuration options has been further improved to reduce the workload of configuration personnel. In this embodiment, step 3) also includes providing an illegal configuration path cluster in the configuration output menu, and the illegal configuration path cluster refers to the path composed of the configuration options of some or all functions that are not allowed according to the configuration order between functions; in step 5), when generating test stimuli based on the configuration option menu, the configuration output menu and the test program segment, the generated test stimuli do not conform to the illegal configuration path cluster. For example, in this embodiment, the illegal configuration path cluster given in the configuration output menu is: R inv (n), where n = {0, 1, ..., N}, N ≥ 0, where N is the number of illegal configuration path clusters, and N can be configured as needed.
[0071] Specifically, in this embodiment, a function set Func and a configuration option set of each function in the function set Func are provided in the configuration option menu: TranslationMValue, WorkMValue, TableSValue, PTExwrValue.
[0072] Select the scene to be enabled in the configuration output menu: The seed module provides the scene SV39_S_Olevel2 and the scene SV48_U_Olevel2. This embodiment takes the scene SV39_S_Olevel2 as an example to illustrate the implementation method. Enable the scene SV39_S_Olevel2 macro in the configuration output menu;
[0073] The configuration output menu gives a cluster of legal configuration paths:
[0074] R V (0)={TranslationMsv39,WorkMs,TableS2,PTExwr100}
[0075] R V(1)={TranslationMsv39,TableS2,PTExwr100}
[0076] In the configuration output menu, a cluster of illegal configuration paths is given:
[0077] R inv (0)={TranslationMsv39,TableS3}
[0078] R inv (1) = {WorkMm}.
[0079] In this embodiment, step 5) includes:
[0080] 5.1) Determine the scenarios enabled in the configuration output menu and give the legal configuration path clusters. For each given legal configuration path cluster R V (m), generating a corresponding function configuration path cluster C(m), wherein the function configuration path cluster C(m) contains a legal configuration path cluster R V (m) Configuration options of configured functions and configuration options of functions described by the scenario. If there are unconfigured functions in the function configuration path cluster C(m), the unconfigured functions generate the corresponding default function set U(m), otherwise an empty default function set U(m) is generated;
[0081] 5.2) For the function configuration path cluster C(m), combine it with all possible configuration options of the functions in the default function set U(m) to obtain one or more complete function configuration paths L m ;
[0082] As mentioned above, for the function set Func, the complete function configuration path is defined as:
[0083] F k Value = {F k V0(f k ),F k V1(f k ),…,F k V j (f k ),F k V j+1 (f k ),…,F k V J (f k )},
[0084] Fully functional configuration path F kValue contains the configuration description of all functions in the function set Func. In this embodiment, the function configuration path cluster C(m) is defined by the scenarios enabled in the configuration output menu and the legal configuration path cluster R V (m) Jointly decide if the configuration output menu has scenes and legal configuration path clusters R V (m) If different configurations are performed on the same function, the function configuration path cluster C(m) configures the function according to the scenario description; the legal configuration path cluster corresponds to the function configuration path cluster one by one; the legal configuration path cluster R V (m) and function configuration path cluster C(m) allow for function defaults, which may not necessarily describe a set of complete function configuration paths; let the function set described in the function configuration path cluster C(m) be C, and the corresponding default function set U(m) generated by the unconfigured functions is:
[0085] U(m)=Func-C
[0086] The complete function configuration path list corresponding to the function configuration path cluster C(m) is generated by using the unconfigured function to generate the corresponding default function set U(m). The default function is the cluster growth point, and all the configuration options of the default function are traversed. All the configuration options of the default function are combined with the function configuration of the function configuration path cluster C(m) to form a complete function configuration path. The complete function configuration path set thus formed is the complete function configuration path list L m , where m = {0, 1, …, M}, M ≥ 0, M is the number of legal configuration path clusters;
[0087] For example, the scene SV39_S_Olevel2 enabled in the configuration output menu and the legal configuration path cluster R V (0), the function TableS is configured differently. The function TableS is in R V (0) is configured as TableS2 according to the scenario description, then R V The function configuration path cluster of (0) is:
[0088] C(0)={TranslationMsv39,WorkMs,TableS2,PTExwr100}
[0089] If all functions in the function set Func of the configuration option menu have configuration options in the function configuration path cluster C(0), then the default function set U(0) of the function configuration path cluster C(0) is empty; then a list L0 of complete function configuration paths is formed based on the function configuration path cluster C(0) and the default function set U(0); all complete function configuration paths of L0 are as follows:
[0090] L0(0)={TranslationMsv39,WorkMs,TableS2,PTExwr100}
[0091] According to the scene SV39_S_Olevel2 opened in the configuration output menu and the legal configuration path cluster R V (1), we get R V (1) Functional configuration path cluster:
[0092] C(1)={TranslationMsv39,TableS2,PTExwr100}
[0093] If the function WorkM in the function set Func of the configuration option menu does not have a configuration option in C(1), then the default function set of C(1) is:
[0094] U(1)={WorkM}
[0095] A list L1 of complete function configuration paths is formed according to the function configuration path cluster C(1) and the default function set U(1); based on the function configuration path cluster C(1), L1 expands all configuration options of the functions in the default function set U(1) to form multiple complete configuration paths. All complete function configuration paths of L1 are as follows:
[0096] L1(0)={TranslationMsv39,WorkMm,TableS2,PTExwr100}
[0097] L1(1)={TranslationMsv39,WorkMs,TableS2,PTExwr100}
[0098] L1(2)={TranslationMsv39,WorkMu,TableS2,PTExwr100}.
[0099] 5.3) Combine the illegal configuration path cluster with the complete functional configuration path L m Perform matching and delete the complete functional configuration path L that matches the illegal configuration path cluster m , configure the remaining complete functional path L m As the final complete functional configuration path; that is, check list L m Whether the complete functional configuration path in the list L meets the description of any illegal configuration path cluster. If so, remove the complete functional configuration path from the list L m , where m = {0, 1, ..., M}, M ≥ 0, and M is the number of legal configuration path clusters; in the embodiment, specifically, whether the complete functional configuration paths in the lists L0 and L1 conform to the illegal configuration path cluster Rinv (0) or R inv Description of (1): It can be seen that L1(0) in L1 conforms to the illegal configuration path cluster R inv (1), then L1(0) is deleted from the list L1; the updated list is as follows:
[0100] List L0 all complete function configuration paths are as follows:
[0101] L0(0)={TranslationMsv39,WorkMs,TableS2,PTExwr100};
[0102] List L1 all complete function configuration paths are as follows:
[0103] L1(0)={TranslationMsv39,WorkMm,TableS2,PTExwr100}
[0104] L1(1)={TranslationMsv39,WorkMs,TableS2,PTExwr100}.
[0105] 5.4) Generate test sets according to the final complete functional configuration path, and each complete functional configuration path corresponds to a test stimulus, so that the functional configuration described by the complete functional configuration path is inserted into the configuration reserved position before the test program segment in the process of generating the test stimulus. In this embodiment, the test set is specifically generated according to lists L0 and L1; the test set generated according to list L0 contains only a single test stimulus, which satisfies configuration L0(0); the test set generated according to list L1 contains two stimuli, and the two stimuli respectively satisfy configurations L1(0) and L1(1). The functional configuration described by the complete functional configuration path is inserted into the configuration reserved position before the test program segment in the process of generating the test stimulus. When generating a test set according to the list of complete functional configuration paths, if the default function set of the legal configuration path cluster given in the configuration output menu is not empty, or when multiple legal configuration path clusters are given, multiple test stimuli are generated; when the default function set of the legal configuration path cluster given in the configuration output menu is empty, and there is only one legal configuration path cluster, a single test stimulus is generated; the test stimulus set generated by calling the generation module once is called a test set.
[0106] The method of this embodiment is applicable to the functional verification requirements of processor cores of various instruction set architectures, supports the expansion of new instruction set architectures directly on existing systems, and has strong applicability. The method of this embodiment supports test scenario selection, and can expand new scenarios on existing systems to achieve configurable scenarios to adapt to various verification requirements. The method of this embodiment supports batch generation and single generation of directional test stimuli to meet different verification requirements. In addition, the method of this embodiment can realize the centralized management of test sets in processor core verification work and improve the quality of verification management work. In summary, the scenario-configurable directional test set of this embodiment automatically generates processor core functional verification requirements applicable to various instruction set architectures, has strong applicability, configurable scenarios, can adapt to various verification requirements, meet different verification requirements, and can realize the centralized management of test sets in processor core verification work and improve the quality of verification management work.
[0107] In addition, the present invention also provides a scenario-configurable directed test set automatic generation system, comprising a microprocessor and a memory connected to each other, the microprocessor being programmed or configured to execute the steps of the scenario-configurable directed test set automatic generation method. Figure 2As shown, the scenario-configurable directional test set automatic generation system of this embodiment includes a seed module, a configuration module, a test module, a construction module and a generation module. The seed module includes function seeds and other seeds; the function seeds provide the configuration execution logic template and template valid switch of the function that needs to form a template related to the verification content, and provide scenario descriptions and scenario valid switches; other seeds provide execution logic templates and their corresponding valid switches that are not related to the verification content and are related to the test stimulus construction; the configuration module includes a configuration option menu and a configuration output menu; the test module provides a test program segment; the construction module provides a complete program framework required for the test stimulus; the complete program framework content includes a general program segment and a test program flow guide segment required for the test stimulus; the general program segment includes a start segment, a register configuration segment, a self-checking segment, an end segment, and a data segment; the test program flow guide segment is used to guide the entry and exit of the test program segment; the generation module provides an external switch for selecting an instruction set architecture to start generating a test set. Its execution process mainly includes: step one, abstract the functions of the template and the configuration options of each function, and the configuration order between functions according to the verification content; step two, build a seed module; step three, write a configuration option menu and a configuration output menu in the configuration module; step four, write a test program segment in the test module; step five, call the generation module to generate a test set. Among them, the process of writing a test program segment in the test module also includes at least the following content: the test module includes configuration reserved bits and test program segments; the test program segments support two writing modes: one is to select the template in the seed module and inject data according to requirements; the other is to directly write the execution program. This process corresponds to the aforementioned steps 1) to 5) of the scenario-configurable directional test set automatic generation method of this embodiment. For specific details, please refer to the previous text.
[0108] In addition, the present invention also provides a computer-readable storage medium, which stores a computer program programmed or configured to execute the aforementioned scenario-configurable directed test set automatic generation method.
[0109] Those skilled in the art will appreciate 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 a complete hardware embodiment, a complete 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-readable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes. The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, may be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the functions in the process. Figure 1 A process or multiple processes and / or boxes Figure 1 These computer program instructions can also be stored in a computer-readable memory that can guide a computer or other programmable data processing device to work in a specific way, so that the instructions stored in the computer-readable memory produce a product including an instruction device, which implements the functions specified in the process. Figure 1 A process or multiple processes and / or boxes Figure 1 These computer program instructions can also be loaded onto a computer or other programmable data processing device, so that a series of operation steps are executed on the computer or other programmable device to produce a computer-implemented process, so that the instructions executed on the computer or other programmable device provide for implementing the process in the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0110] The above is only a preferred embodiment of the present invention, and the protection scope of the present invention is not limited to the above embodiments. All technical solutions under the concept of the present invention belong to the protection scope of the present invention. It should be pointed out that for ordinary technicians in this technical field, some improvements and modifications without departing from the principle of the present invention should also be regarded as the protection scope of the present invention.
Claims
1. A scenario-configurable directional test set automatic generation method, It is characterized in that include: 1) Based on the verification content of the processor core function verification requirements, the function set required by the seed template and the configuration options of each function in the function set, as well as the configuration order between each function, are abstracted; 2) Based on the function set required to form the seed template, the configuration options of each function in the function set, and the configuration order between each function, construct seed templates corresponding to different scenarios; 3) Generate a configuration option menu and a configuration output menu. In the configuration option menu, a function set and a configuration option set of each function in the function set are given. In the configuration output menu, select the scene to be enabled. 4) Write the test program segment. If the execution logic to be written in the test program segment has a corresponding seed module, select the corresponding seed module and inject data according to the requirements; Otherwise, write the execution program directly; 5) Generate test stimulus based on configuration option menu, configuration output menu and test program segment; Step 3) also includes providing a legal configuration path cluster in the configuration output menu, wherein the legal configuration path cluster refers to a path formed by configuration options of some or all functions that are allowed according to the configuration order between functions, and when generating a test stimulus based on the configuration option menu, the configuration output menu and the test program segment in step 5), the generated test stimulus meets the legal configuration path cluster requirement; Step 3) also includes providing an illegal configuration path cluster in the configuration output menu, wherein the illegal configuration path cluster refers to a path formed by configuration options of some or all functions that are not allowed according to the configuration order between functions; when generating a test stimulus based on the configuration option menu, the configuration output menu and the test program segment in step 5), the generated test stimulus does not conform to the illegal configuration path cluster; Step 5) includes: 5.1) Determine the scenarios enabled in the configuration output menu and provide legal configuration path clusters. For each legal configuration path cluster provided R V ( m ), generate the corresponding function configuration path cluster C ( m ), the function configuration path cluster C ( m ) contains a valid configuration path cluster R V ( m ) The configuration options of the configured functions and the configuration options of the functions described in the scenario, if the function set is in the function configuration path cluster C ( m ) contains unconfigured functions, then the unconfigured functions generate the corresponding default function set U ( m ), otherwise an empty default feature set is generated U ( m ); 5.2) Configure path clusters for functions C ( m ), which is combined with the default functionality U ( m ) are combined to obtain one or more complete function configuration paths. L m ; 5.3) Cluster the illegal configuration path with the complete functional configuration path L m Perform a match and delete the complete functional configuration path that matches the illegal configuration path cluster L m , configure the remaining full functionality path L m As the final fully functional configuration path; 5.4) Generate test sets according to the final complete functional configuration paths. Each complete functional configuration path corresponds to a test stimulus, so that the functional configuration described by the complete functional configuration path is inserted into the configuration reserved position before the test program segment during the process of generating the test stimulus.
2. The method for automatically generating a scenario-configurable directional test set according to claim 1, It is characterized in that The seeds of the seed template in step 1) include function seeds and other seeds. The function seeds are used to provide configuration execution logic templates and template valid switches of each function in the function set that needs to form a template related to the verification content, and provide scenario descriptions and scenario valid switches; Other seeds are used to provide execution logic templates and their corresponding valid switches that are independent of the verification content and are related to the construction of test stimuli.
3. The method for automatically generating a scenario-configurable directional test set according to claim 2, It is characterized in that The function expression of the function set is: Func ={ F 0 , F 1 ,…, F k , F k+1 ,… F K} In the above formula, Func Represents the set of functions needed to validate content, F 0 ~ F K For function collection Func All K function, F k Represents any of the functions in the set k function, F k+1 Represents any of the functions in the set k+ 1 function; the function expression of the configuration order between functions is ( F 0 , F 1 ,…, F k , F k+1 ,… F K ), indicating that the configuration order between functions satisfies: F 0 → F 1 →…→ F k → F k+1 →…→ F K Any k The function expression of the configuration option set of a function is: F k Value ={ F k V 0 ( f k ), F k V 1 ( f k ),…, F k V j ( f k ), F k V j+1 ( f k ),…, F k V J ( f k )} In the above formula, F k Value Indicates k A collection of configuration options for a feature. F k V 0 ( f k )~ F k V J ( f k ) is a collection of configuration options F k Value All J Item configuration options, F k V j ( f k ) is a collection of configuration options F k Value Any of j Item configuration options, F k V j+1 ( f k ) is a collection of configuration options F k Value Any of j +1 configuration option.
4. The method for automatically generating a scenario-configurable directional test set according to claim 3, It is characterized in that Step 2) includes: constructing and configuring execution logic templates for functions in the function set in the function seeds of the seed module, and setting macro definition switches for each execution logic template; constructing other execution logic templates related to the test stimulus construction and not related to the verification content required for configuring the test stimulus generation in other seeds of the seed module, setting macro definition switches for each execution logic template, and constructing execution logic templates for the start segment, self-checking segment, and end segment in the general program segment in other seed parts.
5. The method for automatically generating a scenario-configurable directional test set according to claim 4, It is characterized in that Step 4) selects the corresponding seed module and injects data according to the requirements, specifically refers to selecting the corresponding seed module to call the execution logic of the part in the form of macro definition.
6. A scenario-configurable directed test set automatic generation system, comprising a microprocessor and a memory connected to each other, It is characterized in that The microprocessor is programmed or configured to execute the steps of the method for automatically generating a scenario-configurable directional test set as described in any one of claims 1 to 5.
7. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores a computer program that is programmed or configured to execute the method for automatically generating a scenario-configurable directional test set as described in any one of claims 1 to 5.
