PySV

raw JSON →
0.3.1 verified Mon Apr 27 auth: no python

PySV is a Python library for reading, writing, and converting SystemVerilog files. Version 0.3.1, released periodically on GitHub.

pip install pysv
error ModuleNotFoundError: No module named 'pysv'
cause Library not installed or installed in wrong environment.
fix
Run pip install pysv and verify with pip list | grep pysv.
error AttributeError: module 'pysv' has no attribute 'SystemVerilogParser'
cause Incorrect import path; older library version.
fix
Use from pysv import SystemVerilogParser. Upgrade pysv: pip install --upgrade pysv.
error FileNotFoundError: [Errno 2] No such file or directory: 'example.sv'
cause File not found at given path.
fix
Provide absolute path or ensure file exists in current working directory.
breaking PySV is still in early development (pre-1.0). API may change without deprecation.
fix Pin exact version in requirements.txt and test upgrades.
gotcha Parser requires SystemVerilog-2005 or earlier; does not fully support newer constructs (e.g., interfaces, assertions).
fix Check documentation for supported features; use alternative for advanced SV.
gotcha File path in parse_file must be absolute or relative to CWD; no automatic resolution.
fix Use os.path.abspath() or set working directory accordingly.

Parse a SystemVerilog file and list module names.

from pysv import SystemVerilogParser

parser = SystemVerilogParser()
design = parser.parse_file('example.sv')
print(design.get_module_names())