Ameba-D User Manual
User Manual All information provided in this document is subject to legal disclaimers. © REALTEK 2019. All rights reserved.
118
At time T5 the destination peripheral requests the last burst transaction in the block transfer to the destination. At this point, the channel FIFO
is empty. The number of bytes that must be fetched from the source peripheral to complete the block transfer to the destination is equal to 4 *
4 = 16 bytes. Since 16 bytes is not less than
src_msize_bytes
(16 bytes), the source does not enter the Single Transaction Region. The DMAC
waits for a burst request from the source peripheral, which occurs at time T6. Upon completion of this burst request at time T7, the DMAC
signals a source block transfer completion and asserts dma_finish[0]. Upon completion of the last destination burst transaction at time T8, the
DMAC signals a destination block transfer completion and asserts dma_finish[1] to the destination.
Note that when data pre-fetching is enabled, CFG
x
.FCMODE = 0, the maximum amount of data that can be lost depends on whether the last
transaction in the block transfer to the destination is a single transaction or burst transaction. In the worst case scenario, the DMAC has pre-
fetched enough data from the source to fill the channel FIFO when the last transaction is signalled by the destination peripheral.
The maximum amount of data that can be lost is:
Last transaction in block transfer is a single transaction:
DMAH_CH
x
_FIFO_DEPTH -
dst_single_size_bytes
[refer to equation (1)]
Last transaction in block transfer is a burst transaction:
DMAH_CH
x
_FIFO_DEPTH -
dst_burst_size_bytes
[refer to equation (2)]
If this equation is <= 0, then no data is lost.
Thus, if the last transaction in the block is a burst transaction and equation (2) is less than zero, then no data can be lost when CFG
x
.FCMODE =
0. There is one exception to this, as outlined in Example 8.
Enabling data pre-fetching may reduce the latency of the DMA transfer when the destination is the flow controller.
Observation:
For a source peripheral that is not read-sensitive (such as memory), data pre-fetching should be enabled – that is, CFG
x
.FCMODE
= 0 – in order to reduce the transfer latency when the destination is the flow controller. If the source peripheral is a read-sensitive device (such
as a source FIFO), then data pre-fetching should be disabled – that is, CFG
x
.FCMODE = 1 – when the destination peripheral is the flow
controller.
9.2.8.1.8
Example 8
Scenario
: Data loss when destination is flow controller and data pre-fetching is disabled; CFG
x
.FCMODE = 1.
This scenario arises when CFG
x
.FCMODE = 1:
CTL
x
.SRC_TR_WIDTH <= CTL
x
.DST_TR_WIDTH
CTL
x
.SRC_TR_WIDTH > CTL
x
.DST_TR_WIDTH
Case 1 – CTLx.SRC_TR_WIDTH <= CTLx.DST_TR_WIDTH
In this case, the DMAC controls the transfer of data from the source, such that at any time there is at most enough data to complete the
current transaction – single or burst – to the destination. If there is currently no active transaction to the destination, then the channel FIFO is
empty and no data is pre-fetched from the source, even if the source has an active transaction request. If both the source and destination are
requesting, then the DMAC fetches only enough data from the source to complete the current destination transaction, and no more.
Therefore, there can never be any data loss.
Case 2 – CTLx.SRC_TR_WIDTH > CTLx.DST_TR_WIDTH
In this example, assume the parameters in Table 9-11.
Table 9-11 Parameters in transfer operation – Example 7, Case 2b
Parameter
Description
CFG
x
.FCMODE = 1
Data pre-fetching disabled
CTL
x
.BLOCK_TS =
x
–
CTL
x
.SRC_MSIZE = 3’b001
Decode value = 4
CTL
x
.DEST_MSIZE = 3’b001
Decode value = 4
CTL
x
.SRC_TR_WIDTH = 3’b011
64 bits
CTL
x
.DST_TR_WIDTH = 3’b010
32 bits
CTL
x
.TT_FC = 3’b111
Peripheral to Peripheral transfer with destination as flow controller
DMAH_CH
x
_FIFO_DEPTH = 32 bytes
–
Realtek confidential files
SZ99iot
2019-05-15 10:08:03