Omapl138的EDMA关于ping-pong buffer的操作

Although the previous configuration allows the EDMA3 to serveice a peripheral continuously,it present a number of restrictions to the CPU.Since the input and output buffers are continously being filled/emptied,the CPU must match the pace of the EDMA3 very closely in order to process the data.The EDMA2 recevie data must always be placed in memory before the CPU accesses it, and the CPU must provide the output data before the EDMA3 transfers it. Though not impossible, this is an unnecessary challage. It is particularly difficult in a 2-level cache scheme.

虽然之前的操作允许EDMA3对外设进行连续的读取,但是它也产生了对CPU的很多限制。因为当输入和输出缓冲区被连续的填充和取空的时候,为了满足数据处理的要求,CPU必须和EDMA3的处理进度密切匹配。在CPU要对内存里面的数据进行处理之前,EDMA接收到的数据必须已经被放置到了对应内存上,并且CPU必须在EDMA3传输之前提供这些要往出发的数据。虽然是不可能的,但是它确实是一个无法避免的挑战。尤其是在二级缓存的模式下,显得尤其困难。

Ping-pong buffering is a simple technique that allows the CPU activity to be distanced from the EDMA3 activity. This means that there are multiple (usually two) sets of data buffers for all incoming and outgoing data streams.While the EDMA3 transfers the data into and out of the ping buffers, the CPU manipulates the data in the pong buffers. When both CPU and EDMA2 activity completes, they switch. The EDMA3 then writes over the old input data and transfers the new output data .Figure 18-28 shows the ping-pong scheme for this example.

Ping-pong 缓冲是一种简单的技术,它能够让CPU和EDMA的操作隔离开来。它通常使用两个数据缓冲来处理进来和出去的数据流。当EDMA3 从ping缓冲取出或者输入数据时,CPU在pong缓冲操作数据。当CPU和EDMA3的操作都结束之后,它们进行互换。EDMA3 会写下旧的输入和传输新的输出。Figure 18-28显示的就是这个过程。

To change the continuous operation example, such that a ping-pong buffering scheme is used, the DMA channels need only a moderate change. Instead of one link parameter set, there are two; one for transferring data to/from the ping buffers and one for transferring data to/from the pong buffers. As soon as one transfer completes, the channel loads the PaRAM set for the other and the data transfers continue. Figure 18-29 shows the DMA channel configuration required.

为了改变连续操作的弊端,ping-pong 缓冲技术被引入了。DMA通道仅仅需要微小的改变。将原先的一个链接参数取而代之为两个链接参数设置;一个用来在ping缓冲上传入和传出数据,一个用来在pong缓冲上传入和传出数据。这个一结束,另外一个载有链接参数的缓冲就会继续操作,保证数据传输的连续。Figure 18-29显示的是被请求的DMA通道参数设置。

Each channel has two link parameter sets; ping and pong. The DMA channel is initially loaded with ping parameters(Figure 18-29).The link address for the ping set is set to the PaRAM offset of the pong parameter set(Figure 18-30). The link address for the pong set is set to the PaRAM offset of the ping Parameter set(Figure 18-31). The channel options,count values,and index values are all identical between the ping and pong parameters for each channel. The only differences are the link address provided and the address of the data buffer.

每个参数都有两个链接参数设置:ping和pong. DMA通道初始化的时候装载ping参数(图18-29)这个对ping操作的链接地址被加载在pong参数设置的PaRAM偏移上(图18-30)。这个对pong操作的链接地址被加载在ping参数设置的PaRAM偏移上(图18-31)。ping和pong对各自通道的选项,计数值和索引值都完全一样,唯一不同的是提供的链接地址和数据缓冲的地址。
在这里插入图片描述

在这里插入图片描述

在这里插入图片描述
在这里插入图片描述

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值