Hi Niko, It seems to be a bug in DerivO3CPU. I have found a workaround. Here I will explain my finding.
First, it looks like the numCycles variable is increased every tick, whether is there an instruction to execute or not, in *src/cpu/o3/cpu.cc *line 515 function tick. But I noticed the committedInsts stat is correct, and it is increased in a function deep down in the call chain starting from *commit.tick() *(in *src/cpu/o3/cpu.cc *line 529 function tick). So I guess the *commit.tick()* function return early at line 662, file *src/cpu/o3/commit_impl.hh*, before reaching the point where committedInsts is increased. So I made the following changes: - Change the return type of function *template <class Impl> void DefaultCommit<Impl>::tick() *at line 654 file *src/cpu/o3/commit_impl.hh *from void to bool - Make the corresponding change in the header file (*src/cpu/o3/commit.hh* line 212) - Make function tick *return false* if it returns early at line 662, file *src/cpu/o3/commit_impl.hh*, otherwise, *return true* at the end of the function - In the function tick of the O3CPU (line 507, file *src/cpu/o3/cpu.cc*), catch the returned value from *commit.tick().* If it is false, decreased 1 from the numCycles, basically undo the increment at line 515. I could move the ++numCycles line down and only do it if the *commit.tick()* return true, but I don't know if it affects the *updateCycleCounters* function. This workaround works for me. But I don't know if it breaks somethings, SMT maybe? Hope this help, Duc Anh Vào Th 6, 11 thg 12, 2020 vào lúc 09:13 POLYCHRONOU Nikolaos < [email protected]> đã viết: > Hi, > > I will be very interested to know if this is a bug in Derive03CPU. I work > with the stats file, with one CPU for the moment, but I never checked with > 2cores. > > Regards > > Niko > > > > *From:* Đức Anh via gem5-users <[email protected]> > *Sent:* Thursday, December 10, 2020 7:09 PM > *To:* gem5 users mailing list <[email protected]> > *Cc:* Đức Anh <[email protected]> > *Subject:* [gem5-users] How to get the execution time of each CPU? > > > > Dear all, > > > > I have a system with 2 DerivO3CPU running 2 different workloads, and I > want to measure the execution time of each CPU. How can I do it? In my > case, 1 core always finish later because the workload is significantly > bigger than the other. > > > > I have looked into stats.txt but the numCycles stat for each CPU is always > equal. This is not the case if I use TimingSimpleCPU, where the numCycles > is different, I can take it and divide it with the frequency to get the > execution time. Is there any way I can infer the execution time through the > available stats? > > > > Best regards, > > Duc Anh >
_______________________________________________ gem5-users mailing list -- [email protected] To unsubscribe send an email to [email protected] %(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s
