This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

EDMA3 in DSP TCI6488

Hello,

Is it possible to do random (variable-offset) scattering of data in a source array to a destination array using the EDMA3 module 

Ex:

Source[10] = {1,2,3,4,5,6,7,8,9,10}

I want the destination to be somthing like this

Destination[10] = { 2,7,8,1,3,10,9,5,4,6} --> any pattern

  • I'm pretty sure this is possible, though it's not easy.  This is something I've wanted to write an app note or wiki for quite some time though have just never gotten around to trying it out.  I'm pretty sure this can be accomplished through chaining and self-modifying transfers.  For example, you could have an array in memory that contains all of the addresses of the data you want accessed.  You would then kick off an EDMA transfer such that the first transfer copies an element from that array into the corresponding parameter RAM location.  It would then chain to that channel and it would move that data.

    That's a high-level overview.  If you decide to actually implement it then I can give you a little more assistance with setting up the chaining and completion interrupts.

    Brad

  • Hello Brad,

    Thanks for your reply, i have the following concerns.

    This means that every transfer request needs to do the following steps

    1) copy the data from the source array to the destination array

    2) modify the source address in the PaRAM set  by copying the next address from an array (a different source address) to the PaRAM

    3) modify the destination address  in the PaRAM set  by copying the next address from an array (a different source address) to the PaRAM, this step is optional

    I don't think that this can be achived by a single transfer request given that the prementioned arrays doesn't have a fixed offset between them

    Can this be proken down into two or three linked PaRAM sets whereas the first one copies the actual data from the source to the destination and the other two copies the following source and destination addresses from the arrays to the first PaRAM set.

  • I don't think I explained it well enough.  [:)]  Let me try again.

    So you would need to define an additional array.  Using your initial example, it would be something like this:

    transfer_array[10] = { &Dest[1], &Dest[6], &Dest[7], &Dest[0], &Dest[2], &Dest[6], &Dest[9], &Dest[8], &Dest[4], &Dest[3], &Dest[5] };

    You would need to utilize 2 EDMA channels to pull this off, let's say chan0 and chan1.  Let's say you utilize Param0 and Param1 respectively.

    Chan0/Param0:

    • ACNT=4 (size of each element)
    • src = transfer array
    • BCNT = 10 (number of transfers)
    • dst = Param1.dst
    • SRCBIDX = 4 (contiguous data)
    • DSTBIDX = 0 (fixed)
    • OPT.ITCCHEN = 1 (intermediate chaining)
    • OPT.TCCHEN = 1 (final chaining)
    • OPT.ITCINTEN = 0 (no intermediate completion interrupt)
    • OPT.TCINTEN = 0 (no final completion interrupt)
    • CCNT = 1;
    • TCC = 1 (to chain to Param1)
    • A-synchronized

    Chan1/Param1

    • ACNT=4
    • src = Source
    • BCNT = 10
    • dst = don't care (will be written by Chan0
    • SRCBIDX = 4 (contiguous data)
    • DSTBIDX = don't care (the updated dst will get overwritten by Chan0)
    • OPT.ITCCHEN = 1 (intermediate chaining)
    • OPT.TCCHEN = 0 (NO final chaining)
    • OPT.ITCINTEN = 0 (no intermediate completion interrupt)
    • OPT.TCINTEN = 1 (final completion interrupt)
    • CCNT = 1
    • TCC = 0 (chain to Chan0)
    • A-synchronized

    So you will start off this whole process with a single sync event to Chan0, and then the following occurs

    Transfer of element 1:
    Chan0 transfers transfer_array[0] to Param1.dst
    Chan0 intermediate chains to Chan1 which then transfers Source[0] to dst (as specified by transfer_array)
    Chan1 intermediate chains back to Chan0

    Transfer of element 2:
    Chan0 transfers transfer_array[1] to Param1.dst
    Chan0 intermediate chains to Chan1 which then transfers Source[1] to dst (as specified by transfer_array)
    Chan1 intermediate chains back to Chan0

    Transfer of element 3:
    Chan0 transfers transfer_array[2] to Param1.dst
    Chan0 intermediate chains to Chan1 which then transfers Source[2] to dst (as specified by transfer_array)
    Chan1 intermediate chains back to Chan0

    Transfer of element 4:
    Chan0 transfers transfer_array[3] to Param1.dst
    Chan0 intermediate chains to Chan1 which then transfers Source[3] to dst (as specified by transfer_array)
    Chan1 intermediate chains back to Chan0

    :

    :

    Transfer of element 9:
    Chan0 transfers transfer_array[8] to Param1.dst
    Chan0 intermediate chains to Chan1 which then transfers Source[8] to dst (as specified by transfer_array)
    Chan1 intermediate chains back to Chan0

    Transfer of element 10:
    Chan0 transfers transfer_array[9] to Param1.dst
    Chan0 final chains to Chan1 which then transfers Source[9] to dst (as specified by transfer_array)
    Chan 1 generates final completion interrupt to CPU

     

  • Hello Brad,

    I implemented the solution you suggested and it worked fine

    I will extend it to use a source-addresse array and a destination-addresses array to be more flexible

    Thanks Alot  [:Y]