CN112947857B - A data transfer method, device, equipment, and computer-readable storage medium - Google Patents

A data transfer method, device, equipment, and computer-readable storage medium Download PDF

Info

Publication number
CN112947857B
CN112947857B CN202110211367.8A CN202110211367A CN112947857B CN 112947857 B CN112947857 B CN 112947857B CN 202110211367 A CN202110211367 A CN 202110211367A CN 112947857 B CN112947857 B CN 112947857B
Authority
CN
China
Prior art keywords
data
flow control
task
moving
dma
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202110211367.8A
Other languages
Chinese (zh)
Other versions
CN112947857A (en
Inventor
王峰
张闯
黄广奎
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shandong Yingxin Computer Technology Co Ltd
Original Assignee
Shandong Yingxin Computer Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shandong Yingxin Computer Technology Co Ltd filed Critical Shandong Yingxin Computer Technology Co Ltd
Priority to CN202110211367.8A priority Critical patent/CN112947857B/en
Publication of CN112947857A publication Critical patent/CN112947857A/en
Application granted granted Critical
Publication of CN112947857B publication Critical patent/CN112947857B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0646Horizontal data movement in storage systems, i.e. moving data in between storage devices or systems
    • G06F3/0647Migration mechanisms
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/14Handling requests for interconnection or transfer
    • G06F13/20Handling requests for interconnection or transfer for access to input/output bus
    • G06F13/24Handling requests for interconnection or transfer for access to input/output bus using interrupt
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0602Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
    • G06F3/0626Reducing size or complexity of storage systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0629Configuration or reconfiguration of storage systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2213/00Indexing scheme relating to interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F2213/0026PCI express

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Human Computer Interaction (AREA)
  • Bus Control (AREA)

Abstract

本发明公开了一种数据搬移方法,该方法包括以下步骤:接收目标数据搬移任务对应的配置信息;对配置信息进行解析,得到源地址、目的地址、以及流控类型;判断流控类型是否为外设流控;若是,则当接收到源地址对应的目标外设发送的数据搬移请求时,将统一存储器中源地址对应的数据搬移至目的地址。应用本发明所提供的数据搬移方法,不需要在各外设中分别设置FIFO存储器,降低了系统复杂性,避免了数据传输等待,较大地提高了数据传输效率。本发明还公开了一种数据搬移装置、设备及存储介质,具有相应技术效果。

Figure 202110211367

The invention discloses a data migration method, which comprises the following steps: receiving configuration information corresponding to a target data migration task; parsing the configuration information to obtain a source address, a destination address, and a flow control type; judging whether the flow control type is Peripheral device flow control; if so, when receiving a data transfer request sent by the target peripheral device corresponding to the source address, move the data corresponding to the source address in the unified memory to the destination address. By applying the data transfer method provided by the present invention, it is not necessary to set FIFO memories in each peripheral device separately, which reduces system complexity, avoids waiting for data transmission, and greatly improves data transmission efficiency. The invention also discloses a data transfer device, equipment and storage medium, which have corresponding technical effects.

Figure 202110211367

Description

一种数据搬移方法、装置、设备及计算机可读存储介质A data transfer method, device, equipment, and computer-readable storage medium

技术领域technical field

本发明涉及存储技术领域,特别是涉及一种数据搬移方法、装置、设备及计算机可读存储介质。The present invention relates to the field of storage technology, in particular to a data transfer method, device, equipment and computer-readable storage medium.

背景技术Background technique

随着异构加速日益广泛的应用,基于现场可编程与门阵列(Field ProgrammableGate Array,FPGA)的加速卡也发展迅速。加速卡FPGA通过高速串行计算机扩展总线标准(peripheral component interconnect express,PCIE)接口与服务器主机连接,服务器主机通过PCIE接口将需要加速的数据发送给加速卡FPGA,加速卡FPGA处理完成后通过PCIE接口返回相关的数据。在数据传输过程中,直接访问存储器(Direct Memory Access,DMA)是常用的数据搬移设备。With the increasingly widespread application of heterogeneous acceleration, accelerator cards based on Field Programmable Gate Array (Field Programmable Gate Array, FPGA) are also developing rapidly. The accelerator card FPGA is connected to the server host through the high-speed serial computer expansion bus standard (peripheral component interconnect express, PCIE) interface, and the server host sends the data to be accelerated to the accelerator card FPGA through the PCIE interface, and the accelerator card FPGA finishes processing through the PCIE interface Return relevant data. During data transmission, direct memory access (Direct Memory Access, DMA) is a commonly used data moving device.

目前现有的直接访问存储器接收主机host的指令,申请总线控制权,将数据从地址A搬到地址B,搬移结束后发出中断或者其他信号告知host。但是一般的直接访问存储器只能做存储器(memory)之间的数据搬移,不能直接做流外设之间的数据搬移,比如通用异步收发传输器(Universal Asynchronous Receiver/Transmitter,UART)、网口等设备。At present, the existing direct access memory receives instructions from the host host, applies for bus control, moves data from address A to address B, and sends an interrupt or other signal to inform the host after the transfer is completed. However, general direct access to memory can only be used for data transfer between memories (memory), not directly for data transfer between streaming peripherals, such as Universal Asynchronous Receiver/Transmitter (UART), network ports, etc. equipment.

现有技术中,UART和网口等设备在需要DMA进行数据搬移时,通常的做法就是在DMA与UART之间增加一个FIFO(First Input First Output)存储器,相当于把UART外围设备(peripheral)变成了存储器类型的外设。但是这种办法在外设较多的系统中,需要在每个外设中增加FIFO存储器,增加系统复杂性,不利于产品开发。因为外设的数据并不稳定,数据传输等待时间长,导致数据传输效率很低。In the prior art, when devices such as UART and network ports need DMA to move data, the usual way is to add a FIFO (First Input First Output) memory between the DMA and UART, which is equivalent to changing the UART peripheral (peripheral) Becomes a memory-type peripheral. However, in a system with many peripherals, this method needs to increase FIFO memory in each peripheral, which increases the complexity of the system and is not conducive to product development. Because the data of the peripheral device is not stable, the waiting time for data transmission is long, resulting in low data transmission efficiency.

综上所述,如何有效地解决现有的数据搬移方式系统复杂、数据传输效率低等问题,是目前本领域技术人员急需解决的问题。To sum up, how to effectively solve problems such as complex systems and low data transmission efficiency in existing data transfer methods is an urgent problem for those skilled in the art at present.

发明内容Contents of the invention

本发明的目的是提供一种数据搬移方法,该方法降低了系统复杂性,提高了数据传输效率;本发明的另一目的是提供一种数据搬移装置、设备及计算机可读存储介质。The object of the present invention is to provide a data transfer method, which reduces system complexity and improves data transmission efficiency; another object of the present invention is to provide a data transfer device, equipment and computer-readable storage medium.

为解决上述技术问题,本发明提供如下技术方案:In order to solve the above technical problems, the present invention provides the following technical solutions:

一种数据搬移方法,包括:A method for moving data, comprising:

接收目标数据搬移任务对应的配置信息;Receive the configuration information corresponding to the target data migration task;

对所述配置信息进行解析,得到源地址、目的地址、以及流控类型;Analyzing the configuration information to obtain a source address, a destination address, and a flow control type;

判断所述流控类型是否为外设流控;Judging whether the flow control type is peripheral flow control;

若是,则当接收到所述源地址对应的目标外设发送的数据搬移请求时,将统一存储器中所述源地址对应的数据搬移至所述目的地址。If yes, move the data corresponding to the source address in the unified memory to the destination address when receiving the data transfer request sent by the target peripheral device corresponding to the source address.

在本发明的一种具体实施方式中,将统一存储器中所述源地址对应的数据搬移至所述目的地址,包括:In a specific implementation manner of the present invention, moving the data corresponding to the source address in the unified memory to the destination address includes:

判断当前是否存在待执行的DMA流控数据搬移任务;Determine whether there is currently a DMA flow control data moving task to be executed;

若是,则执行所述DMA流控数据搬移任务;If so, then execute the DMA flow control data moving task;

判断所述DMA流控数据搬移任务是否执行完成;Judging whether the DMA flow control data moving task has been executed;

若是,则执行所述将统一存储器中所述源地址对应的数据搬移至所述目的地址的步骤。If yes, execute the step of moving the data corresponding to the source address in the unified memory to the destination address.

在本发明的一种具体实施方式中,判断当前是否存在待处理的DMA流控数据搬移任务,包括:In a specific implementation manner of the present invention, judging whether there is currently a DMA flow control data transfer task to be processed includes:

判断DMA流控信号是否为使能状态;Determine whether the DMA flow control signal is enabled;

执行所述DMA流控数据搬移任务,包括:Execute the DMA flow control data moving task, including:

确定存在所述DMA流控数据搬移任务,并执行所述DMA流控数据搬移任务。It is determined that the DMA flow control data moving task exists, and the DMA flow control data moving task is executed.

在本发明的一种具体实施方式中,在接收到所述源地址对应的目标外设发送的数据搬移请求之后,还包括:In a specific implementation manner of the present invention, after receiving the data transfer request sent by the target peripheral device corresponding to the source address, it further includes:

判断所述数据搬移请求是否为所述目标数据搬移任务对应的末次数据搬移请求;judging whether the data migration request is the last data migration request corresponding to the target data migration task;

若是,则在执行所述将统一存储器中所述源地址对应的数据搬移至所述目的地址的步骤之后,确定完成对所述目标数据搬移任务的执行。If yes, after performing the step of moving the data corresponding to the source address in the unified memory to the destination address, it is determined that the execution of the target data moving task is completed.

在本发明的一种具体实施方式中,将统一存储器中所述源地址对应的数据搬移至所述目的地址,包括:In a specific implementation manner of the present invention, moving the data corresponding to the source address in the unified memory to the destination address includes:

通过Avalon总线将统一存储器中所述源地址对应的数据搬移至所述目的地址。The data corresponding to the source address in the unified memory is moved to the destination address through the Avalon bus.

一种数据搬移装置,包括:A data transfer device, comprising:

信息接收模块,用于接收目标数据搬移任务对应的配置信息;An information receiving module, configured to receive configuration information corresponding to the target data migration task;

信息解析模块,用于对所述配置信息进行解析,得到源地址、目的地址、以及流控类型;An information parsing module, configured to parse the configuration information to obtain a source address, a destination address, and a flow control type;

第一判断模块,用于判断所述流控类型是否为外设流控;A first judging module, configured to judge whether the flow control type is peripheral flow control;

数据搬移模块,用于当确定所述流控类型为外设流控时,当接收到所述源地址对应的目标外设发送的数据搬移请求时,将统一存储器中所述源地址对应的数据搬移至所述目的地址。A data movement module, configured to unify the data corresponding to the source address in the memory when the flow control type is determined to be peripheral flow control, and when a data movement request sent by the target peripheral corresponding to the source address is received Move to the stated destination address.

在本发明的一种具体实施方式中,所述数据搬移模块包括:In a specific implementation manner of the present invention, the data movement module includes:

第一判断子模块,用于判断当前是否存在待执行的DMA流控数据搬移任务;The first judging sub-module is used to judge whether there is currently a DMA flow control data moving task to be executed;

任务执行子模块,用于当确定当前存在待执行的DMA流控数据搬移任务时,执行所述DMA流控数据搬移任务;The task execution submodule is configured to execute the DMA flow control data movement task when it is determined that there is currently a DMA flow control data movement task to be executed;

第二判断子模块,用于判断所述DMA流控数据搬移任务是否执行完成;The second judging submodule is used to judge whether the DMA flow control data moving task has been executed;

数据搬移子模块,用于当确定所述DMA流控数据搬移任务执行完成时,将统一存储器中所述源地址对应的数据搬移至所述目的地址。The data moving sub-module is configured to move the data corresponding to the source address in the unified memory to the destination address when it is determined that the execution of the DMA flow control data moving task is completed.

在本发明的一种具体实施方式中,还包括:In a specific embodiment of the present invention, it also includes:

第二判断模块,用于在接收到所述源地址对应的目标外设发送的数据搬移请求之后,判断所述数据搬移请求是否为所述目标数据搬移任务对应的末次数据搬移请求;The second judging module is configured to judge whether the data migration request is the last data migration request corresponding to the target data migration task after receiving the data migration request sent by the target peripheral device corresponding to the source address;

任务执行状态确定模块,用于当确定所述数据搬移请求为所述目标数据搬移任务对应的末次数据搬移请求时,在将统一存储器中所述源地址对应的数据搬移至所述目的地址之后,确定完成对所述目标数据搬移任务的执行。A task execution status determining module, configured to, when determining that the data migration request is the last data migration request corresponding to the target data migration task, after moving the data corresponding to the source address in the unified memory to the destination address, It is determined that the execution of the target data moving task is completed.

一种数据搬移设备,包括:A data transfer device, comprising:

存储器,用于存储计算机程序;memory for storing computer programs;

处理器,用于执行所述计算机程序时实现如前所述数据搬移方法的步骤。The processor is configured to implement the steps of the aforementioned data moving method when executing the computer program.

一种计算机可读存储介质,所述计算机可读存储介质上存储有计算机程序,所述计算机程序被处理器执行时实现如前所述数据搬移方法的步骤。A computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the steps of the aforementioned data moving method are implemented.

本发明所提供的数据搬移方法,接收目标数据搬移任务对应的配置信息;对配置信息进行解析,得到源地址、目的地址、以及流控类型;判断流控类型是否为外设流控;若是,则当接收到源地址对应的目标外设发送的数据搬移请求时,将统一存储器中所述源地址对应的数据搬移至所述目的地址。通过预先设置统一存储器,并预先对外设对应的数据搬移任务的流控类型进行配置,在确定目标数据搬移任务的流控类型为外设流控时,通过目标外设主动发起数据搬移请求的方式触发数据搬移任务的执行。从而不需要在各外设中分别设置FIFO存储器,降低了系统复杂性,避免了数据传输等待,较大地提高了数据传输效率。The data migration method provided by the present invention receives the configuration information corresponding to the target data migration task; parses the configuration information to obtain the source address, destination address, and flow control type; judges whether the flow control type is peripheral flow control; if so, Then, when a data transfer request sent by the target peripheral device corresponding to the source address is received, the data corresponding to the source address in the unified memory is moved to the target address. By pre-setting the unified memory and pre-configuring the flow control type of the data migration task corresponding to the peripheral, when the flow control type of the target data migration task is determined to be peripheral flow control, the method of actively initiating a data migration request through the target peripheral Trigger the execution of the data migration task. Therefore, there is no need to set FIFO memories in each peripheral device separately, which reduces the complexity of the system, avoids waiting for data transmission, and greatly improves the efficiency of data transmission.

相应的,本发明还提供了与上述数据搬移方法相对应的数据搬移装置、设备和计算机可读存储介质,具有上述技术效果,在此不再赘述。Correspondingly, the present invention also provides a data migration device, device, and computer-readable storage medium corresponding to the above-mentioned data migration method, which have the above-mentioned technical effects, and will not be repeated here.

附图说明Description of drawings

为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings that need to be used in the description of the embodiments or the prior art. Obviously, the accompanying drawings in the following description are only These are some embodiments of the present invention. Those skilled in the art can also obtain other drawings based on these drawings without creative work.

图1为本发明实施例中数据搬移方法的一种实施流程图;Fig. 1 is a kind of implementation flowchart of the data moving method in the embodiment of the present invention;

图2为本发明实施例中数据搬移方法的另一种实施流程图;Fig. 2 is another implementation flowchart of the data moving method in the embodiment of the present invention;

图3为本发明实施例中一种数据搬移系统的结构框图;FIG. 3 is a structural block diagram of a data transfer system in an embodiment of the present invention;

图4为本发明实施例中一种数据搬移流程图;FIG. 4 is a flow chart of data migration in an embodiment of the present invention;

图5为本发明实施例中一种数据搬移装置的结构框图;5 is a structural block diagram of a data transfer device in an embodiment of the present invention;

图6为本发明实施例中一种数据搬移设备的结构框图。Fig. 6 is a structural block diagram of a data moving device in an embodiment of the present invention.

具体实施方式Detailed ways

为了使本技术领域的人员更好地理解本发明方案,下面结合附图和具体实施方式对本发明作进一步的详细说明。显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。In order to enable those skilled in the art to better understand the solution of the present invention, the present invention will be further described in detail below in conjunction with the accompanying drawings and specific embodiments. Apparently, the described embodiments are only some of the embodiments of the present invention, but not all of them. Based on the embodiments of the present invention, all other embodiments obtained by persons of ordinary skill in the art without making creative efforts belong to the protection scope of the present invention.

实施例一:Embodiment one:

参见图1,图1为本发明实施例中数据搬移方法的一种实施流程图,该方法可以包括以下步骤:Referring to Fig. 1, Fig. 1 is a kind of implementation flowchart of the data moving method in the embodiment of the present invention, and this method may comprise the following steps:

S101:接收目标数据搬移任务对应的配置信息。S101: Receive configuration information corresponding to a target data migration task.

预先在主机host中设置各外设对应的数据搬移任务的配置信息,当存在待处理的目标数据搬移任务时,主机向多流空DMA发送目标数据搬移任务对应的配置信息,多流空DMA接收目标数据搬移任务对应的配置信息。Set the configuration information of the data transfer task corresponding to each peripheral in the host host in advance. When there is a target data transfer task to be processed, the host sends the configuration information corresponding to the target data transfer task to the multi-stream empty DMA, and the multi-stream empty DMA receives Configuration information corresponding to the target data migration task.

配置信息可以包括待搬移数据的源地址、目的地址、流控类型、数据量大小、源地址和目标地址是属于递增类型还是属于不变类型等。The configuration information may include the source address, destination address, flow control type, data size, source address and destination address of the data to be moved, whether they belong to the incremental type or the constant type, etc.

流控类型包括DMA流控和外设流控。DMA流控即以DMA作为数据流控制,外设流控即以外设作为数据流控制。Flow control types include DMA flow control and peripheral flow control. DMA flow control refers to DMA as data flow control, and peripheral flow control refers to peripherals as data flow control.

S102:对配置信息进行解析,得到源地址、目的地址、以及流控类型。S102: Analyze the configuration information to obtain the source address, destination address, and flow control type.

在接收到目标数据搬移任务对应的配置信息之后,对配置信息进行解析,得到源地址、目的地址、以及流控类型。After receiving the configuration information corresponding to the target data moving task, the configuration information is analyzed to obtain the source address, destination address, and flow control type.

S103:判断流控类型是否为外设流控,若否,则执行步骤S104,若是,则执行步骤S105。S103: Determine whether the flow control type is peripheral flow control, if not, execute step S104, and if yes, execute step S105.

在解析得到流控类型之后,判断流控类型是否为外设流控,若否,则说明流控类型为DMA流控,执行步骤S104,若是,则执行步骤S105。After analyzing the flow control type, it is judged whether the flow control type is peripheral flow control, if not, it means that the flow control type is DMA flow control, and step S104 is executed, and if so, step S105 is executed.

S104:当DMA流控信号为使能状态时,将统一存储器中源地址对应的数据搬移至目的地址。S104: When the DMA flow control signal is enabled, move the data corresponding to the source address in the unified memory to the destination address.

当确定流控类型不是外设流控时,说明流控类型为DMA流控,检测DMA流控信号是否处于使能状态,如可以预先设置预备(ready)信号作为DMA流控信号的指示标识,且设置预备信号的低电平对应DMA流控信号的使能状态,当确定DMA流控信号为使能状态时,将统一存储器中源地址对应的数据搬移至目的地址。由于DMA作为流控时,因为DMA可直接获得需要搬移的总数据量,因此在确定DMA流控信号为使能状态时,直接发起数据传输即可,直到目标数据搬移任务执行结束。When it is determined that the flow control type is not peripheral flow control, it indicates that the flow control type is DMA flow control, and detects whether the DMA flow control signal is in an enabled state. For example, the ready (ready) signal can be set in advance as an indicator of the DMA flow control signal. And setting the low level of the preparation signal corresponds to the enable state of the DMA flow control signal, and when it is determined that the DMA flow control signal is in the enable state, the data corresponding to the source address in the unified memory is moved to the destination address. When DMA is used as flow control, because DMA can directly obtain the total amount of data that needs to be moved, when it is determined that the DMA flow control signal is enabled, it is sufficient to directly initiate data transmission until the execution of the target data movement task is completed.

S105:当接收到源地址对应的目标外设发送的数据搬移请求时,将统一存储器中源地址对应的数据搬移至目的地址。S105: When receiving a data transfer request sent by the target peripheral device corresponding to the source address, move the data corresponding to the source address in the unified memory to the destination address.

当确定流控类型为外设流控之时,由于DMA不能获取到总体需要搬移的数据量,因此需等待外设的请求,再进行数据搬移。当接收到源地址对应的目标外设发送的数据搬移请求时,将统一存储器中源地址对应的数据搬移至目的地址。通过预先设置统一存储器,并预先对外设对应的数据搬移任务的流控类型进行配置,在确定目标数据搬移任务的流控类型为外设流控时,通过目标外设主动发起数据搬移请求的方式触发数据搬移任务的执行。从而不需要在各外设中分别设置FIFO存储器,降低了系统复杂性,为产品开发提供了便利,避免了数据传输等待,较大地提高了数据传输效率。When the flow control type is determined to be peripheral flow control, since the DMA cannot obtain the overall amount of data that needs to be moved, it needs to wait for the request from the peripheral before moving the data. When receiving the data transfer request sent by the target peripheral device corresponding to the source address, move the data corresponding to the source address in the unified memory to the destination address. By pre-setting the unified memory and pre-configuring the flow control type of the data migration task corresponding to the peripheral, when the flow control type of the target data migration task is determined to be peripheral flow control, the method of actively initiating a data migration request through the target peripheral Trigger the execution of the data migration task. Therefore, there is no need to set FIFO memories in each peripheral device separately, which reduces the complexity of the system, provides convenience for product development, avoids waiting for data transmission, and greatly improves the efficiency of data transmission.

本发明所提供的数据搬移方法,接收目标数据搬移任务对应的配置信息;对配置信息进行解析,得到源地址、目的地址、以及流控类型;判断流控类型是否为外设流控;若是,则当接收到源地址对应的目标外设发送的数据搬移请求时,将统一存储器中源地址对应的数据搬移至目的地址。通过预先设置统一存储器,并预先对外设对应的数据搬移任务的流控类型进行配置,在确定目标数据搬移任务的流控类型为外设流控时,通过目标外设主动发起数据搬移请求的方式触发数据搬移任务的执行。从而不需要在各外设中分别设置FIFO存储器,降低了系统复杂性,避免了数据传输等待,较大地提高了数据传输效率。The data migration method provided by the present invention receives the configuration information corresponding to the target data migration task; parses the configuration information to obtain the source address, destination address, and flow control type; judges whether the flow control type is peripheral flow control; if so, Then, when a data transfer request sent by the target peripheral device corresponding to the source address is received, the data corresponding to the source address in the unified memory is moved to the destination address. By pre-setting the unified memory and pre-configuring the flow control type of the data migration task corresponding to the peripheral, when the flow control type of the target data migration task is determined to be peripheral flow control, the method of actively initiating a data migration request through the target peripheral Trigger the execution of the data migration task. Therefore, there is no need to set FIFO memories in each peripheral device separately, which reduces the complexity of the system, avoids waiting for data transmission, and greatly improves the efficiency of data transmission.

需要说明的是,基于上述实施例一,本发明实施例还提供了相应的改进方案。在后续实施例中涉及与上述实施例一中相同步骤或相应步骤之间可相互参考,相应的有益效果也可相互参照,在下文的改进实施例中不再一一赘述。It should be noted that, based on the first embodiment above, the embodiment of the present invention also provides a corresponding improvement solution. In subsequent embodiments, the same steps as in the first embodiment above or corresponding steps may be referred to each other, and the corresponding beneficial effects may also be referred to each other, and will not be repeated in the improved embodiments below.

实施例二:Embodiment two:

参见图2,图2为本发明实施例中数据搬移方法的另一种实施流程图,该方法可以包括以下步骤:Referring to Fig. 2, Fig. 2 is another implementation flowchart of the data moving method in the embodiment of the present invention, and the method may include the following steps:

S201:接收目标数据搬移任务对应的配置信息。S201: Receive configuration information corresponding to a target data migration task.

S202:对配置信息进行解析,得到源地址、目的地址、以及流控类型。S202: Analyze the configuration information to obtain the source address, destination address, and flow control type.

S203:判断流控类型是否为外设流控,若否,则执行步骤S204,若是,则执行步骤S205。S203: Determine whether the flow control type is peripheral flow control, if not, execute step S204, and if yes, execute step S205.

S204:当DMA流控信号为使能状态时,通过Avalon总线将统一存储器中源地址对应的数据搬移至目的地址。S204: When the DMA flow control signal is enabled, move the data corresponding to the source address in the unified memory to the destination address through the Avalon bus.

在确定流控类型不是外设流控之后,当DMA流控信号为使能状态时,通过Avalon总线将统一存储器中源地址对应的数据搬移至目的地址,从而实现外设之间的数据搬移。After determining that the flow control type is not peripheral flow control, when the DMA flow control signal is enabled, the data corresponding to the source address in the unified memory is moved to the destination address through the Avalon bus, thereby realizing data movement between peripherals.

S205:接收源地址对应的目标外设发送的数据搬移请求。S205: Receive a data move request sent by the target peripheral device corresponding to the source address.

当确定流控类型为外设流控时,当外设需要进行数据传输时,主动向多流控DMA发送数据搬移请求,多流控DMA接收源地址对应的目标外设发送的数据搬移请求。When the flow control type is determined to be peripheral flow control, when the peripheral needs to perform data transmission, it actively sends a data movement request to the multi-flow control DMA, and the multi-flow control DMA receives the data movement request sent by the target peripheral corresponding to the source address.

S206:判断当前是否存在待执行的DMA流控数据搬移任务,若是,则执行步骤S207,若否,则执行步骤S209。S206: Determine whether there is currently a DMA flow control data moving task to be executed, if yes, perform step S207, and if not, perform step S209.

由于DMA流控的数据传输速度高于外设流控,因此预先设置DMA流控的优先级高于外设流控。在接收到源地址对应的目标外设发送的数据搬移请求之后,判断当前是否存在待执行的DMA流控数据搬移任务,若是,则说明当前需要先执行DMA流控数据搬移任务,执行步骤S207,若否,则执行步骤S209。Since the data transmission speed of the DMA flow control is higher than that of the peripheral flow control, the priority of the preset DMA flow control is higher than that of the peripheral flow control. After receiving the data transfer request sent by the target peripheral device corresponding to the source address, determine whether there is currently a DMA flow control data transfer task to be executed, if so, it means that the DMA flow control data transfer task needs to be executed first at present, and step S207 is executed If not, execute step S209.

S207:执行DMA流控数据搬移任务。S207: Execute the DMA flow control data moving task.

在确定当前存在待执行的DMA流控数据搬移任务时,执行DMA流控数据搬移任务。When it is determined that there is currently a DMA flow control data moving task to be executed, the DMA flow control data moving task is executed.

在本发明的一种具体实施方式中,步骤S206可以包括以下步骤:In a specific implementation manner of the present invention, step S206 may include the following steps:

判断DMA流控信号是否为使能状态;Determine whether the DMA flow control signal is enabled;

相应地,步骤S207可以包括以下步骤:Correspondingly, step S207 may include the following steps:

确定存在DMA流控数据搬移任务,并执行DMA流控数据搬移任务。Determine that there is a DMA flow control data moving task, and execute the DMA flow control data moving task.

将DMA流控信号的状态作为DMA流控数据搬移任务存在与否的判断依据,在接收源地址对应的目标外设发送的数据搬移请求之后,判断DMA流控信号是否为使能状态,若是,则确定存在DMA流控数据搬移任务,并执行DMA流控数据搬移任务。The state of the DMA flow control signal is used as the basis for judging whether the DMA flow control data transfer task exists or not. After receiving the data transfer request sent by the target peripheral device corresponding to the source address, it is judged whether the DMA flow control signal is enabled. If so, Then it is determined that there is a DMA flow control data moving task, and the DMA flow control data moving task is executed.

S208:判断DMA流控数据搬移任务是否执行完成,若是,则执行步骤S209,若否,则不做处理。S208: Determine whether the DMA flow control data moving task is completed, if yes, perform step S209, if not, do not process.

在确定存在DMA流控数据搬移任务,并执行DMA流控数据搬移任务之后,判断DMA流控数据搬移任务是否执行完成,若是,则说明接下来可以执行外设流控数据搬移任务,执行步骤S209,若否,则说明当前仍需等待DMA流控数据搬移任务执行完成,不做处理。After determining that there is a DMA flow control data moving task and executing the DMA flow control data moving task, it is judged whether the DMA flow control data moving task has been executed, if so, it means that the peripheral flow control data moving task can be executed next, and step S209 , if not, it means that it still needs to wait for the completion of the DMA flow control data moving task, and no processing is performed.

S209:通过Avalon总线将统一存储器中源地址对应的数据搬移至目的地址。S209: Move the data corresponding to the source address in the unified memory to the destination address through the Avalon bus.

当确定DMA流控数据搬移任务执行完成时,说明接下来可以执行外设流控数据搬移任务,通过Avalon总线将统一存储器中源地址对应的数据搬移至目的地址。When it is determined that the DMA flow control data movement task is completed, it means that the peripheral flow control data movement task can be executed next, and the data corresponding to the source address in the unified memory is moved to the destination address through the Avalon bus.

S210:判断数据搬移请求是否为目标数据搬移任务对应的末次数据搬移请求,若是,则执行步骤S211,若否,则重复执行步骤S205。S210: Determine whether the data migration request is the last data migration request corresponding to the target data migration task, if yes, execute step S211, if not, repeatedly execute step S205.

当外设作为流控时,DMA不能获取总体需要搬移的数据量,需等待外设的请求,再进行数据搬移,DMA不能自动获取到数据搬移是否结束。因此,当外设的数据快要结束时,通过发起末次数据搬移请求来通知DMA此为最后一次数据搬移,DMA执行完该次的数据搬移后,数据搬移任务结束。在接收到源地址对应的目标外设发送的数据搬移请求之后,判断数据搬移请求是否为目标数据搬移任务对应的末次数据搬移请求,若是,则说明当次数据搬移为目标数据搬移任务对应的末次数据搬移,执行步骤S211,若否,则说明当次数据搬移不是目标数据搬移任务对应的末次数据搬移,重复执行步骤S205。When the peripheral is used as flow control, the DMA cannot obtain the overall amount of data that needs to be moved. It needs to wait for the request from the peripheral before moving the data. The DMA cannot automatically obtain whether the data transfer is complete. Therefore, when the data of the peripheral device is about to end, the DMA is notified by initiating the last data transfer request that this is the last data transfer. After the DMA completes the data transfer, the data transfer task ends. After receiving the data migration request sent by the target peripheral corresponding to the source address, judge whether the data migration request is the last data migration request corresponding to the target data migration task, and if so, it means that the current data migration is the last data migration request corresponding to the target data migration task For data migration, step S211 is executed. If not, it means that the current data migration is not the last data migration corresponding to the target data migration task, and step S205 is repeatedly executed.

S211:确定完成对目标数据搬移任务的执行。S211: Determine that the execution of the target data moving task is completed.

当确定数据搬移请求为目标数据搬移任务对应的末次数据搬移请求时,说明当次数据搬移为目标数据搬移任务对应的末次数据搬移,确定完成对目标数据搬移任务的执行。When it is determined that the data migration request is the last data migration request corresponding to the target data migration task, it indicates that the current data migration is the last data migration corresponding to the target data migration task, and it is determined that the execution of the target data migration task is completed.

参见图3,图3为本发明实施例中一种数据搬移系统的结构框图。该系统包括SRAM、DDR、SPI、UART、以太网(Ethernet)等外设,多流控DMA,主机host。外设与多流控DMA、多流控DMA与host之间均通过Avalon-MM接口相连。多流控DMA设置为基于FPGA的多流控DMA,所有的逻辑在FPGA中实现,主要分为8个模块:配置模块,状态模块,DMA流控模块,外设流控模块,Burst传输模块,Last传输模块,请求模块,中断模块。Referring to FIG. 3, FIG. 3 is a structural block diagram of a data migration system in an embodiment of the present invention. The system includes SRAM, DDR, SPI, UART, Ethernet (Ethernet) and other peripherals, multi-flow control DMA, and host. The peripherals and the multi-flow control DMA, and the multi-flow control DMA and the host are connected through the Avalon-MM interface. The multi-flow control DMA is set as FPGA-based multi-flow control DMA. All the logic is implemented in the FPGA, which is mainly divided into 8 modules: configuration module, status module, DMA flow control module, peripheral flow control module, Burst transmission module, Last transfer module, request module, interrupt module.

配置模块主要接收来自host的配置信息,包括多流控DMA要搬移数据的源地址,目的地址,数据量,流控类型,源地址和目标地址是属于递增类型还是属于不变类型等。The configuration module mainly receives configuration information from the host, including the source address, destination address, data volume, flow control type, and whether the source address and destination address belong to the incremental type or the constant type, etc. for multi-flow control DMA.

状态模块主要功能是记录DMA流控模块与外设流控模块的状态信息,比如内部FIFO空满,当前流控通道是正在搬移,还是等待,或者结束,剩余数据量等等。The main function of the status module is to record the status information of the DMA flow control module and the peripheral flow control module, such as the internal FIFO is full, whether the current flow control channel is moving, waiting, or ending, the amount of remaining data, and so on.

DMA流控模块主要功能是以多流控DMA作为数据流控制,执行存储器(memory)或者外设(peripheral)之间的数据搬移,流控类型有四种,memory to memory(m2m),memory toperipheral(m2p),peripheral to memory(p2m),peripheral to peripheral(p2p)。The main function of the DMA flow control module is to use multi-flow control DMA as data flow control to perform data movement between memory (memory) or peripheral (peripheral). There are four types of flow control, memory to memory (m2m), memory to peripheral (m2p), peripheral to memory (p2m), peripheral to peripheral (p2p).

外设流控模块的主要功能是以外设作为数据流控制,执行memory或者peripheral之间的数据搬移,流控类型有三种,memory to peripheral(m2p),peripheral to memory(p2m),peripheral to peripheral(p2p)。The main function of the peripheral flow control module is to use peripherals as data flow control to perform data movement between memory or peripheral. There are three types of flow control, memory to peripheral (m2p), peripheral to memory (p2m), peripheral to peripheral ( p2p).

设置DMA流控的优先级高于外设流控。The priority of setting DMA flow control is higher than peripheral flow control.

中断模块的主要功能是当多流控DMA的数据搬移任务完成后,中断模块会发送对应中断或者其他信息告知host,host也可以配置屏蔽这些中断,然后通过读取状态模块获取对应信息。The main function of the interrupt module is that when the data transfer task of the multi-flow control DMA is completed, the interrupt module will send the corresponding interrupt or other information to inform the host, and the host can also be configured to shield these interrupts, and then obtain the corresponding information by reading the status module.

Burst传输模块是将多流控DMA的各种流控请求类型变成满足Avalon总线协议的Burst传输,连续从源地址读取数据,写入目的地址,不管是DMA作为流控,还是外设作为流控,都需要通过该模块。The Burst transmission module converts various flow control request types of multi-flow control DMA into Burst transmission that meets the Avalon bus protocol, continuously reads data from the source address, and writes to the destination address, regardless of whether DMA is used as flow control or peripherals are used as Flow control needs to pass through this module.

Last传输模块是只针对外设作为流控时的数据搬移,当外设作为流控时,多流控DMA不能获取总体需要搬移的数据量,只是等待外设的请求,再进行数据搬移,多流控DMA不能获取数据搬移何时结束。当外设的数据快要结束时,这时就通过请求发起Last传输来告知多流控DMA这是最后一笔数据搬移,多流控DMA执行完Last传输后,数据搬移任务就结束了。而多流控DMA作为流控时,因为多流控DMA能够获取到需要搬移的总数据量,所以发起正常Burst传输即可,直到任务结束。The Last transmission module is only for data migration when the peripheral is used as the flow control. When the peripheral is used as the flow control, the multi-flow control DMA cannot obtain the overall amount of data that needs to be moved, but only waits for the request from the peripheral before moving the data. The flow control DMA cannot know when the data movement is finished. When the data of the peripheral device is about to end, at this time, the multi-flow control DMA is notified by requesting to initiate the Last transfer that this is the last data transfer. After the multi-flow control DMA completes the Last transfer, the data transfer task is over. When the multi-flow control DMA is used as flow control, because the multi-flow control DMA can obtain the total amount of data that needs to be moved, it is enough to initiate a normal Burst transmission until the end of the task.

请求模块的主要功能是接收来自外设模块的数据搬移请求,因为外设的数据并不稳定,有时来的多,有时来的少,有时没有数据,在这种情况下,如果用多流控DMA作为流控,可能需要长时间等待,导致效率很低。此时需要通过外设作为流控,等数据到来时,主动向多流控DMA发起请求,正常情况下多流控DMA发起Burst请求,如果是最后一笔数据,那就发起Last请求,外设流控模块根据请求类型发起对应的Burst/Last数据传输。The main function of the request module is to receive the data movement request from the peripheral module, because the data of the peripheral is not stable, sometimes there is a lot, sometimes there is little, and sometimes there is no data. In this case, if you use multi-flow control As a flow control, DMA may need to wait for a long time, resulting in low efficiency. At this time, it is necessary to use the peripheral as a flow control. When the data arrives, it will actively initiate a request to the multi-flow control DMA. Under normal circumstances, the multi-flow control DMA initiates a Burst request. If it is the last piece of data, it initiates a Last request. The peripheral The flow control module initiates corresponding Burst/Last data transmission according to the request type.

多流控DMA可以封装成IP独立使用,能够适用于多种类型的外设之间的数据搬移。灵活性和可移植性以及可扩展性都增强了,在项目开发中可以直接调用,为产品的开发提供便利,缩短开发周期。Multi-flow control DMA can be encapsulated into IP for independent use, and can be applied to data transfer between various types of peripherals. The flexibility, portability and scalability are enhanced, and it can be called directly during project development, which facilitates product development and shortens the development cycle.

参见图4,图4为本发明实施例中一种数据搬移流程图。以SRAM,DDR和UART之间的数据搬移来说明多流控DMA的工作流程。host的第一组配置情况是,源地址为SRAM地址A,目的地址为DDR地址B,数据总量256M,流控类型为D_m2m,源地址与目的地址都递增。第二组配置情况是,源地址为UART地址C,目的地址为DDR地址D,流控类型为P_p2m,源地址固定不变,目的地址递增。Referring to FIG. 4, FIG. 4 is a flow chart of data migration in an embodiment of the present invention. The workflow of multi-flow control DMA is illustrated by data transfer between SRAM, DDR and UART. The first configuration of the host is that the source address is SRAM address A, the destination address is DDR address B, the total amount of data is 256M, the flow control type is D_m2m, and both the source address and the destination address are incremented. The second configuration is that the source address is UART address C, the destination address is DDR address D, the flow control type is P_p2m, the source address is fixed, and the destination address is incremented.

首先多流控DMA开始执行D_m2m的任务,通过Burst传输模块发起Burst传输,把数据从SRAM读出写入多流控DDR,每一笔Burst读写的地址都是递增的。如果数据搬移到64M时,SRAM的数据不足,需要等待,那此时D_m2m先等待,同时启动P_p2m的传输。如果UART有充足的数据,UART会发起req请求,告知多流控DMA可以读取UART的数据,多流控DMA通过发起Burst传输将UART的数据读出并写入多流控DDR地址D。如果此时SRAM的数据又充足了,ready信号拉低,等P_p2m当前笔burst传输完成,再次启动D_m2m,但是要。当D_m2m的传输结束后,多流控DMA向host发起对应的中断,告知hostD_m2m搬移任务完成,同时继续执行P_p2m,由于UART的数据速率较慢,所以要等较长时间才能执行下一笔搬移,多流控DMA等待UART的req请求,然后执行Burst传输搬移数据,当多流控DMA收到Last req请求时,多流控DMA就会发起Last传输,并且在完成Last传输后,向host发起对应中断,告知host此时P_p2m任务完成。First, the multi-flow control DMA starts to execute the task of D_m2m, initiates the Burst transmission through the Burst transmission module, reads the data from the SRAM and writes it into the multi-flow control DDR, and the address of each Burst read and write is incremented. If the data in the SRAM is insufficient when the data is moved to 64M and it needs to wait, then D_m2m waits first and starts the transmission of P_p2m at the same time. If the UART has sufficient data, the UART will initiate a req request to inform the multi-flow control DMA that the UART data can be read, and the multi-flow control DMA will read the UART data and write it to the multi-flow control DDR address D by initiating a Burst transmission. If the data in SRAM is sufficient at this time, the ready signal is pulled low, and the current burst transmission of P_p2m is completed, and D_m2m is started again, but it is necessary. When the transmission of D_m2m ends, the multi-flow control DMA initiates a corresponding interrupt to the host, notifying the host that the D_m2m transfer task is completed, and continues to execute P_p2m at the same time. Since the data rate of UART is relatively slow, it will take a long time to execute the next transfer. The multi-flow control DMA waits for the UART req request, and then executes Burst transmission to move data. When the multi-flow control DMA receives the Last req request, the multi-flow control DMA will initiate the Last transmission, and after completing the Last transmission, it will initiate a correspondence to the host. Interrupt, inform the host that the P_p2m task is completed at this time.

期间状态模块会记录D_m2m与P_p2m的各个状态信息,host可以屏蔽中断,通过访问状态模块获取信息。During the period, the status module will record the status information of D_m2m and P_p2m, and the host can shield the interrupt and obtain information by accessing the status module.

实施例三:Embodiment three:

相应于上面的方法实施例,本发明还提供了一种数据搬移装置,下文描述的数据搬移装置与上文描述的数据搬移方法可相互对应参照。Corresponding to the above method embodiments, the present invention also provides a data migration device, and the data migration device described below and the data migration method described above can be referred to in correspondence.

参见图5,图5为本发明实施例中一种数据搬移装置的结构框图,该装置可以包括:Referring to FIG. 5, FIG. 5 is a structural block diagram of a data moving device in an embodiment of the present invention, and the device may include:

信息接收模块51,用于接收目标数据搬移任务对应的配置信息;An information receiving module 51, configured to receive configuration information corresponding to the target data moving task;

信息解析模块52,用于对配置信息进行解析,得到源地址、目的地址、以及流控类型;An information parsing module 52, configured to parse the configuration information to obtain the source address, destination address, and flow control type;

第一判断模块53,用于判断流控类型是否为外设流控;The first judging module 53 is used to judge whether the flow control type is peripheral flow control;

数据搬移模块54,用于当确定流控类型为外设流控时,当接收到源地址对应的目标外设发送的数据搬移请求时,将统一存储器中源地址对应的数据搬移至目的地址。The data movement module 54 is configured to move the data corresponding to the source address in the unified memory to the destination address when receiving a data movement request sent by the target peripheral corresponding to the source address when the flow control type is determined to be peripheral flow control.

在本发明的一种具体实施方式中,数据搬移模块54包括:In a specific embodiment of the present invention, the data movement module 54 includes:

第一判断子模块,用于判断当前是否存在待执行的DMA流控数据搬移任务;The first judging sub-module is used to judge whether there is currently a DMA flow control data moving task to be executed;

任务执行子模块,用于当确定当前存在待执行的DMA流控数据搬移任务时,执行DMA流控数据搬移任务;The task execution sub-module is used to execute the DMA flow control data movement task when it is determined that there is currently a DMA flow control data movement task to be executed;

第二判断子模块,用于判断DMA流控数据搬移任务是否执行完成;The second judging sub-module is used to judge whether the DMA flow control data moving task is executed;

数据搬移子模块,用于当确定DMA流控数据搬移任务执行完成时,将统一存储器中源地址对应的数据搬移至目的地址。The data moving sub-module is used to move the data corresponding to the source address in the unified memory to the destination address when it is determined that the execution of the DMA flow control data moving task is completed.

在本发明的一种具体实施方式中,第二判断子模块具体为判断DMA流控信号是否为使能状态的模块;In a specific implementation manner of the present invention, the second judging submodule is specifically a module that judges whether the DMA flow control signal is in an enabled state;

任务执行子模块具体为当确定DMA流控信号为使能状态时,确定存在DMA流控数据搬移任务,并执行DMA流控数据搬移任务的模块。The task execution sub-module is specifically a module that determines that there is a DMA flow control data moving task when it is determined that the DMA flow control signal is enabled, and executes the DMA flow control data moving task.

在本发明的一种具体实施方式中,该装置还可以包括:In a specific embodiment of the present invention, the device may also include:

第二判断模块,用于在接收到源地址对应的目标外设发送的数据搬移请求之后,判断数据搬移请求是否为目标数据搬移任务对应的末次数据搬移请求;The second judging module is used to judge whether the data migration request is the last data migration request corresponding to the target data migration task after receiving the data migration request sent by the target peripheral device corresponding to the source address;

任务执行状态确定模块,用于当确定数据搬移请求为目标数据搬移任务对应的末次数据搬移请求时,在将统一存储器中源地址对应的数据搬移至目的地址之后,确定完成对目标数据搬移任务的执行。The task execution state determination module is used to determine that the data movement request for the target data movement task is completed after the data corresponding to the source address in the unified memory is moved to the destination address when it is determined that the data movement request is the last data movement request corresponding to the target data movement task. implement.

在本发明的一种具体实施方式中,数据搬移模块54具体为通过Avalon总线将统一存储器中源地址对应的数据搬移至目的地址的模块。In a specific implementation manner of the present invention, the data moving module 54 is specifically a module that moves the data corresponding to the source address in the unified memory to the destination address through the Avalon bus.

相应于上面的方法实施例,参见图6,图6为本发明所提供的数据搬移设备的示意图,该设备可以包括:Corresponding to the above method embodiment, refer to FIG. 6, which is a schematic diagram of the data moving device provided by the present invention. The device may include:

存储器61,用于存储计算机程序;memory 61 for storing computer programs;

处理器62,用于执行上述存储器61存储的计算机程序时可实现如下步骤:When the processor 62 is used to execute the computer program stored in the memory 61, the following steps can be realized:

接收目标数据搬移任务对应的配置信息;对配置信息进行解析,得到源地址、目的地址、以及流控类型;判断流控类型是否为外设流控;若是,则当接收到源地址对应的目标外设发送的数据搬移请求时,将统一存储器中源地址对应的数据搬移至目的地址。Receive the configuration information corresponding to the target data migration task; parse the configuration information to obtain the source address, destination address, and flow control type; determine whether the flow control type is peripheral flow control; if so, when receiving the target address corresponding to the source address When the data transfer request is sent by the peripheral, the data corresponding to the source address in the unified memory is moved to the destination address.

对于本发明提供的设备的介绍请参照上述方法实施例,本发明在此不做赘述。For the introduction of the device provided by the present invention, please refer to the above method embodiment, and the present invention will not repeat it here.

实施例四:Embodiment four:

相应于上面的方法实施例,本发明还提供一种计算机可读存储介质,计算机可读存储介质上存储有计算机程序,计算机程序被处理器执行时可实现如下步骤:Corresponding to the above method embodiments, the present invention also provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the following steps can be implemented:

接收目标数据搬移任务对应的配置信息;对配置信息进行解析,得到源地址、目的地址、以及流控类型;判断流控类型是否为外设流控;若是,则当接收到源地址对应的目标外设发送的数据搬移请求时,将统一存储器中源地址对应的数据搬移至目的地址。Receive the configuration information corresponding to the target data migration task; parse the configuration information to obtain the source address, destination address, and flow control type; determine whether the flow control type is peripheral flow control; if so, when receiving the target address corresponding to the source address When the data transfer request is sent by the peripheral, the data corresponding to the source address in the unified memory is moved to the destination address.

该计算机可读存储介质可以包括:U盘、移动硬盘、只读存储器(Read-OnlyMemory,ROM)、随机存取存储器(Random Access Memory,RAM)、磁碟或者光盘等各种可以存储程序代码的介质。The computer-readable storage medium may include: U disk, mobile hard disk, read-only memory (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), magnetic disk or optical disk, etc., which can store program codes. medium.

对于本发明提供的计算机可读存储介质的介绍请参照上述方法实施例,本发明在此不做赘述。For the introduction of the computer-readable storage medium provided by the present invention, please refer to the foregoing method embodiments, and the present invention will not repeat them here.

本说明书中各个实施例采用递进的方式描述,每个实施例重点说明的都是与其它实施例的不同之处,各个实施例之间相同或相似部分互相参见即可。对于实施例公开的装置、设备及计算机可读存储介质而言,由于其与实施例公开的方法相对应,所以描述的比较简单,相关之处参见方法部分说明即可。Each embodiment in this specification is described in a progressive manner, each embodiment focuses on the difference from other embodiments, and the same or similar parts of each embodiment can be referred to each other. As for the device, equipment and computer-readable storage medium disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and for relevant details, please refer to the description of the method part.

本文中应用了具体个例对本发明的原理及实施方式进行了阐述,以上实施例的说明只是用于帮助理解本发明的技术方案及其核心思想。应当指出,对于本技术领域的普通技术人员来说,在不脱离本发明原理的前提下,还可以对本发明进行若干改进和修饰,这些改进和修饰也落入本发明权利要求的保护范围内。In this paper, specific examples are used to illustrate the principles and implementation methods of the present invention, and the descriptions of the above embodiments are only used to help understand the technical solutions and core ideas of the present invention. It should be pointed out that for those skilled in the art, without departing from the principle of the present invention, some improvements and modifications can be made to the present invention, and these improvements and modifications also fall within the protection scope of the claims of the present invention.

Claims (10)

1.一种数据搬移方法,其特征在于,包括:1. A method for moving data, characterized in that, comprising: 接收目标数据搬移任务对应的配置信息;Receive the configuration information corresponding to the target data migration task; 对所述配置信息进行解析,得到源地址、目的地址、以及流控类型;Analyzing the configuration information to obtain a source address, a destination address, and a flow control type; 判断所述流控类型是否为外设流控;Judging whether the flow control type is peripheral flow control; 若是,则当接收到所述源地址对应的目标外设发送的数据搬移请求时,将统一存储器中所述源地址对应的数据搬移至所述目的地址,所述统一存储器为各外围设备统一使用的FIFO存储器。If so, when receiving the data transfer request sent by the target peripheral device corresponding to the source address, the data corresponding to the source address in the unified memory is moved to the destination address, and the unified memory is used uniformly by each peripheral device FIFO memory. 2.根据权利要求1所述的数据搬移方法,其特征在于,将统一存储器中所述源地址对应的数据搬移至所述目的地址,包括:2. The data moving method according to claim 1, wherein moving the data corresponding to the source address in the unified memory to the destination address comprises: 判断当前是否存在待执行的DMA流控数据搬移任务;Determine whether there is currently a DMA flow control data moving task to be executed; 若是,则执行所述DMA流控数据搬移任务;If so, then execute the DMA flow control data moving task; 判断所述DMA流控数据搬移任务是否执行完成;Judging whether the DMA flow control data moving task has been executed; 若是,则执行所述将统一存储器中所述源地址对应的数据搬移至所述目的地址的步骤。If yes, execute the step of moving the data corresponding to the source address in the unified memory to the destination address. 3.根据权利要求2所述的数据搬移方法,其特征在于,判断当前是否存在待处理的DMA流控数据搬移任务,包括:3. The data moving method according to claim 2, wherein judging whether there is currently a DMA flow control data moving task to be processed comprises: 判断DMA流控信号是否为使能状态;Determine whether the DMA flow control signal is enabled; 执行所述DMA流控数据搬移任务,包括:Execute the DMA flow control data moving task, including: 确定存在所述DMA流控数据搬移任务,并执行所述DMA流控数据搬移任务。It is determined that the DMA flow control data moving task exists, and the DMA flow control data moving task is executed. 4.根据权利要求1至3任一项所述的数据搬移方法,其特征在于,在接收到所述源地址对应的目标外设发送的数据搬移请求之后,还包括:4. The data migration method according to any one of claims 1 to 3, characterized in that, after receiving the data migration request sent by the target peripheral device corresponding to the source address, further comprising: 判断所述数据搬移请求是否为所述目标数据搬移任务对应的末次数据搬移请求;judging whether the data migration request is the last data migration request corresponding to the target data migration task; 若是,则在执行所述将统一存储器中所述源地址对应的数据搬移至所述目的地址的步骤之后,确定完成对所述目标数据搬移任务的执行。If yes, after performing the step of moving the data corresponding to the source address in the unified memory to the destination address, it is determined that the execution of the target data moving task is completed. 5.根据权利要求4所述的数据搬移方法,其特征在于,将统一存储器中所述源地址对应的数据搬移至所述目的地址,包括:5. The data moving method according to claim 4, wherein moving the data corresponding to the source address in the unified memory to the destination address comprises: 通过Avalon总线将统一存储器中所述源地址对应的数据搬移至所述目的地址。The data corresponding to the source address in the unified memory is moved to the destination address through the Avalon bus. 6.一种数据搬移装置,其特征在于,包括:6. A data transfer device, characterized in that it comprises: 信息接收模块,用于接收目标数据搬移任务对应的配置信息;An information receiving module, configured to receive configuration information corresponding to the target data migration task; 信息解析模块,用于对所述配置信息进行解析,得到源地址、目的地址、以及流控类型;An information parsing module, configured to parse the configuration information to obtain a source address, a destination address, and a flow control type; 第一判断模块,用于判断所述流控类型是否为外设流控;A first judging module, configured to judge whether the flow control type is peripheral flow control; 数据搬移模块,用于当确定所述流控类型为外设流控时,当接收到所述源地址对应的目标外设发送的数据搬移请求时,将统一存储器中所述源地址对应的数据搬移至所述目的地址,所述统一存储器为各外围设备统一使用的FIFO存储器。A data movement module, configured to unify the data corresponding to the source address in the memory when the flow control type is determined to be peripheral flow control, and when a data movement request sent by the target peripheral corresponding to the source address is received Moving to the destination address, the unified memory is a FIFO memory used uniformly by each peripheral device. 7.根据权利要求6所述的数据搬移装置,其特征在于,所述数据搬移模块包括:7. The data transfer device according to claim 6, wherein the data transfer module comprises: 第一判断子模块,用于判断当前是否存在待执行的DMA流控数据搬移任务;The first judging sub-module is used to judge whether there is currently a DMA flow control data moving task to be executed; 任务执行子模块,用于当确定当前存在待执行的DMA流控数据搬移任务时,执行所述DMA流控数据搬移任务;The task execution submodule is configured to execute the DMA flow control data movement task when it is determined that there is currently a DMA flow control data movement task to be executed; 第二判断子模块,用于判断所述DMA流控数据搬移任务是否执行完成;The second judging submodule is used to judge whether the DMA flow control data moving task has been executed; 数据搬移子模块,用于当确定所述DMA流控数据搬移任务执行完成时,将统一存储器中所述源地址对应的数据搬移至所述目的地址。The data moving sub-module is configured to move the data corresponding to the source address in the unified memory to the destination address when it is determined that the execution of the DMA flow control data moving task is completed. 8.根据权利要求6或7所述的数据搬移装置,其特征在于,还包括:8. The data transfer device according to claim 6 or 7, further comprising: 第二判断模块,用于在接收到所述源地址对应的目标外设发送的数据搬移请求之后,判断所述数据搬移请求是否为所述目标数据搬移任务对应的末次数据搬移请求;The second judging module is configured to judge whether the data migration request is the last data migration request corresponding to the target data migration task after receiving the data migration request sent by the target peripheral device corresponding to the source address; 任务执行状态确定模块,用于当确定所述数据搬移请求为所述目标数据搬移任务对应的末次数据搬移请求时,在将统一存储器中所述源地址对应的数据搬移至所述目的地址之后,确定完成对所述目标数据搬移任务的执行。A task execution status determining module, configured to, when determining that the data migration request is the last data migration request corresponding to the target data migration task, after moving the data corresponding to the source address in the unified memory to the destination address, It is determined that the execution of the target data moving task is completed. 9.一种数据搬移设备,其特征在于,包括:9. A data transfer device, characterized in that it comprises: 存储器,用于存储计算机程序;memory for storing computer programs; 处理器,用于执行所述计算机程序时实现如权利要求1至5任一项所述数据搬移方法的步骤。A processor, configured to implement the steps of the data transfer method according to any one of claims 1 to 5 when executing the computer program. 10.一种计算机可读存储介质,其特征在于,所述计算机可读存储介质上存储有计算机程序,所述计算机程序被处理器执行时实现如权利要求1至5任一项所述数据搬移方法的步骤。10. A computer-readable storage medium, wherein a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the data transfer as described in any one of claims 1 to 5 is realized. method steps.
CN202110211367.8A 2021-02-25 2021-02-25 A data transfer method, device, equipment, and computer-readable storage medium Active CN112947857B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110211367.8A CN112947857B (en) 2021-02-25 2021-02-25 A data transfer method, device, equipment, and computer-readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110211367.8A CN112947857B (en) 2021-02-25 2021-02-25 A data transfer method, device, equipment, and computer-readable storage medium

Publications (2)

Publication Number Publication Date
CN112947857A CN112947857A (en) 2021-06-11
CN112947857B true CN112947857B (en) 2023-02-28

Family

ID=76246183

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110211367.8A Active CN112947857B (en) 2021-02-25 2021-02-25 A data transfer method, device, equipment, and computer-readable storage medium

Country Status (1)

Country Link
CN (1) CN112947857B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113868039B (en) * 2021-08-30 2024-02-09 浪潮电子信息产业股份有限公司 Test method, device and related equipment
CN114490465B (en) * 2021-12-28 2024-04-26 北京奕斯伟计算技术股份有限公司 Data transmission method and device for direct memory access
CN115660941B (en) * 2022-12-27 2023-03-14 北京象帝先计算技术有限公司 Image moving method and device, electronic equipment and computer readable storage medium

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN100342359C (en) * 2004-12-24 2007-10-10 华为技术有限公司 Method of data interchange by using mode of direct memory access
CN100354842C (en) * 2005-02-23 2007-12-12 华为技术有限公司 Access device for direct memory access and method for implementing single channel bidirectional data interaction
CN102541780B (en) * 2011-12-15 2014-10-22 苏州国芯科技有限公司 Multi-data stream channel DMA (Direct Memory Access) system
US20130204962A1 (en) * 2012-02-02 2013-08-08 Texas Instruments Incorporated Network and peripheral interface circuits, systems and processes
CN109558348B (en) * 2018-12-19 2024-10-01 深圳开立生物医疗科技股份有限公司 Data moving method, device and system
CN111352869B (en) * 2018-12-24 2024-05-07 深圳市中兴微电子技术有限公司 Data transmission method and device and storage medium
CN109766296A (en) * 2019-01-08 2019-05-17 郑州云海信息技术有限公司 A data processing method, device, system and DMA controller

Also Published As

Publication number Publication date
CN112947857A (en) 2021-06-11

Similar Documents

Publication Publication Date Title
CN112947857B (en) A data transfer method, device, equipment, and computer-readable storage medium
WO2022156370A1 (en) Fpga-based dma device and dma data migration method
CN106951388B (en) PCIe-based DMA data transmission method and system
CN111190842B (en) Direct memory access, processor, electronic device and data transfer method
CN109558344B (en) A DMA transmission method suitable for network transmission and DMA controller
US20120303846A1 (en) Method for implementing audio transmission and mobile terminal
CN116610608B (en) Direct memory access descriptor processing methods, systems, devices, equipment and media
CN112100090A (en) Data access request processing method, device, medium and memory mapping controller
CN102841871B (en) Pipeline read-write method of direct memory access (DMA) structure based on high-speed serial bus
CN102841870B (en) General direct memory access (DMA) structure based on high-speed serial bus and pre-read method
WO2022032990A1 (en) Command information transmission method, system, and apparatus, and readable storage medium
CA2987807A1 (en) Computer device and method for reading/writing data by computer device
CN118550857B (en) Data transmission method, device, electronic device and storage medium
CN106681948A (en) Logic control method and device of programmable logic device
CN112817899B (en) PCIE-based data transmission method and device, storage medium and electronic equipment
JP2008015876A (en) Data access system, data access device, data access integrated circuit, and data access method
CN116737083B (en) Memory access circuit, memory access method, integrated circuit, and electronic device
CN109800202B (en) PCIE (peripheral component interface express) -based data transmission system, method and device
CN109992539B (en) Double-host cooperative working device
US20060236001A1 (en) Direct memory access controller
CN115629711A (en) Packet writing alignment method, system, device and medium
CN103399949B (en) A kind of database storage block state control method and device
CN116601618B (en) A communication method and device based on USB
CN118151851B (en) Solid state disk reading method, device, equipment and readable storage medium
CN111930214B (en) A method and device for resetting an FPGA accelerator card, and an FPGA accelerator card

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant