From 934160d61951e189a89c6b5c842dc857a338d372 Mon Sep 17 00:00:00 2001 From: Byron Lathi Date: Tue, 25 Feb 2025 08:09:11 -0800 Subject: [PATCH] Limit number of jobs for verilator --- pyproject.toml | 2 +- src/fpga_sim/fpga_sim.py | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 1f2d296..4e96454 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -35,7 +35,7 @@ name = "fpga-sim" # REQUIRED, is the only field that cannot be marked as dynami # https://packaging.python.org/guides/single-sourcing-package-version/ # dynamic = ["version"] -version = "0.2.1" # REQUIRED, although can be dynamic +version = "0.2.2" # REQUIRED, although can be dynamic # This is a one-line description or tagline of what your project does. This # corresponds to the "Summary" metadata field: diff --git a/src/fpga_sim/fpga_sim.py b/src/fpga_sim/fpga_sim.py index 4ab539d..fcc61eb 100644 --- a/src/fpga_sim/fpga_sim.py +++ b/src/fpga_sim/fpga_sim.py @@ -22,6 +22,7 @@ def fpga_sim_main(): parser.add_argument("yaml") parser.add_argument("test_name", nargs="?") + parser.add_argument("-j", "--jobs", default=1) args = parser.parse_args() @@ -78,7 +79,9 @@ def fpga_sim_main(): sim = os.getenv("SIM", "verilator") runner = get_runner(sim) - os.environ["MAKEFLAGS"] = "-j" + jobs = args.jobs + print(jobs) + os.environ["MAKEFLAGS"] = f"-j{jobs}" tests_to_run = [] @@ -107,3 +110,4 @@ def fpga_sim_main(): sys.path.append(test["base_path"]) runner.test(hdl_toplevel=test["toplevel"], test_module=test["modules"], waves=test["waves"], results_xml=result_xml) +