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.

.switch .const

Dear reader(s),

I'm having a shared memory space between CPU1 and CPU2 on a dual core delfino. In shared memory there are shared sections ".switch" and ".const". Are these sections READ or are these sections FETCHED?

Best regards,

Tjarco

  • Hi Tjarco,

    Are you running from Flash and trying to see if the instruction prefetch buffer (fetch) or the data cache (read) would be used?

    I will look into this a little more, but I think the .const would be read since it is data and the .switch may be fetched since it is used with .text for switch statements.

    sal
  • You can look at the assembly and see if PREAD is being used. Please see http://www.ti.com/lit/spru430
    processors.wiki.ti.com/.../C28x_Code_Generation_Tips_and_Tricks


    If you place .switch and .const in PAGE 0 in your linker command file. They will be fetched/PREAD. If you place them in PAGE 1 they will be read likely with a MOV instruction. If you use the unified memory flag (-mt) the compiler is free to generate PREADs to any memory location.

    sal
  • Hi Pezzino,

    Thank you for your valuable reply. Im'n running code for CPU from shared message ram, which is compiled for CPU1. So code from CPU1 (flash) is at boottime copied to shared ram pages. This include .const, .switch and code linked to section "CPU2PROGRAM". Only the RAM page "CPU2PROGRAM" is assigned to CPU2 for Read/Write/Fetch. CPU2 is commanded to Branche to its "main' and starts executing (in "CPU2Program").

    CPU1 and CPU2  share .const and .switch memory.

    So as I understand, I must have the .const and .switch in PAGE 1 (datapage) to have the MOV instruction instead of the PREAD being able to share .const and .switch between CPUs.

    Q) If I use the unified memory option, what will be the condition for the compiler to use the PREAD instead of the MOV?

    Best regards

  • It is my understanding that the compiler will use PREAD by default.

    After you try this, please post your findings.

    sal