DMA controller and data transfer method for broadcast

Through the design of the DMA controller, the data is cached and copied into multiple copies frame by frame using a read access and data copy module, which solves the problem of low efficiency of DMA transmission and broadcast data handling and realizes efficient data parallel computing.

CN118170702BActive Publication Date: 2024-08-30北京壁仞科技开发有限公司 +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410587882.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-05-13
Publication Date
2024-08-30
Estimated Expiration
2044-05-13

AI Technical Summary

Technical Problem

Existing DMA transmission has low broadcast data handling efficiency in data parallel computing scenarios and requires multiple read accesses, resulting in low efficiency.

Method used

A DMA controller is designed, including a read trigger module, a data read cache and a data copy module. It caches data frame by frame through a read access, copies each frame of data into multiple copies, and writes the copies to multiple targets one by one. node, using address mapping compensation and circular row shifting of traversal pointers to implement broadcast copies of data to be written to multiple target nodes.

Benefits of technology

It reduces the number of read accesses, improves the data handling broadcast efficiency of DMA transmission, reduces the burden on the CPU, and improves the performance of data parallel computing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118170702B
    Figure CN118170702B
Patent Text Reader

Abstract

The present application relates to a DMA controller and a data transport method for broadcasting. Based on the present application, the DMA controller can perform only one read access to the broadcast data, wherein, in the sequential reading process of the data to be broadcast triggered by one read access, the DMA controller can cache the data to be broadcast frame by frame, and by copying each cached frame of the data to be broadcast into the same number of broadcast copies as the number of transport target nodes, each frame of the broadcast copies can be written to at least two transport target nodes one by one, so that the data transport based on DMA transmission can realize the broadcast in response to one read access. Compared with the traditional method in which the number of read accesses is the same as the number of transport target nodes, the present application can improve the broadcast efficiency of data transport based on DMA transmission by reducing read accesses.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a DMA (Direct Memory Access) controller, a data transport method for broadcasting, and a processor. Background Art

[0002] DMA is a data transmission method. DMA transmission can realize the data transmission between the source node and the target node without the participation of the CPU, and DMA transmission can be driven by a DMA controller.

[0003] In scenarios where data parallel computing is required, the same data needs to be transferred from one source node to at least two transfer target nodes through DMA transmission, that is, to implement broadcast transmission so that the same data can be parallelly calculated at at least two transfer target nodes. Since DMA transmission is a serial transmission, the DMA controller completes the data transfer to each transfer target node one by one by polling all transfer target nodes, and the DMA control performs read access to the source node and write operation to the currently polled transfer target node for the transfer process of each transfer target node. Therefore, the data transfer process for broadcasting will include multiple read accesses to the same data (i.e., the same number of transfer target nodes), and thus the broadcast efficiency of data transfer based on DMA transmission is not high.

[0004] It can be seen that how to improve the broadcast efficiency of data handling based on DMA transmission has become a technical problem to be solved in the prior art. Summary of the invention

[0005] Embodiments of the present application provide a DMA controller, a data transfer method for broadcasting, and a processor, which are helpful to improve the broadcasting efficiency of data transfer based on DMA transmission.

[0006] In one embodiment of the present application, a DMA controller is provided, comprising:

[0007] A read trigger module, used to initiate a read access to the data to be broadcast according to the source address of the data to be broadcast at the transport source node; wherein the read access is used to trigger the sequential reading of the data to be broadcast;

[0008] A data read cache, used for caching the to-be-broadcasted data read sequentially frame by frame; wherein each frame of the to-be-broadcasted data is less than or equal to the cache capacity of the data read cache;

[0009] A data replication module, used to replicate each cached frame of the data to be broadcast into a number of broadcast copies; wherein the number of target nodes for transporting the data to be broadcast is at least two, and the number of broadcast copies of each frame of the data to be broadcast is the same as the number of target nodes for transporting;

[0010] The broadcast transfer cache is used to store each frame of the broadcast copies in association with the broadcast addresses of the to-be-broadcasted data at at least two of the transfer target nodes, so that each frame of the broadcast copies is written to at least two of the transfer target nodes one by one.

[0011] In some examples, optionally, the data read cache is specifically configured to: in response to completion of copying of each frame of the data to be broadcast, receive and cache the next frame of the data to be broadcast, so as to implement frame-by-frame caching of the data to be broadcast.

[0012] In some examples, optionally, each frame of the data to be broadcast is stored in the data read cache at a row granularity; the data replication module is specifically configured to: loop through traversal accesses to the occupied rows of each frame of the data to be broadcast in the data read cache to copy each frame of the data to be broadcast into the number of broadcast copies; wherein the number of loops of the traversal accesses for each frame of the data to be broadcast is the same as the number of broadcast copies.

[0013] In some examples, optionally, the data replication module is specifically configured to: utilize the circular row shift of the traversal pointer of the data read cache to cyclically perform the traversal access to each frame of the data to be broadcast; wherein, the single shift range of the circular row shift of the traversal pointer is the occupied row of the current frame of the data to be broadcast in the data read cache, and the target number of cycles of the circular row shift of the traversal pointer is the number of broadcast copies.

[0014] In some examples, optionally, the traversal pointer uses the row currently pointed to by the read pointer of the data read cache as the traversal start row for each traversal, and uses the row previous to the row currently pointed to by the write pointer of the data read cache as the traversal end row for each traversal; wherein the read pointer remains stationary before the circular row shift of the traversal pointer completes the target number of cycles, and the read pointer and the traversal pointer jump to the row currently pointed to by the write pointer when the circular row shift of the traversal pointer completes the target number of cycles, to wait for the reception and caching of the next frame of the data to be broadcast to be completed through the row-by-row shift of the write pointer.

[0015] In some examples, optionally, each frame of the data to be broadcast is determined by dividing the address mapping result of the data to be broadcast; wherein the address mapping result includes a compensation space for compensating for the address offset between the source address and the broadcast address, so as to characterize the alignment state of the data to be broadcast and the broadcast address by introducing the compensation space; and the address mapping result is divided based on the cache capacity as the granularity, so that each frame of the data to be broadcast is less than or equal to the cache capacity of the data read cache; the data replication module is also used to: perform address mapping compensation on each replicated frame using the address offset, so that each frame of the broadcast copy is cached in the broadcast transport cache in the alignment state.

[0016] In some examples, optionally, each frame of the data to be broadcast is stored in the data read cache at a row granularity; the data copy module is specifically configured to: cyclically perform a traversal access to the occupied rows of each frame of the data to be broadcast in the data read cache, so as to copy each frame of the data to be broadcast into the number of broadcast copies; wherein the number of cycles of the traversal access for each frame of the data to be broadcast is the same as the number of broadcast copies, and the single-row acquisition range of the traversal access for each frame of the data to be broadcast is determined based on the address offset.

[0017] In some examples, optionally, the data replication module is specifically configured to: in the process of traversal access to each frame of the data to be broadcast, use the current traversal row and adjacent rows of the current traversal row as redundant candidate rows, and use the single-row acquisition range to obtain a single row of data from the redundant candidate rows; wherein each of the broadcast copies of each frame includes each single row of data acquired through one traversal access.

[0018] In some examples, optionally, the data replication module includes a register sequence, the register sequence includes a first register group, a second register group, and a third register group connected in series in sequence, the second register group is used to cache the current traversal row, the first register group is used to cache the previous adjacent row of the current traversal row, the third register group is used to cache the next adjacent row of the current traversal row, and the register sequence is triggered to perform a data shift in response to the completion of the acquisition of a single row of data for the current traversal row; wherein the data shift includes the previous adjacent row in the first register group being shifted out, the current traversal row in the second register group being shifted into the first register group to replace the previous adjacent row, and the next adjacent row in the third register group being shifted into the second register group to replace the current traversal row; the data replication module also includes a temporary cache group, the temporary cache group includes a first temporary cache, a second temporary cache, and a third temporary cache, the first temporary cache The storage is used to cache the previous adjacent row in the first register group, the second temporary cache is used to cache the currently traversed row in the second register group, and the third temporary cache is used to cache the next adjacent row in the third register group. The current cache rows in the first temporary cache, the second temporary cache and the third temporary cache are successively formed as the redundant candidate row cached in the temporary cache group, and the redundant candidate row cached in the temporary cache group is triggered to perform a data refresh in response to the completion of the data shift of the register sequence; the data copy module also includes a selector, the input bus of the selector has a multi-row specification covering the first temporary cache, the second temporary cache and the third temporary cache, the output bus of the selector has a single-row specification, and the selection range of the output bus and the input bus is used to characterize the single-row acquisition range, so as to obtain a single-row data from the redundant candidate row through the selection of the output bus and the input bus.

[0019] In some examples, optionally, it also includes: an instruction decoding module, used to determine the source address, the broadcast address, and the number of the transfer target nodes by decoding the received data transfer instructions; a transfer scheduling module, used to control the frame-by-frame caching of the data read cache, control the replication of each frame by the data replication module, and control the associated storage of each frame of the broadcast copy and the broadcast address.

[0020] In another embodiment of the present application, a data transport method for broadcast is provided, which is applied to a DMA controller and includes:

[0021] Initiate a read access to the data to be broadcast according to the source address of the data to be broadcast at the transport source node; wherein the read access is used to trigger the sequential reading of the data to be broadcast, and the sequentially read data to be broadcast is cached frame by frame in the data reading cache, and each frame of the data to be broadcast is less than or equal to the cache capacity of the data reading cache;

[0022] Each cached frame of the data to be broadcast is copied into a broadcast copy number; wherein the number of the transport target nodes of the data to be broadcast is at least two, the broadcast copy number of each frame of the data to be broadcast is the same as the number of the transport target nodes, and each frame of the broadcast copy number is stored in the broadcast transport cache in association with the broadcast address of the data to be broadcast in at least two of the transport target nodes, so that each frame of the broadcast copy number is written to at least two of the transport target nodes one by one.

[0023] In some examples, optionally, the data read cache is specifically configured to: in response to completion of copying of each frame of the data to be broadcast in the data read cache, receive and cache the next frame of the data to be broadcast, so as to implement frame-by-frame caching of the data to be broadcast.

[0024] In some examples, optionally, each frame of the data to be broadcast is stored in the data read cache at a row granularity; copying each cached frame of the data to be broadcast into the number of broadcast copies includes: loopingly performing a traversal access to the occupied rows of each frame of the data to be broadcast in the data read cache to copy each frame of the data to be broadcast into the number of broadcast copies; wherein the number of loops of the traversal access for each frame of the data to be broadcast is the same as the number of broadcast copies.

[0025] In some examples, optionally, the loop performs a traversal access to the occupied rows of each frame of the data to be broadcast in the data read cache, including: utilizing a circular row shift of a traversal pointer of the data read cache to circularly perform the traversal access to each frame of the data to be broadcast; wherein a single shift range of the circular row shift of the traversal pointer is an occupied row of a current frame of the data to be broadcast in the data read cache, and a target number of cycles of the circular row shift of the traversal pointer is the number of broadcast copies.

[0026] In some examples, optionally, the traversal pointer uses the row currently pointed to by the read pointer of the data read cache as the traversal start row for each traversal, and uses the row previous to the row currently pointed to by the write pointer of the data read cache as the traversal end row for each traversal; wherein the read pointer remains stationary before the circular row shift of the traversal pointer completes the target number of cycles, and the read pointer and the traversal pointer jump to the row currently pointed to by the write pointer when the circular row shift of the traversal pointer completes the target number of cycles, to wait for the reception and caching of the next frame of the data to be broadcast to be completed through the row-by-row shift of the write pointer.

[0027] In some examples, optionally, each frame of the data to be broadcast is determined by dividing the address mapping result of the data to be broadcast; wherein the address mapping result includes a compensation space for compensating for the address offset between the source address and the broadcast address, so as to characterize the alignment state of the data to be broadcast and the broadcast address by introducing the compensation space; and the address mapping result is divided based on the cache capacity as the granularity, so that each frame of the data to be broadcast is less than or equal to the cache capacity of the data read cache; the copying of each cached frame of the data to be broadcast into broadcast copies also includes: performing address mapping compensation on each copied frame using the address offset, so that each frame of the broadcast copies is cached in the broadcast transport cache in the alignment state.

[0028] In some examples, optionally, each frame of the data to be broadcast is stored in the data read cache at a row granularity; the address mapping compensation for each copied frame using the address offset includes: using a single-row acquisition range determined based on the address offset, cyclically executing a traversal access to the occupied rows in the data read cache for each frame of the data to be broadcast, so as to copy each frame of the data to be broadcast into the number of broadcast copies; wherein the number of cycles of the traversal access for each frame of the data to be broadcast is the same as the number of broadcast copies.

[0029] In some examples, optionally, the single-row acquisition range determined according to the address offset is used to cyclically perform a traversal access to the occupied rows in the data read cache for each frame of the data to be broadcast, including: in the process of the traversal access to each frame of the data to be broadcast, the current traversal row and the adjacent rows of the current traversal row are used as redundant candidate rows, and the single-row acquisition range is used to acquire a single row of data from the redundant candidate rows; wherein each of the broadcast copies of each frame includes each single row of data acquired through one traversal access.

[0030] In some examples, optionally, the method further includes: determining the source address, the broadcast address, and the number of the transfer target nodes by decoding the received data transfer instruction.

[0031] In another embodiment of the present application, a processor is provided, in which the DMA controller as described in the above embodiment is integrated.

[0032] Based on the above-mentioned embodiments, the DMA controller can perform only one read access on the data to be broadcast, wherein, in the sequential reading process of the data to be broadcast triggered by one read access, the DMA controller can cache the data to be broadcast frame by frame, and by copying each cached frame of the data to be broadcast into the same number of broadcast copies as the number of transport target nodes, each frame of the broadcast copies can be written to at least two transport target nodes one by one, so that the data transport based on DMA transmission can achieve broadcast in response to one read access. Compared with the traditional method in which the number of read accesses is the same as the number of transport target nodes, the embodiments of the present application can improve the broadcast efficiency of data transport based on DMA transmission by reducing read accesses. BRIEF DESCRIPTION OF THE DRAWINGS

[0033] The following drawings are only used to illustrate and explain the present application, and do not limit the scope of the present application:

[0034] Figure 1 Schematic diagram of the data transfer principle of the DMA controller in the embodiment of the present application;

[0035] Figure 2 This is a schematic diagram of an example of implementing frame-by-frame caching and copying by DMA in an embodiment of the present application;

[0036] Figure 3 It is a schematic diagram of the data transfer effect of the DMA controller in the embodiment of the present application;

[0037] Figure 4 An exemplary schematic diagram of frame division of a DMA controller in an embodiment of the present application;

[0038] Figure 5 is an exemplary schematic diagram of offset compensation of a DMA controller in an embodiment of the present application;

[0039] Figure 6 It is a schematic diagram of an example of an implementation structure of the offset compensation of the DMA controller in the embodiment of the present application;

[0040] Figure 7 The figure is a schematic diagram of an exemplary flow chart of a data handling method for broadcasting in an embodiment of the present application. DETAILED DESCRIPTION

[0041] In order to make the objectives, technical solutions and advantages of the present application more clearly understood, the present application is further described in detail below with reference to the accompanying drawings and examples.

[0042] Figure 1 Schematic diagram of the data transfer principle of the DMA controller in the embodiment of the present application. Figure 1 In an embodiment of the present application, the DMA controller may include a read trigger module 120 , a data read cache 150 , a data copy module 160 , and a broadcast transfer cache 170 .

[0043] In an embodiment of the present application, the read trigger module 120 can be used to initiate a read access to the to-be-broadcast data Data_dma according to the source address Addr_src of the to-be-broadcast data Data_dma at the transport source node Region_src. The read access initiated by the read trigger module 120 to the to-be-broadcast data Data_dma can trigger the sequential reading of the to-be-broadcast data Data_dma, and the number K of the transport target nodes Region_dst_1~Region_dst_K of the to-be-broadcast data Data_dma is at least two, and K is a positive integer greater than or equal to 2.

[0044] Exemplarily, in an embodiment of the present application, the read access initiated by the read trigger module 120 to the broadcast data Data_dma may be initiated in response to a data handling instruction. In this case, the DMA controller may further include an instruction decoding module 110, wherein the instruction decoding module 110 may be used to determine the source address Addr_src of the data to be broadcast Data_dma at the handling source node Region_src, the broadcast address Addr_brc of the data to be broadcast Data_dma at the handling target node Region_dst_1~Region_dst_K, and the number K of the handling target nodes Region_dst_1~Region_dst_K of the data to be broadcast Data_dma by decoding the received data handling instruction, and the read trigger module 120 may also be used to receive the source address Addr_src of the data to be broadcast Data_dma at the handling source node Region_src generated by decoding the instruction decoding module 110.

[0045] For example, in an embodiment of the present application, the transport source node Region_src and at least two transport target nodes Region_dst_1~Region_dst_K may include memory, the source address Addr_src of the data to be broadcast Data_dma in the transport source node Region_src may represent the storage address of the data to be broadcast Data_dma in the address space of the memory of the transport source node Region_src, and the broadcast address Addr_brc of the data to be broadcast Data_dma in the transport target nodes Region_dst_1~Region_dst_K may represent the storage address of the data to be broadcast Data_dma in the address space of the memory of the transport source node Region_src. The storage address in the address space of the memory of st_1~Region_dst_K, and the decoding process of the instruction decoding module 110 decoding the received data transfer instruction is used to convert the address description information of the source address Addr_src and the broadcast address Addr_brc in the instruction into a register value that is convenient for recording through a register, so that the instruction decoding module 110 can record the decoding results of the source address Addr_src and the broadcast address Addr_brc in the source address register group and the broadcast address register group respectively, and the read trigger module 120 can receive the source address Addr_src through the source address register group, and the broadcast address Addr_brc can be obtained by other modules through the broadcast address register group. In addition, the number K of the transfer target nodes Region_dst_1~Region_dst_K in the data transfer instruction can also be decoded by the instruction decoding module 110 into the form of a register value and stored in the target number register group.

[0046] In an embodiment of the present application, the data read cache 150 can be used to cache the data to be broadcast Data_dma read sequentially frame by frame, wherein each frame frame_i of the data to be broadcast Data_dma is less than or equal to the cache capacity of the data read cache 150, i is a positive integer less than or equal to M, M represents the number of frames of the data to be broadcast Data_dma, and M is a positive integer greater than or equal to 1.

[0047] Exemplarily, in an embodiment of the present application, the cache capacity of the data read cache 150 can be expressed as N×W, where N represents the total number of rows of the data read cache 150, and W represents the row width of the data read cache 150 (i.e., the total number of columns in bits). In this case, each frame frame_i of the data to be broadcast Data_dma is stored in the data read cache 150 in a row granularity, that is, the data read cache 150 can receive the data to be broadcast Data_dma read sequentially in row units, that is, the data to be broadcast Data_dma can be read sequentially in a granularity of the row width W of the data read cache 150. For example, N can be 16, and W can be 1024 bits. In this case, the cache capacity of the data read cache 150 can be 2048 bytes.

[0048] In an embodiment of the present application, the data replication module 160 can be used to copy each cached frame frame_i of the data Data_dma to be broadcast into a number of broadcast copies, wherein, as described above, the number K of the target nodes Region_dst_1~Region_dst_K for transporting the data Data_dma to be broadcast is at least two, that is, K is a positive integer greater than or equal to 2, and the number of broadcast copies of each frame frame_i of the data Data_dma to be broadcast is the same as the number of the target nodes Region_dst_1~Region_dst_K for transporting, that is, the number of broadcast copies can also be expressed as K.

[0049] Exemplarily, in an embodiment of the present application, the data copy module 160 can read each frame frame_i of the to-be-broadcast data Data_dma currently cached in the data read cache 150 the same number of times as the number of broadcast copies (i.e., K times), so as to copy each frame frame_i of the to-be-broadcast data Data_dma into the number of broadcast copies (i.e., K copies). In this case, the data read cache 150 can be specifically configured to: in response to the completion of the copying of each frame frame_i of the to-be-broadcast data Data_dma, receive and cache the next frame of the to-be-broadcast data Data_dma, so as to realize frame-by-frame caching of the to-be-broadcast data Data_dma.

[0050] Exemplarily, in an embodiment of the present application, if as described above, each frame frame_i of the data Data_dma to be broadcast is stored in the data read cache 150 in a row granularity, then the data copy module 160 can be specifically configured to: loop through the traversal access to the occupied rows of each frame frame_i of the data Data_dma to be broadcast in the data read cache 150, so as to copy each frame frame_i of the data Data_dma to be broadcast into the number of broadcast copies (i.e., K copies), wherein the number of loops of the traversal access to each frame frame_i of the data Data_dma to be broadcast is the same as the number of broadcast copies (i.e., K copies).

[0051] Figure 2 This is a schematic diagram of an example of DMA implementing frame-by-frame caching and copying in an embodiment of the present application. Figure 2 In an embodiment of the present application, the data read cache 150 may be configured as a FIFO (First Input First Output) first-in-first-out cache, and the data read cache 150 may be configured with a write pointer P_waddr, a read pointer P_raddr, and a traversal pointer P_real. The pointer positions of the write pointer P_waddr, the read pointer P_raddr, and the traversal pointer P_real are all measured in units of lines, and the pointer positions of the write pointer P_waddr, the read pointer P_raddr, and the traversal pointer P_real may be represented by the register values ​​of the write pointer register, the read pointer register, and the traversal pointer register, respectively.

[0052] When each frame frame_i of the to-be-broadcast data Data_dma is stored in the data read buffer 150 , the data of the frame frame_i may be pushed into the data read buffer 150 with the row width W of the data read buffer 150 as the granularity. The row currently pointed to by the write pointer P_waddr of the data read cache 150 is used to represent the cache position of the row data of the frame frame_i to be pushed into, that is, in response to each row shift of the write pointer P_waddr of the data read cache 150, the row data of the frame frame_i received each time is pushed into the row currently pointed to by the write pointer P_waddr, so that, as the write pointer P_waddr of the data read cache 150 continuously shifts row by row, the frame frame_i is pushed into each row passed by the write pointer P_waddr, and, after the frame frame_i is completely stored in the data read cache 150, the write pointer P_waddr stops at the next row of the last row of the frame frame_i in the occupied rows of the data read cache 150.

[0053] For each frame frame_i stored in the data read cache 150 by shifting the write pointer P_waddr row by row, the read pointer P_raddr can be maintained at the first row of the occupied rows of the frame frame_i in the data read cache 150, and the traversal pointer P_real can use the row currently pointed to by the read pointer P_raddr (the first row of the occupied rows of the frame frame_i in the data read cache 150) as the traversal start row of each traversal and the previous row of the row currently pointed to by the write pointer P_waddr (that is, the last row of the occupied rows of the frame frame_i in the data read cache 150) as the traversal end row of each traversal, and perform circular row shifting. Among them, in each cycle of the circular row shift, the traversal pointer P_real can traverse all occupied rows of the frame frame_i in the data read cache 150, and the row data of each row traversed by the traversal pointer P_real will be read by the data copy module 160. Therefore, through K cycles, the data copy module 160 can complete K acquisitions of the frame frame_i, and then copy each frame frame_i of the data Data_dma to be broadcast into the number of broadcast copies (i.e., K copies).

[0054] That is, in an embodiment of the present application, the data replication module 160 can be specifically configured as: utilizing the circular row shift of the traversal pointer P_real of the data read cache 150, cyclically executing the traversal access to each frame frame_i of the broadcast data Data_dma, wherein the single shift range of the circular row shift of the traversal pointer P_real is the occupied row of the current frame of the broadcast data Data_dma in the data read cache 150, and the target number of cycles of the circular row shift of the traversal pointer P_real is the number of broadcast copies (i.e., K copies).

[0055] In addition, before the cyclic row shift of the traversal pointer P_real completes the target number of cycles (i.e., K times), the read pointer P_raddr remains stationary, and the data copy module 160 is prohibited from performing a pop-up operation; when the cyclic row shift of the traversal pointer P_real completes the target number of cycles (i.e., K times), the pop-up operation of the data copy module 160 is triggered to clear the frame frame_i that has been copied, and the read pointer P_raddr and the traversal pointer P_real can jump to the row currently pointed to by the write pointer P_waddr (i.e., the next row of the last row of the frame frame_i in the occupied rows of the data read cache 150) to wait for the reception and caching of the next frame frame_i+1 of the data Data_dma to be broadcast to be completed through the row-by-row shift of the write pointer P_waddr.

[0056] In an embodiment of the present application, the broadcast transport cache 170 is used to store each frame frame_i of the copied broadcast copies (i.e., K copies) in association with the broadcast address Addr_brc of the to-be-broadcast data Data_dma in at least two transport target nodes Region_dst_1~Region_dst_K, so that each frame frame_i of the broadcast copies (i.e., K copies) is written one by one into at least two transport target nodes Region_dst_1~Region_dst_K, that is, the j-th copy of each frame frame_i of the broadcast copies is used to be written into the j-th transport target node Region_dst_ j, where j is a positive integer greater than or equal to 1 and less than or equal to K.

[0057] Exemplarily, in an embodiment of the present application, each copy (i.e., the jth copy) of each frame frame_i of the copied broadcast copies (i.e., K copies) can be associated with the corresponding data to be broadcast Data_dma at the broadcast address Addr_brc of the corresponding transfer target node Region_dst_ j and stored in the same row of the broadcast transfer cache 170, that is, the number of rows of the broadcast transfer cache 170 can be greater than or equal to the number of broadcast copies K, and the row width of the broadcast transfer cache 170 can be greater than or equal to one frame of the data to be broadcast Data_dma, that is, the row width of the broadcast transfer cache 170 can be greater than or equal to the cache capacity N×W of the data read cache 150, and thus, the cache capacity of the broadcast transfer cache 170 can be greater than or equal to N×W×K.

[0058] Exemplarily, in an embodiment of the present application, the broadcast transfer cache 170 can be configured as a FIFO first-in-first-out cache, so that each frame frame_i of the broadcast copies (ie, K copies) can be written one by one into at least two transfer target nodes Region_dst_1~Region_dst_K in the copy order.

[0059] Based on the above-mentioned embodiment, the DMA controller can perform only one read access on the broadcast data Data_dma, wherein, in the sequential reading process in which the broadcast data Data_dma is triggered by one read access, the DMA controller can cache the broadcast data Data_dma frame by frame, and by copying each cached frame frame_i of the broadcast data Data_dma into the same number of broadcast copies K as the number of transport target nodes Region_dst_1 to Region_dst_K, each frame frame_i of the broadcast copies (i.e., K copies) can be written one by one into at least two transport target nodes Region_dst_1 to Region_dst_K.

[0060] Figure 3Schematic diagram of the data transfer effect of the DMA controller in the embodiment of the present application. Figure 3 When each frame frame_1~frame_M of the data to be broadcast Data_dma is copied frame by frame into the broadcast number (i.e. K copies) and written into at least two transfer target nodes Region_dst_1~Region_dst_K one by one, the data transfer based on DMA transmission can realize the broadcast in response to a read access.

[0061] Compared to the conventional method in which the number of read accesses is the same as the number K of Region_dst_1 to Region_dst_K (i.e., the conventional method of K read accesses), the embodiment of the present application can improve the broadcast efficiency of data transfer based on DMA transmission by reducing read accesses (i.e., reducing N-1 read accesses). For example, if K is 10, the read access initiated to the transfer source node Region_src can be reduced by 90%, so that the broadcast efficiency can be improved due to the 90% reduction in read accesses.

[0062] Please look back Figure 1 In an embodiment of the present application, the DMA controller may further include a transport scheduling module 130, which may be used to control the frame-by-frame caching of the data read cache 150, control the data replication module 160 to replicate each frame frame_i of the broadcast data Data_dma, and control the associated storage of each frame frame_i of the broadcast copies (i.e., K copies) and the broadcast address Addr_brc.

[0063] Exemplarily, in an embodiment of the present application, the transport scheduling module 130 may be specifically used to control the frame-by-frame caching of the data read cache 150 by maintaining the following parameters to achieve control of the frame-by-frame caching of the data read cache 150:

[0064] The total amount of data buf_size of the data to be broadcasted Data_dma, the total amount of data buf_size can be determined according to the address length of the source address Addr_src or the broadcast address Addr_brc, and the parameter value of the total amount of data buf_size can be recorded in the data amount register group;

[0065] The total number of frames bc_num of the data to be broadcast Data_dma, that is, the total number of frames bc_num can be assigned a value of M, and M can be determined according to the total amount of data buf_size of the data to be broadcast Data_dma and the cache capacity N×W of the data read cache 150, and the parameter value M after the total number of frames bc_num is assigned can be stored in the frame number register group;

[0066] The current frame identifier bc_num_now of a frame frame_i of the to-be-broadcast data Data_dma currently cached in the data read cache 150, the current frame identifier bc_num_now can be determined by updating the counting result of the frames that have been cached and copied, and the parameter value of the current frame identifier bc_num_now can be recorded in the current frame register group and updated by updating the register value of the current frame register group;

[0067] The single frame data amount bc_size_i of each frame frame_i of the data Data_dma to be broadcasted is less than or equal to the cache capacity N×W of the data read cache 150, and the single frame data amounts bc_size_1 to bc_size_M of each frame frame_1 to frame_M of the data Data_dma to be broadcasted may not be all the same, and the parameter values ​​of the single frame data amounts bc_size_1 to bc_size_M of each frame frame_1 to frame_M may be recorded in the frame quota register group;

[0068] The number of single-frame rows bc_len_i occupied by each frame frame_i of the data Data_dma to be broadcast in the data read cache 150 can be determined based on the single-frame data amount bc_size_i and the row width W of the data read cache 150. Since the single-frame data amounts bc_size_1 to bc_size_M of each frame frame_1 to frame_M of the data Data_dma to be broadcast may not be all the same, the number of single-frame rows bc_len_1 to bc_len_M of each frame frame_1 to frame_M may also not be all the same, and the number of single-frame rows bc_len_1 to bc_len_M of each frame frame_1 to frame_M may be recorded in the frame row number register group.

[0069] Exemplarily, in an embodiment of the present application, the transport scheduling module 130 can implement frame-by-frame caching control of the data read cache 150 according to the above-mentioned total number of frames bc_num, the current frame identifier bc_num_now, and the number of single-frame lines bc_len_i. For example, the transport scheduling module 130 can control the write pointer P_waddr, the push operation, and the pop-up operation of the data read cache 150 according to the above-mentioned total number of frames bc_num, the current frame identifier bc_num_now, and the number of single-frame lines bc_len_i, so as to implement frame-by-frame caching control of the data read cache 150 by controlling the write pointer P_waddr, the push operation, and the pop-up operation.

[0070] Exemplarily, in an embodiment of the present application, the transport scheduling module 130 can control the data replication module 160 to replicate each frame frame_i of the broadcast data Data_dma based on the number K of transport target nodes Region_dst_1~Region_dst_K, the above-mentioned total number of frames bc_num, the current frame identifier bc_num_now and the number of single frame rows bc_len_i. For example, the transport scheduling module 130 can control the read pointer P_raddr and the traversal pointer P_real based on the number K of transport target nodes Region_dst_1~Region_dst_K, as well as the above-mentioned total number of frames bc_num, the current frame identifier bc_num_now and the number of single frame rows bc_len_i, so that the number of times the traversal pointer P_real traverses the single shift range determined by the read pointer P_raddr and the write pointer P_waddr can reach the target number of cycles (i.e., K times), thereby ensuring that the data copy module 160 copies the number of copies of each frame frame_i of the broadcast data Data_dma currently cached in the data read cache 150 to reach the broadcast number (i.e., K copies).

[0071] Exemplarily, in an embodiment of the present application, the transport scheduling module 130 can also be used to receive the broadcast address Addr_brc of the to-be-broadcast data Data_dma decoded and generated by the instruction decoding module 110 at at least two transport target nodes Region_dst_1~Region_dst_K, for example, to obtain the broadcast address Addr_brc decoded and generated by the instruction decoding module 110 from the broadcast address register group described above, so as to control the associated storage of each frame frame_i of the broadcast number (i.e., K copies) and the broadcast address Addr_brc.

[0072] Figure 4 This is an exemplary schematic diagram of the frame division of the DMA controller in the embodiment of the present application. Figure 4 In an embodiment of the present application, an address offset Dev_addr may be allowed to exist between the source address Addr_src of the to-be-broadcast data Data_dma at the transport source node Region_src and the broadcast address Addr_brc of the to-be-broadcast data Data_dma at at least two transport target nodes Region_dst_1~Region_dst_K. For example, the address offset Dev_addr may be specifically expressed as a column offset. Thus, by allowing the address offset Dev_addr, it is not necessary to align the broadcast address Addr_brc with the source address Addr_src (for example, column alignment), thereby making the data transport for broadcasting more flexible.

[0073] In this case, each frame of the data to be broadcast Data_dma is determined by dividing the address mapping result of the data to be broadcast Data_dma, wherein the address mapping result may include compensation spaces, and the compensation spaces are used to compensate for the address offset Dev_addr between the source address Addr_src of the data to be broadcast Data_dma in the transport source node Region_src and the broadcast address Addr_brc. Therefore, the alignment state of the data to be broadcast Data_dma and the broadcast address Addr_brc can be represented by introducing compensation spaces, and then, by dividing the frames when the data to be broadcast Data_dma is in this alignment state, each frame frame_i of the data to be broadcast Data_dma can be written to the broadcast address Addr_brc in at least two transport target nodes Region_dst_1~Region_dst_K as complete rows as possible.

[0074] Moreover, the frame division of the address mapping result when the data to be broadcast Data_dma is in the aligned state can be based on the cache capacity N×W of the data read cache 150, so that each frame frame_i of the data to be broadcast Data_dma is less than or equal to the cache capacity N×W of the data read cache 150. Since the above-mentioned compensation space in the address mapping result can only be spliced ​​at the start end and / or end end of the data to be broadcast Data_dma, therefore:

[0075] Any one of the first frame frame_1 starting from the starting end of the data Data_dma to be broadcast and the last frame frame_M ending at the ending end of the data Data_dma to be broadcast can be equal to the cache capacity N×W of the data read cache 150, or can be less than the cache capacity N×W of the data read cache 150; and if the total number of frames bc_num (i.e., M) of the data Data_dma to be broadcast is greater than 2, then the intermediate frame between the first frame frame_1 and the last frame frame_M can be equal to the cache capacity N×W of the data read cache 150.

[0076] Exemplarily, in an embodiment of the present application, the transport scheduling module 130 may also be specifically configured to determine the total number of frames bc_num (ie, M) by maintaining the following parameters:

[0077] The first frame compensation space length first_bc_size, the sum of the first frame compensation space length first_bc_size and the single frame data amount bc_size_1 of the first frame frame_1 may be equal to the cache capacity N×W of the data read cache 150, wherein the first frame compensation space length first_bc_size may be determined according to the address offset Dev_addr, and the value of the first frame compensation space length first_bc_size may be recorded in the first frame compensation register;

[0078] The tail frame compensation space length final_bc_size, the sum of the tail frame compensation space length final_bc_size and the single frame data amount bc_size_M of the tail frame frame_M, can be equal to the cache capacity N×W of the data read cache 150, wherein the tail frame compensation space length final_bc_size can be determined according to the total data buf_size of the data Data_dma to be broadcast, the first frame compensation space length first_bc_size, and the cache capacity N×W of the data read cache 150, that is, the tail frame compensation space length final_bc_size can be indirectly associated with the address offset Dev_addr, and the value of the tail frame compensation space length final_bc_size can be recorded in the tail frame compensation register.

[0079] For example, if the address offset Dev_addr of the broadcast address Addr_brc relative to the source address Addr_src is a right offset, that is, each column address in the broadcast address Addr_brc is located on the right side of the corresponding column address in the source address Addr_src, then the value of the first frame compensation space length first_bc_size can be the address offset Dev_addr; if the address offset Dev_addr of the broadcast address Addr_brc relative to the source address Addr_src is a left offset, that is, each column address in the broadcast address Addr_brc is located on the left side of the corresponding column address in the source address Addr_src, then the value of the first frame compensation space length first_bc_size can be the difference between the cache capacity N×W of the data read cache 150 and the address offset Dev_addr, that is, the single frame data amount bc_size_1 of the first frame frame_1 is equal to the address offset Dev_addr.

[0080] For example, the single-frame data volume bc_size_M of the last frame frame_M can be the sum of the total data volume buf_size of the data Data_dma to be broadcast and the first frame compensation space length first_bc_size, modulo the cache capacity N×W of the data read cache 150, and the last frame compensation space length final_bc_size can be the difference between the cache capacity N×W of the data read cache 150 and the single-frame data volume bc_size_M of the last frame frame_M.

[0081] In an embodiment of the present application, if an address offset Dev_addr is allowed to exist between the source address Addr_src of the to-be-broadcast data Data_dma at the transport source node Region_src and the broadcast address Addr_brc of the to-be-broadcast data Data_dma at at least two transport target nodes Region_dst_1~Region_dst_K, then the data replication module 160 can also be used to: use the address offset Dev_addr to perform address mapping compensation on each copied frame frame_i, so that each frame frame_i of the broadcast number (i.e., K copies) is cached in the broadcast transport cache 170 in an aligned state.

[0082] Exemplarily, in an embodiment of the present application, if as described above, each frame frame_i of the data Data_dma to be broadcast is stored in the data read cache 150 in a row granularity, then the data copy module 160 can be specifically configured to: loop through the traversal access to the occupied rows of each frame frame_i of the data Data_dma to be broadcast in the data read cache 150, so as to copy each frame frame_i of the data Data_dma to be broadcast into the number of broadcast copies (i.e., K copies), wherein the number of loops of the traversal access to each frame frame_i of the data Data_dma to be broadcast is the same as the number of broadcast copies (i.e., K copies), and the single-row acquisition range of the traversal access to each frame frame_i of the data Data_dma to be broadcast can be determined based on the address offset Dev_addr.

[0083] Figure 5 This is an exemplary schematic diagram of the offset compensation of the DMA controller in the embodiment of the present application. Figure 5In an embodiment of the present application, the data copy module 160 may be specifically configured as follows: in the process of traversing access to each frame frame_i of the data to be broadcasted Data_dma, the current traversing row and the adjacent rows of the current traversing row (i.e., the adjacent rows before and after) are used as redundant candidate rows Lines_candi, and the single row acquisition range determined according to the address offset Dev_addr (or the first frame compensation space length first_bc_size) is used to acquire the single row of data Line_sel from the redundant candidate rows Lines_candi, and each of the broadcast copies (i.e., K copies) of each frame frame_i of the data to be broadcasted Data_dma includes each single row of data acquired by traversing access to the occupied rows of the frame frame_i in the data read cache 150. The current traversing row may refer to data read from the row before the row currently pointed to by the traversal pointer P_real, and the range offset of the single row acquisition range of the single row of data Line_sel may be determined by the address offset Dev_addr (or the first frame compensation space length first_bc_size).

[0084] Figure 6 Schematic diagram of an example of an implementation structure of the offset compensation of the DMA controller in the embodiment of the present application. Figure 6 In an embodiment of the present application, the data replication module 160 may include a register sequence, a temporary cache group, and a selector Sel_dev, wherein:

[0085] The register sequence may include a first register group Reg_front, a second register group Reg_cur, and a third register group Reg_rear which are sequentially connected in series, the second register group Reg_cur is used to cache a current traversal line, the first register group Reg_front is used to cache a previous adjacent line of the current traversal line, and the third register group Reg_rear is used to cache a next adjacent line of the current traversal line;

[0086] The temporary cache group includes a first temporary cache Temp_front, a second temporary cache Temp_cur and a third temporary cache Temp_rear, the first temporary cache Temp_front is used to cache the previous adjacent row of the current traversal row in the first register group Reg_front, the second temporary cache Temp_cur is used to cache the current traversal row in the second register group Reg_cur, and the third temporary cache Temp_rear is used to cache the next adjacent row of the current traversal row in the third register group Reg_rear, so that the current cache rows in the first temporary cache Temp_front, the second temporary cache Temp_cur and the third temporary cache Temp_rear are continuously formed to form redundant candidate rows Lines_candi cached in the temporary cache group;

[0087] The input bus of the selector Sel_dev has a multi-row specification covering the first temporary cache Temp_front, the second temporary cache Temp_cur and the third temporary cache Temp_rear (that is, the bus bandwidth is 3 times the row width W of the data read cache 150), and the output bus of the selector Sel_dev has a single-row specification (that is, the bus bandwidth is the row width W of the data read cache 150), and the selection range of the output bus and the input bus of the selector Sel_dev is used to characterize the single-row acquisition range determined according to the address offset Dev_addr, so as to obtain a single row of data from the redundant candidate row Lines_candi through the selection of the output bus and the input bus of the selector Sel_dev.

[0088] During a traversal access to the occupied rows in the data read cache 150 for each frame frame_i of the broadcast data Data_dma, the register sequence is triggered to perform a data shift in response to the completion of the acquisition of the single row data Line_sel of the current traversal row, wherein each data shift may include the previous adjacent row of the current traversal row in the first register group Reg_front being shifted out, the current traversal row in the second register group Reg_cur being shifted into the first register group Reg_front to replace the previous adjacent row, and the next adjacent row in the third register group Reg_rear being shifted into the second register group Reg_cur to replace the current traversal row; and, in response to the completion of the data shift of the register sequence (i.e., the current data shift of the register sequence), the redundant candidate rows Lines_candi cached in the temporary cache group may be triggered to perform a data refresh, thereby starting to acquire the single row data Line_sel of the next current traversal row, until the acquisition of all single row data is completed in a traversal access to the occupied rows of the frame frame_i in the data read cache 150, and then the next copying may be started.

[0089] Figure 7 This is an exemplary flow chart of a data handling method for broadcasting in an embodiment of the present application. Figure 7 The embodiment of the present application further provides a data transport method for broadcasting, and the data transport method may include:

[0090] S710: Initiate a read access to the data to be broadcast based on the source address of the data to be broadcast at the source node, wherein the read access initiated for the data to be broadcast can be used to trigger sequential reading of the data to be broadcast, and the sequentially read data to be broadcast are cached frame by frame in the data read cache, the number of target nodes for the data to be broadcast is at least two, and each frame of the data to be broadcast is less than or equal to the cache capacity of the data read cache.

[0091] Exemplarily, in an embodiment of the present application, the read access to the data to be broadcast initiated in S710 may be initiated in response to a data transport instruction. In this case, the data transport method in the embodiment of the present application may also include: by decoding the received data transport instruction, determining the source address of the data to be broadcast at the transport source node, the broadcast address of the data to be broadcast at the transport target node, and the number of transport target nodes of the data to be broadcast.

[0092] Exemplarily, in an embodiment of the present application, each frame of the data to be broadcast can be stored in the data read cache with row granularity, that is, the data read cache can receive the data to be broadcast read sequentially in row units, that is, the data to be broadcast can be read sequentially with the row width of the data read cache as the granularity.

[0093] S730: Copy each cached frame of the data to be broadcast into broadcast copies, wherein the broadcast copies of each frame of the data to be broadcast are the same as the number of the transport target nodes, and each frame of the broadcast copies is associated with the broadcast addresses of the data to be broadcast in at least two transport target nodes and stored in the broadcast transport cache, so that each frame of the broadcast copies is written into at least two transport target nodes one by one.

[0094] For example, in an embodiment of the present application, S730 can read each frame of the to-be-broadcast data currently cached in the data read cache the same number of times as the broadcast copies, so as to copy each frame of the to-be-broadcast data into the broadcast copies. In this case, the data read cache can be specifically configured to: in response to the completion of the copying of each frame of the to-be-broadcast data, receive and cache the next frame of the to-be-broadcast data, so as to realize frame-by-frame caching of the to-be-broadcast data.

[0095] Exemplarily, in an embodiment of the present application, if, as described above, each frame of the data to be broadcast is stored in the data read cache at a row granularity, then S730 may specifically include: loopingly executing a traversal access to the occupied rows of each frame of the data to be broadcast in the data read cache to copy each frame of the data to be broadcast into the number of broadcast copies, wherein the number of loops for the traversal access to each frame of the data to be broadcast is the same as the number of broadcast copies.

[0096] For example, S730 may specifically include: utilizing the circular row shift of the traversal pointer of the data read cache to cyclically perform traversal access to each frame of the data to be broadcast, wherein the single shift range of the circular row shift of the traversal pointer is the occupied row of the current frame of the data to be broadcast in the data read cache, and the target number of cycles of the circular row shift of the traversal pointer is the number of broadcast copies. For the single shift range of the circular row shift of the traversal pointer and the jump of the traversal pointer after completing the target number of cycles, please refer to the above description of Figure 2 The relevant description will not be repeated here.

[0097] Based on the above-mentioned embodiments, the data transport method for broadcasting can perform only one read access to the broadcast data, wherein, in the sequential reading process of the data to be broadcasted triggered by one read access, the data transport method for broadcasting can cache the data to be broadcasted frame by frame, and by copying each cached frame of the data to be broadcasted into the same number of broadcast copies as the number of transport target nodes, each frame of the broadcast copies can be written to at least two transport target nodes one by one, so that the data transport based on DMA transmission can realize the broadcast in response to one read access. Compared with the traditional method in which the number of read accesses is the same as the number of transport target nodes, the embodiments of the present application can improve the broadcast efficiency of data transport based on DMA transmission by reducing read accesses.

[0098] In an embodiment of the present application, the data transport method for broadcasting may allow an address offset between the source address of the transport source node of the data to be broadcasted and the broadcast address of at least two transport target nodes of the data to be broadcasted, as described above. Figure 4Related descriptions. In this case, each frame of the data to be broadcast is determined by dividing the address mapping result of the data to be broadcast, wherein the address mapping result may include compensation spaces, and the compensation spaces are used to compensate for the address offset between the source address of the data to be broadcast at the transport source node and the broadcast address. Thus, the alignment state of the data to be broadcast and the broadcast address can be characterized by introducing compensation spaces, and then, by dividing the frames when the data to be broadcast is in the alignment state, each frame of the data to be broadcast can be written to the broadcast address in a complete row as much as possible at at least two transport target nodes. In addition, S730 may also include: utilizing the address offset between the source address of the data to be broadcast at the transport source node and the broadcast address of the data to be broadcast at at least two transport target nodes, address mapping compensation is performed on each copied frame, so that each frame of the broadcast copies is cached in the broadcast transport cache in an aligned state.

[0099] Exemplarily, in an embodiment of the present application, if, as described above, each frame of the data to be broadcast is stored in the data read cache at a row granularity, then the process of S730 using the address offset to perform address mapping compensation on each copied frame may specifically include: using a single-row acquisition range determined based on the address offset, cyclically executing a traversal access to the occupied rows in the data read cache for each frame of the data to be broadcast, so as to copy each frame of the data to be broadcast into the number of broadcast copies, wherein the single shift range of the cyclic row shift of the traversal pointer is the occupied rows of the current frame of the data to be broadcast in the data read cache, and the target number of cycles of the cyclic row shift of the traversal pointer is the number of broadcast copies.

[0100] For example, in an embodiment of the present application, the process of cyclically executing the traversal access to the occupied lines in the data read cache for each frame of the broadcast data using the single-line acquisition range determined according to the address offset in S730 may specifically include:

[0101] In the process of traversing and accessing each frame of the data to be broadcast, the current traversing row and the adjacent rows of the current traversing row (i.e., the adjacent rows before and after) are used as redundant candidate rows, and the single row data is obtained from the redundant candidate rows using the single row acquisition range determined according to the address offset, wherein each of the broadcast copies of each frame of the data to be broadcast includes the single row data obtained by traversing and accessing the occupied rows of the frame in the data read cache once. For example, the current traversing row may refer to the data read from the row before the row currently pointed to by the traversal pointer, and the range offset of the single row acquisition range of the single row data may be determined by the address offset.

[0102] In an embodiment of the present application, a processor is also provided, in which the DMA controller described in the foregoing embodiment may be integrated. For example, the processor may refer to any device with processing capability, for example, the processor may be any one of a CPU (Central Processing Unit), a GPU (Graphics Processing Unit), a TPU (Tensor Processing Unit), an NPU (Neural Network Processing Unit), a DPU (Deep Learning Processing Unit), an APU (Accelerated Processing Unit), and a GPGPU (General-Purpose computing on Graphics Processing Units). The examples given here are only for the purpose of facilitating the understanding of the meaning of the processor involved in the embodiment of the present application, and are not intended to make unnecessary restrictions on the type of processor. For another example, the processor may include a front-end circuit and processing resources, and the DMA controller may be integrated in the front-end circuit of the processor. For example, the transport source node and the transport destination node may both include the on-chip memory of the processor, or both include the off-chip memory of the processor, or each include the off-chip memory and on-chip memory of the processor, and the embodiments of the present application are not limited to this.

[0103] The above description is only a preferred embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application shall be included in the scope of protection of the present application.

Claims

1. A DMA controller, characterized in that: include: A read trigger module, used to initiate a read access to the data to be broadcast according to the source address of the data to be broadcast at the transport source node; wherein the read access is used to trigger the sequential reading of the data to be broadcast; A data read cache, used for caching the to-be-broadcasted data read sequentially frame by frame; wherein each frame of the to-be-broadcasted data is less than or equal to the cache capacity of the data read cache; A data replication module, used to replicate each cached frame of the data to be broadcast into a number of broadcast copies; wherein the number of target nodes for transporting the data to be broadcast is at least two, and the number of broadcast copies of each frame of the data to be broadcast is the same as the number of target nodes for transporting; The broadcast transfer cache is used to store each frame of the broadcast copies in association with the broadcast addresses of the to-be-broadcasted data at at least two of the transfer target nodes, so that each frame of the broadcast copies is written to at least two of the transfer target nodes one by one.

2. The DMA controller according to claim 1, characterized in that: The data read cache is specifically configured to: in response to completion of copying each frame of the data to be broadcast, receive and cache the next frame of the data to be broadcast, so as to achieve frame-by-frame caching of the data to be broadcast.

3. The DMA controller according to claim 1, wherein: Each frame of the data to be broadcast is stored in the data read cache at a behavior granularity; The data replication module is specifically configured to: cyclically execute traversal access to the occupied lines in the data read cache for each frame of the data to be broadcast, so as to copy each frame of the data to be broadcast into the number of broadcast copies; wherein the number of cycles of the traversal access to each frame of the data to be broadcast is the same as the number of broadcast copies.

4. The DMA controller according to claim 3, characterized in that: The data replication module is specifically configured to: utilize the circular row shift of the traversal pointer of the data read cache to cyclically execute the traversal access to each frame of the data to be broadcast; wherein, the single shift range of the circular row shift of the traversal pointer is the occupied row of the current frame of the data to be broadcast in the data read cache, and the target number of cycles of the circular row shift of the traversal pointer is the number of broadcast copies.

5. The DMA controller according to claim 4, characterized in that: The traversal pointer uses the row currently pointed to by the read pointer of the data read cache as the traversal start row for each traversal, and uses the row previous to the row currently pointed to by the write pointer of the data read cache as the traversal end row for each traversal; wherein the read pointer remains stationary before the circular row shift of the traversal pointer completes the target number of cycles, and the read pointer and the traversal pointer jump to the row currently pointed to by the write pointer when the circular row shift of the traversal pointer completes the target number of cycles, so as to wait for the reception and caching of the next frame of the data to be broadcast to be completed through the row-by-row shift of the write pointer.

6. The DMA controller according to claim 1, characterized in that: Each frame of the data to be broadcast is determined by dividing the address mapping result of the data to be broadcast; wherein the address mapping result includes a compensation space for compensating the address offset between the source address and the broadcast address, so as to characterize the alignment state of the data to be broadcast and the broadcast address by introducing the compensation space; and the address mapping result is divided based on the cache capacity as the granularity, so that each frame of the data to be broadcast is less than or equal to the cache capacity of the data read cache; The data replication module is further used for: performing address mapping compensation on each replicated frame by using the address offset, so that each frame of the broadcast copies is cached in the broadcast transport cache in the aligned state.

7. The DMA controller according to claim 6, characterized in that: Each frame of the data to be broadcast is stored in the data read cache at a behavior granularity; The data copy module is specifically configured to: cyclically execute traversal access to the occupied rows in the data read cache for each frame of the data to be broadcast, so as to copy each frame of the data to be broadcast into the number of broadcast copies; wherein the number of cycles of the traversal access to each frame of the data to be broadcast is the same as the number of broadcast copies, and the single-row acquisition range of the traversal access to each frame of the data to be broadcast is determined based on the address offset.

8. The DMA controller according to claim 7, characterized in that: The data replication module is specifically configured as follows: in the process of the traversal access to each frame of the data to be broadcast, the current traversal row and the adjacent rows of the current traversal row are used as redundant candidate rows, and the single-row acquisition range is used to acquire a single-row data from the redundant candidate rows; wherein each of the broadcast copies of each frame includes each single-row data acquired through one traversal access.

9. The DMA controller according to claim 8, characterized in that: The data replication module includes a register sequence, the register sequence includes a first register group, a second register group and a third register group which are sequentially connected in series, the second register group is used to cache the current traversal row, the first register group is used to cache the previous adjacent row of the current traversal row, the third register group is used to cache the next adjacent row of the current traversal row, and the register sequence is triggered to perform a data shift in response to completion of single-row data acquisition of the current traversal row; wherein the data shift includes the previous adjacent row in the first register group being shifted out, the current traversal row in the second register group being shifted into the first register group to replace the previous adjacent row, and the next adjacent row in the third register group being shifted into the second register group to replace the current traversal row; The data replication module further includes a temporary cache group, the temporary cache group includes a first temporary cache, a second temporary cache and a third temporary cache, the first temporary cache is used to cache the previous adjacent row in the first register group, the second temporary cache is used to cache the current traversal row in the second register group, and the third temporary cache is used to cache the next adjacent row in the third register group, the current cache rows in the first temporary cache, the second temporary cache and the third temporary cache successively form the redundant candidate row cached in the temporary cache group, and the redundant candidate row cached in the temporary cache group is triggered to perform a data refresh in response to the completion of the data shift of the register sequence; The data replication module also includes a selector, an input bus of the selector has a multi-row specification covering the first temporary cache, the second temporary cache and the third temporary cache, an output bus of the selector has a single-row specification, and a gating range of the output bus and the input bus is used to characterize the single-row acquisition range, so as to obtain a single-row data from the redundant candidate row by gating the output bus and the input bus.

10. The DMA controller according to claim 1, wherein: Also includes: An instruction decoding module, configured to determine the source address, the broadcast address, and the number of the transfer target nodes by decoding the received data transfer instruction; The transport scheduling module is used to control the frame-by-frame caching of the data reading cache, control the replication of each frame by the data replication module, and control the associated storage of each frame of the broadcast copies and the broadcast address.

11. A data transfer method for broadcasting, applied to a DMA controller, characterized in that: include: Initiate a read access to the data to be broadcast according to the source address of the data to be broadcast at the transport source node; wherein the read access is used to trigger the sequential reading of the data to be broadcast, and the sequentially read data to be broadcast is cached frame by frame in the data reading cache, and each frame of the data to be broadcast is less than or equal to the cache capacity of the data reading cache; Each cached frame of the data to be broadcast is copied into a broadcast copy number; wherein the number of the transport target nodes of the data to be broadcast is at least two, the broadcast copy number of each frame of the data to be broadcast is the same as the number of the transport target nodes, and each frame of the broadcast copy number is stored in the broadcast transport cache in association with the broadcast address of the data to be broadcast in at least two of the transport target nodes, so that each frame of the broadcast copy number is written to at least two of the transport target nodes one by one.

12. The data transfer method according to claim 11, characterized in that: Each frame of the data to be broadcast is determined by dividing the address mapping result of the data to be broadcast; wherein the address mapping result includes a compensation space for compensating the address offset between the source address and the broadcast address, so as to characterize the alignment state of the data to be broadcast and the broadcast address by introducing the compensation space; and the address mapping result is divided based on the cache capacity as the granularity, so that each frame of the data to be broadcast is less than or equal to the cache capacity of the data read cache; The step of copying each cached frame of the data to be broadcast into broadcast copies further includes: performing address mapping compensation on each copied frame using the address offset, so that each frame of the broadcast copies is cached in the broadcast transport cache in the aligned state.

13. A processor, characterized in that: The processor is integrated with a DMA controller as claimed in any one of claims 1 to 10.

Citation Information

Patent Citations

  • DMA broadcast data transmission method based on host count in GPDSP

    CN108234147A

  • Static allocable shared multi-queue cache device and method

    CN113312278A