[gem5-users] Re: Destructor for BaseCPU

2022-02-09 Thread Gabe Black via gem5-users
*Very* superficially looking at this (just at what's in the emails here), you might want to make sure the BaseCPU destructor is virtual, or at least the destructor of a base class is. If it isn't currently, the destructor of SimObject should probably be virtual. I don't know for sure whether that

[gem5-users] Re: findOrCreate function

2022-02-09 Thread Jason Lowe-Power via gem5-users
Hi Scott, I think the answer is the same as the prior email. You need to register an exit callback to close the file stream :). See, for instance, the elastic trace code: https://gem5.googlesource.com/public/gem5/+/refs/heads/stable/src/cpu/o3/probe/elastic_trace.cc#103 Cheers, Jason On Wed,

[gem5-users] Re: Destructor for BaseCPU

2022-02-09 Thread Jason Lowe-Power via gem5-users
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

[gem5-users] findOrCreate function

2022-02-09 Thread Scott Blankenberg via gem5-users
Hello all, Has anyone used the findOrCreate Gem5 function for opening custom file streams? For example in src/cpu/base.cc we see that this function is used in the constructor for BaseCPU const std::string fname = csprintf("ftrace.%s", name()); functionTraceStream =

[gem5-users] Destructor for BaseCPU

2022-02-09 Thread Scott Blankenberg via gem5-users
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

[gem5-users] Memory Issue using pthreads+m5threads+SE mode

2022-02-09 Thread Andronicus Samsundar Rajasukumar via gem5-users
Hi, I'm running a multi-threaded application using pthreads + m5threads using SE mode. I see that as the simulation progresses, the memory consumption keeps increasing for the process until it gets killed. the process map shows that the address space is getting filled up with the application's