sgherbst / pysvinst

Python library for parsing module definitions and instantiations from SystemVerilog files
MIT License
22 stars 5 forks source link

Support Python 3.8, show macro definitions, explain files with syntax errors #11

Closed sgherbst closed 3 years ago

sgherbst commented 3 years ago

Summary

This PR addresses issues #6, #7, and #9. It also updates the sv-parser version to 0.8.2.

Details

  1. Adds support for Python 3.8 by releasing a binary wheel for it (Linux and macOS) and including Python 3.8 in the regression tests suite.
  2. Adds a debugging feature that shows macro definitions on a per-file basis. To activate it, set show_macro_defs to True when running call_svinst, get_defs, or get_syntax_tree. At the moment, macro definitions are shown as text strings rendered by **sv-parser``. In the future, these strings may be parsed to make the information inside more conveniently accessible.
  3. When multiple files are passed to call_svinst, get_defs, or get_syntax_tree, the tool will try to explain which files have syntax errors. It prints the indices of files in the list that have errors (starting with 1), and indicates the names of those files using asterisks. If needed, this feature can be disabled by setting explain_error=False.