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.

TMS570LC4357-EP: PMU clock cycle

Part Number: TMS570LC4357-EP
Other Parts Discussed in Thread: TMS570LC4357

we are using TMS570LC4357 Launchpad in development activities. For task benchmarking we are using PMU counters, under certain circumstances the value is getting frozen. we are suspecting it is due to counter reaching the maximum value. Currently the CPU clock is configured as 300MHz and we would like to slow down the PMU clock? is it possible to do it? is there any other reason can influence the PMU counters?

Thanks,

Subash

  • Hi Subash,

    The PMU uses the CPU core clock. There is no divider for FPU clock. 

    under certain circumstances the value is getting frozen.

    Does the counter register get overflowed? Is the counter reset before is is used in your each measurement?

  • The PMU counter is a 32-bit register, so the maximum CPU cycles It can count is 2^32-1 --> about 14.3 seconds if PCU freq=300MHz

    You can reset the counter and re-start the counter in the PMU counter overflow interrupt routine. So the total cycle = 2^32-1 + value of the counter register.

    Another way is to toggle a GIO pin. 

  • Hi  QJ Wang,

    Thank you so much for your response. When I observed the PMU cycle counter values it  starts counting and frozen at some value before reaching the maximum value.  I did the same experiment on Launchpad as well as HDK board.  The result was peculiar as I didn't see any issues in Launchpad, the PMU is counting as expected. However the issue is found only on HDK board.  

    I have attached snapshot for your reference, the captured counter values on Launchpad and HDK board. 

  • When the PMU counter gets frozen, does the CPU get stalled? Is the CPU in in debug halt state? Do you use xds100v2 on HDK?

    If possible, can you share your code? 

  • Hi QJ Wang,

    Yes, we are using xds100v2 on HDK. The CPU neither get stalled nor debug halt state. while in debug mode we observed that CP15 cycle counter not getting incremented for the step operations, however in launchpad it is incrementing for each step operation.   

  • Thanks Subash,

    I will run a test today on HDK to see if I can produce the issue.

  • Hi Subash,

    I am running the test, so far I haven't produce the issue:

    My test code measures the cycles used for adding two matrixes (100x100) in a while() loop. I get two results: cycles1 and cycles2: cycles1 is the value before the matrixes' addition, and cycles2 is  cycles after the addition. The two values are compared, if cycles2 is not bigger than cycles1, the counter is considered frozen.

    But I got overflow when the counter reaches its maximum value. The bit 31 of the status register is set:

  • I am testing onTMS570LC43x HDK, and using the built-in xds100v2 emulator.

    I did the same test couple times, and did not produce the issue.