When using Crosscore for Sc58x, I understand the EMUCLK register is the cycle counter.
How can I see its value in real time?
CCES library provides functions to measure cycle counts. This internally uses the EMUCLK register
//Include the preprocessor switch ‘DO_CYCLE_COUNTS’ in the compiler preprocessor settings
//Declare variables of the type cycle_t
<code/ data access for which the cycle count has to be measured>
//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
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));
I have attached a working project which can be used for measuring the cycle counts.
Let me know if this helps
Retrieving data ...