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.

C674x Circular buffer addressing

Hi,

 

The C55x DSP seems to support a circular addressing in hardware. Does the C674x have such features as well? The datasheet mentions 'Hardware Support for Module Loop Operation', but it seems that that refers to the loop execution buffer for software pipelined loops (SPLOOP).

What I want to achieve is something like this:

for (index=0;index<4;index++)

buffer[(offset+index)%4]=calculate();

 

This situation can of course be efficiently coded by using &(4-1) instead of %4, but it get's inefficient when the modulo argument is not a power of 2. So I was wondering whether the hardware contains instructed to do that efficiently.

 

Regards,

 

Remco Poelstra

  • Hi Remco,

    Thanks for your post.

     I don't think there are other instructions other than SPLOOP (loop execution buffer). But you shall introduce loop buffer count register (LBC) in your code, whenever SPLOOP nstruction is executed, you shall increment loop the buffer count register until it reaches/equals the maximum iteration interval and put an if condition, when it reaches the iteration interval, LBC resets to zero and also you shall try decrementing the inner loop count register (ILC) at this point of time.

    For more information, Please check the below C674x  DSP instruction set and kindly check Section 7.4.2:

    http://www.ti.com/lit/ug/sprufe8b/sprufe8b.pdf

    Thanks & regards,

    Sivaraj K

    ------------------------------------------------------------------------------------------------
    Please click the
    Verify Answer button on this post if it answers your question.
    ------------------------------------------------------------------------------------------------
     

     

     

  • Hi Sivaraj,

    Thanks for your reply.

    I'm very sorry, but I do not see the relevance of the LBC and ILC registers related to circular addressing of a buffer. Please note that I need the circular addressing outside of an SPLOOP'ed loop.

    What I actually need is an efficient implementation of the '%' operator, for non power of 2 values.

    Kind regards,

    Remco Poelstra

  • Hi Remco,

    Thanks for your post.

    I don't think we have modulo operator (%) instruction with non power of 2.

    We do have Galois field multiply hardware on the DSP, which is GMPY4 based out of modulo 2 & modulo 5 arithmetic operations. The GMPY4 instruction performs four parallel operations on 8-bit packed data on the .M unit.

    For more information, Please check the below link:

    http://www.ti.com/lit/ug/sprufe8b/sprufe8b.pdf

    Thanks & regards,

    Sivaraj K

    ------------------------------------------------------------------------------------------------
    Please click the
    Verify Answer button on this post if it answers your question.
    ------------------------------------------------------------------------------------------------