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.

Porting in C64x+

Other Parts Discussed in Thread: DM3730

Hello All,

I am trying to port ECG code, ie C5515 MDK to DM3730.(c64x+). CCS  Version: 4.1.0.02002

I was able to port the c files and was able to generate an .out file. 

I have the assembly files to be ported. 

What i have to do to port these file?     Is it i should completely rewrite the .asm.

Also i found out that in C5515 , in Properties -> C/C++ Build->Run Time Model Options -> Code Gen outputs algebraic was enabled.

But in C64X+ project , i could not get that option.

Kindly Suggest.

The functions in C5515 are provided below for reference.

.asmfunc

_ECG_FilterProcess:

AC0 = 0;

repeat (#351)
AC0 = AC0 + ((*AR0-)* (*AR1+));

; repeat (#351)
; AC0 = AC0 + ((*AR0-)* (*CDP+)) || AC1 = AC1 + ((*AR1-)* (*CDP+));

(*AR2+) = HI(AC0);
(*AR2) = AC0;

return
.endasmfunc

.func
_ECG_AntiAlising_FilterProcess:

AC0 = 0;

repeat (#51)
AC0 = AC0 + ((*AR0-)* (*AR1+));


(*AR2+) = HI(AC0);
(*AR2) = AC0;

return
.endfunc

  • There is no direct easy way to port from C55x Assembly to C64x Assembly.  It most likely would be better to get a functional understanding of the assembly routine and rewrite it in C.  I'd let the compiler do the optimizing and not go to hand assembly unless further optimization is needed.  I'd also suggest looking into the training material on how to optimize C code for the C64x family of devices.

    Best Regards,

    Chad

  • Hi Chad, 

    Thanks for the comments. I am presently going through the TMS320C6000 Optimizing Compiler v7.4 User's Guide chapter 2 and 3.

    In between i got a DSP LIB for c64x+ and it has lot of functions. Can i use that directly or rewrite the assembly code into C as you have suggested.

    Is this the training material you suggested?

         http://training.ti.com/courses/coursedescription.asp?iCSID=1224   ( Optimize C Code on TMS320C6000 (TM) DSPs )

    Thanks a billion,

    GS Vinoth.

  • GS,

    If there are routines you can use from the DSP Lib, I'd say yes, use those.  I assume your code would do a bit more, so it would be calling those routines in your code as needed, since they should be optimized code in the DSP Library.  Otherwise it's mainly re-writing the code in C.  I've found this to be much more efficient than trying to port Assembly language from two totally different architectures.  I find it's even faster if you can get a high level understanding of what the Assembly routine was to do, and simply re-write it in C w/o looking at the assembly code itself.  I've taken code that took a team of engineers weeks to port, and asked the owner exactly what does from a high level and wrote in in C in a matter of hours and even ended up with better efficiency on top of everything.

    The course you mentioned is definitely one of the training material's I'd suggest taking online and is most applicable to your current needs.

    Best Regards,

    Chad