Hi Scott,

If you want something to execute before gem5 is completed, you can call
`registerExitCallback`. See
http://doxygen.gem5.org/release/current/namespacegem5.html#abcf3056836ee522620e5b14d9392ea87

I *think* that will solve your problem, but let me know if not. I don't
think there's a clean way to have a SimObject's destructor guaranteed to be
called.

Cheers,
Jason

On Wed, Feb 9, 2022 at 4:47 PM Scott Blankenberg via gem5-users <
gem5-users@gem5.org> wrote:

> Hello,
>
> In src/cpu/base.cc we have the following destructor:
>
> BaseCPU::~BaseCPU()
> {
> }
>
> By default nothing is inside of it. However, when I put code inside, it
> does not seem to be executed at any point. Based on some previous threads I
> have seen on the forums, it seems that the destructor for BaseCPU is not
> being called at the end of the simulation.
>
> Has anyone found a way to make sure this destructor is called when the
> simulation ends?
>
> Similarly, has anyone written a tracer which is a subclass of InstTracer
> that has a destructor which is successfully called at the end of
> simulation?
>
> Basically my objective is to make sure the destructor to my customTracer
> is called at the end of the simulation.
>
> Thanks,
>
> Scott Blankenberg
> _______________________________________________
> 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

Reply via email to