Cycle counter in SC58x sharc
When using Crosscore for Sc58x, I understand the EMUCLK register is the cycle counter.
How can I see its value in real time?
Hello,
CCES library provides functions to measure cycle counts. This internally uses the EMUCLK register
#include <cycle_count.h>
//Include the preprocessor switch ‘DO_CYCLE_COUNTS’ in the compiler preprocessor settings
//Declare variables of the type cycle_t
cycle_t start_count1,final_count1;
START_CYCLE_COUNT(start_count1);
<code/ data access for which the cycle count has to be measured>
STOP_CYCLE_COUNT(final_count1,start_count1);
//The cycle count will be stored in the variable final_count1, print the value of the variable if required
Check the ‘CCES Help’ for complete information on the different ways to measure cycle count.
Let me know if this works
Regards,
Mahesh
Thanks
I tried that for some time, but the compiler isn’t too happy. I am using CCES 2.2.0
I get this when I put in the code:
And from the red line under the var, start_count1 – I get this: Invalid redeclaration of 'START_CYCLE_COUNT(start_count1)'
From the yellow line under the MACRO I get: Statement has no effect 'START_CYCLE_COUNT(start_count1)'
So if you have an idea of how to deal with this I will very much appreciate it. In the mean time I am using assembly:
asm ("%0 = EMUCLK;" : "=d" (cycleStart));
Hello,
I have attached a working project which can be used for measuring the cycle counts.
Let me know if this helps
Regards,
Mahesh
This question has been assumed as answered either offline via email or with a multi-part answer. This question has now been closed out. If you have an inquiry related to this topic please post a new question in the applicable product forum.
Thank you,
EZ Admin
Please log in to reply.