diff --git a/script/src/Main.scala b/script/src/Main.scala index 427fb037ca..e41bc51b08 100644 --- a/script/src/Main.scala +++ b/script/src/Main.scala @@ -180,6 +180,10 @@ object Main: name = "event-log-path", doc = "Set the event log path" ) eventLogFilePath: Option[os.Path] = None, + @arg( + name = "program-output-path", + doc = "Path to store the ELF stdout/stderr" + ) programOutputFilePath: Option[os.Path] = None, @arg( name = "out-dir", doc = "path to save wave file and perf result file" @@ -231,6 +235,11 @@ object Main: val eventLogPath = if eventLogFilePath.isDefined then eventLogFilePath.get else outputPath / "rtl-event.log" + val programOutputPath = + if programOutputFilePath.isDefined then programOutputFilePath.get + else outputPath / "mmio-store.txt" + if os.exists(programOutputPath) then + os.remove(programOutputPath) def dumpCycleAsFloat() = val ratio = dumpCycle.toFloat @@ -302,7 +311,9 @@ object Main: .arr(0) .obj("beatbyte") .toString(), - s"--log-path=${emulatorLogPath}" + s"--log-path=${emulatorLogPath}", + "--program-output-path", + programOutputPath.toString, ) ++ optionals(noLog.value, Seq("--no-logging")) ++ optionals(noFileLog.value, Seq("--no-file-logging")) ++ optionals(noConsoleLog.value, Seq("--no-console-logging"))