Automatic test case integration method and device and case test method and device

By extracting and rendering the preset fields and function calling relationships of the incentive class, a reusable wrapper interface class file is generated, which solves the problem of difficulty in reusing incentive classes across modules in the UVM verification platform and improves the reuse rate of incentive classes. and testing efficiency.

CN118550784APending Publication Date: 2024-08-27SHANDONG YUNHAI GUOCHUANG CLOUD COMPUTING EQUIP IND INNOVATION CENT CO LTD
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202410718920.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-04
Publication Date
2024-08-27

AI Technical Summary

Technical Problem

In the UVM verification platform, test case management is inconvenient and incentive classes are difficult to reuse across modules, resulting in low environmental code reuse rate. Especially when calling across module levels, incentive classes are difficult to reuse.

Method used

By extracting the preset field information and function calling relationships in the incentive class, a reusable wrapper interface class file is generated and stored in a standardized resource pool to achieve cross-module reuse of incentive classes and reduce overloading and Rewrite the requirements for incentive classes.

Benefits of technology

It improves the cross-module reuse efficiency and reuse rate of incentive classes, simplifies test case management, reduces developers' duplication of work, and improves test execution efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118550784A
    Figure CN118550784A
Patent Text Reader

Abstract

The invention relates to the technical field of chip verification, and discloses an automatic test case integration method and device and a case testing method and device.According to the method and device, logic preset field information of multiple test incentives and function calling relations among the test incentives are extracted, and based on the function calling relations, preset fields are rendered; the method comprises the following steps: generating a reusable wrapper interface class file, binding the wrapper interface class file with a plurality of test incentives by introducing declarations, obtaining all test case information in a reporter interface class file and a test case information base, initializing the test case information into test case files, and then, carrying out test on the test case files. According to the universal verification methodology verification platform, the resource pool class is parameterized into a basic data type to form a parameterized resource pool for storing shared resources, and the whole universal verification methodology verification platform realizes test case management integration and multiplexing excitation integration, so that the multiplexing efficiency of different excitation classes across modules is remarkably improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of chip verification technology, and in particular to an automated test case integration method and device, and a case test method and device. Background Art

[0002] In the traditional UVM verification platform, there is no integrated management of test case information. In the design process of complex and large-scale test cases, engineers can only rely on external script management. These scripts generally collect the information of the test cases in batches at one time during the verification regression phase and cannot be synchronized with the verification platform. When building a verification environment platform, it is usually necessary to inherit or recreate the test cases on known use cases due to the addition of new function points or the modification of old function points. This requires reloading or rewriting the old stimulus classes, resulting in a low reuse rate of the environment code. Especially when calling across module levels, these stimulus classes are also difficult to reuse. Summary of the invention

[0003] In view of this, the present invention provides an automated test case integration method and device, and a case test method and device to solve the problem of how to improve the cross-module reuse efficiency of different stimulus classes.

[0004] In a first aspect, the present invention provides an automated test case integration method, the method comprising: obtaining all stimulus classes pre-registered on a general verification methodology verification platform; encapsulating logic corresponding to a plurality of test stimuli in the stimulus class;

[0005] Extracting a plurality of preset field information in the logic, and extracting a plurality of function call relationships between the test stimuli;

[0006] Based on the function call relationship between the plurality of test stimuli, the plurality of preset fields are rendered to obtain a reusable encapsulator interface class file;

[0007] And, based on the function call relationship between the multiple test stimuli, configure the multiple test stimuli with an import statement corresponding to the wrapper interface class file, wherein the import statement is used to indicate the establishment of a binding relationship between the wrapper interface class file and each of the multiple test stimuli;

[0008] Obtaining a preset reporter interface class file and all test case information in a test case information library, wherein a resource pool class is predefined in the reporter interface class file;

[0009] Initialize all the test case information into a test case file;

[0010] The resource pool corresponding to the resource pool class is parameterized as a basic data type, and the parameterized resource pool is used to store the reporter interface class file, the encapsulator interface class file and the test case file to complete the test case management integration and reuse incentive integration of the general verification methodology verification platform.

[0011] The embodiment of the present invention extracts the function call relationship between preset field information and test stimuli, clearly determines the association between various stimulus classes, provides a basis for subsequent reuse, renders preset fields and generates a reusable wrapper interface class file, and encapsulates the logic of the stimulus class in a standardized interface. Compared with the related art of overloading or rewriting the old stimulus class, this embodiment can directly reuse similar stimulus classes between different modules through standardized wrapper interface class files, thereby avoiding the need to overload or rewrite the stimulus class when calling at different module levels. By configuring the import declaration corresponding to the wrapper interface class file for multiple test stimuli, it is indicated The binding relationship between the wrapper interface class file and the test stimulus. When calling the test stimulus, whether it is the same module or not, the corresponding wrapper interface class file can be used directly without calling the implementation of each stimulus class separately, thereby improving the efficiency of cross-module reuse. The resource pool class is parameterized and used to store reporter interface class files, wrapper interface class files, and test case files. It can be understood that all relevant resources are stored in a standardized parameterized resource pool to facilitate the sharing of reporter interface class files, wrapper interface class files, and test case files between different modules, further significantly improving the cross-module reuse rate of the stimulus class.

[0012] In an optional implementation, the plurality of preset fields include a file path segment, a class name segment, an attribute segment, and an operation method;

[0013] Based on the function call relationship between the multiple test stimuli, the multiple preset fields are rendered to obtain a reusable encapsulator interface class file, including:

[0014] Store the file path segment, the class name segment, the attribute segment, and the operation method in a data frame object;

[0015] Obtaining a preset encapsulator class template file, wherein the encapsulator class template file serves as a prototype of the encapsulator interface class file;

[0016] Convert the function prototype declaration and the corresponding data frame object into Python dictionary data format;

[0017] Rendering the prototype declaration of the function converted into the format of the Python dictionary data and the data frame object converted into the format of the Python dictionary data into the preset wrapper class template file through the render() method of the mako library, to obtain the wrapper interface class file, wherein the wrapper interface class includes a tracker() method and an is_inlib() method;

[0018] The tracker() method is used to display the function call relationship between multiple test stimuli in the stimulus class in the general verification methodology verification platform;

[0019] The is_inlib() method is used to query the operation methods in multiple test stimuli.

[0020] In this embodiment, by storing key information such as file path, class name, attributes and operation methods in a Pandas data frame object, developers can view and modify the content of the data frame object, thereby improving the maintainability of the code. Through the preset wrapper class template file, the data frame object is converted into Python dictionary format, and the render() method of the mako library is used to automatically render these data into the template file. Developers can avoid writing the wrapper class from scratch every time, reducing the tedious steps in the related art where developers still need to write a wrapper class from beginning to end, saving development time. The tracker() and is_inlib() methods contained in the public task task of the wrapper interface class file can integrate function call relations and operation method queries in a public task task at one time, effectively improving the reusability of the entire wrapper interface class file.

[0021] In an optional implementation, the operation method includes different task methods; each of the task methods corresponds to a task call relationship; wherein the function call relationship includes the task call relationship; the method further includes:

[0022] Determine the levels of different tasks based on different task calling relationships;

[0023] The levels of the different tasks are used to characterize the execution order of the different tasks, wherein each task method corresponds to one task;

[0024] Selecting a first incentive class to which a task corresponding to a first task level belongs, wherein the first task level is used to represent a task that is to be executed for the first time in the execution order;

[0025] The wrapper implementation declaration is added to the first stimulus class, wherein the first stimulus class includes a plurality of tasks.

[0026] In this embodiment, since the wrapper implementation declaration provides a unified interface, the process of program code compilation and execution cannot be executed in parallel, and the subsequent code can only be executed in sequence starting from the starting position of the code. The first-level task is the most basic task that does not depend on other tasks. It can also be understood as the basis for the execution of subsequent tasks and the first task at the starting position. By declaring it in the first-level task, it can be ensured that all subsequent tasks run in a consistent environment, and that all subsequent function tasks can introduce a unified wrapper interface, thereby ensuring the reusability of the stimulus class corresponding to the wrapper interface class file.

[0027] In an optional embodiment, the reporter interface class file also includes a basic data class, a reporter interface class and a sequence information class;

[0028] Among them, the reporter interface class encapsulates report number function logic, report timestamp function logic, report status function logic, report coverage function logic, report description function logic, report inheritance logic and report summary logic; the sequence information class encapsulates test case identification information, test case timestamp information, test result information of the test case, test case coverage information, test case description information and test case hierarchy information.

[0029] This embodiment reduces the steps of repeated code writing and improves the reusability of the code by encapsulating the general reporting function logic. During the test execution process, no matter what test result, it can be reported through the reporter interface class, and all test contents can be reported directly at one time, ensuring the real-time update of the test case results so that the testers can see the test results in real time.

[0030] In a second aspect, the present invention provides a use case testing method, the method comprising: in response to a test trigger instruction, obtaining target test case information and a corresponding mark bit in the test trigger instruction;

[0031] Confirming the type of the target test case according to the mark bit;

[0032] When it is confirmed that the target test case is of the first type, the target test case information is integrated based on the automated test case integration method described in the first aspect or any corresponding implementation manner thereof, wherein the first type is used to indicate that the target test case information is newly added test case information;

[0033] And in accordance with the test trigger instruction, call the reuse stimulus integrated in the general verification methodology verification platform in the automated test case integration method described in the first aspect or any corresponding implementation method to execute the test operation corresponding to the target test case information.

[0034] The use case testing method provided in this embodiment responds to a test trigger instruction and obtains the target test case information and the corresponding mark bit in the test trigger instruction. The type of the target test case is confirmed according to the mark bit. When the target test case is confirmed to be of the first type, the target test case information is integrated based on the automated test case integration method described in the first aspect or any corresponding embodiment thereof, and the reused stimulus in the universal verification methodology verification platform is used to quickly reuse the existing stimulus code, which greatly reduces the duplication of testers and improves the test execution efficiency.

[0035] In an optional embodiment, the method further includes:

[0036] When it is confirmed that the type of the test case is the second type, the test trigger instruction is directly followed to call the reuse stimulus integrated in the general verification methodology verification platform in the automated test case integration method described in the first aspect or any corresponding implementation method thereof, and execute the test operation corresponding to the target test case information; wherein the second type is used to indicate that the target test case information is integrated and valid test case information in the general verification methodology verification platform;

[0037] Alternatively, when it is confirmed that the type of the test case is the third type, the target test case information is cleared from the general verification methodology verification platform, wherein the third type is used to indicate that the target test case information is integrated and invalid test case information in the general verification methodology verification platform.

[0038] The use case testing method provided in this embodiment uses a marker bit to distinguish test case types, namely the first type, the second type and the third type, and can flexibly handle newly added test cases and existing test cases to ensure the accuracy of the test cases.

[0039] In an optional embodiment, the method also includes: analyzing the logic in each incentive class, identifying the function call link in the logic in each incentive class, and dividing the main process and sub-process of the incentive execution function; according to the divided multiple main processes and sub-processes, respectively setting corresponding basic interface classes, and setting the parent classes inherited by different incentive classes as basic interface classes; setting the inherited basic interface class as a reusable encapsulator interface class file.

[0040] This embodiment analyzes the logic in each stimulus class, identifies the function call link in the logic of each stimulus class, and divides the main process and sub-process of the stimulus execution function; according to the divided multiple main processes and sub-processes, corresponding basic interface classes are set respectively, and the parent classes inherited by different stimulus classes are set as basic interface classes; the inherited basic interface class is set as a reusable encapsulator interface class file, which can not only improve the modularity of the test code, but also simplify the stimulus class writing process by reducing duplicate code, thereby achieving rapid integration.

[0041] In a third aspect, the present invention provides an automated test case integration device, the device comprising:

[0042] The stimulus class acquisition and parsing module is used to obtain all stimulus classes pre-registered in the universal verification methodology verification platform; the stimulus class encapsulates the logic corresponding to multiple test stimuli;

[0043] A logic analysis and encapsulator generation module, used to extract a plurality of preset field information in the logic, and to extract a function call relationship between a plurality of the test stimuli;

[0044] A test stimulus configuration and binding module, used for rendering a plurality of the preset fields based on the function call relationship between the plurality of the test stimuli to obtain a reusable encapsulator interface class file;

[0045] A reporter interface and resource management module, configured to configure an import statement corresponding to the encapsulator interface class file for the multiple test stimuli based on the function call relationship between the multiple test stimuli, wherein the import statement is used to indicate the establishment of a binding relationship between the encapsulator interface class file and each of the multiple test stimuli;

[0046] A test case initialization module, used for obtaining a preset reporter interface class file and all test case information in a test case information library, wherein a resource pool class is predefined in the reporter interface class file;

[0047] A resource pool parameterization module, used for initializing all the test case information into a test case file;

[0048] The test case integration and reuse management module is used to parameterize the resource pool corresponding to the resource pool class into a basic data type. The parameterized resource pool is used to store the reporter interface class file, the encapsulator interface class file and the test case file to complete the test case management integration and reuse incentive integration of the general verification methodology verification platform.

[0049] In a fourth aspect, the present invention provides a use case testing device, the device comprising:

[0050] A test instruction parsing and target identification module, used to respond to a test trigger instruction and obtain target test case information and corresponding marking bits in the test trigger instruction;

[0051] A test case type confirmation and processing module, used to confirm the type of the target test case according to the mark bit;

[0052] A new test case integration module, configured to integrate the target test case information based on the automated test case integration method described in the first aspect or any corresponding embodiment thereof when it is confirmed that the target test case is of the first type, wherein the first type is used to indicate that the target test case information is newly added test case information;

[0053] The reused stimulus scheduling and test execution module is used to call the reused stimulus integrated in the general verification methodology verification platform in the automated test case integration method as described in the first aspect or any corresponding implementation method in accordance with the test trigger instruction, and execute the test operation corresponding to the target test case information.

[0054] In a fifth aspect, the present invention provides a general verification methodology verification platform, comprising: a memory and a processor, the memory and the processor are communicatively connected to each other, computer instructions are stored in the memory, and the processor executes the automated test case integration method of the above-mentioned first aspect or any corresponding embodiment thereof, or the use case testing method of the above-mentioned second aspect or any corresponding embodiment thereof by executing the computer instructions.

[0055] In a sixth aspect, the present invention provides a computer-readable storage medium having computer instructions stored thereon, the computer instructions being used to enable a computer to execute the automated test case integration method of the first aspect or any corresponding embodiment thereof, or the use case testing method of the second aspect or any corresponding embodiment thereof.

[0056] In the seventh aspect, the present invention provides a computer program product, including computer instructions, which are used to enable a computer to execute the automated test case integration method of the above-mentioned first aspect or any corresponding embodiment, or the use case testing method of the above-mentioned second aspect or any corresponding embodiment. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0058] Figure 1 is a flow chart of an automated test case integration method according to an embodiment of the present invention;

[0059] Figure 2 is a flow chart of another automated test case integration method according to an embodiment of the present invention;

[0060] Figure 3 is a flowchart of a use case testing method according to an embodiment of the present invention;

[0061] Figure 4 It is a UVM verification structure diagram according to a use case test method of an embodiment of the present invention;

[0062] Figure 5 is a flowchart of another use case testing method according to an embodiment of the present invention;

[0063] Figure 6 is a structural block diagram of an automated test case integration device according to an embodiment of the present invention;

[0064] Figure 7 is a structural block diagram of a use case testing device according to an embodiment of the present invention;

[0065] Figure 8 It is a schematic diagram of the hardware structure of a computer device according to an embodiment of the present invention. DETAILED DESCRIPTION

[0066] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.

[0067] With the development of large-scale integrated circuit technology, the logic scale of chips and the complexity of circuits are increasing. In order to ensure the correctness of design functions, verifiers need to build a verification platform and construct test scenarios according to the test plan. At present, the UVM verification platform can provide a general verification framework, including transactions to be stimulated (Sequence), drivers that drive stimulus transactions to interfaces, monitors that monitor interfaces, reference models that simulate the main functions of the design to be tested, and scoreboards that compare the output of the reference model with the output of the design to be tested. Therefore, verifiers can develop different test cases.

[0068] However, in large-scale chip verification scenarios, the number of test cases will increase significantly. When there are many automated test cases maintained by each project, management becomes chaotic and inefficient. In current test case management, engineers generally manually enter the test cases in the verification plan or use external scripting languages ​​to process a large amount of log information. It is not timely and friendly for verification personnel and verification platforms to obtain and process test case information.

[0069] It is understandable that with the update and iteration of the design, it is usually necessary to reuse old test cases. Old test cases are difficult to be directly used by new test cases and need to be processed and modified, that is, the same stimulus class cannot be reused across modules. The management and reuse of these test cases are coupled to a certain extent with the verification platform.

[0070] The present invention provides an automated test case integration method, which is applied to large-scale hardware verification test scenarios. It only needs to call an automated Python script on the original verification platform to implement iteration (adding new test cases) and reuse (reusing stimulus classes) of a test case library, and it only needs to call an automated Python script on the original verification platform to implement cross-module reuse of stimulus classes in the test case library.

[0071] According to an embodiment of the present invention, an embodiment of an automated test case integration method is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0072] In this embodiment, an automated test case integration method is provided, which can be used for the above-mentioned computer. Figure 1 is a flowchart of an automated test case integration method according to an embodiment of the present invention. Figure 1 As shown, the process includes the following steps:

[0073] Step S101, obtaining all stimulus classes pre-registered in the universal verification methodology verification platform; the stimulus class encapsulates logic corresponding to multiple test stimuli.

[0074] It should be noted that the Universal Verification Methodology Verification Platform (UVM Verification Platform), a standard methodology for creating reusable verification components, is used for hardware verification. UVM provides a framework that contains a rich library and methods to support modeling, configuration, control and reporting of advanced verification environments.

[0075] It is understandable that, in the UVM environment, the stimulus class refers to the class used to generate test stimuli, multiple test stimuli refer to input sequences under a variety of different test scenarios or conditions, and each test stimulus represents a specific test situation. The logic corresponding to the multiple test stimuli refers to the logic implemented inside each test stimulus class, for example, a certain logic is how to generate the test condition A of the hardware to be tested, and the logic at least includes the properties, file path, and operation method of generating the test condition A of the hardware to be tested.

[0076] Specifically, a Python script can be used to traverse the code directory of the verification platform, identify all test files with specific naming rules, and automatically extract all inherited stimulus classes and their corresponding logic from these files according to a preset parsing algorithm.

[0077] In the UVM verification platform, test stimuli are applied to the hardware to be verified (such as chips, etc.) to trigger specific behaviors and responses. Pre-registration in the UVM verification platform means that the stimulus class has been defined and configured in the verification platform and is available for use at any time. Different test cases correspond to different stimulus classes, and these registered stimulus classes cannot be reused. In other words, when different test cases may require the same stimulus class, they need to be registered twice. Even if the stimulus class is the same, repeated registration is still required.

[0078] Step S102, extracting multiple preset field information in the logic, and extracting the function call relationship between multiple test stimuli.

[0079] It should be noted that the multiple preset field information in the logic refers to the configuration information pre-defined in the test stimulus, which is used to implement the logic corresponding to the multiple test stimuli.

[0080] It is understandable that different test stimuli are not separate or isolated, and there is still a calling or dependent relationship between these test stimuli. For example, a test stimulus T1 needs to execute another test stimulus T2 to set the initial state first. At this time, the function of test stimulus T1 will call the function of test stimulus T2.

[0081] Specifically, use static code analysis tools to identify the variables and configuration parameter fragments used within the logic, obtain the call graph or class diagram preset during code writing, analyze the direct or indirect calling relationship between methods, and determine the function calling relationship between multiple test stimuli.

[0082] Step S103, based on the function call relationship between the multiple test stimuli, multiple preset fields are rendered to obtain a reusable encapsulator interface class file.

[0083] It can be understood that by rendering multiple preset fields, a reusable encapsulator interface class file is obtained, which means that a unified and standard public encapsulator interface class file (which can be understood as a public interface) is obtained. Before the reusable encapsulator interface class file is generated, the stimulus class cannot be called across modules individually. Once the reusable encapsulator interface class file is generated, different test stimuli can be called in a standardized manner, thereby realizing the reuse of test cases when calling the stimulus class.

[0084] Exemplarily, based on the extracted function prototype and preset field information, the Mako template engine is used to fill in the pre-prepared wrapper_template.sv template file to generate wrapper.sv, which is a reusable wrapper interface class file.

[0085] The example code in a reusable wrapper interface class file provided by this embodiment is as follows:

[0086] interface class wrapper;

[0087] pure virtual function void cal_xor(...);

[0088] pure virtual function void cal_crc(...);

[0089] pure virtual task void dma_read(input...,output...);

[0090] pure virtual task void dma_write(input...,output...);

[0091] endclass:wrapper;

[0092] Among them, interface class wrapper means that an interface class named wrapper is defined; purevirtual function void cal_xor(...) and pure virtual function void cal_crc(...) represent different pure virtual functions respectively; pure virtual task void dma_read(input...,output...) and purevirtual task void dma_write(input...,output...) represent different tasks with void return type, with input and output parameters respectively.

[0093] Step S104, and, based on the function call relationship between the multiple test stimuli, configure the multiple test stimuli with import statements corresponding to the encapsulator interface class file, the import statement is used to indicate the establishment of a binding relationship between the encapsulator interface class file and each of the multiple test stimuli.

[0094] It can be understood that the purpose of adding necessary declarations in each stimulus class is to introduce (also called instantiate) the above-mentioned wrapper interface file, thereby establishing an association between the stimulus class and the wrapper interface class.

[0095] Specifically, in each source code of the stimulus class that needs to be reused, an import statement for the generated wrapper interface class is added through a script to implement the wrapper interface in the stimulus class.

[0096] This embodiment may provide a sample code for implementing a wrapper interface in an incentive class, as shown below:

[0097] class dma_imp_seg extends mcu_seg_base implements wrapper;

[0098] Among them, dma_imp_seg represents the defined class name; extends mcu_seg_base means that dma_imp_seg inherits from the mcu_seg_base base class; implements wrapper means that the stimulus class implements the introduction of the wrapper interface.

[0099] Step S105, obtaining a preset reporter interface class file and all test case information in a test case information library, wherein a resource pool class is predefined in the reporter interface class file.

[0100] It should be noted that the preset reporter interface class file refers to a pre-defined class specifically used to report information about the verification test process. It can be understood as a feedback mechanism for chip test results and verification progress, ensuring the efficiency of chip verification testing and providing a stable and synchronized chip verification environment.

[0101] Exemplarily, an existing reporter.sv file is read, in which a resource pool class (such as a predefined uvm_pool class) is defined for storing shared data, and specific information of all test cases is extracted from a database, including at least the test case name, test case coverage, test case priority, etc.

[0102] Step S106, initializing all test case information into a test case file.

[0103] It can be understood that initializing all test case information into a test case file means converting the data in the test case information library into a specific file format (such as a YAML file) to facilitate automatic integration into the resource pool, which also simplifies the steps in the related technology that require integrating different test cases separately in sequence.

[0104] Step S107, parameterize the resource pool corresponding to the resource pool class as a basic data type. The parameterized resource pool is used to store reporter interface class files, encapsulator interface class files and test case files to complete the test case management integration and reuse incentive integration of the general verification methodology verification platform.

[0105] It should be noted that the resource pool is a specific instance of the resource pool class instantiation, which is adapted to different types of resource storage through parameterization (also known as specifying data types). For example, encapsulator class interface files, reporter class interface files, and test case files belong to different types of resource storage. Therefore, the resource pool needs to be parameterized to efficiently store reporter interface class files, encapsulator interface class files, and test case files to ensure resource sharing and improve reuse efficiency.

[0106] The embodiment of the present invention extracts the function call relationship between preset field information and test stimulus, clearly determines the association between various stimulus classes, provides a basis for subsequent reuse, renders preset fields and generates a reusable wrapper interface class file, and encapsulates the logic of the stimulus class in a standardized interface. Compared with the related art of overloading or rewriting the old stimulus class, this embodiment can directly reuse similar stimulus classes between different modules through standardized wrapper interface class files, thereby avoiding the need to overload or rewrite the stimulus class when calling at different module levels. By configuring the import declaration corresponding to the wrapper interface class file for multiple test stimuli, it is indicated that the encapsulation The binding relationship between the reporter interface class file and the test stimulus. When calling the test stimulus, no matter whether it is the same module or not, the corresponding wrapper interface class file can be used directly without calling the implementation of each stimulus class separately, thereby improving the efficiency of cross-module reuse. The resource pool class is parameterized and used to store reporter interface class files, wrapper interface class files, and test case files. It can be understood that all relevant resources are stored in a standardized parameterized resource pool to facilitate the sharing of reporter interface class files, wrapper interface class files, and test case files between different modules, further significantly improving the cross-module reuse rate of the stimulus class.

[0107] In this embodiment, an automated test case integration method is provided, which can be used for the above-mentioned computer, and the process includes the following steps:

[0108] Step S201, obtain all the stimulus classes pre-registered in the universal verification methodology verification platform; the stimulus class encapsulates the logic corresponding to multiple test stimuli. Figure 1 Step S101 of the illustrated embodiment will not be described in detail here.

[0109] Step S202: extract multiple preset field information in the logic, and extract the function call relationship between multiple test stimuli. Figure 1 Step S102 of the illustrated embodiment will not be described in detail here.

[0110] Step S203, based on the function call relationship between the multiple test stimuli, multiple preset fields are rendered to obtain a reusable encapsulator interface class file.

[0111] Specifically, the above step S203 includes:

[0112] Step S2031, storing the file path segment, the class name segment, the attribute segment, and the operation method in a data frame object.

[0113] Specifically, the information of each field, including file path, class name, attributes and operation method, is collected and stored in a data frame object (DataFrame object). A data frame is a two-dimensional table data structure, and a data frame object can be determined by the Pandas library in Python. It is understandable that storing these fragments of information in a data frame object makes it more intuitive to understand the logic of multiple test incentives. When R&D personnel make modifications, they can directly make intuitive modifications according to the content of the DataFrame object.

[0114] Step S2032, obtaining a preset encapsulator class template file, the encapsulator class template file serving as a prototype of the encapsulator interface class file.

[0115] Understandably, using preset templates ensures that developers do not need to write wrapper classes from scratch every time, saving time.

[0116] Step S2033, converting the prototype declaration of the function and the corresponding data frame object into the format of Python dictionary data.

[0117] Step S2034, using the render() method of the mako library, renders the prototype declaration of the function converted into the format of Python dictionary data and the data frame object converted into the format of Python dictionary data into the preset wrapper class template file to obtain the wrapper interface class file, wherein the wrapper interface class includes a tracker() method and an is_inlib() method.

[0118] Among them, the tracker() method is used to display the function call relationship between multiple test stimuli in the stimulus class in the general verification methodology verification platform; the is_inlib() method is used to query the operation methods in multiple test stimuli.

[0119] Specifically, the render() method of the mako library is used to render the previously converted data (such as function prototype declaration) into the preset wrapper class template file to generate the final wrapper interface class file. The public logic class in this wrapper interface class file contains two methods: tracker() and is_inlib(). The tracker() and is_inlib() methods contained in the wrapper interface class are used to display the function call relationship and query operation methods, respectively, effectively ensuring code reuse.

[0120] Exemplarily, file path: / path / to / wrapper; class name: WrapperClass; attributes: attr1, attr2; operation methods: method1(), method2(), store the above information in a Pandas data frame object, convert the function prototype declaration and the corresponding data frame object into the format of Python dictionary data, convert the data frame object into a Python dictionary, output the Python dictionary data, use the render() method of the mako library, render the dictionary data into the template file wrapper_template.sv, and obtain the wrapper.sv file, which encapsulates a common task task. This common task includes tracker() and is_inlib() methods, which are respectively used to display function call relationships and query operation methods, thereby ensuring code reuse.

[0121] In this embodiment, by storing key information such as file path, class name, attributes and operation methods in a Pandas data frame object, developers can view and modify the content of the data frame object, thereby improving the maintainability of the code. Through the preset wrapper class template file, the data frame object is converted into Python dictionary format, and the render() method of the mako library is used to automatically render these data into the template file. Developers can avoid writing the wrapper class from scratch every time, reducing the tedious steps in the related art where developers still need to write a wrapper class from beginning to end, saving development time. The tracker() and is_inlib() methods contained in the public task task of the wrapper interface class file can integrate function call relations and operation method queries in a public task task at one time, effectively improving the reusability of the entire wrapper interface class file.

[0122] Step S204, and, based on the function call relationship between the multiple test stimuli, configure the multiple test stimuli with import statements corresponding to the encapsulator interface class file, the import statement is used to indicate the establishment of a binding relationship between the encapsulator interface class file and each of the multiple test stimuli. For details, see Figure 1 Step S104 of the illustrated embodiment will not be described in detail here.

[0123] Step S205, obtaining a preset reporter interface class file and all test case information in the test case information library, wherein the reporter interface class file predefines a resource pool class. Figure 1 Step S105 of the illustrated embodiment will not be described in detail here.

[0124] Step S206: Initialize all test case information into a test case file. Figure 1 Step S106 of the illustrated embodiment will not be described in detail here.

[0125] Step S207, parameterize the resource pool corresponding to the resource pool class into a basic data type, and the parameterized resource pool is used to store the reporter interface class file, the wrapper interface class file and the test case file, so as to complete the test case management integration and reuse incentive integration of the general verification methodology verification platform. For details, please refer to Figure 1 Step S107 of the illustrated embodiment will not be described in detail here.

[0126] In an optional implementation, the above step S203 may also include: analyzing the logic in each incentive class, identifying the function call link in the logic in each incentive class, and dividing the main process and sub-process of the incentive execution function; according to the divided multiple main processes and sub-processes, respectively setting corresponding basic interface classes, and setting the parent classes inherited by different incentive classes as basic interface classes; setting the inherited basic interface class as a reusable encapsulator interface class file.

[0127] Specifically, the basic interface class contains methods for operating preset fields, such as setUp(), which is used to initialize the test environment and set preset fields. executeTest() is used for the core test logic execution entry, and different internal methods are called according to specific stimuli. tearDown() is used to clean up the test environment and release resources. verifyResults() is used for unified result verification logic, accepting test results as input to determine whether they pass or fail.

[0128] It can be understood that during the operation, the specific stimulus class instance can be dynamically bound to the method of the wrapper interface class according to the pre-configured stimulus class and interface class. When adding or modifying the test stimulus, only the configuration needs to be adjusted without changing the wrapper interface class code, thus achieving rapid integration.

[0129] This embodiment analyzes the logic in each stimulus class, identifies the function call link in the logic of each stimulus class, and divides the main process and sub-process of the stimulus execution function; according to the divided multiple main processes and sub-processes, corresponding basic interface classes are set respectively, and the parent classes inherited by different stimulus classes are set as basic interface classes; the inherited basic interface class is set as a reusable encapsulator interface class file, which can not only improve the modularity of the test code, but also simplify the stimulus class writing process by reducing duplicate code, thereby achieving rapid integration.

[0130] In an optional implementation, the operation method includes different task methods; each task method corresponds to a task call relationship; wherein the function call relationship includes a task call relationship; an automated test case integration method provided in this embodiment also includes:

[0131] Step A1, determining the levels of different tasks based on different task calling relationships;

[0132] Step A2, the levels of different tasks are used to characterize the execution order of different tasks, wherein each task method corresponds to one task;

[0133] Step A3, selecting a first incentive class to which a task corresponding to a first task level belongs, wherein the first task level is used to represent a task that is to be executed for the first time in the execution order;

[0134] Step A4: adding the wrapper implementation declaration to the first stimulus class, wherein the first stimulus class includes a plurality of tasks.

[0135] It should be noted that the task method refers to the function used by a specific task defined in the automated testing process, and the task call relationship refers to the calling order and dependency relationship between task methods. For example, task A may depend on the output data of task B, so task A calls task B. The function call relationship refers to the calling and dependency relationship between different functions in the program, including the task call relationship. The task level refers to the priority or hierarchy of different tasks in the execution order. The task level is used to indicate which tasks are executed first and which tasks are executed later.

[0136] Specifically, refer to Figure 2 , use the topological sorting algorithm to analyze the task graph, find out the tasks without dependencies as the first-level tasks, and so on, until all tasks are assigned; apply the task level determined in step A1 to the task method. Tasks with lower levels are executed first, and tasks with higher levels are executed later. In the test framework, configure the execution order of tasks according to the order of task levels; select all level 1 tasks from the task list and classify these tasks into the first stimulus class. The tasks in the first stimulus class are the first set of tasks to be executed. In the definition of the first stimulus class, add a wrapper implementation declaration to implement the wrapper interface in the stimulus class.

[0137] In this embodiment, since the wrapper implementation declaration provides a unified interface, the process of program code compilation and execution cannot be executed in parallel, and the subsequent code can only be executed in sequence starting from the starting position of the code. The first-level task is the most basic task that does not depend on other tasks. It can also be understood as the basis for the execution of subsequent tasks and the first task at the starting position. By declaring it in the first-level task, it can be ensured that all subsequent tasks run in a consistent environment, and that all subsequent function tasks can introduce a unified wrapper interface, thereby ensuring the reusability of the stimulus class corresponding to the wrapper interface class file.

[0138] In an optional embodiment, the reporter interface class file also includes a basic data class, a reporter interface class, and a sequence information class;

[0139] Among them, the reporter interface class encapsulates report number function logic, report timestamp function logic, report status function logic, report coverage function logic, report description function logic, report inheritance logic and report summary logic; the sequence information class encapsulates the identification information of the test case, the timestamp information of the test case, the test result information of the test case, the coverage information of the test case, the description information of the test case and the hierarchy information of the test case.

[0140] It should be noted that the basic data class, inherited from uvm_object, is used to provide basic attribute definitions of test cases, such as test case names and identification information. The reporter interface class provides a set of common reporting functions, including report_id(), report_timestamp(), report_status(), report_coverage(), report_description(), report_heri(), and report_sum(), each of which encapsulates specific reporting logic. The sequence information class encapsulates detailed information of the test case, including at least identification information, timestamp, test results, coverage, description, and hierarchy.

[0141] This embodiment reduces the steps of repeated code writing and improves the reusability of the code by encapsulating the general reporting function logic. During the test execution process, no matter what test result, it can be reported through the reporter interface class, and all test contents can be reported directly at one time, ensuring the real-time update of the test case results so that the testers can see the test results in real time.

[0142] In this embodiment, a use case testing method is provided, which can be used for the above-mentioned computer. Figure 3 is a flow chart of a use case testing method according to an embodiment of the present invention. Figure 3 As shown, the process includes the following steps:

[0143] Step S301, in response to a test trigger instruction, obtaining target test case information and a corresponding mark bit in the test trigger instruction.

[0144] Step S302, confirming the type of the target test case according to the mark bit.

[0145] Step S303, when it is confirmed that the target test case is of the first type, the target test case information is integrated based on the automated test case integration method of the first aspect or any corresponding implementation method thereof, and the first type is used to indicate that the target test case information is newly added test case information.

[0146] Step S304, according to the test trigger instruction, call the reuse stimulus integrated in the general verification methodology verification platform in the automated test case integration method of the first aspect or any corresponding implementation method, and execute the test operation corresponding to the target test case information.

[0147] It should be noted that the test trigger instruction refers to a command signal used to start or trigger a test operation, and the target test case information refers to the data and detailed information of the specific use case to be tested. The tag bit is used to identify and distinguish the flag variable of the test case status type. At the beginning of the test, it is necessary to respond to instructions from the test management system or the user to obtain the specific use case to be tested and its related information, in order to lay a good foundation for subsequent test operations, to ensure which use case is tested, and whether the test case is available. When it is confirmed that the target test case is of the first type, it means that the target test case information is the newly added test case information, then the reused stimulus integrated in the general verification methodology verification platform in the automated test case integration method of the first aspect or any corresponding embodiment thereof is called, and the test operation corresponding to the target test case information is executed to quickly reuse the stimulus code of the general verification methodology verification platform that has integrated the common stimulus class.

[0148] In actual operation, the UVM verification structure that adds test case management and reuses stimulus classes can be referred to Figure 4 ,in:

[0149] Sequencer: organizes and manages sequences and is used to pass transactions generated by sequences to the driver.

[0150] Driver: Requests sequence_item data packet transaction from sequencer, and drives the information in the transaction to the port of DUT according to the bus protocol.

[0151] Monitor: Used to receive data from the DUT, communicate with the DUT interface signals, convert them into transaction-level transactions and transmit them to subscribed components.

[0152] Reference model: Reference model, which simulates the main functions of the design to be tested and provides theoretical values ​​for the scoreboard.

[0153] Scoreboard: Compares the data from the monitor with the data from the Reference model.

[0154] Case manager: It consists of an interface class that encapsulates all tasks and a reporter interface class that reports case information, and initializes the case information from the YAML DB. The interface class features can be used to implement test case recording, analysis, and customized reporting. The manager component is not a native component class of UVM, but a uvm_object class that relies on the interface class to implement test case reuse and management.

[0155] YAML DB: Test case information library, containing data sets of different use cases, such as test name, coverage, test case priority, function, test result test flag (used to report historical test results for verifying the regression process), and other data information.

[0156] For example, to verify a certain interactive function of the DUT (chip under test), a new test case is created. The test case obtains the corresponding sequence (test stimulus class) through the wrapper (wrapper class) in the case manager (case management). The sequence will generate transactions. The sequencer (stimulus manager) schedules these sequences according to the test case. The sequencer sends transactions to the driver (transmitter) in the expected order. The driver converts the transaction into a physical signal recognizable by the DUT to complete the entire test process. The monitor monitors the response of the DUT and obtains the actual output signal of the DUT. The reference model (expected model) is a pre-designed model. This model simulates the response signal that the DUT should have under this test case based on the content of the in_agent (input entity). The scoreboard obtains the actual output signal of the DUT based on the content of the out_agent (output entity). Then the actual output signal of the DUT is compared with the expected signal generated by the reference model. The comparison result will generate a test report and store it in the YAML DB (YAML file library). The reporter (reporter class) in the case manager is used to report the test results in the YAML DB. Finally, the comprehensive verification of the DUT interaction function is completed and the corresponding test report is generated.

[0157] The use case test method provided in this embodiment responds to the test trigger instruction and obtains the target test case information and the corresponding mark bit in the test trigger instruction. The type of the target test case is confirmed according to the mark bit. When the target test case is confirmed to be of the first type, the target test case information is integrated based on the automated test case integration method of the first aspect or any corresponding implementation method thereof, and the reused stimulus in the general verification methodology verification platform is used to quickly reuse the existing stimulus code, which greatly reduces the duplication of testers and improves the test execution efficiency.

[0158] In an optional embodiment, the method further includes:

[0159] When it is confirmed that the type of the test case is the second type, the reuse stimulus integrated in the general verification methodology verification platform in the automated test case integration method of the first aspect or any corresponding implementation method is called directly according to the test trigger instruction, and the test operation corresponding to the target test case information is executed; wherein the second type is used to indicate that the target test case information is integrated and valid test case information in the general verification methodology verification platform;

[0160] Alternatively, when it is confirmed that the type of the test case is the third type, the target test case information is cleared from the general verification methodology verification platform, wherein the third type is used to indicate that the target test case information is integrated and invalid test case information in the general verification methodology verification platform.

[0161] For example, refer to Figure 5 , after the verification platform integrates the test case management and reuse components, first execute the test command script and execute a test case. This test case can reuse the virtual method in the wrapper interface class. When the verification platform is executed, the case_infoload() function is first called. This method searches the YAML file to see if the test case already exists. If the test flag is "add", the test is executed directly. If the test flag is "off", it is removed from the case library. If the test flag is "new", the automation script is executed and the test case library is updated and the simulation is re-executed. The test flag is reset or modified after the verification platform case data is updated. Execute this test case, and call the case_infoupdate() method after the test to update the test result information directly to the YAML file.

[0162] The use case testing method provided in this embodiment uses a marker bit to distinguish test case types, namely the first type, the second type and the third type, and can flexibly handle newly added test cases and existing test cases to ensure the accuracy of the test cases.

[0163] This embodiment provides an automated test case integration device, such as Figure 6 As shown, including:

[0164] The stimulus class acquisition and parsing module 601 is used to acquire all stimulus classes pre-registered by the universal verification methodology verification platform; the stimulus class encapsulates logic corresponding to multiple test stimuli;

[0165] The logic analysis and encapsulator generation module 602 is used to extract multiple preset field information in the logic, and to extract the function call relationship between multiple test stimuli;

[0166] The test stimulus configuration and binding module 603 is used to render multiple preset fields based on the function call relationship between multiple test stimuli to obtain a reusable encapsulator interface class file;

[0167] The reporter interface and resource management module 604 is used to configure the import declarations corresponding to the encapsulator interface class files for the multiple test stimuli based on the function call relationship between the multiple test stimuli, and the import declaration is used to indicate the establishment of a binding relationship between the encapsulator interface class file and each of the multiple test stimuli;

[0168] The test case initialization module 605 is used to obtain a preset reporter interface class file and all test case information in the test case information library, wherein the resource pool class is predefined in the reporter interface class file;

[0169] Resource pool parameterization module 606, used to initialize all test case information into a test case file;

[0170] The test case integration and reuse management module 607 is used to parameterize the resource pool corresponding to the resource pool class into a basic data type. The parameterized resource pool is used to store reporter interface class files, encapsulator interface class files and test case files to complete the test case management integration and reuse incentive integration of the general verification methodology verification platform.

[0171] In some optional implementations, the test stimulus configuration and binding module 603 includes:

[0172] A data storage unit, used for storing a file path segment, a class name segment, an attribute segment, and an operation method in a data frame object;

[0173] A template acquisition unit, used for acquiring a preset encapsulator class template file, the encapsulator class template file being used as a prototype of the encapsulator interface class file;

[0174] The data conversion unit is used to convert the function prototype declaration and the corresponding data frame object into the Python dictionary data format;

[0175] The template rendering unit is used to render the prototype declaration of the function converted into the format of Python dictionary data and the data frame object converted into the format of Python dictionary data into a preset wrapper class template file through the render() method of the mako library to obtain a wrapper interface class file, wherein the wrapper interface class includes a tracker() method and an is_inlib() method;

[0176] The tracker() method is used to display the function call relationship between multiple test stimuli in the stimulus class in the general verification methodology verification platform;

[0177] The is_inlib() method is used to query the operation methods in multiple test stimuli.

[0178] In some optional implementations, the operation method includes different task methods; each task method corresponds to a task call relationship; wherein the function call relationship includes a task call relationship; the above device further includes:

[0179] A task level determination module is used to determine the levels of different tasks based on different task calling relationships;

[0180] The task level characterization module is used for characterizing the execution order of different tasks at different levels, where each task method corresponds to one task;

[0181] A first incentive class selection module, used to select a first incentive class to which a task corresponding to a first task level belongs, wherein the first task level is used to represent a task that is to be executed for the first time in the execution order;

[0182] The wrapper implementation adding module is used to add the wrapper implementation declaration to the first stimulus class, wherein the first stimulus class includes a plurality of tasks.

[0183] In some optional embodiments, the reporter interface class file also includes a basic data class, a reporter interface class, and a sequence information class;

[0184] Among them, the reporter interface class encapsulates report number function logic, report timestamp function logic, report status function logic, report coverage function logic, report description function logic, report inheritance logic and report summary logic; the sequence information class encapsulates the identification information of the test case, the timestamp information of the test case, the test result information of the test case, the coverage information of the test case, the description information of the test case and the hierarchy information of the test case.

[0185] The further functional description of each of the above modules and units is the same as that of the above corresponding embodiments and will not be repeated here.

[0186] In this embodiment, a use case testing device is also provided, which is used to implement the above-mentioned embodiments and preferred implementation modes, and the descriptions that have been made will not be repeated. As used below, the term "module" can implement a combination of software and / or hardware for a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.

[0187] This embodiment provides a test device for a use case, such as Figure 7 As shown, including:

[0188] The test instruction parsing and target identification module 701 is used to obtain the target test case information and the corresponding mark bit in the test trigger instruction in response to the test trigger instruction;

[0189] The test case type confirmation and processing module 702 is used to confirm the type of the target test case according to the mark bit;

[0190] A new test case integration module 703 is used to integrate the target test case information based on the automated test case integration method when it is confirmed that the target test case is of the first type, wherein the first type is used to indicate that the target test case information is newly added test case information;

[0191] The reuse stimulus scheduling and test execution module 704 is used to call the reuse stimulus integrated in the general verification methodology verification platform in the automated test case integration method according to the test trigger instruction, and execute the test operation corresponding to the target test case information.

[0192] In some optional embodiments, the above device further includes:

[0193] A general verification module, which is used to directly call the reuse stimulus integrated in the general verification methodology verification platform in the automated test case integration method according to the test trigger instruction when confirming that the type of the test case is the second type, and execute the test operation corresponding to the target test case information; wherein the second type is used to indicate that the target test case information is the test case information that has been integrated and is valid in the general verification methodology verification platform;

[0194] The test case clearing module is used to clear the target test case information from the general verification methodology verification platform when it is confirmed that the type of the test case is the third type, wherein the third type is used to indicate that the target test case information is the test case information that has been integrated in the general verification methodology verification platform and is invalid.

[0195] The further functional description of each of the above modules and units is the same as that of the above corresponding embodiments and will not be repeated here.

[0196] The automated test case integration device in this embodiment is presented in the form of a functional unit, where the unit refers to an ASIC (Application Specific Integrated Circuit) circuit, a processor and memory that executes one or more software or fixed programs, and / or other devices that can provide the above functions.

[0197] The embodiment of the present invention also provides a universal verification methodology verification platform, having the above Figure 6 or Figure 7 The automated test case integration device shown.

[0198] See also Figure 8 , Figure 8 is a schematic diagram of a general verification methodology verification platform provided by an optional embodiment of the present invention, such as Figure 8 As shown, the universal verification methodology verification platform includes: one or more processors 10, a memory 20, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. The various components are connected to each other using different buses for communication, and can be installed on a common mainboard or installed in other ways as needed. The processor can process instructions executed in the universal verification methodology verification platform, including instructions stored in or on the memory to display graphical information of the GUI on an external input / output device (such as a display device coupled to the interface). In some optional embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories and multiple memories. Similarly, multiple universal verification methodology verification platforms can be connected, and each device provides some necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system). Figure 8 A processor 10 is taken as an example.

[0199] The processor 10 may be a central processing unit, a network processor or a combination thereof. The processor 10 may further include a hardware chip. The hardware chip may be a dedicated integrated circuit, a programmable logic device or a combination thereof. The programmable logic device may be a complex programmable logic device, a field programmable gate array, a general purpose array logic or any combination thereof.

[0200] The memory 20 stores instructions executable by at least one processor 10, so that at least one processor 10 executes the method shown in the above embodiment.

[0201] The memory 20 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required by at least one function; the data storage area may store data created according to the use of the universal verification methodology verification platform, etc. In addition, the memory 20 may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some optional embodiments, the memory 20 may optionally include a memory remotely arranged relative to the processor 10, and these remote memories may be connected to the universal verification methodology verification platform via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0202] The memory 20 may include a volatile memory, such as a random access memory; the memory may also include a non-volatile memory, such as a flash memory, a hard disk or a solid state drive; the memory 20 may also include a combination of the above types of memory.

[0203] The universal verification methodology verification platform further includes a communication interface 30 for the universal verification methodology verification platform to communicate with other devices or communication networks.

[0204] The embodiment of the present invention also provides a computer-readable storage medium. The method according to the embodiment of the present invention can be implemented in hardware, firmware, or can be implemented as a computer code that can be recorded in a storage medium, or can be implemented as a computer code that is originally stored in a remote storage medium or a non-temporary machine-readable storage medium and will be stored in a local storage medium through a network download, so that the method described herein can be stored in such software processing on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. Among them, the storage medium can be a magnetic disk, an optical disk, a read-only storage memory, a random access memory, a flash memory, a hard disk or a solid-state hard disk, etc.; further, the storage medium can also include a combination of the above types of memories. It can be understood that a computer, a processor, a microprocessor controller, or programmable hardware includes a storage component that can store or receive software or computer code. When the software or computer code is accessed and executed by a computer, a processor, or hardware, the method shown in the above embodiment is implemented.

[0205] A part of the present invention may be applied as a computer program product, such as a computer program instruction, which, when executed by a computer, can call or provide the method and / or technical solution according to the present invention through the operation of the computer. Those skilled in the art should understand that the existence of the computer program instruction in a computer-readable medium includes, but is not limited to, a source file, an executable file, an installation package file, etc., and accordingly, the way in which the computer program instruction is executed by the computer includes, but is not limited to: the computer directly executes the instruction, or the computer compiles the instruction and then executes the corresponding compiled program, or the computer reads and executes the instruction, or the computer reads and installs the instruction and then executes the corresponding installed program. Here, the computer-readable medium may be any available computer-readable storage medium or communication medium accessible to the computer.

[0206] Although the embodiments of the present invention have been described in conjunction with the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present invention, and such modifications and variations are all within the scope defined by the claims.

Claims

1. An automated test case integration method, It is characterized in that The method comprises: Obtain all stimulus classes pre-registered on the universal verification methodology verification platform; the stimulus classes encapsulate logic corresponding to multiple test stimuli; Extracting a plurality of preset field information in the logic, and extracting a plurality of function call relationships between the test stimuli; Based on the function call relationship between the plurality of test stimuli, the plurality of preset fields are rendered to obtain a reusable encapsulator interface class file; And, based on the function call relationship between the multiple test stimuli, configure the multiple test stimuli with an import statement corresponding to the wrapper interface class file, wherein the import statement is used to indicate the establishment of a binding relationship between the wrapper interface class file and each of the multiple test stimuli; Obtaining a preset reporter interface class file and all test case information in a test case information library, wherein a resource pool class is predefined in the reporter interface class file; Initialize all the test case information into a test case file; The resource pool corresponding to the resource pool class is parameterized as a basic data type, and the parameterized resource pool is used to store the reporter interface class file, the encapsulator interface class file and the test case file to complete the test case management integration and reuse incentive integration of the general verification methodology verification platform.

2. The method according to claim 1, It is characterized in that The plurality of preset fields include a file path segment, a class name segment, an attribute segment and an operation method; Based on the function call relationship between the multiple test stimuli, the multiple preset fields are rendered to obtain a reusable encapsulator interface class file, including: Store the file path segment, the class name segment, the attribute segment, and the operation method in a data frame object; Obtaining a preset encapsulator class template file, wherein the encapsulator class template file serves as a prototype of the encapsulator interface class file; Convert the function prototype declaration and the corresponding data frame object into Python dictionary data format; Rendering the prototype declaration of the function converted into the format of the Python dictionary data and the data frame object converted into the format of the Python dictionary data into the preset wrapper class template file through the render() method of the mako library, to obtain the wrapper interface class file, wherein the wrapper interface class includes a tracker() method and an is_inlib() method; The tracker() method is used to display the function call relationship between multiple test stimuli in the stimulus class in the general verification methodology verification platform; The is_inlib() method is used to query the operation methods in multiple test stimuli.

3. The method according to claim 2, It is characterized in that The operation method includes different task methods; Each of the task methods corresponds to a task calling relationship; wherein the function calling relationship includes the task calling relationship; and the method further includes: Determine the levels of different tasks based on different task calling relationships; The levels of the different tasks are used to characterize the execution order of the different tasks, wherein each task method corresponds to one task; Selecting a first incentive class to which a task corresponding to a first task level belongs, wherein the first task level is used to represent a task that is to be executed for the first time in the execution order; The wrapper implementation declaration is added to the first stimulus class, wherein the first stimulus class includes a plurality of tasks.

4. The method according to any one of claims 1 to 3, It is characterized in that The reporter interface class file also includes a basic data class, a reporter interface class and a sequence information class; Among them, the reporter interface class encapsulates report number function logic, report timestamp function logic, report status function logic, report coverage function logic, report description function logic, report inheritance logic and report summary logic; the sequence information class encapsulates test case identification information, test case timestamp information, test result information of the test case, test case coverage information, test case description information and test case hierarchy information.

5. A use case testing method, It is characterized in that The method comprises: In response to a test trigger instruction, obtaining target test case information and a corresponding mark bit in the test trigger instruction; Confirming the type of the target test case according to the mark bit; When it is confirmed that the target test case is of the first type, integrating the target test case information based on the automated test case integration method according to any one of claims 1 to 4, wherein the first type is used to indicate that the target test case information is newly added test case information; And according to the test trigger instruction, call the reuse stimulus integrated in the general verification methodology verification platform in the automated test case integration method as described in any one of claims 1-4 to execute the test operation corresponding to the target test case information.

6. The method according to claim 5, It is characterized in that The method further comprises: When it is confirmed that the type of the test case is the second type, the test trigger instruction is directly followed to call the reuse stimulus integrated in the general verification methodology verification platform in the automated test case integration method as described in any one of claims 1 to 4, and execute the test operation corresponding to the target test case information; wherein the second type is used to indicate that the target test case information is integrated and valid test case information in the general verification methodology verification platform; or, When it is confirmed that the type of the test case is the third type, the target test case information is cleared from the general verification methodology verification platform, wherein the third type is used to indicate that the target test case information is integrated and invalid test case information in the general verification methodology verification platform.

7. An automated test case integration device, It is characterized in that The device comprises: The stimulus class acquisition and parsing module is used to obtain all stimulus classes pre-registered in the universal verification methodology verification platform; the stimulus class encapsulates the logic corresponding to multiple test stimuli; A logic analysis and encapsulator generation module, used to extract a plurality of preset field information in the logic, and to extract a function call relationship between a plurality of the test stimuli; A test stimulus configuration and binding module, used for rendering a plurality of the preset fields based on the function call relationship between the plurality of the test stimuli to obtain a reusable encapsulator interface class file; A reporter interface and resource management module, configured to configure an import statement corresponding to the encapsulator interface class file for the multiple test stimuli based on the function call relationship between the multiple test stimuli, wherein the import statement is used to indicate the establishment of a binding relationship between the encapsulator interface class file and each of the multiple test stimuli; A test case initialization module, used for obtaining a preset reporter interface class file and all test case information in a test case information library, wherein a resource pool class is predefined in the reporter interface class file; A resource pool parameterization module, used for initializing all the test case information into a test case file; The test case integration and reuse management module is used to parameterize the resource pool corresponding to the resource pool class into a basic data type. The parameterized resource pool is used to store the reporter interface class file, the encapsulator interface class file and the test case file to complete the test case management integration and reuse incentive integration of the general verification methodology verification platform.

8. A use case test device, It is characterized in that The device comprises: A test instruction parsing and target identification module, used to respond to a test trigger instruction and obtain target test case information and corresponding marking bits in the test trigger instruction; A test case type confirmation and processing module, used to confirm the type of the target test case according to the mark bit; A new test case integration module, configured to integrate the target test case information based on the automated test case integration method according to any one of claims 1 to 5 when it is confirmed that the target test case is of a first type, wherein the first type is used to indicate that the target test case information is newly added test case information; The reused stimulus scheduling and test execution module is used to call the reused stimulus integrated in the general verification methodology verification platform in the automated test case integration method as described in any one of claims 1 to 4 in accordance with the test trigger instruction, and execute the test operation corresponding to the target test case information.

9. A universal verification methodology verification platform, It is characterized in that include: A memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the automated test case integration method described in any one of claims 1 to 4, or executes the use case testing method described in any one of claims 5 to 6 by executing the computer instructions.

10. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores computer instructions, which are used to enable the general verification methodology verification platform to execute the automated test case integration method described in any one of claims 1-4; or to execute the use case testing method described in any one of claims 5-6.

Citation Information

Cited By

  • UVM-based verification case construction method and system

    CN120850912A

  • Bus coverage rate collection method based on verification component, electronic equipment and medium

    CN120874725A