AnsweredAssumed Answered

MDMA channel selection (BF561)

Question asked by Laz on Jul 23, 2010
Latest reply on Jul 26, 2010 by gyi

I would like to compare two image files stored in SDRAM.  My comparison is more complicated than shown here.  Per EE-276, each image is located in a separate SDRAM Bank, as is the resulting image.

 

In pseudo-code:

 

buffer1, buffer2, buffer3 hold one line of pixels, in L2 memory

 

for (1 to numLines)

     MDMA copy Image1Line(i) to buffer1

     MDMA copy Image2Line(i) to buffer2

 

     for (1 to pixelsPerLine)

          buffer3 = buffer1 - buffer2

     next pixel

 

     MDMA copy buffer3 to Image3Line(i)

next line

 

There are two MDMA engines, each having two channels (S0/D0 and S1/D1).  Which is the best way to arrange these for the 3 MDMA transfers?  If you unroll the loop, you can see that all 3 might run at the same time:

 

MDMA copy buffer3 to Image3Line(i)

MDMA copy Image1Line(i) to buffer1

MDMA copy Image2Line(i) to buffer2

... wait for buffer2 write to complete

 

Any wisdom here?

Outcomes