Hi all,
I am a newbie in DSP. We have grabbed the ADS1298-C5515 EVM kit and successfully built the ECG MDK source code.
Now we are trying to port the ECG algorithm to C64x DSP. For that, I am trying to convert the two assembly functions in
ECG MDK to C source code. At first, I am trying to test the equivalent C code in C5515 EVM itself. But when I convert the assembly functions
to C code, it is not working properly in C5515 EVM. Below are the functions for your reference:
ECG_FilterProcess:
AC0 = 0;
repeat (#351)
AC0 = AC0 + ((*AR0-)* (*AR1+));
(*AR2+) = HI(AC0);
(*AR2) = AC0;
return
_ECG_AntiAlising_FilterProcess:
AC0 = 0;
repeat (#51)
AC0 = AC0 + ((*AR0-)* (*AR1+));
(*AR2+) = HI(AC0);
(*AR2) = AC0;
return
The Test routine takes three int16 pointers. The first two are inputs and the third one is output.
One of the operands for multiplication is Q15 format filter coefficients.
I understood that there is some problem when I port the multiplication instruction to C source code.
On viewing the disassembly view, I understood that equivalent instruction for multiplication is MACM.
I have also verified the status register settings of SATD, M40, SMUL, FRCT bits in my source code. All these
are found to be in their default values in the lpva2000.inc file.
I have debugged the C code and understood that the problem is with the multiplication instruction in my C code.
I have also referred the following posts in TI forums and made several trials.
http://e2e.ti.com/support/dsp/c5000/f/109/t/103964.aspx
I have tried with the SMULT macro mentioned in the above forum. But still I didn't get the expected results.
http://e2e.ti.com/support/dsp/tms320c6000_high_performance_dsps/f/115/t/187702.aspx?pi64368=1
http://e2e.ti.com/support/dsp/c5000/f/109/t/101101.aspx
Still my multiplication output fails.
Could you please share your thoughts on this issue?
Also please tell if it is okay for these asm porting to C while porting to C64x DSP.
Thanks,
Honey S