svql: SystemVerilog Module Analysis Tool
A Python tool for parsing and analyzing SystemVerilog modules using SQL queries.
Overview
svql provides a simple interface to extract and query information from SystemVerilog modules. It parses module parameters, ports, and their connections, storing them in SQL-queryable DataFrames.
Installation
Very easy! Just run:
pip install svql
Usage
Below are some examples demonstrating how to parse a SystemVerilog module, execute queries, and print the outputs.
Example 1: Query Parameters Not Changed from Default
Module parameters typically come with default values. When a parameter has not been explicitly overridden, it retains its default value. Use the following query to extract those parameters:
from svql import Module
# Parse a SystemVerilog module
module = Module("path/to/your/module.sv")
print(f"All parameters that have not been changed from default for {module.header}:")
print(module.query("SELECT * FROM params WHERE override_value IS NULL"), "\n")
# Expected Output:
# All parameters that have not been changed from default for pipeline_top:
# name dtype default_value override_value scope typed_param
# 0 DATA_WIDTH int 32 None parameter 0
# 1 FILTER_TAPS int 4 None parameter 0
# 2 BUFFER_DEPTH int 8 None parameter 0
Example 2: Query Input Ports
To retrieve all input ports of a module, filter the ports based on their direction:
from svql import Module
# Parse a SystemVerilog module
module = Module("path/to/your/module.sv")
print(f"Ports where direction = 'input' for {module.header}:")
print(module.query("SELECT * FROM ports WHERE direction = 'input'"), "\n")
# Expected Output:
# Ports where direction = 'input' for pipeline_top:
# name dtype direction width connected_to
# 0 clk logic input 1 None
# 1 rst_n logic input 1 None
# 2 data_in logic input [DATA_WIDTH-1:0] None
# 3 valid_in logic input 1 None
# 4 read_en logic input 1 None
Metadata
Release files for svql 0.1.9
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| svql-0.1.9.tar.gz | 7.0 kB | Without provenance | Details for svql-0.1.9.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| svql-0.1.9-py3-none-any.whl | Python 3 | none | any | Details for svql-0.1.9-py3-none-any.whl |
Total release size: 14.7 kB
Release files / svql-0.1.9.tar.gz
| Download URL | svql-0.1.9.tar.gz |
|---|---|
| Size | 7.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
722518836d61eb3e22b38d21729a0c492081d493b5963169a14c53c9660a9da6
|
|
BLAKE2b-256 checksum How to use checksums |
8341f00cb7e5911f2dde5cae207939a18c45732f940005e806cb098d246c7b54
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.9.19
|
Release files / svql-0.1.9-py3-none-any.whl
| Download URL | svql-0.1.9-py3-none-any.whl |
|---|---|
| Size | 7.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
0a99a8fab2a942e6ad676f3a45e09b5ac41b10452b740cb943063a2b4910df23
|
|
BLAKE2b-256 checksum How to use checksums |
c0b9437121b1d3e36fda5e583f373ac2ff2228d92d004a958ce81926b08016a0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.9.19
|
Security for svql 0.1.9
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.