Compression Transfer Method, Device, Equipment and Storage Medium for Parameterized Class

By using compressed structures to classify and compress the parameters of parameterized classes in UVM verification methodology, the problem of cumbersome and difficult to maintain parameter transfer is solved, and the simplified delivery of parameterized classes and efficient maintenance of code is achieved.

CN114841118BActive Publication Date: 2025-05-27YUNHE ZHIWANG (SHANGHAI) TECHNOLOGY CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210508906.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-05-11
Publication Date
2025-05-27
Estimated Expiration
2042-05-11

AI Technical Summary

Technical Problem

In UVM verification methodology, the parameter passing of parameterized classes is complicated and easy to miss parameters, making it difficult to maintain and read the code, especially when the number of parameters is large.

Method used

By using the compressed structure to customize the data type in the package package file, the parameters in the verification component are classified and hierarchically compressed, and the final compression parameters of the custom data type are obtained, and these compression parameters are passed in the verification platform component.

Benefits of technology

The delivery process of parameterized classes is simplified, the number of parameters that need to be passed is reduced, the readability and maintenance of the code is improved, and parameter omissions and human errors are avoided.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114841118B_ABST
    Figure CN114841118B_ABST
Patent Text Reader

Abstract

An embodiment of the present invention provides a method, device, equipment and medium for compressed transmission of parameterized classes. The method includes: obtaining parameters to be processed in a verification component; classifying and hierarchically compressing the parameters in the verification component according to functions by using a compressed structure to customize data types in a package file, so as to obtain final compressed parameters of the customized data types; using the final compressed parameters of the customized data types to write a parameterized verification platform component and transmit the same therein. By classifying the application scenarios and functions of the parameters in the verification platform component, the present invention can achieve classified and hierarchical compression of more parameters, which is convenient for simplifying the transmission of a large number of parameters in a complex verification platform component and is also convenient for verification developers to read and understand.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular, to a method, device, equipment, and storage medium for compressing and transmitting parameterized classes. Background Art

[0002] Usually, people will build a verification platform based on the UVM verification methodology to verify the design under test (DUT). As Figure 1 shown, Figure 1 is a typical architecture of a verification platform built based on the UVM verification methodology.

[0003] It can be seen that usually in a verification platform, a signal interface ( Figure 1 the interface in

[0004]

[0005]

[0006]

[0007] (1) Use the macros uvm_object_param_utils and uvm_component_param_utils to register UVM objects or components.

[0007] (2) Parameters need to be specified when declaring and instantiating parameterized classes.

[0008] (3) The parameters of parameterized classes are passed layer by layer from the top-level component to the bottom-level component.

[0009] For example, for a DUT, if there are 4 parameters on its interface that need to be specified when instantiating it in the top-level module, then when writing a parameterized interface to model its input and output ports, the interface also has 4 corresponding parameters to model the input and output ports of the DUT.

[0010] This solution is feasible for the case of fewer parameters. However, imagine that the above interface parameters change from 4 to 20 or even more. Then, most of the content in the code is occupied by a large number of parameter transmissions, leading to the following problems:

[0011] (1) Since there are relatively many parameters to be transmitted, writing the parameterized class code in the verification environment will be very cumbersome and it is easy to make mistakes in missing parameters;

[0012] (2) The code will become difficult to read, and it will be more difficult to locate problems if they occur in the future;

[0013] (3) If the number of transmitted parameters of the IP design under test increases or decreases in the future, then all places where relevant parameter transmission declarations are made in the code of the verification environment need to be modified, which will be difficult to maintain and it is easy to make human errors, which will bring certain risks to the project. Summary of the Invention

[0014] In view of this, the purpose of the present invention is to provide a method, device, equipment and storage medium for compressed transmission of parameterized classes to improve the above problems.

[0015] An embodiment of the present invention provides a method for compressed transmission of parameterized classes, which includes:

[0016] Obtain the parameters to be processed in the verification component;

[0017] In the package file, use a compressed structure to customize the data type to classify and hierarchically compress the parameters in the verification component according to their functions, and obtain the final compressed parameters of the customized data type;

[0018] Use the compressed parameters of the customized data type to write a parameterized verification platform component and transmit it therein.

[0019] Preferably, when performing classification and hierarchical compression, first perform classification compression according to the function of the parameters, and then perform further multi-level compression according to the pairing and grouping of the parameters.

[0020] Preferably, the parameters to be processed include input and output addresses and data bit widths. Then, in the package file, use a compressed structure to customize the data type to classify and hierarchically compress the parameters in the verification component according to their functions, and obtain the final compressed parameters of the customized data type, which specifically includes:

[0021] Perform first-level compression on the input and output addresses and data bit widths respectively, and compress them into first-level compressed parameters of multiple customized data types;

[0022] According to the pairing grouping of the input and output ports, further multi-level compression is performed on the first-level compression parameters to obtain the final compression parameters of the custom data type.

[0023] Preferably, before using the final compression parameters of the custom data type to write a parameterized verification platform component and transmit it therein, it further includes:

[0024] Define default parameter values in the package file.

[0025] Preferably, after using the final compression parameters of the custom data type to write a parameterized verification platform component and transmit it therein, it further includes:

[0026] Obtain the parameters to be increased or decreased and their corresponding compression parameters;

[0027] Modify the data type of the compression parameters in the package file.

[0028] Preferably, the compression structure is obtained by combining the structure data type and the compression data structure type; wherein, the structure data type is used to implement the packaging of multiple different data types; the compression data structure is used to implement the bitwise splicing compression of multiple different data types.

[0029] An embodiment of the present invention further provides a compression and transmission device for parameterized classes, which includes:

[0030] A parameter acquisition unit, configured to acquire the parameters to be processed in the verification component;

[0031] A compression unit, configured to classify and grade the parameters in the verification component according to functions by using the custom data type of the compression structure in the package file to obtain the final compression parameters of the custom data type;

[0032] A transmission unit, configured to write a parameterized verification platform component by using the compression parameters of the custom data type and transmit it therein.

[0033] Preferably, when performing classification and grading compression, first perform classification compression according to the function of the parameters, and then perform further multi-level compression according to the pairing grouping of the parameters.

[0034] An embodiment of the present invention further provides a compression and transmission device for parameterized classes, which includes a memory and a processor, and a computer program is stored in the memory, and the computer program can be executed by the processor to implement the compression and transmission method for parameterized classes as described above.

[0035] An embodiment of the present invention also provides a computer-readable storage medium storing a computer program that can be executed by a processor of a device where the computer-readable storage medium is located to implement the compression transfer method for parameterized classes as described above.

[0036] In summary, this embodiment ingeniously combines a structure body and a compressed data structure type to achieve compression of parameters of different data types. By classifying the application scenarios and functions of the parameters in the verification platform components, hierarchical compression of more parameters can be achieved, which facilitates simplifying the transfer of a large number of parameters in complex verification platform components and is also convenient for verification developers to read and understand.

[0037] In addition, by this method of compressing parameters, no modification needs to be made to the code of parameterized verification components, so the code maintenance work of the future verification platform will become easier. BRIEF DESCRIPTION OF THE DRAWINGS

[0038] To more clearly illustrate the technical solutions of the embodiments of the present invention, the following will briefly introduce the drawings required to be used in the embodiments. It should be understood that the following drawings only show some embodiments of the present invention and should not be regarded as limiting the scope. For those of ordinary skill in the art, other related drawings can be obtained based on these drawings without creative efforts.

[0039] Figure 1 is a typical architecture diagram of a UVM verification platform.

[0040] Figure 2 is a flowchart of the compression transfer method for parameterized classes provided by the first embodiment of the present invention.

[0041] Figure 3 is a schematic diagram of hierarchical compression of parameter classification provided by the embodiments of the present invention.

[0042] Figure 4 is a structural diagram of the compression transfer device for parameterized classes provided by the second embodiment of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0043] The following will clearly and completely describe the technical solutions in the embodiments of the present invention with reference to the drawings in the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, not all of them. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts belong to the scope of protection of the present invention.

[0044] To better understand the technical solutions of the present invention, the following will describe the embodiments of the present invention in detail with reference to the drawings.

[0045] It should be clear that the described embodiments are only a part of the embodiments of the present invention, rather than all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative work fall within the protection scope of the present invention.

[0046] The terms used in the embodiments of the present invention are only for the purpose of describing specific embodiments, and are not intended to limit the present invention. The singular forms of "a", "the", and "said" used in the embodiments of the present invention and the appended claims are also intended to include the plural forms, unless the context clearly indicates otherwise.

[0047] The present invention will be further described in detail below in conjunction with the drawings and specific embodiments:

[0048] Please refer to Figure 2 and Figure 3 , the first embodiment of the present invention provides a method for compressed transmission of parameterized classes, which can be executed by a compressed transmission device for parameterized classes (hereinafter referred to as the transmission device), and in particular, by one or more processors in the transmission device to at least achieve the following steps:

[0049] S101, obtain the parameters to be processed in the verification component.

[0050] In this embodiment, the transmission device may be a terminal device with specific data processing capabilities such as a desktop computer, a notebook computer, a tablet, a workstation, or a server, and the present invention does not make specific limitations.

[0051] In this embodiment, the parameters to be processed are based on actual verification or work needs. As Figure 3 shown, Figure 3 the leftmost column of parameters is the parameters to be processed, and it can be seen that the number of parameters to be processed is 20. Of course, it should be noted that in other embodiments of the present invention, the parameters to be processed can be set according to actual needs, Figure 3 which is only an example of the present invention and should not be construed as a limitation of the present invention.

[0052] S102, classify and compress the parameters in the verification component by function using a compressed structure custom data type in the package file to obtain the compressed parameters of the custom data type.

[0053] In this embodiment, the structure (struct) data type can realize the packaging of multiple different data types. And the compressed (packed) data structure can realize the bit splicing and compression of multiple different data types. Combining the characteristics of the above two data structure types, this embodiment proposes to use a compressed structure (struct packed) to compress a large number of parameters of different data types. This is somewhat similar to the file compression package used, which can package multiple files, so that the parameters in the entire verification environment will be sharply reduced.

[0054] Specifically, in this embodiment, Figure 3 For example:

[0055] First, Figure 3 The input and output addresses and data bit widths in the leftmost column are compressed into the custom data types addr_i_t, data_i_t, addr_o_t, and data_o_t.

[0056] Specifically, this embodiment performs compression according to the function classification of parameters. For example, addr_i_t here is used as the bit width parameter of the compressed input address, which includes the bit width parameters addr1_i_width to addr5_i_width of the compressed input address. The rest of data_i_t, addr_o_t and data_o_t are similar, and the same applies to the compression of the same type of parameters.

[0057] The primary compression parameters are then further compressed at the secondary and tertiary levels.

[0058] Specifically, in order to achieve the transmission of as few parameters as possible in the verification platform, this embodiment will further perform multi-level compression according to the paired grouping of input and output ports, such as the second-level compression demo_config_i_width_t here, which contains the first-level compression parameter types addr_i_t and data_i_t, which represent the bit width compression parameters of the input address and input data of the design to be tested respectively. Since addresses and data generally appear in pairs, multi-level compression in this way can further reduce the number of parameters that need to be transmitted.

[0059] It can be seen that through the above classification and compression, the original 20 parameters that need to be passed in the verification component have been reduced to 1.

[0060] In addition, if the number of parameters needs to be increased or decreased later, it is only necessary to modify the data type of the above compression parameters in the package file without making any changes to the component code in the verification platform, so subsequent code maintenance will become easier.

[0061] It should be noted that in the above embodiments, classification and grading compression are achieved by classifying according to functions and pairing and grouping. However, it should be understood that in other embodiments of the present invention, different classification and grading rules can also be configured to achieve data compression, and these solutions are all within the protection scope of the present invention.

[0062] S103. Use the final compression parameters of the custom data type to write a parameterized verification platform component and pass them therein.

[0063] In this embodiment, the usage mode of these passed final compression parameters is the same as the existing usage mode, which is:

[0064] First, when declaring and instantiating the final compression parameters, it is necessary to indicate the parameters carried by them in the way of #.

[0065] Finally, if the UVM factory mechanism is to be used, then for the final compression parameters, it is necessary to use the macros uvm_object_param_utils or uvm_component_param_utils to register the object or component.

[0066] It should be noted that the following steps are also included between steps S102 and S103:

[0067] Define the default parameter values in the package file.

[0068] Among them, when writing a parameterized class, it is necessary to specify default parameter values for the parameters to be passed to the parameterized class. This default parameter value is defined after the package file, and all class objects included in the package file can use this default parameter value, that is, it is equivalent to packaging the class object and the parameter default value, which is convenient for code extension and reuse.

[0069] In summary, this embodiment cleverly combines the structure body and the compressed data structure type to achieve the compression of parameters of different data types. By classifying the application scenarios and functions of the parameters in the verification platform component, the classification and grading compression of more parameters can be achieved, which is convenient for simplifying the transmission of a large number of parameters in complex verification platform components and is also convenient for verification developers to read and understand.

[0070] In addition, by this method of compressing parameters, it is possible to make no modification to the code of the parameterized verification component, so the future code maintenance work of the verification platform will become easier.

[0071] Please refer to Figure 4 , the second embodiment of the present invention also provides a compression and transmission device for a parameterized class, which includes:

[0072] A parameter acquisition unit 210 is configured to acquire the parameters to be processed in the verification component;

[0073] A compression unit 220 is configured to classify and hierarchically compress the parameters in the verification component according to functions by using a compressed structure custom data type in the package file, so as to obtain compressed parameters of the custom data type;

[0074] A transmission unit 230 is configured to write a parameterized verification platform component by using the compressed parameters of the custom data type and transmit the parameterized verification platform component therein.

[0075] Preferably, when performing classification and hierarchical compression, first perform classification compression according to the functions of the parameters, and then perform further multi-level compression according to the pairing and grouping of the parameters.

[0076] The third embodiment of the present invention further provides a compression and transmission device for parameterized classes, which includes a memory and a processor. A computer program is stored in the memory, and the computer program can be executed by the processor to implement the compression and transmission method for parameterized classes as described above.

[0077] The fourth embodiment of the present invention further provides a computer-readable storage medium, which stores a computer program, and the computer program can be executed by the processor of the device where the computer-readable storage medium is located to implement the compression and transmission method for parameterized classes as described above.

[0078] In several embodiments provided by the embodiments of the present invention, it should be understood that the disclosed devices and methods can also be implemented in other ways. The device and method embodiments described above are merely illustrative. For example, the flowcharts and block diagrams in the accompanying drawings show the possible architectures, functions, and operations of devices, methods, and computer program products according to multiple embodiments of the present invention. In this regard, each block in the flowchart or block diagram may represent a module, a program segment, or a part of code, and the module, program segment, or part of code includes one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the blocks may occur in a different order from that marked in the accompanying drawings. For example, two consecutive blocks may actually be executed substantially in parallel, and they may sometimes be executed in the reverse order, depending on the functions involved. It should also be noted that each block in the block diagram and / or flowchart, as well as the combination of blocks in the block diagram and / or flowchart, can be implemented by a dedicated hardware-based system for performing the specified functions or actions, or can be implemented by a combination of dedicated hardware and computer instructions.

[0079] In addition, in each embodiment of the present invention, the functional modules can be integrated together to form an independent part, or each module can exist alone, or two or more modules can be integrated to form an independent part.

[0080] If the above-mentioned function is implemented in the form of a software functional module and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for causing a computer device (which can be a personal computer, an electronic device, or a network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes: USB flash drives, mobile hard disks, read-only memories (ROMs), random access memories (RAMs), magnetic disks, or optical discs, and other various media that can store program codes. It should be noted that in this article, the terms "include", "comprise", or any other variant thereof are intended to cover non-exclusive inclusion, so that a process, method, article, or device including a series of elements not only includes those elements but also includes other elements that are not explicitly listed, or further includes elements inherent to such a process, method, article, or device. Without further limitations, an element defined by the statement "including one..." does not exclude the existence of additional identical elements in the process, method, article, or device including the said element.

[0081] The above are only the preferred embodiments of the present invention and are not used to limit the present invention. For those skilled in the art, the present invention can have various changes and modifications. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included within the protection scope of the present invention.

Claims

1. A compression transfer method for parameterized classes, characterized in that, it includes: Obtain the parameters to be processed in the verification component; wherein, the parameters to be processed include input / output addresses and data bit widths; In the package file, use a compressed structure to customize the data type to classify and hierarchically compress the parameters in the verification component according to their functions, and obtain the final compressed parameters of the customized data type; wherein, when performing classification and hierarchical compression, first perform classification compression according to the function of the parameters, and then perform further multi-level compression according to the pairing and grouping of the parameters; specifically: perform first-level compression on the input / output addresses and data bit widths respectively to compress them into multiple first-level compressed parameters of the customized data type; according to the pairing and grouping of the input / output ports, perform further multi-level compression on the first-level compressed parameters to obtain the final compressed parameters of the customized data type; Use the final compressed parameters of the customized data type to write a parameterized verification platform component and transfer it therein.

2. The compression transfer method for parameterized classes according to claim 1, characterized in that, Before using the final compressed parameters of the customized data type to write a parameterized verification platform component and transfer it therein, it further includes: Define default parameter values in the package file.

3. The compression transfer method for parameterized classes according to claim 1, characterized in that, After using the compressed parameters of the customized data type to write a parameterized verification platform component and transfer it therein, it further includes: Obtain the parameters to be increased or decreased and their corresponding compressed parameters; Modify the data type of the compressed parameters in the package file.

4. The compression transfer method for parameterized classes according to claim 1, characterized in that, The compressed structure is obtained by combining the structure data type and the compressed data structure type; wherein, the structure data type is used to implement the packaging of multiple different data types; the compressed data structure is used to implement the bitwise splicing and compression of multiple different data types.

5. A compression transfer device for parameterized classes, characterized in that, it includes: A parameter acquisition unit for obtaining the parameters to be processed in the verification component; wherein, the parameters to be processed include input / output addresses and data bit widths; A compression unit for using a compressed structure to customize the data type to classify and hierarchically compress the parameters in the verification component according to their functions in the package file, and obtain the final compressed parameters of the customized data type; wherein, when performing classification and hierarchical compression, first perform classification compression according to the function of the parameters, and then perform further multi-level compression according to the pairing and grouping of the parameters; specifically: perform first-level compression on the input / output addresses and data bit widths respectively to compress them into multiple first-level compressed parameters of the customized data type; according to the pairing and grouping of the input / output ports, perform further multi-level compression on the first-level compressed parameters to obtain the final compressed parameters of the customized data type; A transfer unit for using the final compressed parameters of the customized data type to write a parameterized verification platform component and transfer it therein.

6. A compression transfer device for parameterized classes, characterized in that, it includes a memory and a processor, and a computer program is stored in the memory, and the computer program can be executed by the processor to implement the compression transfer method for parameterized classes as described in any one of claims 1 to 4.

7. A computer-readable storage medium, characterized in that, it stores a computer program, and the computer program can be executed by the processor of the device where the computer-readable storage medium is located to implement the compression transfer method for parameterized classes as described in any one of claims 1 to 4.

Citation Information

Patent Citations

  • File compression method and apparatus

    CN105095278A

  • Automatic parameter synchronization method between RTL design and verification environment

    CN114118002A