dma - CS1372 CS1372: HELPING TO PUT THE COMPUTING IN ECE...

Info iconThis preview shows pages 1–13. Sign up to view the full content.

View Full Document Right Arrow Icon
CS1372: HELPING TO PUT THE COMPUTING IN ECE CS1372 DMA
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
CS1372: HELPING TO PUT THE COMPUTING IN ECE Understanding DMA Suppose you have a block of shorts whose starting address is in a pointer: u16 *source; And you want to move the shorts to a location whose starting address is in a pointer: u16 *dest; And you have the number of shorts: int count;
Background image of page 2
CS1372: HELPING TO PUT THE COMPUTING IN ECE You can code void transfer(u16*source, u16*dest, int count) { int i; for(i=0; i<count; i++) { dest[i] = source[i]; } }
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
CS1372: HELPING TO PUT THE COMPUTING IN ECE Which is the same as void transfer(u16*source, u16*dest, int count) { int i; for(i=0; i<count; i++) { *dest++ = *source++; } }
Background image of page 4
CS1372: HELPING TO PUT THE COMPUTING IN ECE Which is the same as void transfer(u16*source, u16*dest, int count) { while(count-- > 0) { *dest++ = *source++; } }
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
CS1372: HELPING TO PUT THE COMPUTING IN ECE At which point. .. ...a friendly CmpE can make a circuit that does the same thing!
Background image of page 6
CS1372: HELPING TO PUT THE COMPUTING IN ECE Before Processor Memory
Background image of page 7

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
CS1372: HELPING TO PUT THE COMPUTING IN ECE After Processor Memory DMA Src Dst Ctl N
Background image of page 8
CS1372: HELPING TO PUT THE COMPUTING IN ECE Options void transfer(u16*source, u16*dest, int count) { while(count-- > 0) { *dest ++ = *source ++ ; } }
Background image of page 9

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
CS1372: HELPING TO PUT THE COMPUTING IN ECE Fill void transfer(u16*source, u16*dest, int count) { while(count-- > 0) { *dest ++ = *source; } }
Background image of page 10
CS1372: HELPING TO PUT THE COMPUTING IN ECE void transfer(u16*source, u16*dest, int count) { while(count-- > 0) { *dest = *source ++ ; } }
Background image of page 11

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
CS1372: HELPING TO PUT THE COMPUTING IN ECE Reverse void transfer(u16*source, u16*dest, int count) { while(count-- > 0) { *dest-- = *source ++ ; } }
Background image of page 12
Image of page 13
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 27

dma - CS1372 CS1372: HELPING TO PUT THE COMPUTING IN ECE...

This preview shows document pages 1 - 13. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online