Other Parts Discussed in Thread: EK-TM4C1294XL
I am doing some design feasibility work. I am trying to understand the performance of the uDMA in the TM4C1290. My primary concern is whether I will have adequate DMA performance to keep up with asynchronous data acquisition from a peripheral port register without losing any data. Hence, I am very interested in determining how long a data capture via DMA will take, prior to the next data sample’s arrival.
The central design is to read from a peripheral port register and transfer to a circular RAM buffer for latter processing. Although there is very little time between some sample bursts, on the average the rate is such that background processing of the data buffer is feasible.
I cannot use Ping-Pong because I need to avoid disturbing the existing elaborate interrupt structure by adding another ISR (for supporting ping-pong).
Therefore, I plan to use Scatter-Gather, with one ‘task’ for each transfer from the data port into the buffer. I will have an N entry circular buffer with a parallel list of N+1 tasks. Each task will be dedicated to transferring data to the corresponding position in the data buffer.
The last task in the list (N+1) will rewrite the primary control structure’s control field, so that the buffer is made circular. For expediency, only the 32-bit control field will be written by the task. I believe that there is no need to re-write the source and designation fields in the primary control structure, because they are not altered while the task list runs.
Q: Any comments on this overall design?
My analysis of my performance constraints will be greatly enhanced if you can answer the following questions. Please reference the question number in your answers.
Thanks!!
1. Cost of Scatter-Gather Unused Field - When using Scatter-Gather, it appears that there is the waste of transferring the ‘Unused’ field of a task in the task list to the alternate control structure. In other words, I am obliged to transfer all 4 words of the task (wasting one read and one write bus cycle), even though only the first 3 words are ‘live’. This is based on Figure 9-3 Memory Scatter-Gather, Setup and Configuration [DS-TM4C1290NCDT-15863.2743, dated June 18, 2014]. On the right column for the Channel Control Table, the example lists the control field as ITEMS = 12. There are indeed 3 tasks with 4 words each = 12 words. Question: Is the DMA controller smart enough to skip transferring the 4th (unused) field?
2. DMA Idle Cycles - During a Scatter-Gather DMA transfer, are there any bus idle cycles inserted by the DMA controller? Asked differently: Is every available bus cycle used to transfer data to (or from) the DMA controller and the transferred region (or the RAM-based control structures / task list)? When answering, disregard any bus cycles that are taken by the CPU.
3. Striped RAM - Can the DMA run at full speed concurrent with the CPU, given the following assumptions? In other words, will the DMA ever be slowed by bus contention with the CPU, given the following conditions? Assume:
a. The Scatter-Gather DMA mode is used to transfer data from a peripheral to a RAM buffer.
b. All RAM used by DMA is located in a dedicated section of striped section of RAM (say the top quarter), including:
i. Primary control structure.
ii. Alternate control structure.
iii. Task list.
iv. Destination RAM buffer.
c. The CPU never accesses any RAM in the DMA’s striped area while DMA is running.
d. Ignore any potential occasional contention between the CPU and DMA for access to the peripherals.
4. Peripheral Bus - When accessing a peripheral, does DMA have to wait for the CPU to have an idle bus cycle? Asked differently: Is DMA undelayed when accessing a peripheral as long as the CPU is not also accessing a peripheral? The crux of the question: Is there a peripheral bus that is separate from (and concurrent with) the main flash memory bus?
5. Read Frequency of Source and Destination Fields - During a DMA transfer, how often are the source and destination fields read from the RAM control structure? I believe that the answer is probably one of the following. Which one? (Alternatively, is there another answer?)
a. The fields are read once during startup of the DMA transfer. The fields are not reloaded after losing and subsequently regaining channel arbitration. In other words, the fields are remembered internally by the DMA controller for channel resumption after regaining arbitration.
b. The fields are read once during startup of the DMA transfer. The fields are read again, after resuming a transfer that has been interrupted by losing channel arbitration. In other words, the fields are forgotten by the DMA controller if the channel loses arbitration.
c. The fields are read once during startup of the DMA transfer. The fields are read again after every channel arbitration. The reloading occurs even if the current channel has not lost the arbitration.
d. The source field is re-read prior to every read cycle from the transferred memory area. The destination field is re-read prior for every write cycle to the transferred memory area. In other words, the source and destination are not maintained internally in the DMA controller between data transfers.
6. Write Frequency of Control Field - During a DMA transfer, how often is the control field written back to the RAM control structure? I believe that the answer is probably one of the following. Which one? (Alternatively, is there another answer?)
a. The control field is written only when the channel loses arbitration after a bust transfer.
b. The control field is written after each memory write cycle of transferred data in a burst transfer. During a bust transfer with N items, the control field will be written N times.
7. Read Frequency of Control Field – During a DMA transfer, how often is the control field read from the RAM control structure? I believe that the answer is probably one of the following. Which one? (Alternatively, is there another answer?)
a. The control field is read once during startup of the DMA transfer. The control field is not read again, even after losing and subsequently regaining channel arbitration. In other words, the field is remembered internally by the DMA controller for channel resumption after regaining arbitration.
b. The control field is read once during startup of the DMA transfer. The channel’s control field is read again, after resuming a transfer that has been interrupted by losing channel arbitration.
c. The control field is read once during startup of the DMA transfer. The control field is read again after every channel arbitration, even if arbitration was not lost.
8. Scenario: In Scatter-Gather mode, done with running one task in the alternate control structure, and ready to load the next task into the alternate control structure. Is the primary control structure reloaded into the DMA controller before the next task is DMA’ed from the task list to the alternate control structure? Alternatively, is the primary control structure remembered internally in the DMA controller while it runs the alternate control structure?