From a234aa700cb2addd7581f3febb74f3704f5685a5 Mon Sep 17 00:00:00 2001 From: Lars Asplund Date: Thu, 12 Sep 2024 23:36:30 +0200 Subject: [PATCH] Added debugging of file system events. --- examples/vhdl/three_step_flow/run.py | 27 ++++++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/examples/vhdl/three_step_flow/run.py b/examples/vhdl/three_step_flow/run.py index 580d38abf..84d498687 100644 --- a/examples/vhdl/three_step_flow/run.py +++ b/examples/vhdl/three_step_flow/run.py @@ -8,6 +8,13 @@ from pathlib import Path from vunit import VUnit, VUnitCLI from os import environ +import logging +from watchdog.observers import Observer +from watchdog.events import LoggingEventHandler + +logging.basicConfig( + level=logging.DEBUG, format="%(asctime)s.%(msecs)03d - %(levelname)7s - %(message)s", datefmt="%H:%M:%S" +) cli = VUnitCLI() @@ -16,11 +23,13 @@ vu = VUnit.from_argv() vu.add_vhdl_builtins() +root = Path(__file__).parent + lib1 = vu.add_library("lib1") -lib1.add_source_files(Path(__file__).parent / "sub_module" / "*.vhd") +lib1.add_source_files(root / "sub_module" / "*.vhd") lib2 = vu.add_library("lib2") -lib2.add_source_files(Path(__file__).parent / "*.vhd") +lib2.add_source_files(root / "*.vhd") tb = lib2.test_bench("tb_example") test = tb.test("test") @@ -29,5 +38,17 @@ test.add_config(name=f"{value}", generics=dict(value=value)) vu.set_sim_option("modelsim.three_step_flow", True) +vu.set_sim_option("modelsim.vsim_flags", ["-novopt", "-suppress", "12110"]) + +event_handler = LoggingEventHandler() +observer = Observer() +observer.schedule(event_handler, root / "vunit_out" / "modelsim", recursive=True) +observer.start() + + +def post_run(results): + observer.stop() + observer.join() + -vu.main() +vu.main(post_run=post_run)