From dd33e02befd83ac3fb3b5c2d48ab963d0a825742 Mon Sep 17 00:00:00 2001 From: Byron Lathi Date: Sat, 22 Nov 2025 16:27:19 -0800 Subject: [PATCH] Catch exception --- pyproject.toml | 2 +- src/fpga_sim/fpga_sim.py | 22 +++++++++++++--------- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 1afce37..37c5693 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.5.0" # REQUIRED, although can be dynamic +version = "0.5.1" # 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 a8f97a9..d9fbab8 100644 --- a/src/fpga_sim/fpga_sim.py +++ b/src/fpga_sim/fpga_sim.py @@ -108,15 +108,19 @@ def fpga_sim_main(): if test["waves"]: build_args.append("--trace-fst") - runner.build( - sources=sources, - includes=incdirs, - hdl_toplevel=test["toplevel"], - build_dir=f"{test['base_path']}/sim_build", - waves=test["waves"], - defines=defines, - build_args=build_args - ) + try: + runner.build( + sources=sources, + includes=incdirs, + hdl_toplevel=test["toplevel"], + build_dir=f"{test['base_path']}/sim_build", + waves=test["waves"], + defines=defines, + build_args=build_args + ) + except CalledProcessError: + print("Failed to compile") + return result_xml = f"../sim_build/{test['name']}_results.xml".replace(" ", "_")