DMA memory access optimization method based on multi-core AI chip
By using data merging and transmission methods in multi-core AI chips, the host Master and slave Slave modules work together solve the problem of low DMA memory access efficiency, improve DRAM access efficiency and write hit rate, and reduce memory access delay and The overhead caused by multiple DMA startups enables more efficient data transmission.
Patent Information
- Application Number
- CN202411354313.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-27
- Publication Date
- 2024-11-01
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The DMA memory access efficiency in traditional multi-core AI chips is low, resulting in a reduced DRAM access efficiency, and it is impossible to effectively solve the interference and power consumption waste caused by simultaneous access of multiple DMAs.
Data merging and transmission is adopted, through the collaborative work of the host Master module and the slave Slave module, register configuration and on-chip Internet network are used to realize data merging and transmission, reducing the number of DRAM accesses and page turnovers, and improving access efficiency.
It significantly improves the access efficiency and write hit rate of DRAM, reduces memory access delay, increases data transmission bandwidth, and reduces the overhead and waste caused by simultaneous startup of multiple DMAs.
Smart Images

Figure CN118885418A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of data processing in a multi-core AI chip, and in particular to a DMA memory access optimization method based on a multi-core AI chip. Background Art
[0002] Artificial Intelligence (AI) chip: is an integrated circuit specially designed to perform AI tasks. They are designed to provide high-efficiency computing when processing large amounts of data and executing complex algorithms. AI chips usually have the characteristics of parallel computing capabilities, low-power design, dedicated hardware accelerators, flexibility and programmability, and high-performance storage and communication interfaces. The development of AI chips has promoted the widespread application of artificial intelligence technology, including speech recognition, image recognition, natural language processing, intelligent driving and other fields. With the continuous development of AI technology and the expansion of application scenarios, the design and performance of AI chips are also constantly evolving and improving.
[0003] Direct Memory Access (DMA): is a component used to control data exchange, mainly used for data exchange between external memory (DRAM) and internal memory (SRAM) or computing modules without the intervention of the CPU. This can significantly increase data transmission speed, reduce the burden on the CPU, and use resources more efficiently, thereby improving overall performance.
[0004] The access efficiency of DRAM restricts the speed of DMA data transfer, and has become a bottleneck for improving the performance and efficiency of multi-core AI chips. The traditional design idea is to configure a DMA for each AI computing core to transfer the data required by the core, and only one DMA is allowed to transfer data at a time. However, the data flow required for modern AI chip calculations is huge, and each access to DRAM requires access to a large number of data blocks. Changing from a single core to a multi-core can greatly improve the computing speed of the chip. Multiple cores call for parallel calculations, and parallel programs perform calculations at the same time, which greatly increases the computing performance of the chip. The data required by the parallel program comes from the DMA from the off-core storage. When the multi-core processor performs calculations, the DMA of each AI computing core will transfer data at the same time, which will cause interference between each other, resulting in unnecessary overhead and waste of power consumption, resulting in a decrease in the efficiency of DMA access to DRAM.
[0005] Traditionally used strategies to improve DMA memory access efficiency include double-buffers mechanism, DRAM three-dimensional structure scheduling access mechanism and other strategies. These strategies do not restore memory access locality, are limited by buffer depth or do not fundamentally solve the problem. Summary of the invention
[0006] To this end, the technical problem to be solved by the present invention is to overcome the strategic influence of DMA memory access efficiency in the prior art, which leads to the problem that memory access locality is not restored and DRAM access efficiency is reduced, thereby providing a DMA memory access optimization method, in which the data transmission method, that is, through the merged transmission design, can effectively improve the write hit rate of DRAM, reduce the number of page flips of the off-core storage body DRAM, and greatly improve the memory access efficiency of DRAM.
[0007] In order to solve the above technical problems, the present invention provides a DMA memory access optimization method based on a multi-core AI chip, wherein the DMA memory access optimization method is implemented based on a data merging transmission mode, wherein the DMA includes a host Master module and a slave Slave module, wherein the host Master module has instruction information receiving, storage, sending, and submission and release, and comprises the following steps: Step S1: before receiving the register information configured by the register configuration module, the write system is initialized; wherein all spaces of the parameter storage body ParaBuffer are initialized, and a direct correspondence between the ID and the register configuration information is established; in addition, the FIFOs in the two GPIPs are also initialized, that is, the read and write request control and calculation module in the GPIP submodule stores all the ID information into the FIFO, fills the write pointer, and establishes a one-to-one mapping relationship between the ID and the data in the FIFO; Step S2: After the write system initialization is completed, the host Master module receives the register configuration information configured by the register configuration module and the write response from the on-chip interconnect network; Step S3: The GPIP module read / write request and control module reads register configuration information from the parameter storage body ParaBuffer, and sends the instruction information to other corresponding nodes through the on-chip Internet through the request source selection vector SrcVec in the register configuration information. The register configuration information includes the data merge transmission mode Mode, the request source selection vector SrcVec, the merge cycle number Shift, the merge step size Step and the merge transmission granularity Grid, and updates the values of four registers, namely the SrcVec_tmp register, the SCR slave count register, the OR data transmission end register, and the Retvec return response indication register; Step S4: When the data transmission is completed, the host Master module receives the return write response from the on-chip interconnect network, determines whether it is the write response of the core, and determines whether the transmission is completed according to the SCR register and the OR register; after confirmation, the parameter body storage body ParaBuffer and the GPIP module need the ID to release the instructions stored in the storage entity, release the storage space, and facilitate the next configuration; at the same time, the completion information is sent to the read and write control units of other AI computing cores.
[0008] In one embodiment of the present invention, in step S2, after the host Master module receives the register configuration information configured by the register configuration module, the data merging and transmission process is started, the parameter body storage body ParaBuffer module obtains the ID in the write pointer FIFO, and stores the register configuration information configured by the register configuration module in the parameter body storage body ParaBuffer according to the corresponding relationship between the ID and the parameter body storage body ParaBuffer; When receiving the completion of the write response from the on-chip interconnect network, the parameter body storage body ParaBuffer read and write control pointer reads the instruction (register configuration information) of the parameter body storage body ParaBuffer according to the correspondence between the ID in the completion instruction information and the parameter body storage body ParaBuffer, and updates its corresponding SCR register. At the same time, the write pointer writes the ID in the completion instruction information into the parameter body storage body ParaBuffe.
[0009] In one embodiment of the present invention, the slave module has the function of passively receiving a merged write request from a host Master and a write response from an on-chip interconnect network structure, including the following steps: Step S11: before receiving the data merge transmission request from the host Master module, the slave module writes system initialization; that is, all spaces of the data storage body in the slave processing module are initialized, and a direct correspondence between data related information and data is established; Step S12: After the write system initialization is completed, the slave module can receive the data merge transmission request from the host Master module; Step S13: After the slave module receives the data merging and transmission request from the master module, it returns the calculated data cached in the slave processing module to the on-chip interconnection network; Step S14: After the slave module receives the data merging and transmission request from the host Master module, it returns the calculation data cached in the slave processing module to the on-chip interconnection network through the GPIP read-write dedicated channel; Step S15: When the data transmission is completed, the slave module of each AI computing core receives the return write response from the on-chip interconnect network, determines whether it is the write response of the core, and determines whether the transmission is completed according to the SCR register and the OR register; Step S16: When it is confirmed that the data transmission is completed, the storage space is released to facilitate the next configuration.
[0010] In one embodiment of the present invention, the host Master module is composed of a parameter storage body ParaBuffer and a general channel GPIP module; wherein the parameter storage body ParaBuffer is responsible for storing the data merge transmission register configured by the cache register configuration module, wherein the SrcVec_tmp register is a temporary register for storing all request source vectors; SCR is a slave count register for counting slave DMA; OR register is a data transmission end register for indicating data merge transmission; Retvec is a return response marking register for indicating the write response of the AI computing core; The above registers are used to configure the DMA transmission mode, transmission data volume and transmission start flag. DMA stores these register configuration parameters in the ParaBuffer module. DMA obtains the corresponding register configuration parameters according to different startup modes and transmits them to the GPIP module.
[0011] In one embodiment of the present invention, the host Master module includes two general channels GPIP with completely identical functions, namely GPIP0 and GPIP1. The general channel GPIP is responsible for translating parameter words and starting the corresponding transmission mode after decoding. The general channel is not only responsible for decoding parameter words, but also takes into account the calculation and sending of read and write requests, which is the main function of the GPIP module.
[0012] In one embodiment of the present invention, the general channel GPIP is composed of five modules, namely, a state machine FSM, an abnormal judgment processing module, a read / write request calculation and control module, a data return processing module and a FIFO of a certain depth; wherein the state machine FSM is the control circuit of the entire general channel GPIP module, the abnormal judgment processing module is responsible for monitoring whether the state during DMA transmission is abnormal, and once an abnormality occurs, the state of the state machine FSM is reset to the initial state; the read / write request calculation and control module is the main control processing module of the general channel GPIP, which calculates the information of the data that DMA needs to transmit according to the transmission parameter word and controls the distribution of read / write requests; the FIFO module is responsible for caching the data transmitted from the data return processing module; the data of the data return processing module is the data returned by DMA reading the storage body within the core or the data returned by DMA accessing the storage body outside the core in the form of matrix transposition, and this module is responsible for disassembling the data.
[0013] In one embodiment of the present invention, the slave module includes a slave processing module and four dedicated channels; the slave processing module is responsible for caching the read return data of the off-core storage, the read and write operations of the AI computing core initiated by the off-core, and arbitrating and distributing the data and requests; the four dedicated channels are write-dedicated channel 0, write-dedicated channel 1, read-dedicated channel 0, and read-dedicated channel 1; the read and write channels are 2 channels respectively and are independent of each other, and their purpose is the same as the GPIP module, which is to increase the efficiency of data movement and reduce latency.
[0014] The above technical solution of the present invention has the following advantages compared with the prior art: The DMA memory access optimization method of the present invention is applicable to the data processing field of multi-core AI chips and has flexible scalability and adaptability. The design also adopts DMA data transmission and a data merging transmission mechanism to avoid the overhead and waste caused by starting multiple DMAs at the same time, reduce the number of accesses and page turns of the external storage DRAM, greatly improve the access efficiency and write hit rate of DRAM, reduce memory access delay, and thus increase data transmission bandwidth. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] In order to make the contents of the present invention more clearly understood, the present invention is further described in detail below based on specific embodiments of the present invention in conjunction with the accompanying drawings.
[0016] Figure 1 It is a full flow chart of data merging and transmission in a DMA memory access optimization method based on a multi-core AI chip provided by the present invention.
[0017] Figure 2 It is a schematic diagram of data merging transmission parameters described in the present invention.
[0018] Figure 3 This is the data merging and transmission state machine described in the present invention. DETAILED DESCRIPTION
[0019] The following is a further detailed description of a DMA memory access optimization method based on a multi-core AI chip proposed by the present invention in conjunction with the accompanying drawings and specific embodiments. According to the following description, the advantages and features of the present invention will become clearer. It should be noted that the accompanying drawings are all in a very simplified form and are not in precise proportions, and are only used to conveniently and clearly assist in explaining the purpose of the embodiments of the present invention. Embodiment 1
[0020] This embodiment provides a DMA memory access optimization method based on a multi-core AI chip, characterized in that the DMA memory access optimization is implemented based on a data merging transmission method, and its specific modules include a host Master module and a slave Slave module. The host Master component is responsible for starting data merging transmission and actively initiating a merged write request to the off-core storage body according to the parameters configured by the register. The slave Slave component can passively receive the merged write request sent by the host Master and the write response from the on-chip interconnect network (NOC) structure.
[0021] The host Master module consists of a parameter storage body ParaBuffer and a general channel GPIP module. Among them, the parameter storage body ParaBuffer is responsible for storing the data merging transmission register configured by the cache register configuration module, where the SrcVec_tmp register is a temporary register for saving all request source vectors; SCR is a slave count register for counting slave DMA; OR register is a data transmission end register, which is a mark for data merging transmission; Retvec is a return response marking register, which is used to mark the write response of the AI computing core. These registers are used to configure the DMA transmission mode, transmission data volume and transmission start flag. DMA stores these register configuration parameters in the ParaBuffer module. DMA obtains the corresponding register configuration parameters according to different startup methods and transmits them to the GPIP module.
[0022] The two universal channels GPIP0 and GPIP1 in the host Master module have completely identical functions. Their purpose is to increase the efficiency of data transfer and reduce delay. The universal channel GPIP is responsible for the translation of parameter words and starts the corresponding transmission mode after decoding. The universal channel is not only responsible for the decoding of parameter words, but also takes into account the calculation and sending of read and write requests, which is the main function of the GPIP module. The universal channel GPIP consists of 5 modules, namely the state machine FSM, the abnormal judgment processing module, the read and write request calculation and control module, the data return processing module and a certain depth of FIFO. Among them, the state machine FSM is the control circuit of the entire universal channel GPIP module. The abnormal judgment processing module is responsible for monitoring whether the state during DMA transmission is abnormal. Once abnormal, the state of the state machine FSM is reset to the initial state. The read and write request calculation and control module is the main control processing module of the universal channel GPIP. It calculates the information of the data that DMA needs to transmit according to the transmission parameter word and controls the distribution of read and write requests. The FIFO module is responsible for caching the data transmitted from the data return processing module. The data returned by the data return processing module is the data returned by DMA reading the in-core storage or the data returned by DMA accessing the out-core storage in the form of matrix transposition. This module is responsible for disassembling the data.
[0023] The slave module consists of a slave processing module and four dedicated channels. The slave processing module is responsible for caching the read return data of the off-core storage, the read and write operations of the AI computing core initiated by the off-core, and the arbitration and distribution of data and requests. The four dedicated channels are write-dedicated channel 0, write-dedicated channel 1, read-dedicated channel 0, and read-dedicated channel 1. The read and write channels are two channels and are independent of each other. Their purpose is the same as that of the GPIP module, which is to increase the efficiency of data movement and reduce latency.
[0024] The host Master module has the functions of receiving, storing, sending and submitting the command information. The specific steps are as follows: Step S1: Before receiving the register information configured by the register configuration module, write system initialization. All the space of the parameter storage body ParaBuffer is initialized to establish a direct correspondence between the ID and the register configuration information; in addition, the FIFOs in the two GPIPs must also be initialized, that is, the read and write request control and calculation module in the GPIP submodule stores all the ID information into the FIFO, fills the write pointer, and establishes a one-to-one mapping relationship between the ID and the data in the FIFO; Step S2: After the write system initialization is completed, the host Master module can receive the register configuration information configured by the register configuration module and the write response from the on-chip interconnect network.
[0025] When the host Master module receives the register configuration information configured from the register configuration module, it starts the data merging and transmission process, the parameter body storage body ParaBuffer module obtains the ID in the write pointer FIFO, and stores the register configuration information configured from the register configuration module into the parameter body storage body ParaBuffer according to the corresponding relationship between the ID and the parameter body storage body ParaBuffer.
[0026] When receiving the completion of the write response from the on-chip interconnect network, the parameter body storage body ParaBuffer read and write control pointer reads the instruction (register configuration information) of the parameter body storage body ParaBuffer according to the correspondence between the ID in the completion instruction information and the parameter body storage body ParaBuffer, and updates its corresponding SCR register. At the same time, the write pointer writes the ID in the completion instruction information into the parameter body storage body ParaBuffe.
[0027] Step S3: The GPIP module read / write request and control module reads register configuration information from the parameter storage body ParaBuffer, and sends instruction information to other corresponding nodes through the on-chip Internet through the request source selection vector SrcVec in the register configuration information. The register configuration information includes data merge transmission mode Mode, request source selection vector SrcVec, merge cycle number Shift, merge step Step and merge transmission granularity Grid, and updates the values of four registers, namely, SrcVec_tmp register, SCR slave count register, OR data transmission end register, and Retvec return response indication register.
[0028] Step S4: When the data transmission is completed, the host Master module receives the return write response from the on-chip interconnect network, determines whether it is the write response of the core, and determines whether the transmission is completed according to the SCR register and the OR register. After the confirmation is completed, the parameter body storage body ParaBuffer and the GPIP module need to release the instructions stored in the storage entity, release the storage space, and facilitate the next configuration. At the same time, the completion information is sent to the read and write control unit of other AI computing cores.
[0029] The slave module has the function of passively receiving the merged write request sent by the host Master and the write response from the on-chip interconnection network structure, and the specific steps are as follows: Step S11: Before receiving the data merge transmission request from the host Master module, the slave module writes system initialization. That is, all the spaces of the data storage body in the slave processing module are initialized, and a direct correspondence between data related information and data is established; Step S12: After the write system initialization is completed, the slave module can receive the data merge transmission request from the host Master module.
[0030] Step S13: After the slave module receives the data merging and transmission request from the host Master module, it returns the calculation data cached in the slave processing module to the on-chip interconnect network.
[0031] Step S14: After the slave module receives the data merging and transmission request from the host Master module, it returns the calculation data cached in the slave processing module to the on-chip interconnection network through the GPIP read-write dedicated channel.
[0032] Step S15: When the data transmission is completed, the slave module of each AI computing core receives the return write response from the on-chip interconnect network, determines whether it is a write response from the core, and determines whether the transmission is completed based on the SCR register and the OR register.
[0033] Step S16: When it is confirmed that the data transmission is completed, the storage space is released to facilitate the next configuration. Embodiment 2
[0034] like Figure 1 As shown, this embodiment provides a DMA memory access optimization method based on a multi-core AI chip, in which data merging transmission is different from traditional DMA transmission. Only one DMA transfer transaction needs to be initiated to write the data in the in-core storage space of one or more AI computing cores to the off-core storage space DRAM. The AI computing core DMA that initiates the DMA data merging transmission transaction is the host DMA, which is responsible for the calculation and generation of read and write requests; other AI computing core DMAs are called slave DMAs, and each DMA slave participating in the transmission counts itself to confirm the end of the transmission. The specific transmission process is as follows: Step S1: Each time DMA data merge transmission is performed, the register configuration module needs to first configure the five transmission parameter words (SrcVec, Mode, Shift, Step and Grid) of the host DMA and the slave DMA participating in the transmission also needs to configure the slave count register SCR, which contains the number of data blocks that each slave DMA needs to receive.
[0035] Step S2: After the host DMA configures the transmission parameters, it starts the DMA data merging transmission and generates a read request in a segmented manner and sends it to each slave DMA.
[0036] Step S3: After receiving the read request from the host DMA, the slave DMA returns the read response data to the on-chip interconnect network structure.
[0037] Step S4: the on-chip interconnection network generates a write request (ie, data) after receiving the read response data returned by each slave DMA and writes it back to the DRAM.
[0038] Step S5: After the DRAM receives the write data sent by each slave DMA from the on-chip interconnection network and writes the data into the memory successfully, it returns a write response corresponding to each slave DMA and transmits it to each slave DMA via the on-chip interconnection network.
[0039] Step S6: When the slave DMA receives the corresponding write response signal, it will automatically count the transmitted data blocks. First, it is determined whether it is a write response from the core. If so, the corresponding SCR value is reduced; if not, it does not need to accept the write response.
[0040] Step S7: Finally, when all the slave DMA transmissions are judged to be completed, it is judged whether the SCR value is 0. If it is 0, it means that the slave DMA counting is completed and the counting ends; otherwise, the counting continues.
[0041] Step S8: When the SCR values of all the transmitting AI computing cores are 0, the value of the data transmission end register OR of this core is set to 1. When the OR of all the AI computing cores participating in the transmission is 1, the data merging transmission ends; otherwise, the counting continues.
[0042] The present invention provides a data merging transmission parameter diagram of a DMA memory access optimization method based on a multi-core AI chip, such as Figure 2 As shown in Figure 1, five register parameters are introduced in the data merge transmission design, namely, data merge transmission mode Mode, request source selection vector SrcVec, merge cycle number Shift, merge step Step, and merge transmission granularity Grid.
[0043] The data merge transmission mode Mode bit width is 1. When Mode=1, DMA starts data merge transmission and moves data from one or more AI computing cores' internal storage space (i.e., internal storage) to the external storage DRAM. The request source selection vector SrcVec bit width is 16, indicating 16 AI computing cores. When one of the bits is 1, it indicates that the response read return data is transmitted to the AI computing core. The merge cycle number Shift bit width is 4, and the maximum value is 15. The value of this parameter indicates the number of AI computing cores participating in the data merge transmission. When DMA performs data merge transmission, the request source selection vector SrcVec will shift left. After each shift, the request source selection vector reloads its initial value, and its initial value is saved in the temporary register SrcVec_tmp. The merge step Step bit width is 4, indicating the length of the request source selection vector SrcVec when it is shifted left. The merge transmission granularity Grid bit width is 16, indicating the size of the data block configured for each frame (i.e., each row of data) of each AI computing core when performing DMA data merge transmission. The remaining excess bit width can be used to expand the AI computing core or add corresponding functions to enhance system adaptability and scalability.
[0044] The data merge transmission register table shows the four registers required in the design. The SrcVec_tmp register has a bit width of 64 bits, and the lower 12 bits indicate the initial value of SrcVec; the SCR register has a bit width of 64 bits, and SCR is a slave count register used for slave DMA counting; the OR register is a data transmission end register with a bit width of 64 bits, which indicates data merge transmission; Retvec is a return response marking register with a bit width of 64 bits, which is used to indicate the write response of the AI computing core.
[0045] The present invention provides a data merging and transmission state machine based on a DMA memory access optimization method of a multi-core AI chip, such as Figure 3As shown. In the data merging and transmission state machine, the transmission state machine is designed with 6 states, namely the initial state idle, the data transmission state replace, the read request state inread, the write request state write, the waiting state wait and the completion state finish. The specific state transition process is as follows: Step S11: When there is no transmission request, the state machine is always in the initial state idle.
[0046] Step S12: When DMA needs to perform data transmission, the state machine enters the data transmission state replace from the initial state idle state.
[0047] Step S13: At this time, decoding is performed according to the transmission parameters configured by the register configuration module, and then data merging and transmission are performed. The state changes from the data transmission state replace to the read request state inread. At this time, DMA is calculating the read request and sending the request to its own in-core storage while calculating. Once an abnormal situation occurs during the calculation process, the state jumps to the initial state idle.
[0048] Step S14: If there is no abnormality and when the read request is calculated, the state machine jumps from the read request state inread to the write request state write. When the in-core storage returns the read data to the DMA according to the read request, the DMA calculates the write request and sends the write request to the on-chip network structure and then to the off-core storage DRAM. If an abnormal state occurs during the calculation, it will jump to the initial state idle.
[0049] Step S15: When the write request calculation is completed, the state machine jumps from the write request state write to the waiting state wait. In the waiting state wait, the DRAM returns a write response signal according to the write request, and one write request corresponds to one write response.
[0050] Step S16: When the DMA receives all corresponding write response signals, the state machine jumps to the final completion state finish, which means that the DMA data merging and transmission is completed at this time, and an interrupt is issued, and the state machine jumps to the initial state idle.
[0051] In summary, compared to the traditional DMA transmission method, it is necessary to start multiple DMAs, which causes unnecessary overhead and waste of power consumption, and increases congestion in the on-chip interconnection network structure. The DMA memory access optimization method of the present invention targets the write hit rate of DRAM, by writing the data of all AI computing cores from the in-core storage space to the out-core storage space in a merged transmission manner. Avoiding the overhead and waste caused by starting multiple DMAs at the same time reduces the number of accesses and page turns of the out-core storage body DRAM, greatly improving the access efficiency and write hit rate of DRAM, reducing memory access delays, and increasing data transmission bandwidth. The DMA memory access optimization has flexible adaptability and scalability.
[0052] Obviously, the above embodiments are merely examples for clear explanation and are not intended to limit the implementation methods. For those skilled in the art, other different forms of changes or modifications can be made based on the above description. It is not necessary and impossible to list all the implementation methods here. The obvious changes or modifications derived from these are still within the protection scope of the invention.
Claims
1. A DMA memory access optimization method based on a multi-core AI chip, wherein the DMA memory access optimization method is implemented based on a data merging transmission mode. It is characterized in that The DMA includes a host Master module and a slave Slave module. The host Master module has the functions of receiving, storing, sending and submitting and releasing instruction information, including the following steps: Step S1: before receiving the register information configured by the register configuration module, the write system is initialized; wherein all spaces of the parameter storage body ParaBuffer are initialized, and a direct correspondence between the ID and the register configuration information is established; in addition, the FIFOs in the two GPIPs are also initialized, that is, the read and write request control and calculation module in the GPIP submodule stores all the ID information into the FIFO, fills the write pointer, and establishes a one-to-one mapping relationship between the ID and the data in the FIFO; Step S2: After the write system initialization is completed, the host Master module receives the register configuration information configured by the register configuration module and the write response from the on-chip interconnect network; Step S3: The GPIP module read / write request and control module reads register configuration information from the parameter storage body ParaBuffer, and sends the instruction information to other corresponding nodes through the on-chip Internet through the request source selection vector SrcVec in the register configuration information. The register configuration information includes the data merge transmission mode Mode, the request source selection vector SrcVec, the merge cycle number Shift, the merge step size Step and the merge transmission granularity Grid, and updates the values of four registers, namely the SrcVec_tmp register, the SCR slave count register, the OR data transmission end register, and the Retvec return response indication register; Step S4: When the data transmission is completed, the host Master module receives the return write response from the on-chip interconnect network, determines whether it is the write response of the core, and determines whether the transmission is completed according to the SCR register and the OR register; after confirmation, the parameter body storage body ParaBuffer and the GPIP module need the ID to release the instructions stored in the storage entity, release the storage space, and facilitate the next configuration; at the same time, the completion information is sent to the read and write control units of other AI computing cores.
2. The DMA memory access optimization method according to claim 1, Features: In step S2, after the host Master module receives the register configuration information configured by the register configuration module, the data merging and transmission process is started, the parameter body storage body ParaBuffer module obtains the ID in the write pointer FIFO, and stores the register configuration information configured by the register configuration module into the parameter body storage body ParaBuffer according to the corresponding relationship between the ID and the parameter body storage body ParaBuffer; When receiving the completion of the write response from the on-chip interconnect network, the parameter body storage body ParaBuffer read and write control pointer reads the instruction of the parameter body storage body ParaBuffer according to the correspondence between the ID in the completion instruction information and the parameter body storage body ParaBuffer, and updates its corresponding SCR register. At the same time, the write pointer writes the ID in the completion instruction information into the parameter body storage body ParaBuffe.
3. The DMA memory access optimization method according to claim 1, Features: The slave module has the function of passively receiving the merged write request sent by the host Master and the write response from the on-chip interconnection network structure, including the following steps: Step S11: before receiving the data merge transmission request from the host Master module, the slave module writes system initialization; that is, all spaces of the data storage body in the slave processing module are initialized, and a direct correspondence between data related information and data is established; Step S12: After the write system initialization is completed, the slave module can receive the data merge transmission request from the host Master module; Step S13: After the slave module receives the data merging and transmission request from the master module, it returns the calculated data cached in the slave processing module to the on-chip interconnection network; Step S14: After the slave module receives the data merging and transmission request from the host Master module, it returns the calculation data cached in the slave processing module to the on-chip interconnection network through the GPIP read-write dedicated channel; Step S15: When the data transmission is completed, the slave module of each AI computing core receives the return write response from the on-chip interconnect network, determines whether it is the write response of the core, and determines whether the transmission is completed according to the SCR register and the OR register; Step S16: When it is confirmed that the data transmission is completed, the storage space is released to facilitate the next configuration.
4. The DMA memory access optimization method according to claim 1, Features: The host Master module is composed of a parameter storage body ParaBuffer and a general channel GPIP module; wherein the parameter storage body ParaBuffer is responsible for storing the data merge transmission register configured by the cache register configuration module, wherein the SrcVec_tmp register is a temporary register for storing all request source vectors; SCR is a slave count register for counting slave DMA; OR register is a data transmission end register for marking data merge transmission; Retvec is a return response marking register for marking the write response of the AI computing core; The above registers are used to configure the DMA transmission mode, transmission data volume and transmission start flag. DMA stores these register configuration parameters in the ParaBuffer module. DMA obtains the corresponding register configuration parameters according to different startup modes and transmits them to the GPIP module.
5. The DMA memory access optimization method according to claim 1, Features: The host Master module includes two general channels GPIP with completely identical functions. The general channel GPIP is responsible for translating parameter words and starting the corresponding transmission mode after decoding. The general channel is not only responsible for decoding parameter words, but also for calculating and sending read and write requests.
6. The DMA memory access optimization method according to claim 5, Features: The general channel GPIP consists of five modules, namely, the state machine FSM, the abnormal judgment processing module, the read / write request calculation and control module, the data return processing module and a FIFO of a certain depth; the state machine FSM is the control circuit of the entire general channel GPIP module, the abnormal judgment processing module is responsible for monitoring whether the state of DMA transmission is abnormal, and once it is abnormal, the state of the state machine FSM is reset to the initial state; the read / write request calculation and control module is the main control processing module of the general channel GPIP, which calculates the information of the data that DMA needs to transmit according to the transmission parameter word and controls the distribution of read / write requests; the FIFO module is responsible for caching the data transmitted from the data return processing module; The data returned by the data return processing module is the data returned by DMA reading the in-core storage or the data returned by DMA accessing the out-core storage in the form of matrix transposition. This module is responsible for disassembling the data.
7. The DMA memory access optimization method according to claim 3, Features: The slave module includes a slave processing module and four dedicated channels; the slave processing module is responsible for caching the read return data of the off-core storage, the read and write operations of the AI computing core initiated by the off-core, and arbitrating and distributing the data and requests; the four dedicated channels are write-dedicated channel 0, write-dedicated channel 1, read-dedicated channel 0, and read-dedicated channel 1; the read and write channels are 2 channels respectively and are independent of each other.
Citation Information
Patent Citations
Instruction prefetch-based multi-core shared memory control equipment
CN102207916A
DMA data merging transmission method in GPDSP
CN108062282A
DMA communication device and apparatus for high-speed interconnection network interface chip, method thereof, and the chip,
CN112256624A
Heterogeneous accelerator card-oriented multifunctional DMA design method and system
CN116629176A
DMA bandwidth determination method and device based on AI chip, equipment and medium
CN117827710A
Cited By
Reading control method, device, chip and system of communication interface
CN120067023A
AI data handling optimization method based on multi-core system
CN121614433A
Computing chip, debugging system and data transmission method
CN122132353A
