From 06a4686af9b0d8e9e25e0591873d2f269bfb6d1b Mon Sep 17 00:00:00 2001 From: Nathan Binkert Date: Fri, 11 Feb 2005 09:47:41 -0500 Subject: Rework the command line paramters for python output and how output files and the output directory are are handled. Make the output directory configuration via a command line parameter, or an environment variable. SConscript: Add new output file stuff base/misc.cc: dev/simconsole.cc: use new output file code cpu/base_cpu.cc: use new output file code to generate output streams dev/etherdump.cc: use the output file code to find the output directory use a real stream instead of a pointer dev/etherdump.hh: use a real stream instead of a pointer objects/Root.mpy: output_dir and config_output_file are not longer configured here. sim/main.cc: - Completely rework the command line argument passing to deal with changes in python and output files. - Update help output to reflect changes. - Remove all direct support for .ini files. They are strictly for intermediate representation. - Remove the --foo:bar=blah syntax for .ini files and add --foo.bar=blah syntax for python. This will generate: foo.bar = 'blah' in the python script. - Add '-d' to set the output directory. - Use new output file code to access the output stream. sim/serialize.cc: use the new code to find the output directory sim/universe.cc: Get rid of makeOutputStream. Use the new output file code. Remove output_dir and config_output_file as parameters. --HG-- extra : convert_revision : df2f0e13d401c3a60cae1239aa1ec3511721544d --- cpu/base_cpu.cc | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'cpu') diff --git a/cpu/base_cpu.cc b/cpu/base_cpu.cc index c4bb97ff8..425ac8877 100644 --- a/cpu/base_cpu.cc +++ b/cpu/base_cpu.cc @@ -26,13 +26,14 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#include #include #include -#include #include "base/cprintf.hh" #include "base/loader/symtab.hh" #include "base/misc.hh" +#include "base/output.hh" #include "cpu/base_cpu.hh" #include "cpu/exec_context.hh" #include "sim/param.hh" @@ -132,8 +133,7 @@ BaseCPU::BaseCPU(const string &_name, int _number_of_threads, bool _def_reg, functionTracingEnabled = false; if (_function_trace) { - std::string filename = csprintf("ftrace.%s", name()); - functionTraceStream = makeOutputStream(filename); + functionTraceStream = simout.find(csprintf("ftrace.%s", name())); currentFunctionStart = currentFunctionEnd = 0; functionEntryTick = _function_trace_start; @@ -157,11 +157,8 @@ BaseCPU::enableFunctionTrace() BaseCPU::~BaseCPU() { - if (functionTracingEnabled) - closeOutputStream(functionTraceStream); } - void BaseCPU::init() { -- cgit v1.2.3