I'm running code on a 6455, developing using CGT 7.2.0B2 with DSP/BIOS 5.41.09.34. I'm using CCS V5.0.1.201101102000, which is a little long in the tooth....
I've been developing an application, and it was working as well as expected until recently. After making some "trivial" code changes in "unrelated" code, my application has been hanging. When I use the Blackhawk emulator to inspect things, after retrying to connect when it complains:
after a retry, I see this in the disassembly view:
00840eb6: 4DE7 SPLOOPD 12
00840eb8: 069813A2 || MVC.S2X A6,ILC
00840ebc: E5260842 .fphead n, l, DW/NDW, NW, nobr, nosat, 0101001
312 s = survivor[s][n];
C$L14, C$DW$L$_ViterbiEqualiser$22$B:
00840ec0: 2CE7 SPMASK L1,L2
00840ec2: B247 || ^ MV.L2X A4,B5
00840ec4: 04012829 || MVK.S1 0x0250,A8
00840ec8: 02480FD8 || ^ OR.L1 0,A18,A4
00840ecc: 04110570 MPYLI.M1 A8,A4,A9:A8
00840ed0: 4C6E NOP 3
00840ed2: 2D66 SPMASK S1
00840ed4: 0220A079 || ADD.L1 A5,A8,A4
00840ed8: DA8E || ^ MV.S1X B21,A6
00840eda: C230 ADD.L1 A6,A4,A3
00840edc: EA200203 .fphead n, l, W, BU, nobr, nosat, 1010001
00840ee0: 020C0264 LDW.D1T1 *+A3[0],A4
00840ee4: 4C6E NOP 3
00840ee6: 2C67 SPMASK L1
00840ee8: 03AC0FD8 || ^ OR.L1 0,A11,A7
313 VE_Iest[n-1] = VE_Symbols[s][0];
00840eec: 019C9E40 ADDAD.D1 A7,A4,A3
00840ef0: 018C0334 LDNW.D1T1 *+A3[0],A3
00840ef4: 2C6E NOP 2
310 while(n > 0)
00840ef6: 8ED0 ADD.L1 A5,-4,A5
313 VE_Iest[n-1] = VE_Symbols[s][0];
00840ef8: 82C7 MV.L2 B5,B4
00840efa: 1FE6 SPKERNEL 0x 7752677664,8166
00840efc: EC402008 .fphead n, l, W, BU, nobr, nosat, 1100010
00840f00: 8ED1 || ADD.L2 B5,-4,B5
00840f02: 0235 || STNW.D2T1 A3,*B4[0]
C$L16, C$L15, C$DW$L$_ViterbiEqualiser$22$E:
00840f04: 1586 MV.L1X B11,A0
00840f06: 2627 || MVK.L2 1,B4
C$L17:
00840f08: D23C42F7 [!A0] STW.D2T2 B4,*+SP[2]
The PC is 0c840efa, i.e.
00840efa: 1FE6 SPKERNEL 0x 7752677664,8166
which is obviously rubbish, if I reload the executable and don't let it run to the problem point, I see a much more reasonable disassembly,:
C$L13:
00840eb6: 4DE7 SPLOOPD 12
00840eb8: 069813A2 || MVC.S2X A6,ILC
00840ebc: E5260842 .fphead n, l, DW/NDW, NW, nobr, nosat, 0101001
312 s = survivor[s][n];
C$L14, C$DW$L$_ViterbiEqualiser$22$B:
00840ec0: 2CE7 SPMASK L1,L2
00840ec2: B247 || ^ MV.L2X A4,B5
00840ec4: 04012829 || MVK.S1 0x0250,A8
00840ec8: 02480FD8 || ^ OR.L1 0,A18,A4
00840ecc: 04110570 MPYLI.M1 A8,A4,A9:A8
00840ed0: 4C6E NOP 3
00840ed2: 2D66 SPMASK S1
00840ed4: 0220A079 || ADD.L1 A5,A8,A4
00840ed8: DA8E || ^ MV.S1X B21,A6
00840eda: C230 ADD.L1 A6,A4,A3
00840edc: EA200203 .fphead n, l, W, BU, nobr, nosat, 1010001
00840ee0: 020C0264 LDW.D1T1 *+A3[0],A4
00840ee4: 4C6E NOP 3
00840ee6: 2C67 SPMASK L1
00840ee8: 03AC0FD8 || ^ OR.L1 0,A11,A7
313 VE_Iest[n-1] = VE_Symbols[s][0];
00840eec: 019C9E40 ADDAD.D1 A7,A4,A3
00840ef0: 018C0334 LDNW.D1T1 *+A3[0],A3
00840ef4: 2C6E NOP 2
310 while(n > 0)
00840ef6: 8ED0 ADD.L1 A5,-4,A5
313 VE_Iest[n-1] = VE_Symbols[s][0];
00840ef8: 82C7 MV.L2 B5,B4
00840efa: 1FE6 SPKERNEL 0,7
00840efc: EC402008 .fphead n, l, W, BU, nobr, nosat, 1100010
i.e. 00840efa: 1FE6 SPKERNEL 0,7
but as far as I can see the memory contents around this point are identical to the previous result. I only see the odd disassembly after a crash. The fstg value seems to vary somewhat but is always enormous typically starting 77 followed by 8 digits.
Note the Fcyc value 8166 is the decimal value for the OP code as a whole 0x1FE6.
It seems obvious that the disassembler has screwed-up, but what information is different in the hung case to the reloaded one?
My code in this area is written in C, and the loop that it is trying to execute is:
while(n > 0)
{
s = survivor[s][n];
VE_Iest[n-1] = VE_Symbols[s][0];
n--;
}
I'm fairly confident that my application is hanging in this loop, from previous occasions where I added code to monitor the CPU's progress through the routine.
My changes are typically adding more instrumentation, i.e. text output, but are not in the immediate vicinity to this code in terms of execution in this thread, although the application is multi-tasking and I guess that my changes could be having an effect near in terms of time. Unfortunately I can't pin down a single change that breaks the application, I've tried undoing them in sequence, but can find no pattern as to which the application will work with and which it will not. I'm currently assuming that one or more changes affects timing. Note interrupts are running and EDMAs are active, but I can't say if the are coincident with thus SPLOOP. It doesn't fail the first time through this code, it must have been run 100s of times before the crash. The compiler also produces 2 other SPLOOPs in the function being executed, but every time I've seen it fail is has been in this "while (n>0)" loop.
The compilation for the source code for used the following options:
-mv64+
-g
-O3
--relaxed_ansi
--gcc
--define="_DEBUG" --define=MINI_NESIE_HW --define="CHIP_6416"
--include_path="C:/TI_CCS_V5.0.1/ccsv5/tools/compiler/c6000/include" ....
--display_error_number
--issue_remarks
--diag_warning=225 --diag_warning=270 --diag_warning=183
--optimize_with_debug
--interrupt_threshold=960
--abi=coffabi
--opt_for_speed=5
--printf_support=nofloat
--preproc_with_compile
--preproc_dependency=...
I've checked that I haven't overflown any of the stacks in the application.
Are there any known issues with interrupts or task pre-emption and SPLOOPs, particularly on the 6455. ?
Paul Bray