Hi all, Have a look at http://www.gem5.org/SimObject_Initialization and src/sim/sim_object.hh. In general, I would recommend to not schedule events in init(), and rather do so in initState, loadState or startup.
Andreas From: gem5-users <[email protected]<mailto:[email protected]>> on behalf of Erfan Azarkhish <[email protected]<mailto:[email protected]>> Reply-To: gem5 users mailing list <[email protected]<mailto:[email protected]>> Date: Tuesday, 30 June 2015 07:42 To: gem5 users mailing list <[email protected]<mailto:[email protected]>> Subject: Re: [gem5-users] Wakeup after restoring checkpoint Dear Yuan, I faced the same issue, and I solved it using a not very clean trick. So, I would really appreciate it if someone could tell us the proper solution to address this issue. Here is how I fixed it: 1. In the init() method of my component, I check whether this is a "fresh execution" or a "checkpoint resume". (I pass this information MANUALLY to gem5 by creation of a file and checking whether it exists). Now in the init() method, I schedule my periodic event ONLY if the execution is fresh, otherwise I won't schedule it (see below). 2. I override the drain() method of my component, and I make sure that there are no in-flight transactions in my component (You can see an example of how this method is used in the existing components). 3. I override the drainResume() method, and there, I schedule my periodic event. This way the periodic event works both with fresh execution, and with checkpoint resuming. I hope that this helps, Best, On Fri, Jun 19, 2015 at 12:23 PM, Yuan Yao <[email protected]<mailto:[email protected]>> wrote: Hi All: Recently I wrote a new component in Garnet, which wakes itself up when initialized. After that, it re-shedules periodically. Below is the code for this purpose: MyComponent::MyComponent(){ ... scheduleEventAbsolute(m_net_ptr->clockEdge(Cycles(1))); ... } MyComponents::wakeup(){ ... scheduleEvent(Cycles(A_PERIOD)); ... } The code works fine when I start a full system simulation afresh. However, when I restore from a checkpoint, MyComponent never wakes up. I guess the problem is in the event queue. It seems the wake up event of MyComponent is not registered successfully. But I am not sure about this... Based on this observation, my question is: - How to wake up your own component after restoring from a checkpoint? Best Regards ================================== Yuan Yao (Mr.) PhD Candidate in Electronic and Computer Systems School of ICT KTH Royal Institute of Technology [email protected]<mailto:[email protected]> _______________________________________________ gem5-users mailing list [email protected]<mailto:[email protected]> http://m5sim.org/cgi-bin/mailman/listinfo/gem5-users -- Erfan Azarkhish Micrel Lab - Viale Carlo Pepoli 3/2 - 40123, Bologna DEI - University of Bologna, Italy https://www.linkedin.com/in/erfanazarkhish -- IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you. ARM Limited, Registered office 110 Fulbourn Road, Cambridge CB1 9NJ, Registered in England & Wales, Company No: 2557590 ARM Holdings plc, Registered office 110 Fulbourn Road, Cambridge CB1 9NJ, Registered in England & Wales, Company No: 2548782
_______________________________________________ gem5-users mailing list [email protected] http://m5sim.org/cgi-bin/mailman/listinfo/gem5-users
