Using C6000 EDMA3 - Overview (12 of 15)
There are 15 parts to this series:
- Introduction to C6000 Architecture (1 of 15)
- C6000 Architecture (2 of 15)
- C6000 Optimizations – Overview (3 of 15)
- C6000 Optimizations – Part 1 (4 of 15)
- C6000 Optimizations – Part 2 (5 of 15)
- C6000 Optmizations – Lab (6 of 15)
- C6000 Cache – Overview (7 of 15)
- C6000 Cache – Part 1 (8 of 15)
- C6000 Cache – Part 2 (9 of 15)
- C6000 Cache – Part 3 (10 of 15)
- C6000 Cache – Lab (11 of 15)
- Using EDMA3 – Overview (12 of 15)
- Using EDMA3 – Part 1 (13 of 15)
- Using EDMA3 – Part 2 (14 of 15)
- Using EDMA3 – Part 3 (15 of 15)
Resources
Hey, Scott, so we ended up in Dallas, Texas.
We've gone from your home state for videos to my home state.
That's right.
--Dallas.
That's not your home state. That's kind of your home city, right?
This is where I live now, at least for now, Texas. And you've got your Texas Rangers hat on.
I do.
So you're at least rooting for the right team this time.
That's right.
Remember that, Carl.
[LAUGHTER]
So we're at one the [INAUDIBLE] of the iconic places for Dallas. You see the cattle drive back behind us that kind of represents a lot of what North Texas was in terms of Dallas-Fort Worth and cattle drive.
Are we supposed to be two of the cattle in the stream being steered by the cowboy back there?
I'm not going to go there-- not going to go there.
That's what I feel like.
It looks a little bit like [INAUDIBLE]. You've got all this [INAUDIBLE] and cattle linked together.
It does. It brings us to this point-- why are we here? We are introducing the EDMA chapter, EDMA Version 3. And this is going to be the introduction to that chapter. So we're going to talk about the basic functionality of the EDMA. What does an EDMA do from a basic point of view? It transfers stuff from one place to another
So in this introduction, I'm going to give a white board introduction to how do you start transfers, how do you configure transfers, and then when the transfer is done, what actions should take place. So I'll be doing the white board discussion. Scott's going to be answering some of my questions and [INAUDIBLE] going to give you an introduction to EDMA.
Instead of transporting cattle, we're going to transport information. [INAUDIBLE]
So here we go. Hey, Scott.
Yeah.
Man, it is so nice to be inside. It is hot out there-- 105 degrees.
It is.
And yesterday it was 108.
It was 108 yesterday.
We were by the steers.
So we're having a cool wave right now.
This is not a cool wave. This is not my definition. I'd like to be right here in the air conditioning. It's hot here in Dallas.
I like it. It's balmy outside.
You can have it. And I know you like to eat outside, as fresco dining. You can have that. For me, it'd be under water.
[INTERPOSING VOICES]
I don't just complain about everything, like you
OK, I accept that.
[LAUGHTER]
So anyway, folks, what we're here to do it in this video is introduce the chapter on the Enhanced DMA controller Version 3, or EDMA3. So Scott and I are just going to give you kind of an overview of the entire architecture, basically, or the capabilities of the EDMA, and then introduce the different parts, part 1, 2, and m that we're going to discuss in other videos.
Correct. We'll get into more of the details later. This kind of a high level overview.
Right. So, Scott, what in it's basic form, one sentence answer, what does an EDMA do? Or what's it supposed to do?
Direct memory access.
And that's helpful because of what?
It's Enhanced Direct Memory Access.
Oh, that's even more powerful.
That is the name of the peripheral. That's what it's named after. In the old days, peripherals it was a big deal when a peripheral could talk to memory. And a peripheral that had direct memory access was a big deal. It's old hat today. Lots of peripherals now today have access to memory.
But really, what it means is I have a peripheral that can move stuff around from one part of memory to another part of memory. Cloud, data, we don't care what it is.
So if I was to draw a very simplified picture of this, maybe we would have an address called here and maybe multiple pieces of something.
It might be a buffer.
A buffer, or this might be a peripheral and the [INAUDIBLE] would have one thing that it contains. And the point of the DMA is to copy something from here or transfer something from here over to there. So that's the whole--
Where here and there represent memory addresses, basically.
Right. This would be an address, a location. This would be a certain size or whatever, and then there, and so forth.
Yeah.
So that's the whole chapter right there. So I guess we're done can.
Could we do that with a CPU?
Oh, that's a good point. Actually, yes, I could read, write. If we were doing assembly, it would be load from this location, store from that location. Or if I was writing C, maybe I could do just like a mem copy, right?
Exactly.
And the CPU would be perform those loads and storage.
But now we have a peripheral piece of hardware that can do that for us, while a CPU does something else.
Which is very valuable .
If you're not using the DMA in most systems, you're not getting the best capability out of that device.
Not even close to the best capability.
Oftentimes it's not even close, yeah.
So if this was my goal is to transfer something from here to there, what does the DMA or the EDMA3 need to know about this transfer? So some people call this buffer descriptor or transfer configuration.
Needs to know here and there.
Maybe I'll just write up a T. I know you've answered the question twice now. But I'm trying not to listen to you.
Then don't ask the question.
All right. So we'll just start off with we need some data inside the transfer configuration or something to describe the transfer that we're doing.
Transfer configurations or transfer parameters--
That's the reason I like to put a T there. And the other names that we have for this, the documentation will call these parameter RAM sets. Now parameter, that would be like stores stats, different parameters. RAM means it's in RAM memory associated with the EDMA. So these things don't take room L1 or L2 or anything like that.
So the EDMA version of the DMA has its own built-in RAM.
Right.
And it's called the parameter RAM.
Or P Set.
Or P for short.
Right.
And these transfer configurations, that's where we store them, is in that one.
That's correct.
I need to have a source address--
A source address--
--here, which in our case, is here.
So that would be a source address.
Destination--
Destination--
--where we want to put it.
Destination address--
And how much, how big is--
Cost wise? $20. (LAUGHING) Oh, you mean size of the transfer. OK, so size, right that makes some sense. How big would you want size to be?
I'm trying to think of [INAUDIBLE]. Size, I want it to be fairly large, or I would want it to be anything from, say, one, all the way--
One byte?
--one byte, all the way up to the size of the memory on the device almost.
And as we get into the details, we'll talk about the how size broken up into different dimensions. You multiply all those together, and it's bigger than you can imagine. So that's certainly not a limitation. So we have a source, destination, and size transferring from here to there.
Now, if this was a peripheral-- and because we're using a white board, we do this.
Kind of like going from an A-to-D converter.
A-to-D converter, a serial core of any kind-- it's just got one memory map and location. So we're going to bring the value in, core is going to bring it in, and then we want to--
Will that change the size from only moving one thing?
Not really.
I may want to move from there to there, from there to there, so I might have a size still larger than one, Yes but what's going to change? How do I handle that situation?
We're going to talk about that in the basics section.
We are? OK.
Yeah, and we'll get into it a little bit, about how we kind of start the transfer, which we haven't talked about yet. I'm not sure exactly where you're leading. My brain is somewhere else, and this happens sometimes with live video.
Where were you going? You were going to use something called index?
No, I was actually going to talk about synchronization.
[INTERPOSING VOICES]
[LAUGHTER]
See, OK what I said. So the point is, so if we've got a peripheral and we get a value in here, would we want to change the location, like you said, if we want to do multiple moves, we've got data come in, we want to fill up the buffer.
Right.
Then after we transfer something from this location here to this location, so we've got this one taken care of, and this one's done--
Right
What are we going to want to do to this address?
Nothing.
It needs to stay where it is.
Stay right where it's at.
What about this guy?
This address does not change.
So the second one comes in here, and we want to move it to this location.
I need to increment this address.
So we call that indexing.
So we have an index register tells cost me how much I'm going to increment my source and destination point.
That's correct. And because you want that flexibility, both on the source and the destination side to be able to go increment by one, let's say, stay, increment by two, maybe go every other one, or in some cases, you may want to go backwards.
So plus, minus by a different value-- so index really-- I have indexes for both the source and the destination side.
Right, then you've got two. And we'll talk about when those come into play. So if you've used previous EDMAs before, DMAs on other processors, sometimes they call them like element, and then frame is a bunch of elements together, and then a block is a bunch of frames. So it's kind of three dimensions. It's similar to what we have here.
So we have index capability. Anything else that you look up here and say--
So you said something about synchronization. Is that where if I have an A converter, let's say, that I'm reading from, I'm guessing my DMA can read from that location faster than it can be killed by A-to-D converter.
Yeah. Right. So how would you, if you didn't have a DMA capability and a value showed up in a peripheral, what is the common way of knowing that that value is net peripheral?
Well, I would guess the CPU would get an interrupt--
An interrupt--
Just saying, there's something to come read.
So remember when we talked about this DMA capability is independent of the CPU. So you may take an interrupt. The CPU goes off and reads that value and puts it in this buffer over here, right?
Right. But we want the DMA to do it.
But then the CPU is busy doing that.
So can the DMA get interrupts? We call something else, right?
We call them something else. We call them events.
Events, OK.
So I'll put the big E up there and just call this events. So these are things that can start the transfer. And you are talking about one of them, and that is what I would call a synchronization signal, or you could just call it an event. So this is the peripheral gets a value, and it can send an interrupt to the CPU, or it can send an event to the DMA to say, go off and grab that value and put it in here based upon the information in that transfer configuration channel.
So most or all the peripherals on our devices that have an EDMA can send singles either event-- it interrupts to the CPU-- or events to the DMA.
That's correct.
What's another way we could kick off a-- couldn't I just do it manually, like a mem copy type of thing? So I could use an event from a peripheral. That's one option.
That's correct.
But the other one is just to kick it off?
It's just to say, I set up a transfer configuration or P set, and I just want it to go.
Go.
So that would be a manual start.
So we've got a situation here. Let me go back to the synchronous part. So I have a peripheral, serial port, or A-to-D convert or something, that's giving me values. And I've said, I want to take x number, some size number, let's say four values, and I fill a buffer there with four values. Think of that being in, like say, in the driver of a peripheral. A serial port driver might fill a buffer using the DMA.
And it's kind of done its job.
When it's done, [INAUDIBLE] zero--
Now what happens?
Now, when I want my CPU to get interrupted for that, so rather then getting an interrupt for every one of these, I get an interrupt once--
Per buffer.
Yeah-- a lot less interrupts.
So that would be-- you can stay close to where you're at. That would be called an action. So we have events that start things off, transfer configuration--
About how things get moved from one point to another.
Exactly. And then when this thing is done, like you said, count value or size goes to zero, I'm done doing what this thing told me I was doing.
Now we want the CPU or something else to happen.
What action do I want to take?
CPU's the one that came to mind as one of the first things.
And so you said interrupt the CPU.
Right.
So when this thing is done, I interrupt the CPU to say, hey, you got a buffer to fill. And if you've been watching some of our other videos and done some of our other labs, you would say, oh, well, that's the time when the audio buffer is full and you interrupt the CPU. What does the CPU do? Assemble four posts because we're using bios with TI-RTOS. And it unblocks that task, processes that butler, goes right back and waits for the next one.
Right.
Yeah. So that's one of the actions that we can take.
Whether it's interrupted CPU or setting flag that could be cold, either way, but interrupts are usually the more common one.
Right.
Well, sometimes I've have it where once I've moved one block in, I might want to go kick off another transfer of some sort. I want to have one thing kick off another thing.
You mean the completion of channel one kicking off another transfer?
Another transfer, so that's one way. Or the other one would be what if I had two buffers? Aren't we using two buffers in most of our examples?
Yeah, ping-pong buffer scheme, yeah.
So once I've filled [INAUDIBLE] up, then I want to go fill up the next one.
So maybe this is kind of like the ping buffer, let's say. And we have another copy of it down here. And maybe this is the pong. Is that what you're saying?
Yeah
So here we have an active channel, and it's copying things into ping, and now it's down.
[INAUDIBLE] this one.
It interrupts the CPU to say, you've got a buffer to fill.
Right.
And now I want to--
Reprogram this somehow.
--reprogram or reconfigure this same exact channel to point to the pong address.
Right. Correct.
And we call that linking.
Linking.
So linking, we have more than just one parameter RAM set or one P set.
It depends on the device that we're using.
Yeah, it depends on the device. But most processors that have an EDMA have 64 channels.
Right.
So 64 of these transfers could be active at any one time.
And why we have so many is that they're tied to different peripherals.
Correct.
And in some video systems you want lots of mem popping capabilities to stuff around. So you need lots of those. But there's another set of these, or additional sets of these P sets, which can contain other configurations that are sitting there ready to be reloaded into the active channel.
So rather than having the CPU as part of its interrupt service routine having to reprogram this-- that's going to take time-- I could actually have extra sets of these things waiting in the wings, ready to be copied in automatically by the peripheral itself.
Yes. And we call that linking. And that's an option-- by the way, I haven't written this up yet. But that's the options part of the configuration. That's where you say, oh, I want to interrupt the CPU. I want linking turned on. I'm a synchronized. I'm not synchronized.
[INTERPOSING VOICES]
All that stuff, right? And your upper level software drivers can help you program those options.
Right.
So another field is called link. So that means if I'm done with this transfer, let's say transferring to the ping, if you think about this, the source address wouldn't change in that case.
In that specific case, no.
You just want this channel to point to the pong buffer.
Right.
So this would be this parameter RAM set would be everything is the same except the destination.
But that said, we're still going to-- the hardware is still going to copy everything in there over everything in here.
So when I say, I want--
When I set this up the first time--
Linking turned on--
Right.
And I say, I want to link to that parameter RAM set, when I'm done, one of the actions that can happen is link. And it's going to copy the transfer configuration from my linked P set into the active one. Now, does that start the transfer? Is linking one of the things, the events, that can start the transfer?
No.
[INTERPOSING VOICES]
Linking is the same as auto-initialization.
Yeah. Auto-initialization, reload are common terms for linking.
Right.
So linking changes the transfer configuration of the current channel, but it does not start.
Kick it off. We need an event of some sort.
We still need at least one of these two things to kick it off.
Now just because I do linking, does that mean I can't get an interrupt anymore?
Oh, no. You can do both.
So any one or combination of these?
Totally flexible, very orthogonal-- you can do same stuff on source, on dest.
Now, linking sounds pretty good. Sounds like it's going to solve a lot of my problems. But there are times when, kind of like I mentioned earlier, when one of these things finishes, not only do I want to maybe go off and do something else, like--
--with the current channel, maybe.
But I want I want the actual effect of this ending to generate in an event.
Oh. That--
So like a connection from there--
Like a chain between the two.
Yeah, I want something from here to go around to there. [INAUDIBLE]
So that would be called-- and you wrote over what I-- but that looks good. It's blue and black. It's black and blue, Scott.
It's black and blue. Did I bruise you? Did I bruise your ego by doing this?
You did. So that is called chaining. So you can set up in the options register the ability to say when channel x has completed, I want the completion of that to be the starting event to kick off channel y. So not only is it an action here, it's also an event to the next channel.
Right.
So we have capability. What's interesting here is, Scott, when you're done with this first transfer, there's all kinds of options you have here.
Lots of options.
Would you like to interrupt the CPU? Yes. Would I like to link and reconfigure myself? Yes. Would you like to chain to another channel? Yes.
Do I want to do all three at the same time?
Yes.
Maybe. Yeah.
You've got all those capabilities.
All those options.
So the two most common confusions when you look into the EDMA are the following. One is the difference between linking and chaining. People go, oh, linking, chaining, kind of sounds-- there's links inside chains, right? They're chain links. So it's very common to confuse these two.
So what I like to do, and in this chapter, you'll see us really spread these apart-- linking, again, to say this again, is--
--reloading
--is reloading or auto-initialisation, a P set, the target being configure copied into the current one. It does not start a transfer.
Right.
Chaining is more of an event generation.
I would say so. It's really one channel kicking off another channel.
Correct.
So it's an action on one.
An event on another channel, yes.
So those are very--
No reloading done during chaining.
Correct if you want both, you've got use both.
Yes.
This video is part of a series
-
C6000™ embedded design workshop
video-playlist (15 videos)