From 5383e1ada49b59daf4ff8703076923d4ccb6207d Mon Sep 17 00:00:00 2001 From: Andreas Sandberg Date: Fri, 27 Nov 2015 14:41:59 +0000 Subject: base: Add support for changing output directories This changeset adds support for changing the simulator output directory. This can be useful when the simulation goes through several stages (e.g., a warming phase, a simulation phase, and a verification phase) since it allows the output from each stage to be located in a different directory. Relocation is done by calling core.setOutputDir() from Python or simout.setOutputDirectory() from C++. This change affects several parts of the design of the gem5's output subsystem. First, files returned by an OutputDirectory instance (e.g., simout) are of the type OutputStream instead of a std::ostream. This allows us to do some more book keeping and control re-opening of files when the output directory is changed. Second, new subdirectories are OutputDirectory instances, which should be used to create files in that sub-directory. Signed-off-by: Andreas Sandberg [sascha.bischoff@arm.com: Rebased patches onto a newer gem5 version] Signed-off-by: Sascha Bischoff Signed-off-by: Andreas Sandberg --- src/python/swig/trace.i | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/python/swig') diff --git a/src/python/swig/trace.i b/src/python/swig/trace.i index 50ff7fd3d..48caf456a 100644 --- a/src/python/swig/trace.i +++ b/src/python/swig/trace.i @@ -38,12 +38,12 @@ inline void output(const char *filename) { - std::ostream *file_stream = simout.find(filename); + OutputStream *file_stream = simout.find(filename); if (!file_stream) file_stream = simout.create(filename); - Trace::setDebugLogger(new Trace::OstreamLogger(*file_stream)); + Trace::setDebugLogger(new Trace::OstreamLogger(*file_stream->stream())); } inline void -- cgit v1.2.3