From 4a9c0a7dfc8aa1fcd70ec2b194691adec9ce424e Mon Sep 17 00:00:00 2001 From: Steve Reinhardt Date: Sat, 17 Jun 2006 09:58:10 -0400 Subject: Add --outdir option. Didn't call it "-d" since that's already being used for "detailed cpu". Needed to add extra function for user script to pass parsed options back to m5 module. configs/test/fs.py: configs/test/test.py: Call setStandardOptions(). src/python/m5/__init__.py: Add --outdir option. Add setStandardOptions() so user script can pass parsed options back to m5 module. src/sim/main.cc: Add SWIG-wrappable function to set output dir. --HG-- extra : convert_revision : 1323bee69ca920c699a1cd1218e15b7b0875c1e5 --- src/sim/main.cc | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/sim/main.cc') diff --git a/src/sim/main.cc b/src/sim/main.cc index f63aec9cc..fc057ea6f 100644 --- a/src/sim/main.cc +++ b/src/sim/main.cc @@ -297,6 +297,14 @@ main(int argc, char **argv) Py_Finalize(); } + +void +setOutputDir(const string &dir) +{ + simout.setDirectory(dir); +} + + IniFile inifile; SimObject * -- cgit v1.2.3 From d96d28e56d39eec0baa1377779119495cfbf4701 Mon Sep 17 00:00:00 2001 From: Steve Reinhardt Date: Sat, 17 Jun 2006 12:08:19 -0400 Subject: Rename SWIG "main" module to "cc_main" so it's clear from the Python side that this is the interface to C++. src/SConscript: main_wrap.cc -> cc_main_wrap.cc src/python/SConscript: src/python/m5/__init__.py: src/sim/main.cc: s/main/cc_main/ src/python/m5/config.py: s/main/cc_main/ Also directly import cc_main so we don't need to put the "m5." in front all the time. --HG-- extra : convert_revision : 755552f70cf671881ff31e476c677b95ef12950d --- src/sim/main.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/sim/main.cc') diff --git a/src/sim/main.cc b/src/sim/main.cc index fc057ea6f..7a0fbfa61 100644 --- a/src/sim/main.cc +++ b/src/sim/main.cc @@ -166,7 +166,7 @@ sayHello(ostream &out) } -extern "C" { void init_main(); } +extern "C" { void init_cc_main(); } int main(int argc, char **argv) @@ -258,8 +258,8 @@ main(int argc, char **argv) Py_Initialize(); PySys_SetArgv(argc, argv); - // initialize SWIG 'main' module - init_main(); + // initialize SWIG 'cc_main' module + init_cc_main(); if (argc > 0) { // extra arg(s): first is script file, remaining ones are args -- cgit v1.2.3