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.

Can i dump A-B register sets (core registers) using "asm(" ")" in my c code for later analysis ??

Other Parts Discussed in Thread: SYSBIOS

Hi,

Using following code sections for accessing A(0-31)-B(0-31) data register sets(core registers) , i am not able to dump these values at some particular time for later analysis.

volatile UINT32 regValue =0;

asm(" MV A1,regValue;");
printf("regValue 1 = %x \n",regValue);

OR

UINT32 regValue2 =0;

UINT32 *pregValue = &regValue2;

asm(" STW A1,*pregValue;");
printf("regValue 1 = %x \n",*pregValue);

Can you please suggest if above approaches are in the right direction or if any alternate way(other than CCS debug environment core register export) to dump these register sets for analysis?

I was able to capture these using exception module.

Exception_Status status;
UINT32 a1;

Exception_getLastStatus(&status);

printf(" A0 = %x\n ", status.excContext->A0 );

But this will work only in case of exception instances, in other cases (e.g. assert ) if i want to capture these, how can i do that ?

Is there any other SYS/BIOS(v6.34) API which can help ?

Regards

  • I think the best thing to do is to write a function in assembly to dump the registers to a structure, which you can then access from C code.  If you try using inline assembly within a C function you’ll probably have lots of problems as the compiler moves values in/out of registers for its own purposes.

    For a starting point, you can pull some code from one of the Exception source files and modify that.   For example, open the file Exception_asm.s64P in the “src/ti/sysbios/family/c64p” subdirectory of your SYS/BIOS installation.   Look at the code in the function “_ti_sysbios_family_c64p_Exception_dispatch__E”.  There is code here for handling the exception, but you can extract out just the code that saves the A and B-side registers into a structure, and put that in our own assembly function, which you can call from C to fill up the structure.

    Scott