sim-se: create Proc out files in out dir
authorSteve Reinhardt <steve.reinhardt@amd.com>
Wed, 18 Apr 2018 20:41:32 +0000 (16:41 -0400)
committerBrandon Potter <Brandon.Potter@amd.com>
Mon, 29 Apr 2019 20:37:29 +0000 (20:37 +0000)
Redirected output files from Process objects were being
created in the current directory instead of in the
output directory.

Change-Id: Ieb6ab5556fbcc811f4f24910da247d4dcdbc71bd
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/12122
Reviewed-by: Brandon Potter <Brandon.Potter@amd.com>
Maintainer: Brandon Potter <Brandon.Potter@amd.com>
Tested-by: kokoro <noreply+kokoro@google.com>
src/sim/fd_array.cc

index 0600e9ffef066c33080f30ec5bd375419cea6b72..3b0c5879ae92f0bb6fabbc5799eef174bd2798e7 100644 (file)
@@ -43,6 +43,7 @@
 #include <string>
 
 #include "base/logging.hh"
+#include "base/output.hh"
 #include "params/Process.hh"
 #include "sim/fd_entry.hh"
 
@@ -311,7 +312,8 @@ FDArray::openInputFile(std::string const& filename) const
 int
 FDArray::openOutputFile(std::string const& filename) const
 {
-    return openFile(filename, O_WRONLY | O_CREAT | O_TRUNC, 0664);
+    return openFile(simout.resolve(filename),
+                    O_WRONLY | O_CREAT | O_TRUNC, 0664);
 }
 
 std::shared_ptr<FDEntry>