Skip to main content

Test package

This project has been archived.

The maintainers of this project have marked this project as archived. No new releases are expected.

Project description

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

Install the required dependencies with:

pip install -r requirements.txt

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 module 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 module 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

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

svql_minimal-0.1.0.tar.gz (5.7 kB view details)

Uploaded Source

Built Distribution

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

svql_minimal-0.1.0-py3-none-any.whl (7.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: svql_minimal-0.1.0.tar.gz
  • Upload date:
  • Size: 5.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.21

File hashes

Hashes for svql_minimal-0.1.0.tar.gz
Algorithm Hash digest
SHA256 4dfdecd930ee5ca39066ba43dd464ccb8924c3a50b4bf758fbcbfbda2acdcd97
MD5 8a65e569a6acc2ab4d8ea49f9d4956f2
BLAKE2b-256 e65e7dfcb1239dedd65626234806b48cbdd7d9b716dd5d3186d426ea82f4ade7

See more details on using hashes here.

File details

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

File metadata

  • Download URL: svql_minimal-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 7.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.21

File hashes

Hashes for svql_minimal-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c5948e5266c2138bd7396a40c4913d0b4a783ae37e520d47d724e9b7a0f4c63b
MD5 6e58cced73bc3263a55f79b95f6cf4dc
BLAKE2b-256 acb81e66529bc8173d20b651beb17b0153d07ccf6b36546f972fd18424aa0542

See more details on using hashes here.

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