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.

TMS320F280049: Visualizing the load of CPU and CLA

Part Number: TMS320F280049

Hi Champs,

Is there any way to show the CPU load and the CLA load separately and visually?
Our customer would like to see the data so that they could adjust the relocation of their program.

Best regards,
Hitoshi

  • Hi,

    Can you describe what you mean by load? Are you referring to the CPU utilization? Or are you referring to the amount of memory programmed and memory free?

    If you are referring to the later, you can use the .map file to identify the program and data sizes.

    If you are referring to the former, you can set up a CPUTimer to tick at a known period, and have a while loop in the background task which increments a counter and does nothing else with NOPs. Then you can count the number of cycles to iterate through that while loop. Then when the CPUTimer generates an interrupt, you can read the counter value and multiply it by the number of cycles per loop.

    Hope this helps,
    sal
  • Hi Sal,
    Thank you for your following up.
    I would like to measure the CPU and the CLA utilization.
    I would like to clearly understand the method with CPUTimer tick.
    Could you please describe it how to count the cycles of the tasks on CPU and CLA?

    Thank you for your help.
    Best regards,
    Hitoshi
  • Hi,

    Please consider the specific instructions I provided above with the code below.

    Add global counter:
    volatile uint32_t g_ui32SysTickCount = 0; // The global system tick counter.

    In main() as part of system set-up:
    //
    // Enable the system tick for 1ms.
    //
    SysTickInit();
    SysTickPeriodSet(200000UL);
    SysTickIntRegister(SysTickIntHandler);
    SysTickIntEnable();
    SysTickEnable();

    In the background loop:

    //
    // stress - this is where USB interrupts will be taken.
    // Set up CPUTimer for 1ms with interrupt.
    // Count #of cycles per loop iteration.
    // In CPUTimer interrupt multiply cycle count by counter to find # cycles idle in 1ms
    //
    while(1)
    {
    __asm(" RPT #10 || NOP");
    __asm(" RPT #10 || NOP");
    __asm(" RPT #10 || NOP");
    __asm(" RPT #10 || NOP");
    __asm(" RPT #10 || NOP");
    globalCounter++; // loop iteration should be 100 cycles
    __asm(" RPT #10 || NOP");
    __asm(" RPT #10 || NOP");
    __asm(" RPT #10 || NOP");
    __asm(" RPT #10 || NOP");
    }

    Add SysTick interrupt handler:
    //
    // SysTickIntHandler - Interrupt handler for the system tick counter.
    //
    __interrupt void
    SysTickIntHandler(void)
    {
    //
    // SAL stress
    //
    idleCycles = globalCounter * 100U;

    globalCounter = 0UL;

    //
    // Update our system tick counter.
    //
    g_ui32SysTickCount++;
    PieCtrlRegs.PIEACK.all |= 1;
    }

    sal
  • Hi Sal,
    I understood now.
    Thank you very much for your kind explanation.
    Best regards,
    Hitoshi