Hello all,
I've been prototyping with the XC-1A and wanted to know if there was a register corresponding to instantaneous CPU load of each core and maybe even the instantaneous MIPS per thread on each Core along with the various channel loads? This will help with easily figuring out the limits of my code. If it does exist could you forward me a link to the documentation?
Access to XMOS G4 CPU Load Statistics
-
- Member++
- Posts: 31
- Joined: Mon Feb 06, 2012 11:42 pm
-
- XCore Addict
- Posts: 169
- Joined: Fri Jan 08, 2010 12:13 am
There is no performance monitoring on the hardware. If your software is simulator friendly (i.e. doesn't require external interfaces etc) then you can produce gprof output - this might be useful to you.
Hope that helps.
Code: Select all
--gprof Enable gprof profiling output
Paul
On two occasions I have been asked, 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?' I am not able rightly to apprehend the kind of confusion of ideas that could provoke such a question.
On two occasions I have been asked, 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?' I am not able rightly to apprehend the kind of confusion of ideas that could provoke such a question.
-
- XCore Expert
- Posts: 844
- Joined: Sun Jul 11, 2010 1:31 am
If you look at the low bit of getps(0x100*t+4), for t=0..7, it will tell you
for each thread if it is running or not. This will take some cycles to run
of course, and a thread as well, keep that in mind when analysing the data.
for each thread if it is running or not. This will take some cycles to run
of course, and a thread as well, keep that in mind when analysing the data.
-
- XCore Expert
- Posts: 956
- Joined: Fri Dec 11, 2009 3:53 am
- Location: Sweden, Eskilstuna
That was clever!segher wrote:If you look at the low bit of getps(0x100*t+4), for t=0..7, it will tell you
for each thread if it is running or not. This will take some cycles to run
of course, and a thread as well, keep that in mind when analysing the data.
Probably not the most confused programmer anymore on the XCORE forum.
-
- Experienced Member
- Posts: 75
- Joined: Sat May 07, 2016 11:47 am
How do we make the distinction of tiles when using getps to obtain core loads? Thanks
-
- Experienced Member
- Posts: 75
- Joined: Sat May 07, 2016 11:47 am
Code: Select all
void Task_GetCoreStatistics (client core_stats_if core_stats_interface)
{
short int t;
timer tmr;
uint32_t timeelapsed;
tmr :> timeelapsed;
int core_load[8];
while(1)
{
select {
case tmr when timerafter(timeelapsed) :> timeelapsed:
for (t = 0; t <= 7; t++)
{
core_load[t] = getps(0x100*t+4); ///I'm not sure how to get lower byte.
}
printf("%d %d %d %d %d %d %d %d", core_load[0],
core_load[1],
core_load[2],
core_load[3],
core_load[4],
core_load[5],
core_load[6],
core_load[7]);
timeelapsed += 800 * MILLISECOND;
break;
}
}
}
Edit:
Should it be like this?
Code: Select all
core_load[t] = (int) getps(0x100*t+4) >> 4;