Using L138 eXp Kit with the L138 SOM, code executing on the c6748 Core
PSP: 01_30_01 BIOS: 5_31_10_06 EDMA3_lld_01_11_03_01 CCS: 4.2.5 CGT: 6.1.20 & 7.0.5
Compiler options -mv6740 -g -O2 (everything else default settings other than include path searches)
I have decreased the L1P cache size (using the bios config tool) and created a user defined memory section (L1PROG) where I am placing several critical core algorithm functions. Here is a snapshot of my memory map:
MEMORY CONFIGURATION
name origin length used unused attr fill
---------------------- -------- --------- -------- -------- ---- --------
IRAM 11800000 00040000 00032ba5 0000d45b RWIX
L1PROG 11e00000 00004000 00003040 00000fc0 RWIX
CACHE_L1P 11e04000 00004000 00000000 00004000 RWIX
L1DATA 11f00000 00004000 00003840 000007c0 RWIX
CACHE_L1D 11f04000 00004000 00000000 00004000 RWIX
L3_CBA_RAM 80000000 00020000 00000000 00020000 RWIX
DDR c0000000 08000000 00064320 07f9bce0 RWIX
When the function is called, the code gets stuck in an infinite loop, repeatedly jumping back to the first instruction following a call to CLK_gethtime( ). In looking at the assembly window, I can see the CALLP to the trampoline function, where the B3 register is set to the return address and the function call executes normally and returns. A few assembly lines down, I see what seems to be the start of the If( ) statment, but then there is a BNOP.S2 B3,0 instruction, which puts me right back at the return location of the previous function call. This happens indefinitely. This happens for both the 6.1.20 and 7.0.5 tools. Happens with -O1 optimization as well.
Below is the C code fragment and a picture of the dissassembly window associated with it.
// C code fragment.
timeSpLNoiseEnd = CLK_gethtime();
if (spectralLeak)
{
pWD = &aWeights[0];
pWR = &bWeights[0];
Here is a snapshot of the dis-assembly window, with the instructions in question circled in RED.
Any thoughts? Ideas? Is this the type of code you'd expect to see? why the BNOP.S2 B3,0 back to the original return address?
Are there any other compiler settings I need to be aware of if I am running part of my code in L1 RAM and the other in DDR? From what I understand the newer compilers handle large jumps via the trampoline, so there is no longer a compiler option dealing with the code memory model.
thanks
-S