Grating Module Verification Method, Device, Equipment, Storage Medium and Program Product
By generating and comparing images rendered by a target raster module and a reference GPU, the method addresses the inconsistency in raster module verification, achieving higher accuracy and efficiency.
Patent Information
- Application Number
- CN202411747179.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-02
- Publication Date
- 2025-07-15
- Estimated Expiration
- 2044-12-02
AI Technical Summary
In the prior art, the verification of grating modules depends on the experience of verification engineers, resulting in low verification accuracy.
By generating test data and outputting it to the target grating module and the reference GPU, the first and second pictures are generated and the second pictures are compared, and the functional verification results of the target grating module are determined to avoid the influence of human factors.
It improves the accuracy and efficiency of grating module verification, reduces the influence of human factors, and ensures the reliability of verification results.
Smart Images

Figure CN119228625B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of chip verification, and particularly to a method, apparatus, device, storage medium and program product for verifying a raster module. Background Art
[0002] With the development of the GPU (Graphics Processing Unit), it plays a key role in improving the performance of graphics processing. Rasterization is the process of converting geometric data into pixels and is a key step in computer graphics. The raster module can perform rasterization processing and is an important module in the GPU. Therefore, it is necessary to verify the functions of the raster module of the GPU to ensure that the processed raster module meets the design specifications and graphics specifications.
[0003] Currently, usually, verification engineers write relevant test cases according to the design specifications to verify the functions of the raster module. However, this method depends on the experience of the verification engineers and the verification accuracy of the raster module is not high. Summary of the Invention
[0004] Based on this, it is necessary to provide a method, apparatus, device, storage medium and program product for verifying a raster module that can improve the verification accuracy of the raster module for the above technical problems.
[0005] In a first aspect, the present application provides a method for verifying a raster module, the method comprising:
[0006] Generating test data for verifying the functions of a target raster module;
[0007] Outputting the test data to the target raster module to generate a first picture through the target raster module;
[0008] Sending the test data to a reference GPU to generate a second picture through the reference GPU, the reference GPU including a qualified raster module;
[0009] Comparing the first picture with the second picture to obtain the function verification result of the target raster module.
[0010] In one embodiment, generating test data includes:
[0011] Randomly generating register configuration data, primitive type data, vertex coordinate data of the primitive type, and attribute data of the primitive type, and saving them to a log file.
[0012] In one embodiment, sending the test data to the reference GPU to generate a second picture through the reference GPU includes:
[0013] Parse and process the log file, generate a target program based on the register configuration data, the original primitive type data, the vertex coordinate data of the original primitive type, and the attribute data of the original primitive type, and send the target program to the reference GPU;
[0014] Obtain a second picture, which is rendered and generated by the reference GPU running the target program.
[0015] In one embodiment, the method further includes: configuring the registers of the reference GPU according to the register configuration data.
[0016] In one embodiment, outputting test data to the target raster module to generate a first picture through the target raster module, including:
[0017] Configuring the registers of the target raster module according to the register configuration data;
[0018] Obtain a first picture, which is obtained by the target raster module generating a text file based on the original primitive type data, the vertex coordinate data of the original primitive type, and the attribute data of the original primitive type, and based on the text file.
[0019] In one embodiment, comparing the first picture with the second picture to obtain the functional verification result of the target raster module, including:
[0020] Comparing the pixel attributes of the first picture with the pixel attributes of the second picture;
[0021] If all the pixel attributes of the first picture are consistent with the corresponding pixel attributes of the second picture, determine that the functional verification result of the target raster module is qualified.
[0022] In a second aspect, the present application further provides a raster module verification device, including:
[0023] A first generation module, configured to generate test data for functionally verifying the target raster module;
[0024] A second generation module, configured to output the test data to the target raster module to generate a first picture through the target raster module;
[0025] A third generation module, configured to send the test data to the reference GPU to generate a second picture through the reference GPU, where the reference GPU includes a qualified raster module;
[0026] A comparison module, configured to compare the first picture with the second picture to obtain the functional verification result of the target raster module.
[0027] In a third aspect, the present application further provides a computer device, including a memory and a processor. The memory stores a computer program, and when the processor executes the computer program, the raster module verification method according to any one of the above first aspects is implemented.
[0028] In a fourth aspect, the present application further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the raster module verification method according to any one of the above first aspects is implemented.
[0029] In a fifth aspect, the present application further provides a computer program product, including a computer program. When the computer program is executed by a processor, the raster module verification method according to any one of the above first aspects is implemented.
[0030] For the above raster module verification method, device, equipment, storage medium and program product, first, test data for verifying a target raster module is generated. Then, the test data is output to the target raster module to generate a first picture through the target raster module. Next, the test data is sent to a reference GPU including a qualified raster module to generate a second picture through the reference GPU. Finally, the first picture is compared with the second picture to obtain the functional verification result of the target raster module. In this way, the first picture generated by the target raster module according to the test data is compared with the second picture generated by the reference GPU according to the test data to determine the functional verification result of the target raster module. The reference GPU is a GPU including a qualified raster module, that is, the processing result of the target raster module is compared with the processing result of the qualified raster module. There is no need to manually write test cases to verify the function of the target raster module, avoiding the influence of human factors, and the accuracy of the verification of the raster module is higher. Further, the verification result is obtained automatically through comparison, and the verification efficiency is higher. BRIEF DESCRIPTION OF THE DRAWINGS
[0031] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the following will briefly introduce the drawings required for describing the embodiments of the present application or related technologies. Obviously, the drawings in the following description are only some embodiments of the present application. For those of ordinary skill in the art, without creative efforts, other related drawings can also be obtained based on these drawings.
[0032] Figure 1 It is a schematic flowchart of the raster module verification method in an embodiment;
[0033] Figure 2 It is a schematic flowchart of the second picture generation step in an embodiment;
[0034] Figure 3Schematic flowchart of the first picture generation step in an embodiment;
[0035] Figure 4 Schematic flowchart of the grating module verification method in another embodiment;
[0036] Figure 5 Schematic flowchart of the grating module verification method in another embodiment;
[0037] Figure 6 Block diagram of the structure of the grating module verification device in an embodiment;
[0038] Figure 7 Internal structure diagram of a computer device in an embodiment. Detailed implementation manners
[0039] In order to make the objectives, technical solutions and advantages of the present application more clear and understandable, the present application will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0040] Currently, usually, a verification engineer writes relevant test cases according to the design specifications to verify the functions of the grating module. However, this method depends on the experience of the verification engineer, and the verification accuracy of the grating module is not high. If the verification engineer makes a mistake in understanding the design specifications or graphic specifications, the written test cases cannot find the problems existing in the grating module.
[0041] In view of this, the present application determines the function verification result of the target grating module by comparing the first picture generated by the target grating module with the second picture generated by the reference GPU, where the reference GPU is a GPU including a qualified grating module, that is, comparing the processing result of the target grating module with the processing result of the qualified grating module, without the need for manual writing of test cases to verify the functions of the target grating module, avoiding the influence of human factors, and having higher verification accuracy for the grating module. Further, by automatically comparing to obtain the verification result, the verification efficiency is higher.
[0042] In an exemplary embodiment, as Figure 1 shown, a grating module verification method is provided. Taking the application of this method to a terminal as an example for illustration, it can be understood that this method can also be applied to a server, and can also be applied to a system including a terminal and a server, and is implemented through the interaction between the terminal and the server, including the following steps:
[0043] Step 101, generate test data.
[0044] Among them, the test data is used to verify the functions of the target raster module. The raster module is usually used in fields such as image processing or pattern recognition, and is used to process primitives such as points, lines, or triangles output by the previous module, such as a pre-rasterization shader, for example, selection, culling, etc., and then output to the next module for rendering. The target raster module is the raster module that needs to be functionally verified. In order to verify the target raster module, test data is generated. The test data can be the original primitive data input to the target raster module. The raster module processes the original primitive data to obtain the processed image.
[0045] Optionally, the test data can be randomly generated and conform to the input mode of the raster module. The test data can also be generated according to certain design rules. For example, primitives with fixed shapes, colors, and sizes are generated as test data.
[0046] Step 102: Output the test data to the target raster module to generate the first image through the target raster module.
[0047] Optionally, when outputting the test data to the target raster module, the target raster module processes the test data, which may include selection according to various preset conditions, discarding the primitive data that does not need to be rendered, and frustum culling according to the field of view, and finally rendering to obtain the first image. Optionally, the first image includes the coordinate positions and attributes of the primitives that need to be displayed after the test data is processed.
[0048] Step 103: Send the test data to the reference GPU to generate the second image through the reference GPU.
[0049] Among them, the reference GPU includes a qualified raster module. Optionally, the reference GPU can be a GPU including a third-party mature real graphics card. It can be understood that the third-party mature real graphics card also includes a qualified raster module. Optionally, the reference GPU can be set on the terminal device for raster module verification, or can be set on other terminal devices or servers, and obtains the test data by communicating with the terminal for raster module verification. The terminal for raster module verification obtains the second image rendered by the reference GPU according to the test data through communication with the reference GPU. Since the reference GPU includes a third-party mature real graphics card, the second image is an image that conforms to the design specifications and graphics specifications.
[0050] Step 104: Compare the first image with the second image to obtain the functional verification result of the target raster module.
[0051] Compare the attributes of each pixel of the first image with the attributes of each pixel of the second image. According to the comparison result, the functional verification result of the target raster module can be determined. Optionally, if the attributes of each pixel of the first image are the same as the attributes of each pixel of the second image, it can be determined that the functional verification result of the target raster module is qualified. If there are pixels with different pixel attributes between the first image and the second image, it can be determined that the functional verification result of the target raster module is unqualified, that is, the design of the target raster module does not meet the requirements such as design specifications and image specifications.
[0052] In the above embodiment, first, test data for verifying the target raster module is generated. Then, the test data is output to the target raster module to generate a first image through the target raster module. Next, the test data is sent to a reference GPU including a qualified raster module to generate a second image through the reference GPU. Finally, the first image and the second image are compared to obtain the functional verification result of the target raster module. In this way, the first image generated through the target raster module based on the test data is compared with the second image generated through the reference GPU based on the test data to determine the functional verification result of the target raster module. The reference GPU is a GPU including a qualified raster module, that is, the processing result of the target raster module is compared with the processing result of the qualified raster module. There is no need to manually write test cases to verify the function of the target raster module, avoiding the influence of human factors, and the accuracy of the verification of the raster module is higher. Further, the verification result is obtained by automatically comparing, and the verification efficiency is higher.
[0053] In one embodiment, the step of generating test data in step 101 includes: randomly generating register configuration data, primitive type data, vertex coordinate data of the primitive type, and attribute data of the primitive type, and saving them to a log file.
[0054] Among them, the register configuration data may include the identifier of the register used in the rasterization process, the address information of the register, and the numerical information of the register, etc. The primitive type data may include the primitive types to be rendered originally, such as primitives of various shapes such as points, lines, triangles, circles, etc. Different primitive types correspond to different vertex coordinates. For example, when the primitive type is a point, the vertex coordinate of the primitive type is the coordinate data of a point. When the primitive type is a line, the vertex coordinate data of the primitive type may be the coordinate data of the two endpoints of the line. The attribute data of the primitive type may include the attributes of each pixel within the range of the primitive. The attribute of the pixel may be the color of the pixel.
[0055] UVM is a general verification platform development framework. Verification engineers can use the reusable components in UVM to build a functional verification environment with a standardized hierarchical structure and interfaces. Optionally, scripts can be written in UVM to automatically generate test data.
[0056] In the above embodiments, by generating test data and performing rasterization processing based on the test data, it is determined whether the functions of the raster module meet the requirements. At the same time, the test data is saved to a log file for easy viewing and further processing to generate a first picture and a second picture based on the test data.
[0057] In one embodiment, sending the test data to a reference GPU to generate a second picture through the reference GPU includes:
[0058] Step 201, parse the log file, generate a target program according to the register configuration data, the primitive type data, the vertex coordinate data of the primitive type, and the attribute data of the primitive type, and send the target program to the reference GPU.
[0059] Optionally, the terminal parses the log file to obtain the register configuration data, the primitive type data, the vertex coordinate data of the primitive type, and the attribute data of the primitive type. Optionally, the above data is added to a C language template based on OpenGL (Open Graphics Library) to generate a target program source file, and then the target program file is compiled to obtain a target program, where the target program is an executable program. The generated target program is sent to the reference GPU. The reference GPU can be set on the terminal, and the log file is sent through the system bus on the terminal. The reference GPU can also be set on other terminals or servers, and the target program can be sent to the reference GPU on other terminals or servers through the network. After raster processing by the reference GPU, a second picture is generated.
[0060] Step 202, obtain the second picture.
[0061] Among them, the second picture is rendered and generated by the reference GPU running the target program. Optionally, the second picture can be a picture in bmp format. For example, taking the primitive type as a triangle as an example, the vertex coordinates of the primitive type are the coordinates of the three vertices of the triangle, and the attribute data of the primitive type includes the attributes of the three vertices of the triangle, such as color attributes, and the color attributes of other points within the triangle. The second picture generated after rasterization processing according to the above data includes a triangle composed of multiple pixels, and the colors of the pixels of the triangle are determined according to the attribute data of the primitive type.
[0062] Optionally, the registers of the reference GPU are configured according to the register configuration data. The reference GPU runs the target program, and the registers of the reference GPU are configured according to the target program. The register configuration data in the target program may include the identifiers of the registers used in the rasterization process of the reference GPU, the address information of the registers, and the numerical information of the registers, etc.
[0063] In the above embodiment, the second picture is generated by the reference GPU. Since the reference GPU is a GPU including a mature graphics card, that is, the raster module on the reference GPU conforms to the design specifications and graphics specifications. Therefore, by comparing the second picture with the picture generated by the raster module to be tested, it can be determined whether the raster module to be tested conforms to the design specifications and graphics specifications.
[0064] In one embodiment, the step 102 of outputting the test data to the target raster module to generate the first picture by the target raster module is as Figure 3 shown and includes:
[0065] Step 301, configure the registers of the target raster module according to the register configuration data.
[0066] Optionally, the register configuration data may include the identifiers of the registers used in the rasterization process, the address information of the registers, and the numerical information of the registers, etc. Configuring the registers of the target raster module according to the register configuration data means configuring the address or value of the registers, etc.
[0067] Step 302, obtain the first picture.
[0068] Among them, the first picture is obtained by the target raster module generating a text file according to the primitive type data, the vertex coordinate data of the primitive type, and the attribute data of the primitive type, and then obtaining the picture according to the text file. Optionally, after receiving the test data, the target raster module generates a text file according to the primitive type data, the vertex coordinate data of the primitive type, and the attribute data of the primitive type in the test data. The text file may be a.csv type file, and then the first picture is generated according to the text file. The first picture may be a bmp format picture.
[0069] In this embodiment, by processing the test data through the target raster module to obtain the first picture, it can be determined whether the target raster module conforms to the design specifications and graphics specifications according to the first picture.
[0070] In the embodiment of the present application, the process of comparing the first picture with the second picture in the above step 104 is as Figure 4 shown and includes:
[0071] Step 401: Compare the pixel attributes of the first picture with those of the second picture.
[0072] Optionally, compare the pixel attributes of each pixel in the first picture with those of the pixel at the same position in the second picture. For example, compare the pixel color of each pixel in the first picture with the color of the pixel at the same position in the second picture to confirm whether they are the same.
[0073] Step 402: If all the pixel attributes of the first picture are consistent with the corresponding pixel attributes of the second picture, determine that the functional verification result of the target raster module is qualified.
[0074] Since both the first picture and the second picture are obtained after rasterizing test data, if the target raster module meets the design specifications and graphics specifications, the first picture generated by the target raster module should be exactly the same as the second picture generated by the reference GPU. Therefore, if all the pixel attributes of the pixels in the first picture are the same as the corresponding pixel attributes of the pixels in the second picture, determine that the functional verification result of the raster module is qualified. If there are some pixel attributes of the pixels in the first picture that are different from the corresponding pixel attributes of the pixels in the second picture, determine that the functional verification result of the raster module is unqualified.
[0075] In the above embodiments, by comparing the processing result of the target raster module with that of the qualified raster module, it is not necessary to manually write test cases to verify the function of the target raster module, avoiding the influence of human factors and achieving higher accuracy in verifying the raster module. Further, by automatically comparing to obtain the verification result, the verification efficiency is higher.
[0076] In the embodiments of the present application, please refer to Figure 5 , which shows a flowchart of a method for verifying a raster module provided by an embodiment of the present application. The method for verifying the raster module includes the following steps:
[0077] Step 501: Randomly generate register configuration data, primitive type data, vertex coordinate data of the primitive type, and attribute data of the primitive type, and save them to a log file.
[0078] Step 502: Configure the registers of the target raster module according to the register configuration data.
[0079] Step 503: Obtain the first picture.
[0080] Step 504: Parse and process the log file, generate a target program according to the register configuration data, primitive type data, vertex coordinate data of the primitive type, and attribute data of the primitive type, and send the target program to the reference GPU.
[0081] Step 505, obtain a second picture.
[0082] Step 506, compare the first picture with the second picture to obtain the functional verification result of the target grating module.
[0083] For ease of understanding, an example of the grating module verification method of the present application is given. The terminal runs a test case script to generate test data and saves it to a log file such as a log file. The target grating module generates a first picture in the bmp format according to the test data, parses the log file, configures the registers according to the register configuration information, and then generates an OPENGL_cpp file according to other test data and templates to obtain a target program. The target program is sent to a reference CPU through a command such as a draw command, and the reference CPU executes the target program to render a second picture in the bmp format. Obtain the first picture and the second picture, compare the pixel attributes of each pixel point. If the pixel colors of all pixel points are the same, it is determined that the functional verification of the target grating module is qualified. If there are pixel points with inconsistent pixel colors, it is determined that the functional verification result of the target grating module is unqualified.
[0084] It should be understood that although the steps in the flowcharts involved in the above-described embodiments are displayed sequentially according to the arrows, these steps are not necessarily executed sequentially in the order indicated by the arrows. Unless there is a clear description in this article, the execution of these steps has no strict order limit, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-described embodiments may include multiple steps or multiple stages. These steps or stages are not necessarily executed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be executed alternately or alternately with at least a part of other steps or steps in other steps.
[0085] Based on the same inventive concept, the embodiments of the present application also provide a grating module verification device for implementing the above-mentioned grating module verification method. The implementation solutions provided by this device to solve problems are similar to the implementation solutions described in the above method. Therefore, the specific limitations in one or more embodiments of the grating module verification device provided below can refer to the limitations on the grating module verification method in the above text, and will not be repeated here.
[0086] In an exemplary embodiment, as Figure 6 shown, a grating module verification device 600 is provided, including: a first generation module 601, a second generation module 602, a third generation module 603, and a comparison module 604, where:
[0087] The first generation module 601 is used to generate test data, and the test data is used to verify the functions of the target raster module;
[0088] The second generation module 602 is used to output the test data to the target raster module to generate a first picture through the target raster module;
[0089] The third generation module 603 is used to send the test data to the reference GPU to generate a second picture through the reference GPU. The reference GPU includes a qualified raster module;
[0090] The comparison module 604 is used to compare the first picture with the second picture to obtain the function verification result of the target raster module.
[0091] In one embodiment, the first generation module 601 is specifically configured to randomly generate register configuration data, primitive type data, vertex coordinate data of the primitive type, and attribute data of the primitive type, and save them to a log file.
[0092] In one embodiment, the third generation module 603 is specifically configured to parse and process the log file, generate a target program according to the register configuration data, primitive type data, vertex coordinate data of the primitive type, and attribute data of the primitive type, and send the target program to the reference GPU; obtain the second picture, and the second picture is rendered and generated by the reference GPU running the target program.
[0093] In one embodiment, it further includes a configuration module for configuring the registers of the reference GPU according to the register configuration data.
[0094] In one embodiment, the second generation module 602 is specifically configured to configure the registers of the target raster module according to the register configuration data; obtain the first picture, and the first picture is obtained by the target raster module generating a text file according to the primitive type data, vertex coordinate data of the primitive type, and attribute data of the primitive type, and based on the text file.
[0095] In one embodiment, the comparison module 604 is specifically configured to compare the pixel attributes of the first picture with the pixel attributes of the second picture; if all the pixel attributes of the first picture are consistent with the corresponding pixel attributes of the second picture, it is determined that the function verification result of the target raster module is qualified.
[0096] Each module in the above grating module verification device can be implemented in whole or in part by software, hardware, or a combination thereof. Each of the above modules can be embedded in the processor of a computer device in hardware form or be independent of it, or can be stored in the memory of the computer device in software form so that the processor can call and execute the operations corresponding to each of the above modules.
[0097] In an exemplary embodiment, a computer device is provided. The computer device can be a terminal, and its internal structure diagram can be as Figure 7 shown. The computer device includes a processor, a memory, an input / output interface, a communication interface, a display unit, and an input device. Among them, the processor, the memory, and the input / output interface are connected through a system bus, and the communication interface, the display unit, and the input device are connected to the system bus through the input / output interface. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The input / output interface of the computer device is used for exchanging information between the processor and external devices. The communication interface of the computer device is used for communicating with external terminals in a wired or wireless manner. The wireless manner can be achieved through WIFI, a mobile cellular network, near field communication (NFC), or other technologies. The computer program, when executed by the processor, implements a grating module verification method. The display unit of the computer device is used to form a visually visible image, which can be a display screen, a projection device, or a virtual reality imaging device. The display screen can be a liquid crystal display screen or an electronic ink display screen. The input device of the computer device can be a touch layer covering the display screen, or a button, a trackball, or a touchpad provided on the shell of the computer device, or an external keyboard, a touchpad, or a mouse, etc.
[0098] Those skilled in the art can understand that Figure 7 the structure shown in
[0099] In an exemplary embodiment, a computer device is provided, including a memory and a processor. A computer program is stored in the memory. When the processor executes the computer program, the following steps are implemented: generating test data for functional verification of a target raster module; outputting the test data to the target raster module to generate a first picture through the target raster module; sending the test data to a reference GPU to generate a second picture through the reference GPU, where the reference GPU includes a qualified raster module; comparing the first picture with the second picture to obtain the functional verification result of the target raster module.
[0100] In an embodiment, when the processor executes the computer program, the following steps are further implemented: randomly generating register configuration data, primitive type data, vertex coordinate data of the primitive type, and attribute data of the primitive type, and saving them to a log file.
[0101] In an embodiment, when the processor executes the computer program, the following steps are further implemented: parsing the log file, generating a target program according to the register configuration data, primitive type data, vertex coordinate data of the primitive type, and attribute data of the primitive type, and sending the target program to the reference GPU; obtaining a second picture, where the second picture is rendered and generated by the reference GPU running the target program.
[0102] In an embodiment, when the processor executes the computer program, the following steps are further implemented: configuring the registers of the reference GPU according to the register configuration data.
[0103] In an embodiment, when the processor executes the computer program, the following steps are further implemented: configuring the registers of the target raster module according to the register configuration data; obtaining a first picture, where the first picture is obtained by the target raster module generating a text file according to the primitive type data, vertex coordinate data of the primitive type, and attribute data of the primitive type, and based on the text file.
[0104] In an embodiment, when the processor executes the computer program, the following steps are further implemented: comparing the pixel attributes of the first picture with the pixel attributes of the second picture; if all the pixel attributes of the first picture are consistent with the corresponding pixels of the second picture, determining that the functional verification result of the target raster module is qualified.
[0105] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the following steps are implemented: generating test data for functional verification of a target raster module; outputting the test data to the target raster module to generate a first picture through the target raster module; sending the test data to a reference GPU to generate a second picture through the reference GPU, where the reference GPU includes a qualified raster module; comparing the first picture with the second picture to obtain a functional verification result of the target raster module.
[0106] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented: randomly generating register configuration data, primitive type data, vertex coordinate data of the primitive type, and attribute data of the primitive type, and saving them to a log file.
[0107] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented: parsing the log file, generating a target program according to the register configuration data, primitive type data, vertex coordinate data of the primitive type, and attribute data of the primitive type, and sending the target program to the reference GPU; obtaining a second picture, which is rendered and generated by the reference GPU running the target program. In one embodiment, when the computer program is executed by a processor, the following steps are further implemented: configuring the registers of the reference GPU according to the register configuration data.
[0108] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented: configuring the registers of the target raster module according to the register configuration data; obtaining a first picture, which is generated by the target raster module according to the primitive type data, vertex coordinate data of the primitive type, and attribute data of the primitive type to generate a text file and obtained according to the text file.
[0109] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented: comparing the pixel attributes of the first picture with the pixel attributes of the second picture; if all the pixel attributes of the first picture are consistent with the corresponding pixel attributes of the second picture, determining that the functional verification result of the target raster module is qualified.
[0110] In one embodiment, a computer program product is provided, including a computer program. When the computer program is executed by a processor, the following steps are implemented: generating test data for functional verification of a target raster module; outputting the test data to the target raster module to generate a first picture through the target raster module; sending the test data to a reference GPU to generate a second picture through the reference GPU, where the reference GPU includes a qualified raster module; comparing the first picture with the second picture to obtain a functional verification result of the target raster module.
[0111] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented: randomly generate register configuration data, original primitive type data, vertex coordinate data of the original primitive type, and attribute data of the original primitive type, and save them to a log file.
[0112] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented: parse the log file, generate a target program according to the register configuration data, the original primitive type data, the vertex coordinate data of the original primitive type, and the attribute data of the original primitive type, and send the target program to the reference GPU; obtain a second picture, where the second picture is rendered and generated by the reference GPU running the target program. In one embodiment, when the computer program is executed by a processor, the following steps are further implemented: configure the registers of the reference GPU according to the register configuration data.
[0113] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented: configure the registers of the target raster module according to the register configuration data; obtain a first picture, where the first picture is obtained by the target raster module generating a text file according to the original primitive type data, the vertex coordinate data of the original primitive type, and the attribute data of the original primitive type, and based on the text file.
[0114] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented: compare the pixel attributes of the first picture with the pixel attributes of the second picture; if all the pixel attributes of the first picture are consistent with the corresponding pixel attributes of the second picture, determine that the function verification result of the target raster module is qualified.
[0115] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data for analysis, stored data, displayed data, etc.) involved in this application are all information and data that have been authorized by the user or fully authorized by all parties, and the collection, use, and processing of the relevant data need to comply with the relevant regulations.
[0116] Those of ordinary skill in the art can understand that all or part of the processes in the methods of the above embodiments can be completed by instructing relevant hardware through a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above methods. Among them, any reference to a memory, database, or other medium used in the embodiments provided in the present application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM), etc. The databases involved in the embodiments provided in the present application can include at least one of relational databases and non-relational databases. Non-relational databases can include distributed databases based on blockchain, etc., without limitation. The processors involved in the embodiments provided in the present application can be general-purpose processors, central processors, graphics processors, digital signal processors, programmable logic devices, data processing logics based on quantum computing, artificial intelligence (AI) processors, etc., without limitation.
[0117] The technical features of the above embodiments can be combined arbitrarily. For the sake of brevity of description, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, it should be considered to be within the scope recorded in the present application.
[0118] The above-described embodiments merely represent several implementation manners of the present application. The description thereof is relatively specific and detailed, but it should not be construed as a limitation on the patent scope of the present application. It should be noted that for those of ordinary skill in the art, without departing from the concept of the present application, several modifications and improvements can still be made, and these all fall within the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the appended claims.
Claims
1. A method for verifying a grating module, characterized in that, The method includes: Generating test data for functional verification of a target raster module; the test data is generated by a script written based on a UVM-based verification platform; Outputting the test data to the target raster module to generate a first picture through the target raster module; Sending the test data to a reference GPU to generate a second picture through the reference GPU, where the reference GPU includes a qualified raster module; Comparing the pixel attributes of the first picture with those of the second picture, where the pixel attributes include color; If all the pixel attributes of the first picture are consistent with the corresponding pixel attributes of the second picture, determining that the functional verification result of the target raster module is qualified; if there are some pixel attributes of the first picture that are different from the corresponding pixel attributes of the second picture, determining that the functional verification result of the target raster module is unqualified; The generating of the test data includes: Randomly generating register configuration data, primitive type data, vertex coordinate data of the primitive type, and attribute data of the primitive type, and saving them to a log file; The sending of the test data to the reference GPU to generate a second picture through the reference GPU includes: Parsing the log file, generating a target program based on the register configuration data, the primitive type data, the vertex coordinate data of the primitive type, and the attribute data of the primitive type, and sending the target program to the reference GPU; Obtaining the second picture, which is rendered and generated by the reference GPU running the target program.
2. The method according to claim 1, wherein The target program is generated based on OpenGL.
3. The method according to claim 1, wherein The method further includes: Configuring the registers of the reference GPU according to the register configuration data.
4. The method according to claim 1, characterized in that The generating of the test data further includes: Generating primitives with fixed shapes, colors, and sizes as test data according to design rules.
5. The method according to claim 1, wherein The outputting of the test data to the target raster module to generate a first picture through the target raster module includes: Configuring the registers of the target raster module according to the register configuration data; Obtaining the first picture, which is obtained by the target raster module generating a text file based on the primitive type data, the vertex coordinate data of the primitive type, and the attribute data of the primitive type, and then based on the text file.
6. A grating module verification device, characterized in that, The device includes: A first generation module for generating test data for functional verification of a target raster module; the test data is generated by a script written based on a UVM-based verification platform; A second generation module for outputting the test data to the target raster module to generate a first picture through the target raster module; A third generation module for sending the test data to a reference GPU to generate a second picture through the reference GPU, where the reference GPU includes a qualified raster module; A comparison module is configured to compare the pixel attributes of the first picture with the pixel attributes of the second picture, where the pixel attributes include color; if all the pixel attributes of the first picture are consistent with the corresponding pixel attributes of the second picture, it is determined that the function verification result of the target raster module is qualified; if there are some pixels in the first picture whose pixel attributes are different from the pixel attributes of the corresponding pixels in the second picture, it is determined that the function verification result of the target raster module is unqualified. The first generation module is specifically configured to randomly generate register configuration data, primitive type data, vertex coordinate data of the primitive type, and attribute data of the primitive type, and save them to a log file. The third generation module is specifically configured to parse and process the log file, generate a target program according to the register configuration data, the primitive type data, the vertex coordinate data of the primitive type, and the attribute data of the primitive type, and send the target program to the reference GPU; obtain the second picture, where the second picture is rendered and generated by the reference GPU running the target program.
7. The device according to claim 6, characterized in that, The device further includes a configuration module configured to configure the registers of the reference GPU according to the register configuration data.
8. A computer device, comprising a memory and a processor, the memory storing a computer program, characterized in that, When the processor executes the computer program, the steps of the method according to any one of claims 1 to 5 are implemented.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, the steps of the method according to any one of claims 1 to 5 are implemented.
10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by the processor, the steps of the method according to any one of claims 1 to 5 are implemented.
Citation Information
Patent Citations
Method and system for auto testing grating image processor
CN101387983A
Constrained random verification method and device for picture processing class IPs
CN104615537A