From f63e4b17ab075b6f0b3be766630234410e07a0d5 Mon Sep 17 00:00:00 2001 From: Avimitin Date: Wed, 12 Jun 2024 03:10:27 +0800 Subject: [PATCH] [script] wrap programOutputPath for emulator Signed-off-by: Avimitin --- script/src/Main.scala | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/script/src/Main.scala b/script/src/Main.scala index 427fb037c..e41bc51b0 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"))