From: Andrew Bardsley Date: Fri, 14 Nov 2014 08:54:02 +0000 (-0500) Subject: config: Fix checkpoint restore in C++ config example X-Git-Tag: stable_2015_04_15~129 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=27b7b9e561000ce7712e6d7a28102b711cefa8a2;p=gem5.git config: Fix checkpoint restore in C++ config example This patch fixes the checkpoint restore option in the example of C++ configuration (util/cxx_config). The fix introduces a call to config_manager->startup() (which calls startup on all SimObjects managed by that manager) to replicate the loop of SimObject::startup calls in src/python/m5/simulate.py::simulate guarded by need_startup. As util/cxx_config/main.cc is a C++ analogue of src/python/mt/simulate.py, it should make a similar set of calls. --- diff --git a/util/cxx_config/main.cc b/util/cxx_config/main.cc index a9a86b424..afc166174 100644 --- a/util/cxx_config/main.cc +++ b/util/cxx_config/main.cc @@ -88,7 +88,7 @@ usage(const std::string &prog_name) " -s -- save checkpoint to dir after" " the given\n" " number of ticks\n" - " -r -- restore checkpoint to dir\n" + " -r -- restore checkpoint from dir\n" " -c -- switch from cpu 'from' to cpu" " 'to' after\n" " the given number of ticks\n" @@ -226,7 +226,6 @@ main(int argc, char **argv) GlobalSimLoopExitEvent *exit_event = NULL; if (checkpoint_save) { - exit_event = simulate(pre_run_time); DrainManager drain_manager; @@ -265,6 +264,7 @@ main(int argc, char **argv) Serializable::unserializeGlobals(checkpoint); config_manager->loadState(checkpoint); + config_manager->startup(); config_manager->drainResume();