Skip to content

Commit

Permalink
Added debugging of file system events.
Browse files Browse the repository at this point in the history
  • Loading branch information
LarsAsplund committed Sep 12, 2024
1 parent bcf53c0 commit 20a382e
Showing 1 changed file with 24 additions and 3 deletions.
27 changes: 24 additions & 3 deletions examples/vhdl/three_step_flow/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.INFO, format="%(asctime)s.%(msecs)03d - %(levelname)7s - %(message)s", datefmt="%H:%M:%S"
)

cli = VUnitCLI()

Expand All @@ -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")
Expand All @@ -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)

0 comments on commit 20a382e

Please # to comment.