Convert VCD signals to sets of time points based on conditions
Project description
SetVCD
Programmatically inspect hardware VCD signals using a high-level functional interface.
Higher-order programming constructs and set operations are a natural fit for inspecting VCD signals, and this Python library allows you to easily specify, in text, what simulation timesteps matter to functional correctness.
Motivating Example
Say you are debugging a streaming input interface (Accelerator.io_input) and you would like to extract only the values when the streaming transaction is valid. Typically when viewing a wavefile in a viewer, the points we care about look like this:
We can write this desired condition, parameterised by simulation timestep t as a formal statement:
(clk(t - 1) == 0 and clk(t) == 1) and
reset(t) == 0 and
input_ready(t) == 1 and
input_valid(t) == 1
This is a very natural fit for higher-order functions and set operations.
This library provides you two important methods:
-
Get set of timesteps with condition:
SetVCD.get(signal_name: String, condition: (ValueType, ValueType, ValueType) -> Bool, value_type: Raw or String or FP) -> SignalExpression
- SignalExpression represents subset of timesteps of the wavefile that meet the provided condition.
- Two SignalExpression objects (
aandb) be combined with set operations to create a higher SignalExpressionc = a & b: c is the intersection of set a and b.c = a | b: c is the union of set a and b.c = a ^ b: c is the difference of set a and b.
-
A SignalExpression object obtained from
getand combined with operations can then be evaluated on the wavefile via:SetVCD.get_value(signal_name: str, expr: SignalExpression, value_type: Raw or String or FP) -> List(Value) SetVCD.get_value_with_t(signal_name: str, expr: SignalExpression, value_type: Raw or String or FP) -> List((Timestep, Value))
- This yields the set of values you would be interested in.
For a practical example, please see our pre-filled notebook: example.ipynb
Overview
SetVCD is a Python package for analyzing Verilog VCD files and extracting time points where specific signal conditions are met. It provides a simple, type-safe interface for working with simulation waveforms using set-based operations.
Installation
The package is available in PyPI:
pip install setVCD
Future Enhancements
Planned for future versions:
- Higher-order operations for signal conditions
- Performance optimization for large VCD files
- Streaming interface for very large files
- MCP (Model Context Protocol) integration
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file setvcd-0.7.0.tar.gz.
File metadata
- Download URL: setvcd-0.7.0.tar.gz
- Upload date:
- Size: 22.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5a6399ef0575204f2fc237351fe644d698673542a7f75e945688e13ce9a056e4
|
|
| MD5 |
1f9bf2673551392245fc96eb1b427d39
|
|
| BLAKE2b-256 |
7687ea32cf2f6963b865f1f34a9bfb07ab5e47828cc2adf1bd07b1c103e4101b
|
Provenance
The following attestation bundles were made for setvcd-0.7.0.tar.gz:
Publisher:
pypi.yml on mrontio/setVCD
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
setvcd-0.7.0.tar.gz -
Subject digest:
5a6399ef0575204f2fc237351fe644d698673542a7f75e945688e13ce9a056e4 - Sigstore transparency entry: 1051769867
- Sigstore integration time:
-
Permalink:
mrontio/setVCD@ec8b05316e061de21846e639ff014c2753f2d9cc -
Branch / Tag:
refs/tags/v0.7.0 - Owner: https://github.com/mrontio
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi.yml@ec8b05316e061de21846e639ff014c2753f2d9cc -
Trigger Event:
release
-
Statement type:
File details
Details for the file setvcd-0.7.0-py3-none-any.whl.
File metadata
- Download URL: setvcd-0.7.0-py3-none-any.whl
- Upload date:
- Size: 13.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b59aec8bf3d6fd789d72d03a502a5ee42551e94d687b1eb7af0286614e316984
|
|
| MD5 |
26e5663e6f708038dd713387ba21cf06
|
|
| BLAKE2b-256 |
9b5407ba196c583bed707c6fc45c033b92a63df8f0ac79581abf59518faaa315
|
Provenance
The following attestation bundles were made for setvcd-0.7.0-py3-none-any.whl:
Publisher:
pypi.yml on mrontio/setVCD
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
setvcd-0.7.0-py3-none-any.whl -
Subject digest:
b59aec8bf3d6fd789d72d03a502a5ee42551e94d687b1eb7af0286614e316984 - Sigstore transparency entry: 1051769875
- Sigstore integration time:
-
Permalink:
mrontio/setVCD@ec8b05316e061de21846e639ff014c2753f2d9cc -
Branch / Tag:
refs/tags/v0.7.0 - Owner: https://github.com/mrontio
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi.yml@ec8b05316e061de21846e639ff014c2753f2d9cc -
Trigger Event:
release
-
Statement type: