From 7d2e19ac269d0747fb0f783d3b66e88620bdccbe Mon Sep 17 00:00:00 2001 From: developandplay <34752929+developandplay@users.noreply.github.com> Date: Fri, 18 Jun 2021 12:35:42 +0200 Subject: [PATCH] Enable non-interactive mode --- litex/build/sim/verilator.py | 5 +++-- litex/tools/litex_sim.py | 4 +++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/litex/build/sim/verilator.py b/litex/build/sim/verilator.py index 86421f2f2..a96926866 100644 --- a/litex/build/sim/verilator.py +++ b/litex/build/sim/verilator.py @@ -189,7 +189,8 @@ class SimVerilatorToolchain: trace_fst = False, trace_start = 0, trace_end = -1, - regular_comb = False): + regular_comb = False, + interactive = True): # Create build directory os.makedirs(build_dir, exist_ok=True) @@ -238,7 +239,7 @@ class SimVerilatorToolchain: run_as_root = True if sim_config.has_module("xgmii_ethernet"): run_as_root = True - _run_sim(build_name, as_root=run_as_root) + _run_sim(build_name, as_root=run_as_root, interactive=interactive) os.chdir(cwd) diff --git a/litex/tools/litex_sim.py b/litex/tools/litex_sim.py index c08da56e5..3d086ef1f 100755 --- a/litex/tools/litex_sim.py +++ b/litex/tools/litex_sim.py @@ -374,6 +374,7 @@ def sim_args(parser): parser.add_argument("--opt-level", default="O3", help="Compilation optimization level") parser.add_argument("--sim-debug", action="store_true", help="Add simulation debugging modules") parser.add_argument("--gtkwave-savefile", action="store_true", help="Generate GTKWave savefile") + parser.add_argument("--non-interactive", action="store_true", help="Run simulation without user input") def main(): parser = argparse.ArgumentParser(description="Generic LiteX SoC Simulation") @@ -452,7 +453,8 @@ def main(): trace = args.trace, trace_fst = args.trace_fst, trace_start = trace_start, - trace_end = trace_end + trace_end = trace_end, + interactive = not args.non_interactive ) if args.with_analyzer: soc.analyzer.export_csv(vns, "analyzer.csv")