From c71dfc17a7f5601de06085b6c2fe5efd9e3ea11f Mon Sep 17 00:00:00 2001 From: Gabe Black Date: Wed, 10 Oct 2018 17:28:09 -0700 Subject: [PATCH] util: Move the existing systemc example into a subdirectory. This example is for how to embed gem5 within systemc and make it use the systemc event queue. This used to be the only method of using gem5 and systemc together, but now that there are other options, it's ambiguous to have it as the only thing in the util/systemc directory. This change moves it into a gem5_within_systemc subdirectory which clearly shows what type of integration that example corresponds with. Change-Id: I426d68ccb618397d820bef492cbb1ff8ef4a979b Reviewed-on: https://gem5-review.googlesource.com/c/13375 Reviewed-by: Gabe Black Maintainer: Gabe Black --- util/systemc/{ => gem5_within_systemc}/Makefile | 2 +- util/systemc/{ => gem5_within_systemc}/README | 9 +++++---- util/systemc/{ => gem5_within_systemc}/main.cc | 4 ++-- .../systemc/{ => gem5_within_systemc}/sc_gem5_control.cc | 6 +++--- .../systemc/{ => gem5_within_systemc}/sc_gem5_control.hh | 0 util/systemc/{ => gem5_within_systemc}/sc_logger.cc | 0 util/systemc/{ => gem5_within_systemc}/sc_logger.hh | 0 util/systemc/{ => gem5_within_systemc}/sc_module.cc | 0 util/systemc/{ => gem5_within_systemc}/sc_module.hh | 0 util/systemc/{ => gem5_within_systemc}/stats.cc | 0 util/systemc/{ => gem5_within_systemc}/stats.hh | 0 11 files changed, 11 insertions(+), 10 deletions(-) rename util/systemc/{ => gem5_within_systemc}/Makefile (97%) rename util/systemc/{ => gem5_within_systemc}/README (91%) rename util/systemc/{ => gem5_within_systemc}/main.cc (100%) rename util/systemc/{ => gem5_within_systemc}/sc_gem5_control.cc (100%) rename util/systemc/{ => gem5_within_systemc}/sc_gem5_control.hh (100%) rename util/systemc/{ => gem5_within_systemc}/sc_logger.cc (100%) rename util/systemc/{ => gem5_within_systemc}/sc_logger.hh (100%) rename util/systemc/{ => gem5_within_systemc}/sc_module.cc (100%) rename util/systemc/{ => gem5_within_systemc}/sc_module.hh (100%) rename util/systemc/{ => gem5_within_systemc}/stats.cc (100%) rename util/systemc/{ => gem5_within_systemc}/stats.hh (100%) diff --git a/util/systemc/Makefile b/util/systemc/gem5_within_systemc/Makefile similarity index 97% rename from util/systemc/Makefile rename to util/systemc/gem5_within_systemc/Makefile index 24d1e52f2..100402c15 100644 --- a/util/systemc/Makefile +++ b/util/systemc/gem5_within_systemc/Makefile @@ -41,7 +41,7 @@ VARIANT = opt SYSTEMC_INC = ./systemc/include SYSTEMC_LIB = ./systemc/lib-linux64 -CXXFLAGS = -I../../build/$(ARCH) -L../../build/$(ARCH) +CXXFLAGS = -I../../../build/$(ARCH) -L../../../build/$(ARCH) CXXFLAGS += -I$(SYSTEMC_INC) -L$(SYSTEMC_LIB) CXXFLAGS += -std=c++0x CXXFLAGS += -g diff --git a/util/systemc/README b/util/systemc/gem5_within_systemc/README similarity index 91% rename from util/systemc/README rename to util/systemc/gem5_within_systemc/README index b05c81058..9ee1103a8 100644 --- a/util/systemc/README +++ b/util/systemc/gem5_within_systemc/README @@ -29,7 +29,7 @@ First build gem5 as a library with cxx-config support and (optionally) without python. Also build a normal gem5 (cxx-config not needed, Python needed): -> cd ../.. +> cd ../../.. > scons build/ARM/gem5.opt > scons --with-cxx-config --without-python build/ARM/libgem5_opt.so > cd util/systemc @@ -60,8 +60,8 @@ Then run make: Make a config file for the C++-configured gem5 using normal gem5 -> ../../build/ARM/gem5.opt ../../configs/example/se.py -c \ -> ../../tests/test-progs/hello/bin/arm/linux/hello +> ../../../build/ARM/gem5.opt ../../../configs/example/se.py -c \ +> ../../../tests/test-progs/hello/bin/arm/linux/hello The binary 'gem5.opt.cxx' can now be used to load in the generated config file from the previous normal gem5 run. @@ -76,7 +76,8 @@ This should print: The .ini file can also be read by the Python .ini file reader example: -> ../../build/ARM/gem5.opt ../../configs/example/read_ini.py m5out/config.ini +> ../../../build/ARM/gem5.opt ../../../configs/example/read_ini.py \ +> m5out/config.ini If you are interested in SystemC Transaction Level Modeling (TLM2) please have a look into /util/tlm. diff --git a/util/systemc/main.cc b/util/systemc/gem5_within_systemc/main.cc similarity index 100% rename from util/systemc/main.cc rename to util/systemc/gem5_within_systemc/main.cc index cbbdd7229..9d88b63cb 100644 --- a/util/systemc/main.cc +++ b/util/systemc/gem5_within_systemc/main.cc @@ -63,6 +63,8 @@ #include "base/str.hh" #include "base/trace.hh" #include "cpu/base.hh" +#include "sc_logger.hh" +#include "sc_module.hh" #include "sim/cxx_config_ini.hh" #include "sim/cxx_manager.hh" #include "sim/init_signals.hh" @@ -70,8 +72,6 @@ #include "sim/simulate.hh" #include "sim/stat_control.hh" #include "sim/system.hh" -#include "sc_logger.hh" -#include "sc_module.hh" #include "stats.hh" // Defining global string variable decalred in stats.hh diff --git a/util/systemc/sc_gem5_control.cc b/util/systemc/gem5_within_systemc/sc_gem5_control.cc similarity index 100% rename from util/systemc/sc_gem5_control.cc rename to util/systemc/gem5_within_systemc/sc_gem5_control.cc index cf6e0d57c..ae3dc241f 100644 --- a/util/systemc/sc_gem5_control.cc +++ b/util/systemc/gem5_within_systemc/sc_gem5_control.cc @@ -42,14 +42,14 @@ #include #include "base/statistics.hh" +#include "sc_gem5_control.hh" +#include "sc_logger.hh" +#include "sc_module.hh" #include "sim/cxx_config_ini.hh" #include "sim/cxx_manager.hh" #include "sim/debug.hh" #include "sim/init_signals.hh" #include "sim/stat_control.hh" -#include "sc_gem5_control.hh" -#include "sc_logger.hh" -#include "sc_module.hh" #include "stats.hh" namespace Gem5SystemC diff --git a/util/systemc/sc_gem5_control.hh b/util/systemc/gem5_within_systemc/sc_gem5_control.hh similarity index 100% rename from util/systemc/sc_gem5_control.hh rename to util/systemc/gem5_within_systemc/sc_gem5_control.hh diff --git a/util/systemc/sc_logger.cc b/util/systemc/gem5_within_systemc/sc_logger.cc similarity index 100% rename from util/systemc/sc_logger.cc rename to util/systemc/gem5_within_systemc/sc_logger.cc diff --git a/util/systemc/sc_logger.hh b/util/systemc/gem5_within_systemc/sc_logger.hh similarity index 100% rename from util/systemc/sc_logger.hh rename to util/systemc/gem5_within_systemc/sc_logger.hh diff --git a/util/systemc/sc_module.cc b/util/systemc/gem5_within_systemc/sc_module.cc similarity index 100% rename from util/systemc/sc_module.cc rename to util/systemc/gem5_within_systemc/sc_module.cc diff --git a/util/systemc/sc_module.hh b/util/systemc/gem5_within_systemc/sc_module.hh similarity index 100% rename from util/systemc/sc_module.hh rename to util/systemc/gem5_within_systemc/sc_module.hh diff --git a/util/systemc/stats.cc b/util/systemc/gem5_within_systemc/stats.cc similarity index 100% rename from util/systemc/stats.cc rename to util/systemc/gem5_within_systemc/stats.cc diff --git a/util/systemc/stats.hh b/util/systemc/gem5_within_systemc/stats.hh similarity index 100% rename from util/systemc/stats.hh rename to util/systemc/gem5_within_systemc/stats.hh -- 2.30.2