Grating module verification method and device, equipment, storage medium and program product
By generating and comparing the pictures generated by the grating module and reference GPU, the problem that grating module verification in the prior art relies on manual experience is solved, and the verification accuracy and efficiency are improved, ensuring that the grating module complies with design specifications.
Patent Information
- Application Number
- CN202411747179.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-02
- Publication Date
- 2024-12-31
- 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 and manual writing of test cases, which is affected by human factors.
By generating test data and outputting it to the target raster module and the reference GPU, the images generated by the two are compared to determine the functional verification results of the raster module, avoiding manual writing of test cases and improving verification accuracy and efficiency.
High accuracy verification of grating modules is achieved, reducing the influence of human factors, improving verification efficiency, and ensuring that grating modules comply with design specifications and graphic specifications.
Smart Images

Figure CN119228625A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of chip verification technology, and in particular to a grating module verification method, device, equipment, storage medium and program product. Background Art
[0002] With the development of GPU (Graphics Processing Unit), it has played a key role in improving the performance of graphics processing. Rasterization is the process of converting geometric data into pixels, which 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 function of the GPU's raster module to ensure that the raster module meets the design specifications and graphics specifications after processing.
[0003] At present, the function of the grating module is usually verified by verification engineers writing relevant test cases according to design specifications. However, this method relies on the experience of the verification engineers and the verification accuracy of the grating module is not high. Summary of the invention
[0004] Based on this, it is necessary to provide a grating module verification method, device, equipment, storage medium and program product that can improve the verification accuracy of the grating module in response to the above technical problems.
[0005] In a first aspect, the present application provides a grating module verification method, the method comprising:
[0006] Generate test data, which is used to verify the function of the target grating module;
[0007] Outputting the test data to the target raster module to generate a first image through the target raster module;
[0008] sending the test data to a reference GPU to generate a second image by the reference GPU, the reference GPU including a qualified raster module;
[0009] The first image is compared with the second image to obtain a function verification result of the target grating module.
[0010] In one embodiment, generating test data includes:
[0011] Register configuration data, primitive type data, vertex coordinate data of primitive types, and attribute data of primitive types are randomly generated and saved in a log file.
[0012] In one embodiment, sending the test data to a reference GPU to generate a second image by the reference GPU includes:
[0013] 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;
[0014] A second image is obtained, where the second image is generated by rendering by running a target program with reference to a GPU.
[0015] In one of the embodiments, the method further includes: configuring registers of the reference GPU according to the register configuration data.
[0016] In one embodiment, outputting the test data to a target grating module to generate a first image through the target grating module includes:
[0017] Configure the register of the target grating module according to the register configuration data;
[0018] A first picture is obtained, where the target raster module generates a text file according to original primitive type data, vertex coordinate data of the original primitive type, and attribute data of the original primitive type, and the text file is obtained according to the text file.
[0019] In one embodiment, the first image is compared with the second image to obtain a function verification result of the target grating module, including:
[0020] Comparing pixel attributes of the first image with pixel attributes of the second image;
[0021] If all pixel attributes of the first image are consistent with corresponding pixel attributes of the second image, it is determined that the function verification result of the target grating module is qualified.
[0022] In a second aspect, the present application further provides a grating module verification device, comprising:
[0023] A first generating module is used to generate test data, and the test data is used to perform functional verification on the target grating module;
[0024] A second generating module, used for outputting the test data to the target grating module, so as to generate a first picture through the target grating module;
[0025] a third generation module, configured to send the test data to a reference GPU to generate a second image through the reference GPU, the reference GPU comprising a qualified raster module;
[0026] The comparison module is used to compare the first image with the second image to obtain a function verification result of the target grating module.
[0027] In a third aspect, the present application further provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the grating module verification method described in any one of the first aspects is implemented.
[0028] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the grating module verification method described in any one of the first aspects above is implemented.
[0029] In a fifth aspect, the present application further provides a computer program product, including a computer program, which, when executed by a processor, implements the grating module verification method described in any one of the first aspects above.
[0030] The above-mentioned grating module verification method, device, equipment, storage medium and program product first generate test data for verifying the target grating module, then output the test data to the target grating module to generate a first image through the target grating module, then send the test data to a reference GPU including a qualified grating module to generate a second image through the reference GPU, and finally compare the first image with the second image to obtain a functional verification result of the target grating module. In this way, the first image generated by the target grating module according to the test data is compared with the second image generated by the reference GPU according to the test data to determine the functional verification result of the target grating module, and the reference GPU is a GPU including a qualified grating module, that is, the processing result of the target grating module is compared with the processing result of the qualified grating module, and there is no need to manually write test cases to verify the function of the target grating module, which avoids the influence of human factors, and the accuracy of the verification of the grating module is higher. Further, the verification result is obtained by automatic 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 drawings required for use in the embodiments of the present application or related technical descriptions will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0032] FIG1 is a schematic flow chart of a grating module verification method in one embodiment;
[0033] FIG2 is a schematic diagram of a flow chart of a second picture generation step in one embodiment;
[0034] FIG3 is a schematic diagram of a process of generating a first picture in an embodiment;
[0035] FIG4 is a schematic flow chart of a grating module verification method in another embodiment;
[0036] FIG5 is a schematic flow chart of a grating module verification method in another embodiment;
[0037] FIG6 is a block diagram of a grating module verification device in one embodiment;
[0038] FIG. 7 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0039] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with 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] At present, the function of the grating module is usually verified by the verification engineer writing relevant test cases according to the design specifications. However, this method relies on the experience of the verification engineer and the verification accuracy of the grating module is not high. If the verification engineer misunderstands the design specifications or graphic specifications, the written test cases cannot find the problems of the grating module.
[0041] In view of this, the present application determines the functional verification result of the target grating module by comparing the first image generated by the target grating module with the second image generated by the reference GPU, the reference GPU being 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, and does not need to manually write test cases to perform functional verification on the target grating module, thus avoiding the influence of human factors, and the verification of the grating module is more accurate. Furthermore, the verification result is obtained by automatic comparison, and the verification efficiency is higher.
[0042] In an exemplary embodiment, as shown in FIG1 , a grating module verification method is provided, and the method is described by taking the method applied to a terminal as an example. It can be understood that the 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, and includes the following steps:
[0043] Step 101: Generate test data.
[0044] Among them, the test data is used to verify the function of the target raster module. Raster modules are usually used in fields such as image processing or pattern recognition. They are used to process the points, lines or triangles output by the previous module, such as the pre-rasterization shader, such as by selecting and culling, and then output them 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 image metadata input to the target raster module. The raster module processes the original image metadata to obtain a processed image.
[0045] Optionally, the test data may be randomly generated data that conforms to the input mode of the raster module. The test data may also be generated according to certain design rules, such as generating primitives of fixed shape, color and size as test data.
[0046] Step 102: output the test data to the target raster module to generate a first image through the target raster module.
[0047] Optionally, the test data is output to a target raster module, and the target raster module processes the test data, which may include selecting according to various preset conditions, discarding primitives that do not need to be rendered, and culling the frustum according to the field of view, and finally rendering to obtain a 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 a second image through the reference GPU.
[0049] Wherein, the reference GPU includes a qualified raster module. Optionally, the reference GPU may be a GPU including a mature real graphics card of a third party. It is understandable that a mature real graphics card of a third party also includes a qualified raster module. Optionally, the reference GPU may be set on a terminal device for raster module verification, or may be set on other terminal devices or servers, and obtain test data by communicating with a terminal for raster module verification. The terminal for raster module verification obtains a second image generated by rendering the reference GPU according to the test data by communicating with the reference GPU. Since the reference GPU includes a mature real graphics card of a third party, the second image is an image that meets the design specifications and graphic specifications.
[0050] Step 104: Compare the first image with the second image to obtain a function verification result of the target grating module.
[0051] The properties of each pixel of the first image are compared with the properties of each pixel of the second image, and the function verification result of the target grating module can be determined according to the comparison result. Optionally, if the properties of each pixel of the first image are the same as the properties of each pixel of the second image, the function verification result of the target grating module can be determined to be qualified, and if there are pixels with different pixel properties between the first image and the second image, the function verification result of the target grating module can be determined to be unqualified, that is, the design of the target grating module does not meet the requirements of design specifications and image specifications.
[0052] In the above embodiment, first, test data for verifying the target grating module is generated, then the test data is output to the target grating module to generate a first image through the target grating module, then the test data is sent to a reference GPU including a qualified grating module to generate a second image through the reference GPU, and finally, the first image is compared with the second image to obtain a functional verification result of the target grating module. In this way, the first image generated by the target grating module according to the test data is compared with the second image generated by the reference GPU according to the test data to determine the functional verification result of the target grating module, and the reference GPU is a GPU including a qualified grating module, that is, the processing result of the target grating module is compared with the processing result of the qualified grating module, and there is no need to manually write test cases to verify the function of the target grating module, which avoids the influence of human factors, and the accuracy of the verification of the grating module is higher. Further, the verification result is obtained by automatic comparison, 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, original primitive type data, vertex coordinate data of the original primitive type, and attribute data of the original primitive type, and saving them into 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 original primitive type data may include the original primitive type to be rendered, 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 original primitive type is a point, the vertex coordinates of the original primitive type are the coordinate data of a point. When the original primitive type is a line, the vertex coordinate data of the original primitive type may be the coordinate data of the two endpoints of the line. The attribute data of the original primitive type may include the attributes of each pixel within the range of the primitive, and the attribute of a pixel may be the color of the pixel.
[0055] UVM is a universal verification platform development framework. Verification engineers can use reusable components in UVM to build a functional verification environment with standardized hierarchical structures and interfaces. Optionally, scripts can be written through UVM to automatically generate test data through scripts.
[0056] In the above embodiment, by generating test data, rasterization processing is performed according to the test data to determine whether the function of the raster module meets the requirements. At the same time, the test data is saved in a log file for easy viewing and further processing to generate the first image and the second image based on the test data.
[0057] In one embodiment, sending the test data to the reference GPU to generate a second picture by the reference GPU includes:
[0058] Step 201 , parse the log file, generate a target program according to 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.
[0059] Optionally, the terminal parses the log file to obtain register configuration data, original primitive type data, vertex coordinate data of the original primitive type, and attribute data of the original 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, which is an executable program. The generated target program is sent to a reference GPU, which 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. The target program can be sent to the reference GPU on other terminals or servers through the network, and the second image is generated after raster processing by the reference GPU.
[0060] Step 202, obtaining a second picture.
[0061] Among them, the second picture is generated by rendering with reference to the GPU running the target program. Optionally, the second picture can be a picture in bmp format. For example, taking the original primitive type as a triangle as an example, the vertex coordinates of the original primitive type are the coordinates of the three vertices of the triangle, and the attribute data of the original 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 based on the above data includes a triangle composed of multiple pixels, and the color of each pixel of the triangle is determined according to the attribute data of the original primitive type.
[0062] Optionally, registers of the reference GPU are configured according to register configuration data. The reference GPU runs the target program, and registers of the reference GPU are configured according to the target program. The register configuration data in the target program may include identifiers of registers used in the rasterization process of the reference GPU, address information of the registers, and value information of the registers.
[0063] In the above embodiment, the second image is generated by the reference GPU. Since the reference GPU is a GPU including a mature graphics card, that is, the grating module on the reference GPU meets the design specifications and graphic specifications, the second image is compared with the image generated by the grating module to be tested to determine whether the grating module to be tested meets the design specifications and graphic specifications.
[0064] In one embodiment, the step of outputting the test data to the target grating module in 102 to generate the first image through the target grating module is shown in FIG3 and includes:
[0065] Step 301, configuring the registers of the target grating module according to the register configuration data.
[0066] Optionally, the register configuration data may include the identifier of the register used in the rasterization process, the register address information, and the register value information, etc. The register of the target raster module is configured according to the register configuration data, that is, the register address or value is configured.
[0067] Step 302, obtaining a first picture.
[0068] The first image is generated by the target raster module 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 is obtained according to the text file. Optionally, after receiving the test data, the target raster module generates 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 in the test data, and the text file can be a .csv type file, and then generates the first image according to the text file, and the first image can be a bmp format image.
[0069] In this embodiment, the test data is processed by the target grating module to obtain a first image, and whether the target grating module meets the design specification and the graphic specification can be determined based on the first image.
[0070] In an embodiment of the present application, the process of comparing the first image with the second image in step 104 is shown in FIG4 , and includes:
[0071] Step 401, comparing the pixel attributes of the first picture with the pixel attributes of the second picture.
[0072] Optionally, the pixel attributes of each pixel in the first image are compared with the pixel attributes of the pixel at the same position in the second image, for example, the pixel color of each pixel in the first image is compared with the color of the pixel at the same position in the second image to confirm whether they are consistent.
[0073] Step 402: If all pixel attributes of the first image are consistent with corresponding pixel attributes of the second image, it is determined that the function verification result of the target grating module is qualified.
[0074] Since both the first image and the second image are obtained after rasterization processing of the test data, if the target raster module meets the design specifications and graphics specifications, the first image generated by the target raster module should be exactly the same as the second image generated by the reference GPU. Therefore, if the pixel attributes of all pixels of the first image are the same as the pixel attributes of the corresponding pixels of the second image, the functional verification result of the raster module is determined to be qualified. If the pixel attributes of some pixels of the first image are different from the pixel attributes of the corresponding pixels of the second image, the functional verification result of the raster module is determined to be unqualified.
[0075] In the above embodiment, the processing result of the target grating module is compared with the processing result of the qualified grating module. There is no need to manually write test cases to perform functional verification on the target grating module, which avoids the influence of human factors. The accuracy of the verification of the grating module is higher. Furthermore, the verification result is obtained by automatic comparison, and the verification efficiency is higher.
[0076] In an embodiment of the present application, please refer to FIG. 5 , which shows a flow chart of a grating module verification method provided in an embodiment of the present application. The grating module verification method 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 in a log file.
[0078] Step 502: configure the registers of the target grating module according to the register configuration data.
[0079] Step 503, obtaining a first picture.
[0080] Step 504 , 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.
[0081] Step 505, obtaining a second picture.
[0082] Step 506: Compare the first image with the second image to obtain a function verification result of the target grating module.
[0083] For ease of understanding, the grating module verification method of the present application is illustrated by way of example. The terminal runs the 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 a bmp format according to the test data, parses the log file, configures the register according to the register configuration information, and then generates an OPENGL_cpp file according to other test data and a template 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 a bmp format. The first picture and the second picture are obtained, and the pixel attributes of each pixel are compared. If the pixel colors of all pixels are consistent, it is determined that the function verification of the target grating module is qualified. If there are pixels with inconsistent pixel colors, it is determined that the function verification result of the target grating module is unqualified.
[0084] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.
[0085] Based on the same inventive concept, the embodiment of the present application also provides a grating module verification device for implementing the grating module verification method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in one or more grating module verification device embodiments provided below can refer to the limitations of the grating module verification method above, and will not be repeated here.
[0086] In an exemplary embodiment, as shown in FIG6 , a grating module verification device 600 is provided, comprising: a first generation module 601, a second generation module 602, a third generation module 603 and a comparison module 604, wherein:
[0087] A first generating module 601 is used to generate test data, and the test data is used to perform functional verification on the target grating module;
[0088] The second generating module 602 is used to output the test data to the target raster module so as to generate a first picture through the target raster module;
[0089] A third generating module 603, configured to send the test data to a reference GPU to generate a second image through the reference GPU, the reference GPU comprising a qualified raster module;
[0090] The comparison module 604 is used to compare the first image with the second image to obtain a function verification result of the target grating module.
[0091] In one embodiment, the first generation module 601 is specifically used to 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 in a log file.
[0092] In one of the embodiments, the third generation module 603 is specifically used to parse and process the log file, generate a target program based on register configuration data, original primitive type data, vertex coordinate data of the original primitive type, and attribute data of the original primitive type, and send the target program to the reference GPU; obtain a second image, which is generated by rendering the reference GPU running the target program.
[0093] In one of the embodiments, a configuration module is further included, configured to configure registers of the reference GPU according to the register configuration data.
[0094] In one embodiment, the second generation module 602 is specifically used to configure the registers of the target raster module according to the register configuration data; obtain the first image, which is a text file generated by the target raster module 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 is obtained according to the text file.
[0095] In one embodiment, the comparison module 604 is specifically used to compare the pixel attributes of the first image with the pixel attributes of the second image; if all the pixel attributes of the first image are consistent with the corresponding pixel attributes of the second image, it is determined that the functional verification result of the target grating module is qualified.
[0096] Each module in the above-mentioned grating module verification device can be implemented in whole or in part by software, hardware and their combination. Each module can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the corresponding operations of each module.
[0097] In an exemplary embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be shown in FIG7. The computer device includes a processor, a memory, an input / output interface, a communication interface, a display unit, and an input device. The processor, the memory, and the input / output interface are connected via a system bus, and the communication interface, the display unit, and the input device are connected to the system bus via the input / output interface. 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 to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner may be implemented through WIFI, a mobile cellular network, near field communication (NFC) or other technologies. When the computer program is executed by the processor, a grating module verification method is implemented. The display unit of the computer device is used to form a visually visible picture, which may 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, and the input device of the computer device can be a touch layer covering the display screen, or a button, trackball or touchpad set on the computer device shell, or an external keyboard, touchpad or mouse.
[0098] Those skilled in the art will understand that the structure shown in FIG. 7 is merely a block diagram of a partial structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than shown in the figure, or combine certain components, or have a different arrangement of components.
[0099] In an exemplary embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the following steps when executing the computer program: generating test data, the test data being used to perform functional verification on a target grating module; outputting the test data to the target grating module to generate a first image through the target grating module; sending the test data to a reference GPU to generate a second image through the reference GPU, the reference GPU including a qualified grating module; and comparing the first image with the second image to obtain a functional verification result of the target grating module.
[0100] In one embodiment, when the processor executes the computer program, the following steps are also 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 in a log file.
[0101] In one embodiment, when the processor executes the computer program, the following steps are also implemented: parsing the log file, generating 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 sending the target program to the reference GPU; obtaining a second image, which is generated by rendering the reference GPU running the target program.
[0102] In one embodiment, when the processor executes the computer program, the processor further implements the following steps: configuring registers of the reference GPU according to the register configuration data.
[0103] In one embodiment, when the processor executes the computer program, the following steps are also implemented: configuring the registers of the target raster module according to the register configuration data; acquiring a first image, where the target raster module generates 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 the first image is obtained according to the text file.
[0104] In one embodiment, when the processor executes the computer program, the following steps are also implemented: comparing the pixel attributes of the first image with the pixel attributes of the second image; if all the pixel attributes of the first image are consistent with the corresponding pixels of the second image, determining that the functional verification result of the target grating 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, the test data being used to perform functional verification on a target grating module; outputting the test data to the target grating module to generate a first image through the target grating module; sending the test data to a reference GPU to generate a second image through the reference GPU, the reference GPU including a qualified grating module; and comparing the first image with the second image to obtain a functional verification result of the target grating module.
[0106] In one embodiment, when the computer program is executed by the processor, the following steps are also 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 in a log file.
[0107] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: parsing the log file, generating 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 sending the target program to the reference GPU; obtaining a second image, which is generated by rendering the reference GPU running the target program. In one embodiment, when the computer program is executed by the processor, the following steps are also 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 the processor, the following steps are also implemented: configuring the registers of the target raster module according to the register configuration data; acquiring a first image, where the target raster module generates 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 the first image is obtained according to the text file.
[0109] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: comparing the pixel attributes of the first image with the pixel attributes of the second image; if all the pixel attributes of the first image are consistent with the corresponding pixel attributes of the second image, determining that the functional verification result of the target grating module is qualified.
[0110] In one embodiment, a computer program product is provided, comprising a computer program, which implements the following steps when executed by a processor: generating test data, the test data being used to perform functional verification on a target grating module; outputting the test data to the target grating module to generate a first image through the target grating module; sending the test data to a reference GPU to generate a second image through the reference GPU, the reference GPU comprising a qualified grating module; and comparing the first image with the second image to obtain a functional verification result of the target grating module.
[0111] In one embodiment, when the computer program is executed by the processor, the following steps are also 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 in a log file.
[0112] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: parsing the log file, generating 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 sending the target program to the reference GPU; obtaining a second image, which is generated by rendering the reference GPU running the target program. In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: configuring the registers of the reference GPU according to the register configuration data.
[0113] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: configuring the registers of the target raster module according to the register configuration data; acquiring a first image, where the target raster module generates 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 the first image is obtained according to the text file.
[0114] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: comparing the pixel attributes of the first image with the pixel attributes of the second image; if all the pixel attributes of the first image are consistent with the corresponding pixel attributes of the second image, determining that the functional verification result of the target grating 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 used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant regulations.
[0116] A person of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment method can be completed by instructing the relevant hardware through a computer program, and 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-mentioned methods. Among them, any reference to the 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), magnetic 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. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, an artificial intelligence (AI) processor, etc., but are not limited to this.
[0117] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, 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, they should be considered to be within the scope of this application.
[0118] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. A grating module verification method, characterized in that: The method comprises: Generate test data, wherein the test data is used to perform functional verification on the target grating module; Outputting the test data to a target grating module to generate a first image through the target grating module; Sending the test data to a reference GPU to generate a second image by the reference GPU, wherein the reference GPU includes a qualified raster module; The first image is compared with the second image to obtain a function verification result of the target grating module.
2. The method according to claim 1, characterized in that The generating of test data comprises: Register configuration data, primitive type data, vertex coordinate data of primitive types, and attribute data of primitive types are randomly generated and saved in a log file.
3. The method according to claim 2, characterized in that The step of sending the test data to a reference GPU to generate a second picture through the reference GPU includes: Parsing the log file, generating 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 sending the target program to the reference GPU; The second image is obtained, where the second image is generated by rendering when the reference GPU runs the target program.
4. The method according to claim 3, characterized in that The method further comprises: The registers of the reference GPU are configured according to the register configuration data.
5. The method according to claim 2, characterized in that: Outputting the test data to a target grating module to generate a first image through the target grating module includes: configuring the register of the target grating module according to the register configuration data; The first picture is obtained, where the target raster module generates 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 the text file is obtained according to the text file.
6. The method according to claim 1, characterized in that The step of comparing the first image with the second image to obtain a function verification result of the target grating module includes: Comparing pixel attributes of the first picture with pixel attributes of the second picture; If all pixel attributes of the first image are consistent with corresponding pixel attributes of the second image, it is determined that the function verification result of the target grating module is qualified.
7. A grating module verification device, characterized in that: The device comprises: A first generating module, used for generating test data, wherein the test data is used for functional verification of a target grating module; A second generating module, used for outputting the test data to a target grating module, so as to generate a first picture through the target grating module; a third generation module, configured to send the test data to a reference GPU to generate a second image through the reference GPU, wherein the reference GPU includes a qualified raster module; A comparison module is used to compare the first image with the second image to obtain a function verification result of the target grating module.
8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
Citation Information
Patent Citations
Method and system for auto testing grating image processor
CN101387983A
Image processing apparatus, image forming apparatus and image processing method
CN104079796A
Constrained random verification method and device for picture processing class IPs
CN104615537A
Rasterization module verification system and method based on UVM and storage medium
CN117541896A
Device and method for automatically rating fabric pleat appearance retentivity grade
CN117788887A
