I've got a few switch statements that I would like to group with a speed critical section of code for cache performance reasons. My processor is a dm6435. My current linker command file contains the following excerpt:
.FAST_CODE_SECTION > DDR2 align 0x8000 // want fast code aligned on 32kB cache boundary
{
rts64plus.lib<divi.obj>
rts64plus.lib<divu.obj>
rts64plus.lib<strasg.obj>
bsl_minimum.lib<dm6435_reduced.obj>
IQmath_c64xPlus.lib
}
.cinit > DDR2
.const > DDR2
.far > DDR2
.cio > DDR2
.switch > DDR2
Currently, I manually assign function calls to the FAST_CODE_SECTION using the CODE_SECTION pragma.
I'd like a way to include the .switch & .const sections in the .FAST_CODE_SECTION. It would be even better if I had control of this on a module by module basis. Can anyone give an example of how to accomplish this?
EDIT: maybe I need to make sure this will do what I want. I was originally assuming that the const & switch sections would be a program memory fetch and would blow L1P cache if they were not aligned with the currently executing code, but I am now thinking this is a dangerous assumption to make. Are accesses of the .const & switch sections treated as program or data? If one or both are data, I suppose I would want to locate them in L1SRAM instead of the aligned section where I put all my critical code (.txt).