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.

Compiler/TMS320C6678: using circular addressing through C

Part Number: TMS320C6678

Tool/software: TI C/C++ Compiler

Hi to anybody

I am trying to find a way to use circular addressing through C code  with the C6678. If I understand right there

is no support for this in the compiler. So I thought of another way. I know how to update the AMR

register and fix one of the 8 registers that can work with circular addressing to be so.

However I need a way to use that register so I thought to pass a parameter to the routine which is

done on this specific register and then use it as the  pointer that will work circularly. My question is

how can I make this register not to be used by the compiler for other purposes and leave it for use

only for my purpose??? Perhaps declare it Volatile??? would that keep the register to be only the pointer I want?

Whatever if someone know about any support of the compiler conecrn operate circular addressing through C I would love to hear it.

Thanx.

Oded

  • Hi Oded,

    I've notified the sw team to elaborate if we can share something about this.

    Best Regards,
    Yordan
  • oded shahua said:

    My question is

    how can I make this register not to be used by the compiler for other purposes and leave it for use

    only for my purpose???

    Unfortunately, the C6000 compiler does not provide any feature like that.  

    I recommend you write the function which does circular addressing in linear assembly, then call it from C.  

    Thanks and regards,

    -George

  • Thanx George for your answer

    Probably you are right although it's quite disappointing that major feature in signal processing  like circular addressing

    is not supported from C. I wonder for what the possibility to put value in the AMR register from C languaue

    is given if actually I can't use the feature.

    Oded

  • oded shahua said:
    I wonder for what the possibility to put value in the AMR register from C languaue

    The __cregister Keyword allows access to the AMR register from the C language. However, since the compiler assumes all circular-addressing-enabled registers are set for linear addressing if the AMR register is changed in the C language to enable circular addressing then the addressing operations generated by the C compiler will no longer be valid.

    Therefore, as George has already said your only option for performing circular addressing is to write assembler.

  • Hi Chester and thanks for your reply again

    Yes I know how to change the AMR register and I know that if I change by that a register to be circular addressing

    then I need return the register to linear addressing at the end of the routine or wherever In the routine I don't need

    the circular addressing any more. More then that I know that I need to save the value of AMR at the beginning of

    interrupt routines that can occure during  a routine that use this circular addressing and set the AMR to linear addressing

    and at the end of the interrupt restore the value of AMR. however what I don't know is how to fix a circular buffering

    register to my purpose only.

    I had an idea that I am going to test soon to use the .CIRC directive of the Assemblaer through ASM statement in the

    C language that will give the specific register a name like variable and then use it as is. I assume that doing so will

    make sure that the register will not be used by the compiler in this routine for other purposes. I will be happy if

    you can confirm or deny this possibility.

    Thanx

    Oded

  • oded shahua said:
    I had an idea that I am going to test soon to use the .CIRC directive of the Assemblaer through ASM statement in the

    C language that will give the specific register a name like variable and then use it as is.

    The .CIRC directive is for the Assembly Optimizer tool, which processes a Linear Assembly file.

    Whereas the ASM statement in the C language inserts the requested directive into a Assembly Source file which is processed by the Assembler tool.

    Therefore it is not possible to use a .CIRC directive in a C language ASM statement; the Assembler tool reports that .CIRC is an illegal mnemonic.

    See Figure 1-1 TMS320C6000 Software Development Flow for how the tools interact.

    Therefore, to use .CIRC you will have to write your algorithm in a Linear Assembly file.

  • Thank you Chester