I have figured out how to it. I added a boolean named roi in the system.hh header file, right after the totalNumInsts variable. This is now available in src/mem/cache/base.cc, so I can print the cache data only in the region of interest of the benchmarks.
I'm also interested in changing the output directory of the file. I would like to use that directory path that is given as a command line argument with the --d option. After looking into the python files, I see that this option is in the main.py file. I would like to copy this option to CacheConfig.py, so that I can pass it to base.cc. In se.py there is this line: "CacheConfig.config_cache(options, system)". Do I pass the options from main.py as another argument? Is there any other better or easier way to do this? I would appreciate any help. Thanks, Victor On Thu, 24 Oct 2019 at 17:51, Victor Kariofillis <[email protected]> wrote: > Hi Prathap, > > I have already implemented pseudo instructions for the ROI. The code is > the following: > > // > // Mark beginning of ROI in simulated programs > // > void > roibegin(ThreadContext *tc) > { > DPRINTF(PseudoInst, "PseudoInst::roibegin()\n"); > resetstats(tc, 0, 0); > } > // > // Mark end of ROI in simulated programs > // > void roiend(ThreadContext *tc) > { > dumpresetstats(tc, 0, 0); > exitSimLoop("roiend"); > } > > As I've said I would like to have a global variable that I can change in > these functions and have it be available in src/mem/cache/base.cc. I'm not > sure I understand the second part of your answer. > > Cheers, > Victor > > > On Thu, 24 Oct 2019 at 00:58, Prathap Kolakkampadath <[email protected]> > wrote: > >> Why don't you use existing m5_ pseudo instructions around ROI of the >> benchmark. Note to compile your benchmark with the m5 library. >> >> If you are looking for more data, you may also add them in respective >> mem/cache file and compile the gem. >> >> Regards, >> Prathap >> >> On Wed, Oct 23, 2019 at 4:41 PM Victor Kariofillis < >> [email protected]> wrote: >> >>> Hi, >>> >>> I have implemented pseudo instructions for recognizing the Region of >>> Interest of the benchmarks that I am running. What I want to do is to start >>> printing some information (cache data) to a file as soon as the ROI begins. >>> This printing will be done through the base.cc file in mem/cache. I tried >>> having a boolean "roi" variable in system.hh, so that it will globally >>> available, but I'm getting compiler errors of multiple definitions. How can >>> I have knowledge of whether the execution of the program is in the ROI in >>> the base.cc file? >>> >>> I have another question also. Is it possible to delay this printing >>> until the ROI ends? The problem I have with that is that when the "roiend" >>> pseudo instruction is encountered, I dump the stats and exit the >>> simulation. Is it possible to print these data from base.cc just as it is >>> done with regstats before exiting the simulation? >>> >>> Thanks, >>> Victor >>> _______________________________________________ >>> gem5-users mailing list >>> [email protected] >>> http://m5sim.org/cgi-bin/mailman/listinfo/gem5-users >> >> _______________________________________________ >> gem5-users mailing list >> [email protected] >> http://m5sim.org/cgi-bin/mailman/listinfo/gem5-users > >
_______________________________________________ gem5-users mailing list [email protected] http://m5sim.org/cgi-bin/mailman/listinfo/gem5-users
