Download chips/yosys/tests/pyosys/test_monitor.py from STAR-future/Trinity-SciData: direct link, hf CLI and curl.
- Browser
- Download file 445 Bytes
-
https://huggingface.co/datasets/STAR-future/Trinity-SciData/resolve/main/chips/yosys/tests/pyosys/test_monitor.py
- Command line
-
hf download hf://datasets/STAR-future/Trinity-SciData/chips/yosys/tests/pyosys/test_monitor.py
-
curl -L -o test_monitor.py https://huggingface.co/datasets/STAR-future/Trinity-SciData/resolve/main/chips/yosys/tests/pyosys/test_monitor.py
445 Bytes
| 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() | |
| d.monitors = [m] | |
| ys.run_pass(f"read_verilog {__file_dir__ / 'spm.cut.v.gz'}", d) | |
| ys.run_pass("hierarchy -top spm", d) | |
| assert m.mods == ["\\spm"] | |