Skip to content

Commit

Permalink
[script] add debug option for emulator
Browse files Browse the repository at this point in the history
Signed-off-by: Avimitin <[email protected]>
  • Loading branch information
Avimitin committed Jan 14, 2025
1 parent 3036059 commit 744ea13
Showing 1 changed file with 28 additions and 18 deletions.
46 changes: 28 additions & 18 deletions script/emu/src/Main.scala
Original file line number Diff line number Diff line change
Expand Up @@ -275,25 +275,35 @@ object Main:

Logger.info(s"Starting IP emulator: `${processArgs.mkString(" ")}`")

val driverProc = os
.proc(processArgs)
.spawn(
stdout = journalPath,
stderr = os.Pipe,
env = optionalMap(verbose.value, Map("RUST_LOG" -> "TRACE"))
)
val zstdProc = os
.proc(Seq("zstd", "-o", s"${rtlEventPath}"))
.spawn(
stdin = driverProc.stderr,
stdout = os.Inherit,
stderr = os.Inherit
)
if verbose.value then
os.proc(processArgs)
.call(
stdout = os.Inherit,
stderr = os.Inherit,
env = optionalMap(verbose.value, Map("RUST_LOG" -> "TRACE")),
check = false
)
else
val driverProc = os
.proc(processArgs)
.spawn(
stdout = journalPath,
stderr = os.Pipe,
env = optionalMap(verbose.value, Map("RUST_LOG" -> "TRACE"))
)
val zstdProc = os
.proc(Seq("zstd", "-o", s"${rtlEventPath}"))
.spawn(
stdin = driverProc.stderr,
stdout = os.Inherit,
stderr = os.Inherit
)

zstdProc.join(-1)
driverProc.join(-1)
if zstdProc.exitCode() != 0 then Logger.fatal("fail to compress data")
if driverProc.exitCode() != 0 then Logger.fatal("online driver run failed")

zstdProc.join(-1)
driverProc.join(-1)
if zstdProc.exitCode() != 0 then Logger.fatal("fail to compress data")
if driverProc.exitCode() != 0 then Logger.fatal("online driver run failed")

Logger.info("Driver finished")

Expand Down

0 comments on commit 744ea13

Please sign in to comment.