Skip to main content

Generate empty SystemVerilog shells with all signal types forced to logic

Project description

sv-shell

sv-shell is a Python library and Linux CLI that reads a single Verilog/SystemVerilog file and generates an empty SystemVerilog shell that contains only the module declaration and port list (plus parameter port list, if present). Port types are forced to logic.

It uses pyslang (py-slang) AST parsing.

Install (PyPI)

python3 -m pip install ab-sv-shell

Install (Local Development)

python3 -m pip install -e .

CLI

sv-shell path/to/design.sv
sv-shell path/to/design.sv -o shell.sv
sv-shell path/to/design.sv --module my_module

Library

from sv_shell import generate_shell_from_file

shell = generate_shell_from_file("path/to/design.sv")
print(shell)

Example

Example files are included in examples/:

  • Input Verilog: examples/counter.v
  • Generated SystemVerilog shell: examples/counter_shell.sv

Run the example (counter.v) from this repository root:

python3 -m venv .venv
. .venv/bin/activate
pip install -e .
sv-shell examples/counter.v -o examples/counter_shell.sv
cat examples/counter_shell.sv

Maintainer Notes

Release and PyPI publishing steps are documented in RELEASING.md.

License

Project source code is licensed under LGPL-3.0-or-later. Generated output files do not include injected SPDX/copyright lines, so existing copyright / licensing on your original source is applied to the generated file.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ab_sv_shell-0.1.0.tar.gz (7.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ab_sv_shell-0.1.0-py3-none-any.whl (8.7 kB view details)

Uploaded Python 3

File details

Details for the file ab_sv_shell-0.1.0.tar.gz.

File metadata

  • Download URL: ab_sv_shell-0.1.0.tar.gz
  • Upload date:
  • Size: 7.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for ab_sv_shell-0.1.0.tar.gz
Algorithm Hash digest
SHA256 dfb4f8e82770b3381d2957cc79216c6c898338bfc606d0d93f3c23803b8ac40b
MD5 19d3434703fc6505be6e0510a2250f97
BLAKE2b-256 c90e6f64a19bc9dbf9d2a336e9a05211281936bdcafe6ee3d2cb8452382bba44

See more details on using hashes here.

Provenance

The following attestation bundles were made for ab_sv_shell-0.1.0.tar.gz:

Publisher: publish.yml on Topi-ab/sv-shell

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ab_sv_shell-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: ab_sv_shell-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 8.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for ab_sv_shell-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b73a480d5a9ce43172ae8b2797c0cdd1726424c59c2ca97f1f86ef6c60ce7169
MD5 260903ad9bff582bc559d33731260dd3
BLAKE2b-256 95a5ecd21eb8d410338eea39344bbba3a3bcb4e8de3d2469e0b2869f9d693e3f

See more details on using hashes here.

Provenance

The following attestation bundles were made for ab_sv_shell-0.1.0-py3-none-any.whl:

Publisher: publish.yml on Topi-ab/sv-shell

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page