An acceleration method for data processing using dual-channel parallel single-precision floating-point data format
Through the acceleration method of dual-channel parallel single-precision floating-point data format, the parallel mode of configuration and data channel is built, which solves the problems of data overflow and high computational volume in three-dimensional cropping, improves processing efficiency and reduces design complexity, and realizes the Efficient three-dimensional cutting.
Patent Information
- Application Number
- CN202210590699.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-05-27
- Publication Date
- 2024-11-12
- Estimated Expiration
- 2042-05-27
AI Technical Summary
The existing three-dimensional cropping technology has data overflow problems, large computing volume, increased design complexity, and performance impacts caused by processor-added software. It is especially difficult to achieve efficient three-dimensional cropping in graphics processors.
The acceleration method of dual-channel parallel single-precision floating-point data format is adopted. By building a parallel mode of configuration channels and data channels, the next batch of data configurations is cached, the system task processing time is reduced, and the overflow problem is solved through the single-precision floating-point 754 standard format .
It improves the concurrency of configuration and data processing, saves configuration time, reduces the blocking problem caused by pipeline load imbalance, and solves the overflow problem of fixed-point data formats during the calculation process.
Smart Images

Figure CN114820281B_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the technical field of graphics calculation and special accelerator hardware, in particular to an acceleration method for data processing using a dual-channel parallel single-precision floating-point data format. Background Art
[0002] Three-dimensional clipping is a key technology in the contemporary 3D graphics processing pipeline and an important part of improving the performance of graphics processors. On the one hand, different clipping bodies are used to reflect visual simulation, real-feeling experience, architectural blueprints, and computer-aided design effects. On the other hand, clipping technology is used to remove graphics outside the viewing volume, reducing the subsequent calculation amount of the 3D graphics processing pipeline.
[0003] Currently common 3D cutting includes cutting of 6 faces, among which:
[0004] 1) The patent document with announcement number: CN109064383A "A parallel hardware acceleration circuit for three-dimensional cropping in a general-purpose graphics processor" adopts a single data channel. At the same time, the three-dimensional cropping used belongs to a passive processing mode, which is prone to data overflow problems.
[0005] 2) Patent document with announcement number: CN109727184A "A three-dimensional clipping circuit for a graphics processor" introduces a three-dimensional clipping hardware acceleration circuit. The characteristics of the method adopted in this article are as follows: 1. The traditional six clipping planes are used for clipping; 2. The method of separately processing the primitive points, lines, triangles, and grating positions is used; 3. The homogenized coordinates are used for clipping;
[0006] However, the main disadvantage of using 6 faces for cropping is the large amount of calculation: especially for processing different primitives, it will increase the complexity of circuit design. At the same time, the above patent document uses homogenized coordinates for cropping. Although it is relatively simple to determine the positional relationship between the primitive and the cropping surface, when performing cropping interpolation, the coordinates before homogenization still need to be used because the coordinates after homogenization do not meet the basic conditions of the linear interpolation algorithm. Therefore, more information (coordinates before and after homogenization) needs to be saved, which increases the storage capacity.
[0007] 3) At the same time, the patent document with announcement number CN103593875A "Three-dimensional cutting in a graphics processing unit" applied by Shanghai Weta Digital Technology Co., Ltd. does not clearly explain how to achieve three-dimensional cutting.
[0008] However, according to the inference in its specification, the above-mentioned method of using three-dimensional cutting is implemented by means of a processor plus software: handheld devices and mobile devices need to use a central processing unit (CPU) and a digital signal processor (DSP) to complete the three-dimensional cutting function, which is essentially implemented by means of a processor plus software.
[0009] The main advantage of the processor plus software method is its flexibility, but compared with the hardware acceleration method, its significant disadvantage is that it requires more clocks to complete the 3D cropping function, which will affect the performance of the graphics processor.
[0010] In view of this, it is urgent to design and develop a dual-channel parallel floating-point hardware acceleration circuit method that saves configuration time in both horizontal and vertical directions. Summary of the invention
[0011] The purpose of the present invention is to provide a method for accelerating data processing using dual-channel parallel single-precision floating-point data format. By constructing data and configuring a dual-channel mode, the data channel processes data while the configuration channel caches the relevant configuration of the next batch of data to be processed. Once the data processed by the current configuration is processed, the configuration channel quickly replaces the current configuration data with the next batch of data configurations to be processed. The method of using single-precision floating-point 754 standard format data solves the problems in the prior art. To achieve the above purpose, the present invention provides the following technical solutions:
[0012] The acceleration method of data processing using dual-channel parallel single-precision floating-point data format comprises the following steps:
[0013] The first step is to build a configuration channel to cache the target data and reduce the system target task processing time;
[0014] The second step is to build a data channel. When the configuration channel caches the configuration of the next batch of data to be processed, the current target data is processed to form a parallel processing structure with the configuration channel to reduce the system target task processing time;
[0015] The third step is to preset the target data processing flow:
[0016] S3-1, after power-on, the system is set to the configuration state, the configuration channel receives the configuration data, and the data channel is closed;
[0017] If the configuration channel receives a completion signal for the current configuration data, the system starts the data channel and the system is in a data processing state;
[0018] If the system is in the data processing state, the configuration channel receives the next batch of configuration data and caches the received configuration data, and at the same time, the data channel processes the current batch of data;
[0019] S3-2, when the data channel receives the signal that the processing of the current batch of data is completed, the system is switched to the configuration state, and the configuration channel quickly reads the cached configuration data and updates the current configuration;
[0020] Step 4: If the configuration channel receives a signal that the current configuration data is completed, it returns to step S3-1 and loops sequentially until the data processing required by the system is completed.
[0021] As an improvement to the acceleration method of the dual-channel parallel single-precision floating-point data format for data processing of the present invention, in the first step, the configuration channel includes an input interface processing module, an output buffer module, a configuration buffer module, an output interface processing module and a state control module, wherein:
[0022] The input interface processing module is used to parse the system internal configuration bus protocol, and preliminarily decode the target data, and output the current configuration type, wherein the output configuration type includes the current level pipeline configuration, the lower level pipeline configuration and the broadcast configuration;
[0023] The output cache module is used to cache the lower-level pipeline configuration and broadcast configuration;
[0024] The configuration cache module is used to cache the configuration of the pipeline at this level;
[0025] The output interface processing module receives the status signal of the output buffer module and is used to package the lower-level configuration pipeline data into the system internal configuration bus protocol and send it;
[0026] The state control module receives the output buffer module state signal and is used to perform state switching management of the configuration channel and the data channel and send the configuration data of this level.
[0027] As an improvement to the acceleration method of the dual-channel parallel single-precision floating-point data format for data processing of the present invention, when the input interface processing module parses the system internal configuration bus protocol and decodes it as the current-level pipeline configuration, the input interface processing module writes this configuration into the configuration cache module;
[0028] When the input interface processing module parses the system internal configuration bus protocol and decodes it into the lower-level pipeline configuration, the input interface processing module writes this configuration into the output buffer module;
[0029] When the input interface processing module parses the system internal configuration bus protocol and decodes it as a broadcast configuration, the input interface processing module writes this configuration into the output buffer module and the configuration buffer module.
[0030] As an improvement to the acceleration method of the dual-channel parallel single-precision floating-point data format for data processing of the present invention, the output cache module caches the lower-level pipeline configuration and the broadcast configuration.
[0031] It is necessary to determine the maximum cache value of the cached lower-level pipeline configuration and broadcast configuration data:
[0032] When the lower-level pipeline configuration and broadcast configuration data cached by the output cache module exceeds the cache maximum value, the output cache module sends a data cache full status signal to the input interface processing module;
[0033] When the output buffer module performs lower-level pipeline configuration and broadcast configuration data caching, it sends a status signal to the output interface processing module to start the output interface processing module. At this time, the output buffer module processes one configuration data per clock cycle.
[0034] As an improvement to the acceleration method of the dual-channel parallel single-precision floating-point data format for data processing of the present invention, the state control module receives the output buffer module state signal,
[0035] If the output cache module status signal indicates that there is data in the configuration cache, the status control module starts to read the configuration data of this level and sends it to the data channel until the current batch of configuration data is finished reading; wherein,
[0036] When the state control module receives the current batch of configuration data, it switches the state signal to the data processing state; at this time, the state control module no longer reads the configuration from the configuration data until its state switches to the configuration state;
[0037] When the state control module receives the signal that the current batch of configuration data processing is completed sent by the data channel, the state control module switches the internal state to the configuration state and starts receiving the next batch of configuration data;
[0038] If the output buffer module status signal indicates that there is no data in the configuration buffer, the status control module continues to wait.
[0039] As an improvement to the acceleration method of the dual-channel parallel single-precision floating-point data format for data processing of the present invention, the dual-channel for data processing adopts the single-precision floating-point 754 data format to solve the overflow problem of the fixed-point data format during the calculation process and meet the user's rendering accuracy.
[0040] As an improvement to the acceleration method of the dual-channel parallel single-precision floating-point data format for data processing of the present invention, in the second step, the data channel includes a parsing module, a difference coefficient calculation module, a difference calculation module, a difference post-processing module and an assembly output module, wherein:
[0041] The parsing module is used to receive control information, original data of basic primitive lines and triangles, and configuration data and status information of configuration channels sent by the status control module;
[0042] The difference coefficient calculation module is used to calculate 12 groups of difference coefficients of the information received by the analysis module;
[0043] The difference calculation module is used to calculate the new points generated after the system is clipped according to the difference coefficient;
[0044] The difference post-processing module is used to complete the new point storage, identification and duplicate point removal;
[0045] The assembly output module is used to assemble the new points generated by cutting into new basic primitive lines or triangles according to the primitive types, and finally send the output according to the timing of the lower level of the pipeline.
[0046] Compared with the prior art, the present invention has the following beneficial effects:
[0047] Firstly, the present invention constructs a data and configuration dual-channel mode, so that while the data channel is processing data, the configuration channel caches the related configurations of the next batch of data to be processed in parallel. Once the data processed by the current configuration is processed, the configuration channel quickly replaces the current configuration data with the configuration of the next batch of data to be processed, so that the present invention increases the concurrency of configuration and data and saves configuration time in the vertical direction.
[0048] Secondly, the present invention establishes a dual cache structure of output cache and configuration cache, so that the configuration data of the lower-level pipeline can be sent to the lower-level pipeline in priority to the configuration of the current level, thereby solving the configuration problem that the current-level pipeline of a single channel is overloaded, and the current-level pipeline blocks the configuration of the lower-level pipeline when the load of the lower-level pipeline is light, so that the present invention increases the concurrency of configuration and data between the upper and lower levels of the pipeline, and saves configuration time in the horizontal direction;
[0049] Finally, the present invention solves the problem of overflow of the fixed-point data format during the calculation process when the user renders a scene with a large depth of field by adopting the data in the single-precision floating-point 754 standard format. BRIEF DESCRIPTION OF THE DRAWINGS
[0050] Figure 1 A schematic diagram of an acceleration process of a dual-channel parallel single-precision floating-point data format for data processing proposed in an embodiment of the present invention;
[0051] Figure 2 It is a schematic diagram of a data channel performing triangle clipping on three graphic elements proposed in an embodiment of the present invention. DETAILED DESCRIPTION
[0052] The technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.
[0053] In the description of the present invention, it is necessary to understand that the terms "upper", "lower", "front", "back", "left", "right", "top", "bottom", "inside", "outside", etc., indicating the orientation or position relationship are based on the orientation or position relationship shown in the drawings, and are only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as a limitation on the present invention.
[0054] The present invention will be described in further detail below in conjunction with the accompanying drawings, but this is not intended to limit the present invention.
[0055] As an understanding of the technical concept of the present invention: the acceleration method of the dual-channel parallel single-precision floating-point data format for data processing proposed by the present invention adopts a dual-channel structure in which the configuration and data are separated independently but interdependent. That is: the triangle is split into three lines in the manner of clipping of lines and two faces, and the clipping relationship between the three lines and the two faces is calculated in parallel, unifying the clipping circuits of triangles and lines. (Since in the OpenGL specification, each vertex has at least 2 attributes (coordinates and color) and at most 32, and each attribute has 4 parameters, the acceleration method of the dual-channel parallel single-precision floating-point data format for data processing of the present invention requires at least 52 clock cycles and at most 172 clock cycles in the clock cycle required to process a triangle or a line). For this reason,
[0056] like Figure 1 As an embodiment of the present invention, a method for accelerating data processing using a dual-channel parallel single-precision floating-point data format is proposed, comprising the following steps:
[0057] The first step is to build a configuration channel to cache the target data and reduce the system target task processing time;
[0058] It should be noted that the configuration channel includes an input interface processing module, an output buffer module, a configuration buffer module, an output interface processing module and a state control module, wherein:
[0059] The input interface processing module is used to parse the system internal configuration bus protocol, and preliminarily decode the target data, and output the current configuration type. The output configuration types include the current level pipeline configuration, the lower level pipeline configuration and the broadcast configuration: when the input interface processing module parses the system internal configuration bus protocol and decodes it as the current level pipeline configuration, the input interface processing module writes this configuration into the configuration cache module; when the input interface processing module parses the system internal configuration bus protocol and decodes it as the lower level pipeline configuration, the input interface processing module writes this configuration into the output cache module; when the input interface processing module parses the system internal configuration bus protocol and decodes it as the broadcast configuration, the input interface processing module writes this configuration into the output cache module and the configuration cache module, wherein, when the input interface processing module writes data into the output cache module and the configuration cache module, it first needs to determine whether the two caches can receive data. If they can, the configuration data is written into the corresponding cache, otherwise, the currently received configuration data is maintained, and the input interface of the configuration channel is blocked until the cache module can cache the current configuration data.
[0060] The output cache module is used to cache the lower-level pipeline configuration and broadcast configuration. It should be noted that since there are many configurations of the lower-level pipeline, when the output cache module caches the lower-level pipeline configuration and broadcast configuration, it is necessary to judge the maximum cache value of the cached lower-level pipeline configuration and broadcast configuration data (the output cache module can cache the configurations and broadcast configurations of 32 lower-level pipelines): when the lower-level pipeline configuration and broadcast configuration data cached by the output cache module exceeds the cache maximum value, the output cache module sends a status signal of the data cache being full to the input interface processing module: when the output cache module caches the lower-level pipeline configuration and broadcast configuration data, it sends a status signal to the output interface processing module to start the output interface processing module. At this time, the output cache module processes one configuration data per clock cycle.
[0061] The configuration cache module is used to cache the configuration of the current level pipeline; it should be noted that the configuration cache module mainly completes the cache of the configuration data of the current level pipeline. Since the configuration of the current level pipeline is relatively small, in order to increase the configuration parallelism of the upper and lower levels of the pipeline, the present invention adopts a three-cache structure, which can completely cache three batches of the configuration of the current level, so as to prevent the current level pipeline from blocking the configuration of the lower level pipeline as much as possible. Among them, it can be understood that there are two status signals inside the aforementioned three-cache structure, one status signal is used to indicate the cache point of the current receiving configuration, and the other status signal is used to indicate the cache point of the next batch of configurations. At the same time, these two status signals are sent to the input interface processing module and the status control module.
[0062] The output interface processing module receives the status signal of the output cache module, and is used to package the configuration data of the lower-level configuration pipeline into the system internal configuration bus protocol and send it. It can be understood that the output interface processing module mainly completes the packaging of the configuration data of the next-level pipeline into the internal configuration bus protocol. At the same time, it receives the status signal of the output cache module and determines whether there is data to be output. If so, the data is read from the output cache module, packaged into the internal configuration bus protocol, and output to the next level.
[0063] The state control module receives the state signal of the output cache module, and is used to perform the state switching management of the configuration channel and the data channel and the sending of the configuration data of this level: in specific implementation, if the state signal of the output cache module indicates that there is data in the configuration cache, the state control module starts to read the configuration data of this level and sends it to the data channel until the reading of the current batch of configuration data is completed; wherein, after the state control module receives the current batch of configuration data, it switches the state signal to the data processing state; at this time, the state control module no longer reads the configuration from the configuration data until its state is switched to the configuration state; when the state control module receives the current batch of configuration data processing completion signal sent by the data channel, at this time, the state control module switches the internal state to the configuration state and starts receiving the next batch of configuration data;
[0064] If the output buffer module status signal indicates that there is no data in the configuration buffer, the status control module continues to wait.
[0065] The second step is to build a data channel. When the configuration channel caches the configuration of the next batch of data to be processed, the current target data is processed to form a parallel processing structure with the configuration channel, reducing the system target task processing time;
[0066] It should be noted that the data channel proposed in the present invention includes a parsing module, a difference coefficient calculation module, a difference calculation module, a difference post-processing module and an assembly output module, wherein the parsing module is used to receive the control information sent by the state control module, the original data of the basic primitive line and the triangle, and the configuration data and state information of the configuration channel; the difference coefficient calculation module calculates 12 groups of difference coefficients based on the primitive coordinate data received by the parsing module; the difference calculation module is used to calculate the new points generated after the system is clipped based on the difference coefficients and the original primitive coordinates; the difference post-processing module is used to complete the new point storage, identification and duplicate point removal; the assembly output module is used to assemble the new points generated by clipping into new basic primitive lines or triangles according to the primitive type, and finally send the output according to the timing of the downstream of the pipeline.
[0067] Based on the technical concept of the second step, in the specific implementation, the parsing module is responsible for receiving the control information, basic primitive lines, triangle raw data and configuration and status information of the configuration channel sent by the previous stage of the pipeline, and receives a parameter or a configuration information of an attribute of a triangle or a line per clock. When the system power-on reset is released, the acceleration circuit of the data processing dual-channel parallel single-precision floating-point data format is in the configuration state. At this time, the parsing module closes the data channel, prohibits receiving the control information and primitive data sent by the previous stage, and starts to receive the configuration information sent by the configuration channel:
[0068] Once it is detected that the internal state signal sent by the state control module is in the data processing state, it is prohibited to receive configuration data, open the data channel, receive the control information and image metadata sent by the previous level, and start data processing. The specific processing flow is:
[0069] The control information received by the parsing module through the data channel is first cached locally and transparently transmitted to the next level through the bypass channel. It should be noted that the control information received by the above 3D clipping includes two situations:
[0070] The first is the primitive information, including the primitive type, number of attributes and primitive data currently being processed. The parsing module directly saves this configuration information.
[0071] The second is that the current batch of data processing is completed, and the parsing module sends the information to the state control module for switching the working state.
[0072] When in the first state, that is, when the primitive data is received, the primitive is first judged. The primitives received by the three-dimensional clipping can be divided into three situations: the first is that the primitive is outside the viewing body, then it is directly received and discarded without any processing. The second is that the primitive is inside the viewing body, then it is directly transmitted to the next level through the bypass channel. The last is that the primitive intersects with the viewing body, then three-dimensional clipping is required for clipping. When the primitive intersects with the viewing body, the clipping first receives the Z value and W value of the triangle or line, starts the difference coefficient calculation, and suspends receiving other attributes. After waiting for the difference between the Z value and the W value to end, start receiving other attributes.
[0073] After the difference coefficient calculation module receives the start signal sent by the GL command parsing module, it starts to calculate the difference coefficient. It should be noted that the difference coefficient contains 12 groups, each group has two values cnst and neg_cnst. The difference coefficient is calculated mainly using the formula cnst = (a ± b) / ((cd) ± (ef)), neg_cnst = 0x3f80_0000-cnst, where a / b / c / d / e / f are the results of the Z value and W value of three vertices (the line is two vertices) calculated by addition and subtraction operations. The difference coefficient is calculated in a time-division multiplexing manner, with a single beat pipeline, and 12 groups of coefficients require 27 clocks. After the difference coefficient calculation is completed, the intersection calculation begins.
[0074] When the difference calculation module receives the difference coefficient, it starts the difference calculation: the difference calculation uses 3 pipelines with the same structure to calculate the intersection of an edge and two faces. The pipeline for calculating the intersection of an edge and two faces first calculates the spatial position relationship between the two vertices of the input edge and the two faces, and calculates the intersection of the input edge and the two faces respectively. The difference formula nw_vt = (op_d0*cnst) + (op_d1*neg_cnst), where nw_vt is the difference of the intersection, op_d0 and op_d1 are the attribute values of the two vertices of the input edge, and cnst and neg_cnst are a set of difference coefficients. After calculating the intersection, the output clipped edge is selected based on the position relationship between the input edge and the two faces. The intersection pipeline of an edge and two faces first calculates the Z value and W value of the clipped output edge. After the calculation is completed, the parsing module is notified to receive other attributes. The difference of other attributes is calculated while receiving, which can be single-beat pipeline.
[0075] The difference post-processing module mainly completes the caching, identification calculation and new point sorting of the output edges after clipping. The relevant information of the output edges after clipping is stored in the cache. The cache can store the attribute values of 6 vertices of 3 edges at most, waiting to be read out by the assembly output module. Since the three edges of the triangle will generate duplicate points when performing difference calculation, the identification calculation module mainly compares all the attribute values of the adjacent points of the 6 vertices of the 3 edges, calculates which vertices are duplicate points, and then sets the identification of the duplicate points to invalid points and outputs new identifications. The identification calculation process and the vertex caching of the output edges after clipping are carried out simultaneously. The new point sorting module mainly sorts the identifications marked as valid according to the new identifications output by the identification calculation module, puts the valid points together in order, and records the actual positions of the valid points and the number of valid points cnt. The clipping process of the line is similar to that of the triangle, except that the other two pipelines for calculating the intersection of an edge and two faces are disabled.
[0076] The assembly output module mainly completes the functions of transmitting the control information required by the 3D clipping lower level of the 3D graphics processing pipeline, transmitting the basic graphics elements in the visual scene, and assembling and outputting the basic graphics elements after clipping at this level. According to the number of valid points cnt output by the new point sorting module, there are 6 situations for the output after triangle clipping: cnt = 1, only one point p0 is left after the triangle is clipped, and the three points of the output triangle have the same attributes and are all p0; cnt = 2, only one line is left after the triangle is clipped, and the three points of the output triangle are p0_p1_p1; cnt = 1, only one line is left after the triangle is clipped, and the three points of the output triangle are p0_p1_p1; cnt = 2, only one line is left after the triangle is clipped, and the three points of the output triangle are p0_p1_p1; cnt = 3, only one line is left after the triangle is clipped, and the three points of the output triangle are p0_p1_p1; cnt = 4, only one line is left after the triangle is clipped, and the three points of the output triangle are p0_p1_p1; cnt = 5, only one line is left after the triangle is clipped, and the three points of the output triangle are p0_p1_p1; cnt = 6, only one line is left after the triangle is clipped, and the three points of the output triangle are p0_p1_p1; cnt = 7, only one line is left after the triangle is clipped, and the three points of the output triangle are p0_p1_p1; cnt = 8, only one line is left after the triangle is clipped, and the three points of the output triangle are p0_p1_p1; cnt = 9, only one line is left after the triangle is clipped, and the three points of the output triangle are p0_p1_p1; cnt = 1, only one line is t=3, the triangle is a complete triangle after clipping, and the three points of the output triangle are p0_p1_p2; cnt=4, the triangle needs to be assembled into two triangles after clipping, and the two output triangles are p0_p1_p2 and p0_p2_p3; cnt=5, the triangle needs to be assembled into three triangles after clipping, and the three output triangles are p0_p1_p2, p0_p2_p3 and p0_p3_p4, and no output is given in other cases. It can be understood that p0-p4 here are all points sorted by the new point sorting module.
[0077] The third step is to preset the target data processing flow and set the switching method of the above data channels and configuration channels:
[0078] S3-1, after power-on, the system is set to be in the configuration state, the configuration channel receives the configuration data, and the data channel is closed; wherein, if the configuration channel receives the completion signal of the current configuration data, the system starts the data channel, and the system is in the data processing state; if the system is in the data processing state, the configuration channel receives the next batch of configuration data, and caches the received configuration data, and at the same time, the data channel processes the current batch of data;
[0079] S3-2, when the data channel receives the signal that the processing of the current batch of data is completed, the system is switched to the configuration state, and the configuration channel quickly reads the cached configuration data and updates the current configuration.
[0080] It can be understood that by constructing a dual-channel mode of data and configuration, on the one hand, while the data channel is processing data, the configuration channel also caches the relevant configurations of the next batch of data that need to be processed, and once the processing of the currently processed data is completed, the configuration channel quickly replaces the current configuration data with the configuration of the next batch of data that need to be processed, so that the present invention increases the concurrency of configuration and data, and saves configuration time in the vertical direction. On the other hand, by establishing a dual-cache structure of output cache and configuration cache, the configuration data of the lower-level pipeline can be sent to the lower-level pipeline with priority over the current-level configuration, solving the configuration problem that the current-level pipeline of a single channel is overloaded, and the current-level pipeline blocks the lower-level pipeline when the load of the lower-level pipeline is light, so that the present invention increases the concurrency of configuration and data between the upper and lower levels of the pipeline, and saves configuration time in the horizontal direction.
[0081] In the fourth step, if the configuration channel receives a signal that the current configuration data is completed, it returns to step S3-1 and loops sequentially until the data processing required by the system is completed.
[0082] like Figure 2 As shown, in one embodiment of the present invention, the entire clipping process is explained by taking triangle clipping as an example: Figure 2 As shown, there are three metadata data0-3 in the data channel, among which data_end indicates the end of a batch of data, and there are four configuration data cfg0-3 in the configuration channel, among which cfg_end indicates the end of a batch of configurations, cfg0 is the configuration of the next level, cfg1 is the configuration when data0-1 is cropped, cfg2 is the broadcast configuration of data0-1, and cfg3 is the configuration when data2 is cropped.
[0083] In specific implementation, after power-on reset, the system is in a configuration state, and the input interface processing module of the configuration channel starts to read the configuration data cfg0;
[0084] After parsing, if it is found that the configuration is the configuration of the next level, it will be cached to the output cache module, and finally sent to the lower-level pipeline by the output interface processing module:
[0085] After the input interface processing module processes cfg0, it receives cfg1 again. After parsing, it finds that the configuration is the configuration of this level, and then caches it in the configuration cache;
[0086] cfg2 is received again and parsed. If it is a broadcast configuration, the configuration data is written to the configuration cache module and the output cache module at the same time. The output interface processing module sends it to the lower-level pipeline:
[0087] Receiving cfg_end again indicates the end of a batch of configurations.
[0088] At this point, the state control module switches to the data processing state:
[0089] The parsing module of the data processing channel starts to receive the image metadata data0 from the data channel and starts the cropping process;
[0090] After the processing is completed, the metadata data1 is received again, and the cycle continues until data_end is received, and the signal is sent to the state control module;
[0091] The state control module switches to the configuration state and starts to read the next batch of configurations cfg3. It can be understood that the processing method of the above cfg3 is the same as cfg0-2, until cfg_end is received, and then switches to the data processing state again. The data channel starts to receive the data data2 of the configuration channel again. The processing method of data2 is the same as that of data0-1, until the data channel reads data_end.
[0092] However, cfg_end and data_end appear in pairs. After the system is powered on and reset, and after a frame is rendered, the system is always in the configuration state.
[0093] Based on the above technical concept, it can be understood that the method proposed in the present invention adopts a configuration and data dual-channel mode, which improves the parallelism of configuration and data processing, and adopts a single-precision floating-point 754 data format to solve the numerical overflow problem of the fixed-point data format. In the specific implementation, only two faces in the Z-axis direction are cropped, the triangle is cropped in parallel according to the three edges, and the line is regarded as one edge of the triangle for cropping, thereby reducing the cropping calculation amount and design complexity.
[0094] The basic principles and main features of the present invention and the advantages of the present invention are shown and described above. For those skilled in the art, it is obvious that the present invention is not limited to the details of the above exemplary embodiments, and the present invention can be implemented in other specific forms without departing from the spirit or basic features of the present invention; therefore, no matter from which point of view, the embodiments should be regarded as exemplary and non-restrictive. The scope of the present invention is limited by the attached claims rather than the above description. Therefore, it is intended to include all changes within the meaning and scope of the equivalent elements of the claims in the present invention, and any figure marks in the claims should not be regarded as limiting the claims involved.
[0095] In addition, it should be understood that although the present specification is described according to implementation modes, not every implementation mode contains only one independent technical solution. This description of the specification is only for the sake of clarity. Those skilled in the art should regard the specification as a whole. The technical solutions in each embodiment may also be appropriately combined to form other implementation modes that can be understood by those skilled in the art.
Claims
1. A method for accelerating data processing using dual-channel parallel single-precision floating-point data format, characterized in that: The following steps are involved: The first step is to build a configuration channel to cache the target data and reduce the system target task processing time; The second step is to build a data channel. When the configuration channel caches the configuration of the next batch of data to be processed, the current target data is processed to form a parallel processing structure with the configuration channel to reduce the system target task processing time; The third step is to preset the target data processing flow: S3-1, after power-on, the system is set to the configuration state, the configuration channel receives the configuration data, and the data channel is closed; If the configuration channel receives a completion signal for the current configuration data, the system starts the data channel and the system is in a data processing state; If the system is in the data processing state, the configuration channel receives the next batch of configuration data and caches the received configuration data, and at the same time, the data channel processes the current batch of data; S3-2, when the data channel receives the signal indicating that the processing of the current batch of data is completed, the system is switched to the configuration state, and the configuration channel quickly reads the cached configuration data and updates the current configuration; Step 4: If the configuration channel receives a signal that the current configuration data is completed, it returns to step S3-1 and loops sequentially until the data processing required by the system is completed.
2. The acceleration method for dual-channel parallel single-precision floating-point data format for data processing according to claim 1, characterized in that: In the first step, the configuration channel includes an input interface processing module, an output buffer module, a configuration buffer module, an output interface processing module and a state control module, wherein: The input interface processing module is used to parse the system internal configuration bus protocol, and preliminarily decode the target data, and output the current configuration type, the output configuration type includes the current level pipeline configuration, the lower level pipeline configuration and the broadcast configuration; The output cache module is used to cache the lower-level pipeline configuration and broadcast configuration; The configuration cache module is used to cache the configuration of the pipeline at this level; The output interface processing module receives the status signal of the output buffer module and is used to package the lower-level configuration pipeline data into the system internal configuration bus protocol and send it; The state control module receives the output buffer module state signal and is used to perform state switching management of the configuration channel and the data channel and send the configuration data of this level.
3. The acceleration method for dual-channel parallel single-precision floating-point data format for data processing according to claim 2, characterized in that: When the input interface processing module parses the system internal configuration bus protocol and decodes it as the current-level pipeline configuration, the input interface processing module writes this configuration into the configuration cache module; When the input interface processing module parses the system internal configuration bus protocol and decodes it into the lower-level pipeline configuration, the input interface processing module writes this configuration into the output buffer module; When the input interface processing module parses the system internal configuration bus protocol and decodes it as a broadcast configuration, the input interface processing module writes this configuration into the output buffer module and the configuration buffer module.
4. The acceleration method for dual-channel parallel single-precision floating-point data format for data processing according to claim 2, characterized in that: When the output cache module caches the lower-level pipeline configuration and the broadcast configuration, It is necessary to determine the maximum cache value of the cached lower-level pipeline configuration and broadcast configuration data: When the lower-level pipeline configuration and broadcast configuration data cached by the output cache module exceeds the cache maximum value, the output cache module sends a data cache full status signal to the input interface processing module; When the output buffer module performs lower-level pipeline configuration and broadcast configuration data caching, it sends a status signal to the output interface processing module to start the output interface processing module. At this time, the output buffer module processes one configuration data per clock cycle.
5. The acceleration method for dual-channel parallel single-precision floating-point data format for data processing according to claim 2, characterized in that: The state control module receives the state signal of the output buffer module, If the output cache module status signal indicates that the configuration cache has data, the status control module starts to read the configuration data of this level and sends it to the data channel until the current batch of configuration data is finished reading; wherein, When the state control module receives the current batch of configuration data, it switches the state signal to the data processing state; at this time, the state control module no longer reads the configuration from the configuration data until its state switches to the configuration state; When the state control module receives the signal that the current batch of configuration data processing is completed sent by the data channel, the state control module switches the internal state to the configuration state and starts receiving the next batch of configuration data; If the output buffer module status signal indicates that there is no data in the configuration buffer, the status control module continues to wait.
6. The acceleration method for dual-channel parallel single-precision floating-point data format for data processing according to claim 1, characterized in that: The data processing uses dual channels with single-precision floating point 754 data format to meet the user's rendering accuracy.
7. The acceleration method for dual-channel parallel single-precision floating-point data format for data processing according to claim 1, characterized in that: In the second step, the data channel includes an analysis module, a difference coefficient calculation module, a difference calculation module, a difference post-processing module and an assembly output module, wherein: The parsing module is used to receive control information, original data of basic primitive lines and triangles, and configuration data and status information of configuration channels sent by the status control module; The difference coefficient calculation module is used to calculate 12 groups of difference coefficients of the information received by the analysis module; The difference calculation module is used to calculate the new points generated after the system is clipped according to the difference coefficient; The difference post-processing module is used to complete the new point storage, identification and duplicate point removal; The assembly output module is used to assemble the new points generated by cutting into new basic primitive lines or triangles according to the primitive types, and finally send the output according to the timing of the lower level of the pipeline.
