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.

CCS5 Floating Point Support

I'm running CCS Version 5 Simulator.  I've attempted to use the A8 simulator but I don't think one exists.  At least I can only find R4.   I'm running R4  with floating point enabled VFPv3D16.  It compiles OK but crashes and after reviewing the disassembly it looks like the compiler does not handle things on the argument stack properly.  Simple dot products don't seem to work correctly either.

 

Anyone have similar experiences?  Is there A8 support on CCS 5?   Also, is there a way to view the registers as floating point numbers?

Many thanks.

 

Brian

  • Brian,

    To date CCS does not have a Cortex A8 simulator.

    Regarding the issues with the argument stack, would you mind sending a testcase that shows the issue? Since you are seeing this in the disassembly, I imagine the compiler may be at fault but this would require further investigation (the testcase goes a long way to help with this).

    The registers can be added to the Expressions view by using their names starting with upper caps (check the attached screen).

    Regards,

    Rafael

  • Rafael

     

    Thank you for your reply. I will check out adding registers using Expressions.   Below is a function call:

    Please see the attached Word doc.  BTW:  This happens with the optimizer turned on.

     

    The first Picture shows the following:

           SimpleInterpolateLSF(syntdenum, weightdenum,
               lsf, lsfdeq, iLBCenc_inst->lsfold,
               iLBCenc_inst->lsfdeqold,10, iLBCenc_inst);

     

    The number 10 is the 3rd item on the stack  at R13 + 8.

     

    The second picture  is after the function is stepped into.   R4 gets loaded with R13 + 0x80.  For some reason R4 is used as length in the following 2 calculations:

    MOV R12, R2, R4, LSL #2  it should be MOV R12,R2,R12, #2

     

    Hopefully this is clear.  Again, thank you for your help.

     

    Do you know when A8 will be supported?

     

    Brian

     

    CCS5_Sim_1.docx
  • Brian,

    Sorry, what I meant by testcase was a small project that could be compiled here at TI, so we would be able to experiment with the code and better investigate this. I can try to create a small project that has multiple parameters to a function call, but I cannot be sure if the issue will pop up.

    If you are willing to send your complete project (the quickest way to see this issue and start working on it), then we could talk in private via friendship request.

    Let me know what do you prefer, ok?

    Cheers,

    Rafael

  • Rafael

     

    I'd be happy to put a test case together but you know how that works, the compiler may behave properly.  In any event I will try.

     

    Thanks Again

    Brian

  • Rafael

     

     I can display the registers in the Expressions window but there doesn't seem to be a number format for floating point.  Do I need to cast or something?

     

    Thanks,

    Brian

  • Brian,

    Yes, you can typecast the register value. Check the attached screen.

    I was experimenting here with some test code I had but still couldn't see any issues. What exactly are the compiler options used?

    Regards,

    Rafael

  • Rafael

     

    Thanks for the info!

     

    I attached a word doc with 2 compiler windows and a linker window.  If you need more info please let me know.

     

    Best Regards

    Brian

    CCS5_Sim_2.docx
  • Hi Rafael

     

    I have created a small project that just floats an integer counter and loads into 2 floating point arrays. As you can see from the Expressions window it doesn't seem to work.  Also  I don't know how to view the extended single precision registers.  I'll send the project in the next post because I can't seem to attach 2 files in one post.

     

    Thanks!

    Brian

    CCS5_Sim_3.docx
  • Brian,

    I found out the code you sent does not work correctly as well; however, during the tests a colleague found some details that are relevant to this issue:

    • According to the reference below the R4 simulator does not model the FPU, thus rendering the use of the VFP option unusable in this target:

    http://processors.wiki.ti.com/index.php/Cortex-R4_CPU_Functional_Simulator

    • If this option is removed and --float_support is left blank (allowing the float operations to done in software), the correct values are being assigned to the array when running in Cortex R4 simulator
    • Compiling for Cortex A8 with --float_support=VFPv3D16 and running A8 hardware (Beagleboard, etc.), it works as expected.

    Therefore I guess this explains why the behaviour is very odd in your testcase. In this case I strongly suggest to obtain a board with a CortexA8 processor (your original intent anyways) and give your code a try. In the meantime, you can validade the functional aspects of your code by using the software floating point implementation in the R4 simulator.

    Hope this helps,

    Rafael