Iru Cai has submitted this change. ( https://gem5-review.googlesource.com/c/public/gem5/+/58989 )

Change subject: util: fix the cxx_config example
......................................................................

util: fix the cxx_config example

This change replaces and removes the out-of-date APIs to fix the build
error, and add fixClockFrequency() call to fix the runtime error. We
also need the TRACING_ON macro and C++17 to build because of the
header changes.

Tested with X86 and tests/test-progs/hello. Checkpoint restore is not
tested yet.

Change-Id: Id92bb7954defea15b026eba3229a453b688929be
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/58989
Reviewed-by: Gabe Black <gabe.bl...@gmail.com>
Maintainer: Gabe Black <gabe.bl...@gmail.com>
Tested-by: kokoro <noreply+kok...@google.com>
---
M util/cxx_config/Makefile
M util/cxx_config/main.cc
2 files changed, 28 insertions(+), 8 deletions(-)

Approvals:
  Gabe Black: Looks good to me, approved; Looks good to me, approved
  kokoro: Regressions pass




diff --git a/util/cxx_config/Makefile b/util/cxx_config/Makefile
index 1cb2eda..455d031 100644
--- a/util/cxx_config/Makefile
+++ b/util/cxx_config/Makefile
@@ -36,8 +36,8 @@
 ARCH = ARM
 VARIANT = opt

-CXXFLAGS = -I../../build/$(ARCH) -L../../build/$(ARCH)
-CXXFLAGS += -std=c++0x
+CXXFLAGS = -I../../build/$(ARCH) -L../../build/$(ARCH) -DTRACING_ON=1
+CXXFLAGS += -std=c++17
 LIBS = -lgem5_$(VARIANT)

 ## You may also need protobuf flags
diff --git a/util/cxx_config/main.cc b/util/cxx_config/main.cc
index ede2d1d..dc4435c 100644
--- a/util/cxx_config/main.cc
+++ b/util/cxx_config/main.cc
@@ -108,11 +108,10 @@
     if (argc == 1)
         usage(prog_name);

-    cxxConfigInit();
-
     initSignals();

     setClockFrequency(1000000000000);
+    fixClockFrequency();
     curEventQueue(getEventQueue(0));

     statistics::initSimStats();
@@ -248,7 +247,7 @@
         /* FIXME, this should really be serialising just for
          *  config_manager rather than using serializeAll's ugly
          *  SimObject static object list */
-        Serializable::serializeAll(checkpoint_dir);
+        SimObject::serializeAll(checkpoint_dir);

         std::cerr << "Completed checkpoint\n";

@@ -258,11 +257,11 @@
     if (checkpoint_restore) {
         std::cerr << "Restoring checkpoint\n";

-        CheckpointIn *checkpoint = new CheckpointIn(checkpoint_dir,
-            config_manager->getSimObjectResolver());
+        SimObject::setSimObjectResolver(
+            &config_manager->getSimObjectResolver());
+        CheckpointIn *checkpoint = new CheckpointIn(checkpoint_dir);

         DrainManager::instance().preCheckpointRestore();
-        Serializable::unserializeGlobals(*checkpoint);
         config_manager->loadState(*checkpoint);
         config_manager->startup();


--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/58989
To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings

Gerrit-Project: public/gem5
Gerrit-Branch: develop
Gerrit-Change-Id: Id92bb7954defea15b026eba3229a453b688929be
Gerrit-Change-Number: 58989
Gerrit-PatchSet: 2
Gerrit-Owner: Iru Cai <mytbk920...@gmail.com>
Gerrit-Reviewer: Gabe Black <gabe.bl...@gmail.com>
Gerrit-Reviewer: Iru Cai <mytbk920...@gmail.com>
Gerrit-Reviewer: kokoro <noreply+kok...@google.com>
Gerrit-CC: Bobby Bruce <bbr...@ucdavis.edu>
Gerrit-CC: Jason Lowe-Power <power...@gmail.com>
Gerrit-MessageType: merged
_______________________________________________
gem5-dev mailing list -- gem5-dev@gem5.org
To unsubscribe send an email to gem5-dev-le...@gem5.org
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s

Reply via email to