Tool/software: TI C/C++ Compiler
Hi,
I have an urgent issue with the TMS320C6678 DSP. Sometimes, not constantly, running my program I get to an opcode exception.
Looking at the code pointed by the ERP register and the code before it, I couldn't see any code overwrite and the code is as it was when I loaded it to the chip.
The exception is at the SPLOOP instruction.
After reading the C66x CPU and Instruction Set Reference Guide (SPRUGH7, November 2010), paragraph 8.4.3: "There is a 4 cycle latency between when ILC is loaded and when its contents are available for use. When used with the SPLOOP instruction, it should be loaded 4 cycles before the SPLOOP instruction is encountered. ILC must be loaded explicitly using the MVC instruction." I expected to see delay between ILC loading and the following SPLOOP instrcution, but there isn't such delay in our generated code.
The code which got the exception is the following, ERP points to 0x0085f054, This code was generated by the 7.4.1 (and 7.6.0) compiler version and it's originally a C code. I would expect a delay between the MVC.S2 B4, ILC instruction and the SPLOOP 2 instruction (due to the above paragraph from the reference guide):
"
0085f048: 1246 MV.L1X B4,A0 0085f04a: C22E || ADD.S1 A6,A4,A6 0085f04c: 1BF6 || MVK.D1 0,A7 0085f04e: A6BA [!A0] BNOP.S1 $C$DW$L$FUNC$4$E (PC+52 = 0x0085f074),5 0085f050: C69003A2 || [ A0] MVC.S2 B4,ILC $C$L22: 0085f054: 0CE6 SPLOOP 2 0085f056: 3761 || ADD.L2X A6,1,B6 $C$DW$L$FUNC$4$B, $C$L23: 0085f058: 3F5D LDB.D2T2 *B6++[2],B5 0085f05a: 2F5C LDB.D1T1 *A6++[2],A5 0085f05c: EDC184B0 .fphead n, l, W, B, br, nosat, 1101110b 0085f060: 4C6E NOP 3 0085f062: 9AE3 EXTU.S2 B5,24,24,B4 0085f064: 01950CA0 SHL.S1 A5,0x8,A3 0085f068: 02107FF8 OR.L1X A3,B4,A4 0085f06c: 0C6E NOP 1 0085f06e: 7262 EXTU.S1 A4,16,16,A3 0085f070: 5CE6 SPKERNEL 4,1 0085f072: 63F0 || ADD.L1 A3,A7,A7 $C$DW$L$FUNC$4$E, $C$L24, $C$L25: 0085f074: 000C0363 B.S2 B3 0085f078: 019E09A0 || SHRU.S1 A7,0x10,A3
"
As I said, the opcode seems valid and legal, so I can't understand why I get an exception.
Please assist ASAP.
Thanks in advance,
Elad.