The member functions before_end_of_elaboration and end_of_elaboration are defined on sc_core::sc_module and the SystemC simulation kernel handles calling them at the appropriate times.
Try printing something in main.cc:SimControl::before_end_of_elaboration and you should see that print happening before the simulation starts running. - Andrew -----Original Message----- From: gem5-dev [mailto:[email protected]] On Behalf Of Cagdas Dirik via gem5-dev Sent: 17 November 2014 23:45 To: Cagdas Dirik; Andreas Hansson; Default Subject: Re: [gem5-dev] Review Request 2504: config: Fix to SystemC example's event handling ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: http://reviews.gem5.org/r/2504/#review5460 ----------------------------------------------------------- I think you are missing the call to SimControl::before_end_of_elaboration(). May be after sim_control is instantiated, but before sc_start is called? int sc_main(int argc, char **argv) { SimControl sim_control("gem5", argc, argv); ==> sim_control.before_end_of_elaboration(); sc_core::sc_start(); return EXIT_SUCCESS; } - Cagdas Dirik On Nov. 17, 2014, 6:19 a.m., Andreas Hansson wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > http://reviews.gem5.org/r/2504/ > ----------------------------------------------------------- > > (Updated Nov. 17, 2014, 6:19 a.m.) > > > Review request for Default. > > > Repository: gem5 > > > Description > ------- > > Changeset 10555:d1e51dc6cf86 > --------------------------- > config: Fix to SystemC example's event handling > > This patch fixes checkpoint restore in the SystemC hosting example by handling > early PollEvent events correctly before any EventQueue events are posted. > > The SystemC event queue handler (SCEventQueue) reports an error if the event > loop is entered with no Events posted. It is possible for this to happen > after instantiate due to PollEvent events. This patch separates out > `external' events into a different handler in sc_module.cc to prevent the > error from occurring. > > > Diffs > ----- > > util/systemc/Makefile 1a9e235cab09 > util/systemc/main.cc 1a9e235cab09 > util/systemc/sc_module.hh 1a9e235cab09 > util/systemc/sc_module.cc 1a9e235cab09 > > Diff: http://reviews.gem5.org/r/2504/diff/ > > > Testing > ------- > > > Thanks, > > Andreas Hansson > > _______________________________________________ gem5-dev mailing list [email protected] http://m5sim.org/mailman/listinfo/gem5-dev -- 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-dev mailing list [email protected] http://m5sim.org/mailman/listinfo/gem5-dev
