Graphics processors and simulation methods, devices, media, products, fault location methods, and equipment

CN122312366APending Publication Date: 2026-06-30RICUN TECH (SHANGHAI) CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
RICUN TECH (SHANGHAI) CO LTD
Filing Date
2026-06-03
Publication Date
2026-06-30

Smart Images

  • Figure CN122312366A_ABST
    Figure CN122312366A_ABST
Patent Text Reader

Abstract

A graphics processor and simulation method, apparatus, medium, product, fault location method, and device are disclosed. The graphics processor includes: an enable switch register storing enable parameters for controlling whether to enable the calculation of signature values ​​for draw calls of various rendering targets, including stream output, color, and depth of field; an instruction execution unit for executing draw calls; at least one signature value calculation unit for calculating the signature value and its storage address for each draw call of a corresponding rendering target; and at least three signature value buffers for storing the signature values ​​of the draw calls of the corresponding rendering targets according to their storage addresses. This improves the efficiency of fault location for the graphics processor.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of data processing technology, and more specifically to a graphics processor and simulation method, apparatus, medium, product, fault location method, and equipment. Background Technology

[0002] During the rendering process using a graphics processing unit (GPU), a keyframe typically contains hundreds of draw calls. If a rendering error occurs during the GPU rendering of a keyframe, it is difficult to pinpoint the specific problem.

[0003] Therefore, improving the efficiency of fault location for GPUs is a technical challenge that urgently needs to be addressed in this field. Summary of the Invention

[0004] The purpose of this invention is to provide at least one graphics processor that can improve the efficiency of fault location in GPUs.

[0005] In a first aspect, the present invention provides a graphics processor, comprising: An enable switch register stores enable parameters to control whether to enable the calculation of the signature value of the drawing call for each rendering target, including stream output, color, and depth of field; The instruction execution unit is used to execute the drawing call; At least one signature value calculation unit is provided, which is used to calculate the signature value of each drawing call of the corresponding rendering target and its storage address; At least three signature value buffers are provided, which are used to store the signature values ​​of the drawing calls of the corresponding rendering targets according to the storage address.

[0006] Optionally, after each stream output drawing call is executed, multiple data streams are obtained. The signature value calculation unit calculates a signature value and its storage address for each data stream. The signature value calculation unit calculates the storage address of the signature value of each data stream based on the data length of the signature value, the storage base address of the corresponding signature value buffer, and the identifier of the drawing call.

[0007] Optionally, the signature value calculation unit calculates the storage address of the signature value of each data stream of the drawing call using the following method: ; Where j is a positive integer, and j≥1 This represents the storage address of the signature value of the j-th data stream; The identifier of the drawing call is indicated; the data length of the signature value is a; sigbuf_[j]_base represents the storage base address of the j-th data stream in the corresponding signature value buffer.

[0008] Optionally, the instruction execution unit includes multiple processing cores for executing the drawing calls for color and depth of field. Each processing core executes the calls to obtain a corresponding rendering result. The signature value calculation unit calculates a signature value and its storage address for each rendering result. The signature value calculation unit calculates the storage address of the signature value for each rendering result based on the data length of the signature value, the number of processing cores, the identifier of the processing core corresponding to the rendering result, the storage base address of the corresponding signature value buffer, and the identifier of the drawing call.

[0009] Optionally, the signature value calculation unit calculates the storage address of the signature value of each rendering result of the drawing call whose rendering target is color using the following method: ; Where k is the identifier of the processing core, k is an integer, and k≥0; [k] represents the storage address of the signature value of the rendering result of the kth processing core; the data length of the signature value is a; The identifier representing the drawing call; the number of processing cores is b; The base address of the drawing call is stored in the corresponding signature value buffer.

[0010] Optionally, the signature value calculation unit calculates the storage address of the signature value of each rendering result of the rendering call whose rendering target is depth of field using the following method: ; Where k is the identifier of the processing core, k is an integer, and k≥0; [k] represents the storage address of the signature value of the rendering result of the processing core identified as k; the data length of the signature value is a; The identifier representing the drawing call; the number of processing cores is b; The base address of the drawing call is stored in the corresponding signature value buffer.

[0011] Optionally, the interface width of the signature value buffer is greater than the data length of the signature value, the signature value buffer contains multiple storage units, and the signature value calculation unit is further used to obtain the write mask of the signature value of the drawing call of the corresponding rendering target according to the interface width of the corresponding signature value buffer and the data length of the signature value; the signature value buffer is further used to store the signature value at the corresponding storage address according to the corresponding write mask, so as to store the signature value into the corresponding storage unit, wherein each storage unit stores multiple signature values.

[0012] Optionally, the signature value calculation unit calculates the write mask of the signature value using the following method: The interface width n of the corresponding signature value buffer is segmented using the data length 'a' of the signature value as the unit, resulting in a number of segments m. The identifier of the signature value is... c represents the identifier of the corresponding storage unit, and each storage unit that has been filled with signature values ​​stores m signature values; d represents the identifier of the signature value in the segmentation result; 1 is assigned to the data in the segment identified as d in the segmented data received by the corresponding signature value buffer, and 0 is assigned to the data in the remaining segments to obtain the write mask of the signature value.

[0013] Optionally, the signature value calculation unit calculates the signature value in the following manner: performing a zeroing operation on the signature value; obtaining the state parameters generated during the execution of the drawing call of the corresponding rendering target, and segmenting the state parameters according to the data length of the signature value to obtain multiple state parameter segments; randomly shifting each state parameter segment obtained after segmentation, and performing an XOR calculation between each randomly shifted state parameter segment and the signature value, wherein the signature value is updated after each XOR calculation, until the random shift and XOR calculation of all state parameter segments are completed to obtain the signature value of the drawing call.

[0014] Optionally, the graphics processor further includes: At least one capacity configuration register, which records the storage capacity of a corresponding signature value buffer, is used to determine whether the remaining storage capacity of the corresponding signature value buffer is sufficient to store the signature value before each calculation of the signature value.

[0015] Optionally, the graphics processor further includes: At least one address index register, the address index register being used to record the identifier of the drawing call.

[0016] Secondly, the present invention also provides a method for simulating a graphics processor, comprising: Obtain enabling parameters, and determine the rendering target for calculating the signature value based on the enabling parameters. The rendering target includes stream output, color, and depth of field. Execute the drawing calls for the corresponding rendering target, and calculate the reference signature value and its storage address for each drawing call of the rendering target; The reference signature value of the drawing call for the corresponding rendering target is stored at the storage address.

[0017] Thirdly, the present invention also provides a graphics processor simulation device, comprising: An enable switch module stores enable parameters for determining the corresponding rendering target of the drawing call for which the signature value to be calculated, the rendering target including stream output, color, and depth of field; at least one signature value calculation module is used to execute the drawing call of the corresponding rendering target and calculate the reference signature value of the drawing call and its storage address; at least three signature value storage modules are used to store the reference signature value of the drawing call of the corresponding rendering target according to the storage address.

[0018] Fourthly, the present invention also provides a computer-readable storage medium having stored thereon computer program instructions that, when executed by a processor, implement the steps of the above-described graphics processor simulation method.

[0019] Fifthly, the present invention also provides a computer program product, including computer program instructions that, when executed by a processor, implement the steps of the above-described graphics processor simulation method.

[0020] Sixthly, the present invention also provides a method for fault location of a graphics processor, wherein the graphics processor is any of the graphics processors described above, comprising: In response to a rendering error in the graphics processor's rendering results, locate the frame with the rendering error and the corresponding drawing call; Configure the enable switch register of the graphics processor, execute the drawing call of the corresponding rendering target, and read the corresponding signature value from the corresponding signature value buffer; Obtain the reference signature value of the draw call for the corresponding rendering target. The reference signature value is obtained by performing the following simulation method: obtain the enable parameter, determine the rendering target to which the signature value is to be calculated based on the enable parameter, the rendering target includes stream output, color, and depth of field; execute the draw call for the corresponding rendering target, and calculate the reference signature value and its storage address for each draw call of the rendering target; store the reference signature value of the draw call for the corresponding rendering target according to the storage address. The signature value of the drawing call for the corresponding rendering target is compared with the reference signature value, and the drawing call that caused the error is located based on the comparison result.

[0021] In a seventh aspect, the present invention also provides a terminal device including any of the graphics processors described above.

[0022] Compared with the prior art, the technical solution of the present invention has the following beneficial effects: This invention modifies the hardware architecture of a graphics processor by adding an enable switch register for controlling the calculation of signature values ​​of draw calls for each rendering target, a signature value calculation unit for calculating signature values, and a signature value buffer for storing the signature values ​​of each draw call for the corresponding rendering target. This enables the graphics processor to calculate the signature values ​​of draw calls for at least three types of rendering targets: stream output, color, and depth of field. Furthermore, the signature values ​​of the draw calls for the three types of rendering targets are stored in separate signature value buffers. As a result, during the debugging phase, the graphics processor can directly locate rendering errors at the draw call level of each of the rendering targets, thus improving the efficiency of fault location for the graphics processor.

[0023] Furthermore, the present invention provides a simulation method for a graphics processor, which can obtain a reference signature value for each drawing call of the above-mentioned at least three types of rendering targets, and compare it with the corresponding signature value generated by the graphics processor to locate the drawing call with rendering error, thereby improving the efficiency of fault location of the graphics processor.

[0024] Furthermore, the present invention also provides a method for fault location of a graphics processor, which can use an improved graphics processor and its simulation device to obtain the signature value and reference signature value of the drawing call of the corresponding rendering target in batches, and compare the signature value with the corresponding reference signature value one by one, thereby locating the drawing call with rendering error one by one, thus improving the efficiency of fault location of the graphics processor. Attached Figure Description

[0025] Figure 1 This is a schematic diagram of the structure of a graphics processor according to an embodiment of the present invention; Figure 2 This is a flowchart of a simulation method for a graphics processor according to an embodiment of the present invention; Figure 3 This is a schematic diagram of a simulation device for a graphics processor according to an embodiment of the present invention; Figure 4 This is a flowchart of a fault location method for a graphics processor according to an embodiment of the present invention. Detailed Implementation

[0026] As mentioned in the background section, during the GPU rendering process, the target image frame typically includes hundreds of drawing calls. Whether in the GPU development and verification phase or the post-processing verification phase, when the GPU encounters a final graphics rendering error or an error in the output buffer / image data during the rendering of the target image frame, it is difficult to quickly locate the source of the problem.

[0027] The inventors of this application discovered through research that the main reason is that the traditional method for locating GPU rendering problems is usually as follows: Option 1: Capture the target image frame containing the rendering error using a graphics debugger (such as RenderDoc). Use this target image frame as a complete test case that can reproduce the problem. Then, trim the test case to obtain multiple draw calls that may contain errors. Investigate these multiple draw calls to determine which draw call(s) are erroneous. However, using Option 1 to locate the rendering error draw call requires significant computational resources during the test case trimming process. Furthermore, Option 1 often overlooks the coupling relationships between draw calls, making it difficult to reproduce the rendering problem after trimming the test case.

[0028] Option 2: Per-frame signature. During the rendering process of the target image frame, a corresponding signature value is calculated for each target image frame. The signature value of each target image frame can be used to determine which rendering target in the target image frame is erroneous, such as the color buffer, depth buffer, or stream out buffer. However, it cannot determine which specific drawing call(s) are erroneous.

[0029] Therefore, in this embodiment of the invention, during the calculation process of each drawing call, the signature value and its storage address are obtained, and the signature value is stored according to the storage address. When a target image frame with a rendering error is detected, the signature value generated by each drawing call in that target image frame during actual operation can be directly obtained. By comparing the signature value generated during actual operation with a reference signature value, the drawing call with the rendering error can be directly located. This improves the efficiency of fault location in the GPU rendering process.

[0030] To make the above-mentioned objectives, features and beneficial effects of the present invention more apparent and understandable, specific embodiments of the present invention will be described in detail below with reference to the accompanying drawings.

[0031] Reference Figure 1 , Figure 1 A schematic diagram of the structure of a graphics processor 10 according to an embodiment of the present invention is shown. The graphics processor 10 includes: an enable switch register (sigbuf_en) 11, an instruction execution unit 12, at least one signature value calculation unit 13, and at least three signature value buffers 14.

[0032] In specific implementation, enable switch register 11 stores enable parameters to control whether to enable the calculation of the signature value of the draw call for each rendering target. The rendering targets include stream out, color, and depth. The draw call for color is used to fill the color of the set target and save the state parameters generated by the draw call to the color buffer. The draw call for depth is used to fill the depth value of the set target and save the state parameters generated by the draw call to the depth buffer. The draw call for stream out is used to determine how many data streams a piece of data will be divided into and stored in the corresponding stream out buffer. The number of stream out buffers is usually up to four. For each stream out draw call, each stream out buffer stores at most one of the data streams.

[0033] In a non-limiting example, the graphics processor 10 includes an enable switch register 11 that stores three enable parameters. These three parameters control whether to enable the calculation of the signature values ​​of the draw calls for each rendering target, including stream output, color, and depth of field. In other words, one enable switch register 11 controls all rendering targets.

[0034] In another non-limiting example, the graphics processor 10 includes three enable switch registers 11, each storing at least one enable parameter. These three enable switch registers 11 are used to control whether to enable the calculation of the signature value of the draw call for each rendering target, including stream output, color, and depth of field. That is, each enable switch register 11 controls a corresponding rendering target.

[0035] Therefore, the calculation of the signature value of the drawing instructions of each rendering target can be flexibly controlled by using the enable switch register 11. Users can set the corresponding enable parameters of the corresponding enable switch register 11 according to specific debugging needs to enable the calculation of the signature value of the drawing call of the corresponding rendering target and debug the drawing call of the corresponding rendering target. Compared with the existing technology, the location of rendering errors is refined to each drawing call level of the corresponding rendering target, and it can directly locate which drawing call the GPU erred during execution, thus improving the efficiency of fault location of the GPU.

[0036] In some embodiments, the graphics processor 10 further includes at least one capacity configuration register, which records the storage capacity of the corresponding signature value buffer 14, and is used to determine whether the remaining storage capacity of the corresponding signature value buffer 14 is sufficient to store the signature value to be calculated before each signature value calculation.

[0037] In a non-limiting example, the number of capacity configuration registers can be three, with one corresponding capacity configuration register configured for each signature value buffer 14, and each capacity configuration register is used to record the storage capacity of the corresponding signature value buffer 14.

[0038] In some embodiments, the graphics processor 10 further includes at least one address index register, which is used to record the identifier of the drawing call.

[0039] In a non-restrictive example, the number of address index registers can be three, with one corresponding address index register configured for each signature value buffer 14. Each address index register is used to record the identifier of the drawing call for each rendering target in the corresponding signature value buffer 14 that has completed the signature value calculation.

[0040] In specific implementations, the instruction execution unit 12 is used to execute drawing calls. Generally, different instruction execution units 12 can be used to execute the drawing calls for different rendering targets. In particular, drawing calls for stream output are usually completed by a dedicated instruction execution unit 12. The specific structure of the instruction execution unit 12 can adopt any suitable structure in the prior art, which will not be described in detail here.

[0041] In a specific implementation, the signature value calculation unit 13 is used to calculate the signature value and its storage address for each drawing call of the corresponding rendering target. The signature value calculation unit 13 can use various appropriate algorithms to calculate the signature value of each drawing call, as long as the calculated signature value can uniquely identify the execution result of the drawing call.

[0042] In some embodiments, the signature value calculation unit 13 first clears the signature value variable (sig_value) inside the graphics processor 10, then determines the rendering target currently being debugged based on the enable parameters, obtains the status parameters generated during the execution of the corresponding rendering target's drawing call, and segments the status parameters according to the data length of the signature value to obtain multiple status parameter segments; each segmented status parameter segment is randomly shifted, and each randomly shifted status parameter segment is XORed with the signature value, wherein the signature value is updated after each XOR calculation, until the random shift and XOR calculation of all status parameter segments are completed to obtain the signature value of the drawing call. The status parameters used to calculate the signature value can be status parameters generated during the execution of the corresponding drawing call, with the signature value accumulated while the corresponding drawing call is running; the status parameters can also be data stored in the corresponding buffer after the corresponding drawing call is completed, with the status parameters in the corresponding buffer directly obtained for signature value calculation after the corresponding drawing call is completed.

[0043] In a non-limiting example, the random shift performed on each state parameter segment may include: obtaining a random number for each state parameter segment, cyclically shifting each state parameter segment according to the corresponding random number, shifting left bitwise according to the corresponding random number and padding with zeros, and shifting right bitwise according to the corresponding random number and padding with zeros, such that the state parameter segment obtained after the random shift has the same data length as the signature value.

[0044] In a non-restrictive example, the signature value has a data length of 64 bits, and the state parameter has a data length of 640 bits. First, the sig_value is cleared. Then, the state parameter is segmented according to the signature value's data length, resulting in ten state parameter segments. For each segment, a random number is generated. Each segment is cyclically shifted based on the corresponding random number. The first shifted state parameter segment is XORed with the sig_value, and the result is used to update the sig_value. The second shifted state parameter segment is then XORed with the sig_value, and the result is used to update the sig_value. This process of XORing and updating the sig_value is repeated until the tenth shifted state parameter segment is XORed with the sig_value. The final result is used as the signature value for the corresponding rendering instruction, and the signature value is saved to the corresponding signature value buffer 14.

[0045] In some embodiments, for a drawing call whose rendering target is a stream output, each stream output drawing call is executed to obtain multiple data streams. The signature value calculation unit 13 calculates a signature value and its storage address for each data stream. The signature value calculation unit 13 calculates the storage address of the signature value of each data stream based on the data length of the signature value, the storage base address of the corresponding signature value buffer 14, and the identifier of the drawing call.

[0046] In a non-limiting example, the signature value calculation unit 13 calculates the storage address of the signature value of each data stream of a draw call whose rendering target is stream output using the following method: ; Where j is a positive integer, and j≥1 This represents the storage address of the signature value of the j-th data stream; The identifier indicates the drawing call; the data length of the signature value is a; sigbuf_[j]_base represents the storage base address of the j-th data stream in the corresponding signature value buffer 14.

[0047] In a non-restrictive example, since industry standards stipulate that a draw call can only bind to and output the rendering result to a maximum of 4 stream output buffers at the same time, and each stream output buffer corresponds to a stream out signature buffer, sigbuf_buf0_base, sigbuf_buf1_base, sigbuf_buf2_base, and sigbuf_buf3_base are defined to represent the storage base addresses of the 4 stream out signature buffers, respectively.

[0048] Furthermore, during the execution of the drawing call, the system first checks whether the corresponding enable switch register 11 is enabled. If it is disabled, no further operations are performed. If it is enabled, the system checks whether the value of the corresponding address index register is less than the value of the corresponding capacity configuration register. If the value of the corresponding address index register is greater than or equal to the value of the corresponding capacity configuration register, it indicates that the stream output signature value buffer is full and cannot continue to store signature values, thus ending the operation. If the value of the corresponding address index register is less than the value of the corresponding capacity configuration register, the sig_value is cleared, and the signature value of the drawing call is accumulated during the execution of the drawing call. When the drawing call ends, the storage address corresponding to the signature value of the drawing call is calculated. The number of signature values ​​for the drawing call is determined by the number of stream output buffers corresponding to the drawing call. Each stream output buffer corresponds to one stream output signature value buffer. The formula for calculating the storage address of the signature value in the stream output signature value buffer is as follows: [buf_id] = 8 bytes+ [buf_id]_base; buf_id represents the identifier of the stream output signature value buffer corresponding to this signature value. `[buf_id] _base` represents the base address of the stream output signature value buffer corresponding to this signature value. The signature value is stored according to the calculated storage address, `sigbuf_draw_index` is incremented, and the above steps are repeated to calculate the signature value for the next drawing call. The initial value is 0, which means the identifier of the first drawing call is 0.

[0049] In some embodiments, for a draw call whose rendering target is color and depth of field, the instruction execution unit 12 includes multiple processing cores for executing the color and depth of field draw call. Each processing core executes the call and obtains a corresponding rendering result. The signature value calculation unit 13 calculates a signature value and its storage address for each rendering result. The signature value calculation unit 13 calculates the storage address of the signature value of each rendering result based on the data length of the signature value, the number of processing cores, the identifier of the processing core corresponding to the rendering result, the storage base address of the corresponding signature value buffer 14, and the identifier of the draw call. The draw call is distributed to multiple processing cores for execution. After each processing core completes its execution, a corresponding rendering result is obtained. The signature value calculated for a draw call whose rendering target is color and depth of field is the signature value of the corresponding rendering result of each processing core. This allows for further localization of the rendering error to the specific processing core that malfunctioned during the rendering process.

[0050] In a non-limiting example, the signature value calculation unit 13 calculates the storage address of the signature value of each rendering result of a drawing call whose rendering target is color using the following method: ; Where k is the identifier of the processing core, k is an integer, and k≥0; [k] represents the storage address of the signature value of the rendering result of the processing core identified as k; the data length of the signature value is a; This indicates the identifier for the drawing call; the number of processing cores is b. The base address of the drawing call is stored in the corresponding signature value buffer 14.

[0051] In a non-restricted example, during the execution of a draw call targeting color, the system first checks whether the corresponding enable switch register 11 is enabled. If it is disabled, no further operations are performed. If it is enabled, the system checks whether the value of the corresponding address index register is less than the value of the corresponding capacity configuration register. If the value of the corresponding address index register is greater than or equal to the value of the corresponding capacity configuration register, it indicates that the color signature buffer is full and cannot continue to store signature values, thus ending the operation. If the value of the corresponding address index register is less than the value of the corresponding capacity configuration register, the sig_value is cleared, and the signature value of the draw call is accumulated during the execution of the draw call. When the draw call ends, the storage address corresponding to the signature value of the draw call is calculated. Since draw calls targeting color are rendered per processing core, and the graphics processor 10 contains 32 processing cores, each rendering result has a corresponding signature value. The formula for calculating the storage address of the signature value corresponding to each rendering result is as follows: = 8 bytes 32+core_id 8 bytes + color_sigbuf_base; Wherein, core_id represents the sequence number of the processing core corresponding to the rendering result; the data length of the signature value is set to 8 bytes; color_sigbuf_base is the storage base address of the color signature value buffer; This indicates the value of the address index register corresponding to the color signature value buffer; the graphics processor 10 is configured to contain 32 processing cores; the signature value is stored according to the calculated storage address. Perform an increment operation, and repeat the above steps to calculate the signature value for the next drawing call. The initial value is 0, which means the identifier of the first drawing call is 0.

[0052] In a non-limiting example, the signature value calculation unit 13 calculates the storage address of the signature value of each rendering result of a rendering call whose rendering target is depth of field using the following method: ; Where k is the identifier of the processing core, k is an integer, and k≥0; [k] represents the storage address of the signature value of the rendering result of the processing core identified as k; the data length of the signature value is a; This indicates the identifier for the drawing call; the number of processing cores is b. The base address of the drawing call is stored in the corresponding signature value buffer 14.

[0053] In a non-restrictive example, during the execution of a draw call targeting depth of field, the system first checks whether the corresponding enable switch register 11 is enabled. If it is disabled, no further operations are performed. If it is enabled, the system checks whether the value of the corresponding address index register is less than the value of the corresponding capacity configuration register. If the value of the corresponding address index register is greater than or equal to the value of the corresponding capacity configuration register, it indicates that the depth signature buffer is full and cannot continue to store signature values, thus ending the operation. If the value of the corresponding address index register is less than the value of the corresponding capacity configuration register, the sig_value is cleared, and the signature value of the draw call is accumulated during the execution of the draw call. When the draw call ends, the storage address corresponding to the signature value of the draw call is calculated. Since the draw call targeting depth of field is rendered per processing core, and the graphics processor 10 is assumed to contain 32 processing cores, each rendering result has a corresponding signature value. The formula for calculating the storage address of the signature value corresponding to each rendering result is as follows: = 8 bytes 32+core_id 8 bytes + depth_sigbuf_base; Wherein, core_id represents the sequence number of the processing core corresponding to the rendering result; the data length of the signature value is set to 8 bytes; depth_sigbuf_base is the storage base address of the depth signature value buffer; This indicates the value of the address index register corresponding to the depth signature value buffer; the graphics processor 10 is configured to contain 32 processing cores; the signature value is stored according to the calculated storage address. Perform an increment operation, and repeat the above steps to calculate the signature value for the next drawing call. The initial value is 0, which means the identifier of the first drawing call is 0.

[0054] In practice, the signature value buffer 14 is used to store the signature value of the drawing call of the corresponding rendering target according to the storage address.

[0055] In a non-limiting example, when the interface width of the signature value buffer 14 is greater than the data length of the signature value, the signature value buffer 14 contains multiple storage units. The signature value calculation unit 13 is also used to obtain the write mask of the signature value of the drawing call of the corresponding rendering target according to the interface width of the corresponding signature value buffer 14 and the data length of the signature value. The signature value buffer 14 is also used to store the signature value at the corresponding storage address according to the corresponding write mask, so as to store the signature value into the corresponding storage unit, wherein each storage unit stores multiple signature values.

[0056] In a non-limiting example, the signature value calculation unit 13 calculates the write mask of the signature value using the following method: The interface width n of the corresponding signature value buffer 14 is segmented with the signature value data length 'a' as the unit, resulting in a number of segments m, and the signature value identifier is m. c+d; c represents the identifier of the corresponding storage unit, and each storage unit that has been filled with signature values ​​stores m of the signature values; d represents the identifier of the signature value in the segmentation result; 1 is assigned to the data in the segment identified as d in the segmented data received by the corresponding signature value buffer 14, and 0 is assigned to the data in the remaining segments to obtain the write mask of the signature value. The interface width of the signature value buffer 14 is set to 320 bits, and the data length of the signature value is 64 bits, which is equivalent to the data corresponding to the signature value being one cell, the data corresponding to the interface width of the signature value buffer 14 being five cells, and the corresponding storage capacity of each storage unit in the signature value buffer 14 is also five cells. The identifier of the signature value to be stored is 12, and the number of storage units that have been filled with signature values ​​is 2, that is, the identifier of the signature value to be stored in the segmentation result is 2, indicating that the signature value is in the second cell of the segmentation result, and the write mask of the signature value is "01000".

[0057] Reference Figure 2 This invention also provides a method for simulating a graphics processor, comprising: Step S201: Obtain the enabling parameters and determine the rendering target for calculating the signature value based on the enabling parameters. The rendering target includes stream output, color, and depth of field.

[0058] Step S202: Execute the drawing call of the corresponding rendering target, and calculate the reference signature value and its storage address for each drawing call of the rendering target.

[0059] Step S203: Store the reference signature value of the drawing call of the corresponding rendering target according to the storage address.

[0060] This simulation method is typically applied to simulation servers or terminals, usually running in software. However, in some scenarios, it can also be run in other ways, such as through an FPGA or a combination of software and FPGA. Using this simulation method, for a given graphics processor design, a reference signature value can be obtained for each rendering call of various rendering targets. This reference signature value represents the standard result, or correct result, of the graphics processor running for the given design. This reference signature value can then be used to debug and locate faults in the actual production graphics processor chip.

[0061] Reference Figure 3 This invention also provides a graphics processor simulation device 30, comprising: An enable switch module 31 stores enable parameters for determining the corresponding rendering target of the drawing call for which the signature value to be calculated. The rendering target includes stream output, color, and depth of field. At least one signature value calculation module 32 is used to execute the drawing call for the corresponding rendering target and calculate the reference signature value of the drawing call and its storage address. At least three signature value storage modules 33 are used to store the reference signature value of the drawing call for the corresponding rendering target according to the storage address.

[0062] The graphics processor simulation device 30 provided in this embodiment corresponds to the graphics processor 10 described above. The graphics processor 10 in this embodiment is used to execute drawing calls, calculate the signature value of the drawing call, and store it. The graphics processor simulation device 30 is a simulated software model with the same function as the graphics processor 10, used to execute drawing calls, calculate the reference signature value of the drawing call, and store it. The graphics processor simulation method in the above embodiment is the method of using the graphics processor simulation device 30.

[0063] In specific implementations, the graphics processor simulation device 30 may also include: The instruction execution module is used to execute the drawing call; at least one capacity configuration module records the storage capacity of the corresponding signature value buffer, which is used to determine whether the remaining storage capacity of the corresponding signature value buffer can be used to store the signature value to be calculated before each signature value calculation; at least one address index module is used to record the identifier of the drawing call.

[0064] This invention also provides a computer-readable storage medium, which is a non-volatile or non-transitory storage medium storing a computer program. When executed by a processor, the computer program performs the steps of the graphics processor simulation method provided in any of the above embodiments. Preferably, the storage medium may include a computer-readable storage medium such as non-volatile or non-transitory memory. The storage medium may include ROM, RAM, a magnetic disk, or an optical disk, etc.

[0065] This invention also provides a computer program product, including a computer program that, when executed by a processor, implements the steps of the graphics processor simulation method provided in any of the above embodiments.

[0066] Reference Figure 4 This invention also provides a method for fault location of a graphics processor, wherein the graphics processor used is the graphics processor provided in any of the above embodiments, comprising: Step S401: In response to a rendering error in the graphics processor's rendering result, locate the frame with the rendering error and the corresponding drawing call.

[0067] Step S402: Configure the enable switch register of the graphics processor, run the drawing call of the corresponding rendering target, and read the corresponding signature value from the corresponding signature value buffer.

[0068] Step S403: Obtain the reference signature value of the drawing call for the corresponding rendering target. The reference signature value is obtained by performing the following simulation method: obtain the enable parameter, determine the rendering target to be calculated based on the enable parameter, the rendering target includes stream output, color and depth of field; execute the drawing call for the corresponding rendering target, and calculate the reference signature value and its storage address for each drawing call of the rendering target; store the reference signature value of the drawing call for the corresponding rendering target according to the storage address.

[0069] Step S404: Compare the signature value of the drawing call of the corresponding rendering target with the reference signature value, and locate the drawing call that has an error based on the comparison result.

[0070] In the specific implementation of step S401, the graphics processor is first run to execute a rendering task and obtain the rendering result. This rendering task consists of multiple drawing calls. In response to the detection of a rendering error in the obtained rendering result, a graphics debugger (such as RenderDoc) is run to analyze the rendering result, obtain the index of the frame with the rendering error, and determine the corresponding multiple drawing calls based on the index of the frame with the rendering error.

[0071] Step S402 corresponds to the relevant functional description of the graphics processor 10 in the above embodiments, and step S403 corresponds to the relevant functional description of the graphics processor simulation device 30 in the above embodiments. Further details will not be provided here.

[0072] In the specific implementation of step S404, after obtaining the signature value and reference signature value of the drawing call of the corresponding rendering target, the signature value and reference signature value of the drawing call of the corresponding rendering target are compared. If the signature value of the drawing call is inconsistent with the reference signature value, it is determined that an error has occurred in the drawing call during the rendering process.

[0073] This invention also provides a terminal device, including the graphics processor provided in any of the above embodiments.

[0074] In summary, by using the graphics processor and its simulation device provided in the embodiments of the present invention, during the debugging process of the graphics processor, the signature values ​​of all drawing calls of the corresponding rendering target in the frame with rendering errors can be obtained in batches according to the type of rendering target to be debugged. At the same time, the simulation device of the graphics processor is used to obtain the reference signature value of the corresponding drawing call. By comparing the signature value with the reference signature value one by one, the drawing call with rendering error can be located, thereby improving the efficiency of fault location of the graphics processor.

[0075] While the present invention has been disclosed above, it is not limited thereto. Any person skilled in the art can make various modifications and alterations without departing from the spirit and scope of the invention; therefore, the scope of protection of the present invention should be determined by the scope defined in the claims.

Claims

1. A graphics processor, characterized in that, include: An enable switch register stores enable parameters to control whether to enable the calculation of the signature value of the drawing call for each rendering target, including stream output, color, and depth of field; The instruction execution unit is used to execute the drawing call; At least one signature value calculation unit is provided, which is used to calculate the signature value of each drawing call of the corresponding rendering target and its storage address; At least three signature value buffers are provided, which are used to store the signature values ​​of the drawing calls of the corresponding rendering targets according to the storage address.

2. The graphics processor according to claim 1, characterized in that, After each stream output drawing call is executed, multiple data streams are obtained. The signature value calculation unit calculates a signature value and its storage address for each data stream. The signature value calculation unit calculates the storage address of the signature value of each data stream based on the data length of the signature value, the storage base address of the corresponding signature value buffer, and the identifier of the drawing call.

3. The graphics processor according to claim 2, characterized in that, The signature value calculation unit calculates the storage address of the signature value of each data stream invoked in the drawing process using the following method: ; Where j is a positive integer, and j≥1 This represents the storage address of the signature value of the j-th data stream; The identifier of the drawing call is indicated; the data length of the signature value is a; sigbuf_[j]_base represents the storage base address of the j-th data stream in the corresponding signature value buffer.

4. The graphics processor according to claim 1, characterized in that, The instruction execution unit includes multiple processing cores for executing the drawing calls for color and depth of field. Each processing core executes the calls to obtain a corresponding rendering result. The signature value calculation unit calculates a signature value and its storage address for each rendering result. The signature value calculation unit calculates the storage address of the signature value for each rendering result based on the data length of the signature value, the number of processing cores, the identifier of the processing core corresponding to the rendering result, the storage base address of the corresponding signature value buffer, and the identifier of the drawing call.

5. The graphics processor according to claim 4, characterized in that, The signature value calculation unit calculates the storage address of the signature value of each rendering result of the rendering call with the rendering target as color using the following method: ; Where k is the identifier of the processing core, k is an integer, and k≥0; [k] represents the storage address of the signature value of the rendering result of the kth processing core; the data length of the signature value is a; The identifier representing the drawing call; the number of processing cores is b; The base address of the drawing call is stored in the corresponding signature value buffer.

6. The graphics processor according to claim 4, characterized in that, The signature value calculation unit calculates the storage address of the signature value of each rendering result of the rendering call whose rendering target is depth of field using the following method: ; Where k is the identifier of the processing core, k is an integer, and k≥0; [k] represents the storage address of the signature value of the rendering result of the processing core identified as k; the data length of the signature value is a; The identifier representing the drawing call; the number of processing cores is b; The base address of the drawing call is stored in the corresponding signature value buffer.

7. The graphics processor according to claim 1, characterized in that, The interface width of the signature value buffer is greater than the data length of the signature value. The signature value buffer contains multiple storage units. The signature value calculation unit is also used to obtain the write mask of the signature value of the drawing call of the corresponding rendering target according to the interface width of the corresponding signature value buffer and the data length of the signature value. The signature value buffer is also used to store the signature value at the corresponding storage address according to the corresponding write mask, so as to store the signature value into the corresponding storage unit, wherein each storage unit stores multiple signature values.

8. The graphics processor according to claim 7, characterized in that, The signature value calculation unit calculates the write mask of the signature value using the following method: The interface width n of the corresponding signature value buffer is segmented using the data length 'a' of the signature value as the unit, resulting in a number of segments m. The identifier of the signature value is... ; c represents the identifier of the corresponding storage unit, and each storage unit that is full of signature values ​​stores m signature values; d represents the identifier of the signature value in the segmentation result; Assign 1 to the data in the segment marked d in the segmented data received by the corresponding signature value buffer, and assign 0 to the data in the remaining segments to obtain the write mask of the signature value.

9. The graphics processor according to claim 1, characterized in that, The signature value calculation unit calculates the signature value in the following manner: The signature value is cleared; the state parameters generated during the execution of the drawing call of the corresponding rendering target are obtained, and the state parameters are segmented according to the data length of the signature value to obtain multiple state parameter segments; each segmented state parameter segment is randomly shifted, and each randomly shifted state parameter segment is XORed with the signature value, wherein the signature value is updated after each XOR calculation, until the random shift and XOR calculation of all state parameter segments are completed to obtain the signature value of the drawing call.

10. The graphics processor according to claim 1, characterized in that, The graphics processor also includes: At least one capacity configuration register, which records the storage capacity of a corresponding signature value buffer, is used to determine whether the remaining storage capacity of the corresponding signature value buffer is sufficient to store the signature value before each calculation of the signature value.

11. The graphics processor according to claim 1, characterized in that, The graphics processor also includes: At least one address index register, the address index register being used to record the identifier of the drawing call.

12. A simulation method for a graphics processor, characterized in that, include: Obtain enabling parameters, and determine the rendering target for calculating the signature value based on the enabling parameters. The rendering target includes stream output, color, and depth of field. Execute the drawing calls for the corresponding rendering target, and calculate the reference signature value and its storage address for each drawing call of the rendering target; The reference signature value of the drawing call for the corresponding rendering target is stored at the storage address.

13. A graphics processor simulation device, characterized in that, include: An enable switch module stores enable parameters to determine the corresponding rendering target of the drawing call to calculate the signature value. The rendering target includes stream output, color, and depth of field. At least one signature value calculation module is used to execute a drawing call for the corresponding rendering target and calculate the reference signature value of the drawing call and its storage address; At least three signature value storage modules are used to store reference signature values ​​of the drawing calls of the corresponding rendering targets according to the storage address.

14. A computer-readable storage medium having computer program instructions stored thereon, characterized in that, When the computer program instructions are executed by the processor, they implement the steps of the simulation method for the graphics processor as described in claim 12.

15. A computer program product comprising computer program instructions, characterized in that, When the computer program instructions are executed by the processor, they implement the steps of the simulation method for the graphics processor as described in claim 12.

16. A method for fault location of a graphics processor, wherein the graphics processor is the graphics processor according to any one of claims 1-11, characterized in that, include: In response to a rendering error in the graphics processor's rendering results, locate the frame with the rendering error and the corresponding drawing call; Configure the enable switch register of the graphics processor, execute the drawing call of the corresponding rendering target, and read the corresponding signature value from the corresponding signature value buffer; Obtain the reference signature value of the draw call for the corresponding rendering target. The reference signature value is obtained by performing the following simulation method: obtain the enable parameter, determine the rendering target to which the signature value is to be calculated based on the enable parameter, the rendering target includes stream output, color, and depth of field; execute the draw call for the corresponding rendering target, and calculate the reference signature value and its storage address for each draw call of the rendering target; store the reference signature value of the draw call for the corresponding rendering target according to the storage address. The signature value of the drawing call for the corresponding rendering target is compared with the reference signature value, and the drawing call that caused the error is located based on the comparison result.

17. A terminal device, characterized in that, Includes the graphics processor described in claims 1 to 11.