Hi Shyam,

You can register a callback function that will execute when the simulator
exits. You can call the following function at any time (likely during
construction of your SimObject) to register the callback:
https://gem5.googlesource.com/public/gem5/+/master/src/sim/sim_exit.hh#46.

Here is an example use very similar to your use case:
https://gem5.googlesource.com/public/gem5/+/master/src/cpu/simple_thread.cc#93

Cheers,
Jason

On Fri, Nov 30, 2018 at 10:07 AM Shyam Murthy <[email protected]>
wrote:

> Hello everyone,
>
> I am trying to profile some information while running an application on
> gem5 using classic cache model. I have added a data structure in the
> BaseCache class file (src/mem/cache/base.cc). I would like to print the
> contents of the data structure at the end of the simulation. I don’t see
> any prints from the BaseCache class destructor at the end of the
> simulation. How are the BaseCache class objects being destroyed?
>
> I tried printing the contents of the data structure within the
> OutputStream class destructor, I could see the prints, however the data
> structure was freed by then. When does gem5 free user defined data
> structures defined within base.cc?
>
> Thanks in advance.
>
> With regards
> Shyam Murthy
> Computer Science
> UW Madison
> _______________________________________________
> 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

Reply via email to