Files
yosys/tests/pyosys/test_monitor.py
T

23 lines
445 B
Python
Raw Normal View History

2025-09-21 22:36:27 +03:00
from pyosys import libyosys as ys
from pathlib import Path
__file_dir__ = Path(__file__).absolute().parent
d = ys.Design()
class Monitor(ys.Monitor):
def __init__(self):
super().__init__()
self.mods = []
def notify_module_add(self, mod):
self.mods.append(mod.name.str())
m = Monitor()
2025-10-22 00:02:40 +03:00
d.monitors = [m]
2025-09-21 22:36:27 +03:00
ys.run_pass(f"read_verilog {__file_dir__ / 'spm.cut.v.gz'}", d)
ys.run_pass("hierarchy -top spm", d)
assert m.mods == ["\\spm"]