Skip to main content

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: img/gtkwave.png

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 (a and b) be combined with set operations to create a higher SignalExpression
      • c = 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 get and 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

setvcd-0.7.0.tar.gz (22.3 kB view details)

Uploaded Source

Built Distribution

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

setvcd-0.7.0-py3-none-any.whl (13.6 kB view details)

Uploaded Python 3

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

Hashes for setvcd-0.7.0.tar.gz
Algorithm Hash digest
SHA256 5a6399ef0575204f2fc237351fe644d698673542a7f75e945688e13ce9a056e4
MD5 1f9bf2673551392245fc96eb1b427d39
BLAKE2b-256 7687ea32cf2f6963b865f1f34a9bfb07ab5e47828cc2adf1bd07b1c103e4101b

See more details on using hashes here.

Provenance

The following attestation bundles were made for setvcd-0.7.0.tar.gz:

Publisher: pypi.yml on mrontio/setVCD

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

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

Hashes for setvcd-0.7.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b59aec8bf3d6fd789d72d03a502a5ee42551e94d687b1eb7af0286614e316984
MD5 26e5663e6f708038dd713387ba21cf06
BLAKE2b-256 9b5407ba196c583bed707c6fc45c033b92a63df8f0ac79581abf59518faaa315

See more details on using hashes here.

Provenance

The following attestation bundles were made for setvcd-0.7.0-py3-none-any.whl:

Publisher: pypi.yml on mrontio/setVCD

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