[gem5-users] Re: Pseudo Instruction - m5_reset_stats() - Body Modification
I see. Thanks for the clarification. Will see if DPRINTF works, otherwise will write to a file, which should be ok as I am calling m5_stat_reset only once. On Tue, Oct 12, 2021 at 10:57 AM Jason Lowe-Power wrote: > I would suggest using DPRINTF instead of cout. It's possible that some > print statements aren't being flushed. > > Jason > > On Mon, Oct 11, 2021 at 7:16 AM Sampad Mohapatra wrote: > >> Hi Jason, >> >> I have added a std::cout statement to the resetstats()'s body and I am >> calling m5_reset_stats from my GPU benchmarks. >> The GPU kernels are launched right after reset is called. I pipe the >> output of simulations to a file. But, strangely enough >> some outputs show the std::cout statements while others don't. What could >> be the reason ? >> >> Thanks, >> Sampad >> >> On Mon, Oct 4, 2021 at 12:08 PM Jason Lowe-Power >> wrote: >> >>> Hi Sampad, >>> >>> Here is where m5_reset_stats is implemented in the simulator: >>> https://gem5.googlesource.com/public/gem5/+/refs/heads/stable/src/sim/pseudo_inst.cc#303 >>> >>> There are a large number of steps between when the guest code calls >>> m5_reset_stats and when the above function executes, but this should help >>> you start hacking :). >>> >>> Cheers, >>> Jason >>> >>> On Sat, Oct 2, 2021 at 4:05 AM Sampad Mohapatra via gem5-users < >>> gem5-users@gem5.org> wrote: >>> Hi All, I need to set a bool variable in src/cpu/simple/base.(hh|cc) to be true when m5_reset_stats() is *explicitly *called from some binary executing on gem5. Using this bool and instruction count, I want to exit the simulation. How can I modify the body (hack) of m5_reset_stats() to call other functions ? Where is its body defined ? If not possible, then is there any alternative way to set the bool variable when m5_reset_stats() is *explicitly* called ? Thank You, Sampad Mohapatra ___ gem5-users mailing list -- gem5-users@gem5.org To unsubscribe send an email to gem5-users-le...@gem5.org %(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s >>> >>> ___ gem5-users mailing list -- gem5-users@gem5.org To unsubscribe send an email to gem5-users-le...@gem5.org %(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s
[gem5-users] Re: Pseudo Instruction - m5_reset_stats() - Body Modification
I would suggest using DPRINTF instead of cout. It's possible that some print statements aren't being flushed. Jason On Mon, Oct 11, 2021 at 7:16 AM Sampad Mohapatra wrote: > Hi Jason, > > I have added a std::cout statement to the resetstats()'s body and I am > calling m5_reset_stats from my GPU benchmarks. > The GPU kernels are launched right after reset is called. I pipe the > output of simulations to a file. But, strangely enough > some outputs show the std::cout statements while others don't. What could > be the reason ? > > Thanks, > Sampad > > On Mon, Oct 4, 2021 at 12:08 PM Jason Lowe-Power > wrote: > >> Hi Sampad, >> >> Here is where m5_reset_stats is implemented in the simulator: >> https://gem5.googlesource.com/public/gem5/+/refs/heads/stable/src/sim/pseudo_inst.cc#303 >> >> There are a large number of steps between when the guest code calls >> m5_reset_stats and when the above function executes, but this should help >> you start hacking :). >> >> Cheers, >> Jason >> >> On Sat, Oct 2, 2021 at 4:05 AM Sampad Mohapatra via gem5-users < >> gem5-users@gem5.org> wrote: >> >>> Hi All, >>> >>> I need to set a bool variable in src/cpu/simple/base.(hh|cc) to be true >>> when m5_reset_stats() is *explicitly *called from some binary executing >>> on gem5. Using this bool and instruction count, I want to exit the >>> simulation. >>> >>> How can I modify the body (hack) of m5_reset_stats() to call other >>> functions ? Where is its body defined ? >>> If not possible, then is there any alternative way to set the bool >>> variable when m5_reset_stats() is *explicitly* called ? >>> >>> Thank You, >>> Sampad Mohapatra >>> >>> >>> ___ >>> gem5-users mailing list -- gem5-users@gem5.org >>> To unsubscribe send an email to gem5-users-le...@gem5.org >>> %(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s >> >> ___ gem5-users mailing list -- gem5-users@gem5.org To unsubscribe send an email to gem5-users-le...@gem5.org %(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s
[gem5-users] Re: Pseudo Instruction - m5_reset_stats() - Body Modification
Hi Jason, I have added a std::cout statement to the resetstats()'s body and I am calling m5_reset_stats from my GPU benchmarks. The GPU kernels are launched right after reset is called. I pipe the output of simulations to a file. But, strangely enough some outputs show the std::cout statements while others don't. What could be the reason ? Thanks, Sampad On Mon, Oct 4, 2021 at 12:08 PM Jason Lowe-Power wrote: > Hi Sampad, > > Here is where m5_reset_stats is implemented in the simulator: > https://gem5.googlesource.com/public/gem5/+/refs/heads/stable/src/sim/pseudo_inst.cc#303 > > There are a large number of steps between when the guest code calls > m5_reset_stats and when the above function executes, but this should help > you start hacking :). > > Cheers, > Jason > > On Sat, Oct 2, 2021 at 4:05 AM Sampad Mohapatra via gem5-users < > gem5-users@gem5.org> wrote: > >> Hi All, >> >> I need to set a bool variable in src/cpu/simple/base.(hh|cc) to be true >> when m5_reset_stats() is *explicitly *called from some binary executing >> on gem5. Using this bool and instruction count, I want to exit the >> simulation. >> >> How can I modify the body (hack) of m5_reset_stats() to call other >> functions ? Where is its body defined ? >> If not possible, then is there any alternative way to set the bool >> variable when m5_reset_stats() is *explicitly* called ? >> >> Thank You, >> Sampad Mohapatra >> >> >> ___ >> gem5-users mailing list -- gem5-users@gem5.org >> To unsubscribe send an email to gem5-users-le...@gem5.org >> %(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s > > ___ gem5-users mailing list -- gem5-users@gem5.org To unsubscribe send an email to gem5-users-le...@gem5.org %(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s
[gem5-users] Re: Pseudo Instruction - m5_reset_stats() - Body Modification
Hi Sampad, Here is where m5_reset_stats is implemented in the simulator: https://gem5.googlesource.com/public/gem5/+/refs/heads/stable/src/sim/pseudo_inst.cc#303 There are a large number of steps between when the guest code calls m5_reset_stats and when the above function executes, but this should help you start hacking :). Cheers, Jason On Sat, Oct 2, 2021 at 4:05 AM Sampad Mohapatra via gem5-users < gem5-users@gem5.org> wrote: > Hi All, > > I need to set a bool variable in src/cpu/simple/base.(hh|cc) to be true > when m5_reset_stats() is *explicitly *called from some binary executing > on gem5. Using this bool and instruction count, I want to exit the > simulation. > > How can I modify the body (hack) of m5_reset_stats() to call other > functions ? Where is its body defined ? > If not possible, then is there any alternative way to set the bool > variable when m5_reset_stats() is *explicitly* called ? > > Thank You, > Sampad Mohapatra > > > ___ > gem5-users mailing list -- gem5-users@gem5.org > To unsubscribe send an email to gem5-users-le...@gem5.org > %(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s ___ gem5-users mailing list -- gem5-users@gem5.org To unsubscribe send an email to gem5-users-le...@gem5.org %(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s