AI-assisted hardware waveform debugging tool
Project description
Tsunami
AI-assisted hardware waveform debugging tool. Tsunami provides a Rust-powered query engine (using the wellen crate) exposed to Python via PyO3, with three entry points: a Python library, an MCP server for Claude Code, and a CLI.
Requirements
- Python 3.12+
- Rust toolchain (rustc, cargo)
- uv for project management
Setup
uv sync # Install Python dependencies
uv run maturin develop # Build the Rust extension
Usage
CLI
# Waveform metadata
tsunami info <file.fst>
# Signal discovery (glob patterns)
tsunami signals <file.fst> "*clk*"
# Browse hierarchy
tsunami scopes <file.fst> "tb.dut"
# Point query
tsunami value <file.fst> <signal> <time>
# Transitions in a time range
tsunami transitions <file.fst> <signal> <t0> <t1>
# Multi-signal snapshot at a single time
tsunami snapshot <file.fst> <time> <signal1> <signal2> ...
# Signal summary (period, duty cycle, anomalies)
tsunami summarize <file.fst> <signal> <t0> <t1>
# Anomaly detection (glitches, gaps, stuck signals)
tsunami anomalies <file.fst> <signal> <t0> <t1>
# Start MCP server for Claude Code
tsunami serve <file.fst>
Time values accept human-readable formats: 100ps, 1284ns, 1.284us, 642cyc, or raw integers (picoseconds).
Python Library
import tsunami
handle = tsunami.open("sim.fst")
info = tsunami.waveform_info(handle)
# Discover signals
signals = tsunami.list_signals(handle, "*valid*")
# Point query
val = tsunami.get_value(handle, "tb.dut.tl_a_valid", 1_284_000)
# Transitions in a window
result = tsunami.get_transitions(handle, "tb.dut.clk", 0, 10_000_000)
# Multi-signal snapshot
snap = tsunami.get_snapshot(handle, ["tb.dut.clk", "tb.dut.reset"], 1_000)
# Summarise a signal
summary = tsunami.summarize(handle, "tb.dut.clk", 0, 10_000_000)
Predicate DSL
Compose multi-signal conditions that evaluate entirely in Rust in a single pass:
from tsunami.predicate import Signal, scope
with scope("tb.dut") as s:
# TileLink handshake with specific opcode
handshake = s.tl_a_valid & s.tl_a_ready & (s.tl_a_opcode == 4)
# Rising edge detection
rising = s.clk.rise()
# Sequence with time window
roundtrip = handshake >> (s.tl_d_valid & s.tl_d_ready, 50_000)
# Negated preceded-by (protocol violation)
spurious = s.tl_d_valid.rise().preceded_by(handshake, within_ps=50_000).__invert__()
# Scan entirely in Rust
matches = tsunami.find_all(handle, handshake, t0_ps=0, t1_ps=10_000_000)
first = tsunami.find_first(handle, rising, after_ps=0)
MCP Server (Claude Code)
Start the server:
tsunami serve sim.fst
Add to your Claude Code MCP config:
{
"mcpServers": {
"tsunami": {
"command": "tsunami",
"args": ["serve", "sim.fst"]
}
}
}
Available tools: waveform_info, search_signals, browse_scopes, get_snapshot, get_signal_window, find_first_match, find_all_matches, find_anomalies.
Architecture
Claude Code
| MCP protocol (JSON, stdio)
Python MCP Server / CLI
| PyO3 direct function calls
Rust query engine (_engine.so)
| wellen crate
FST / VCD waveform files
| Layer | Technology | Responsibility |
|---|---|---|
| MCP Server | Python, FastMCP | Tool definitions, time parsing, auto-summarisation |
| Query Engine | Rust, PyO3 | Signal access, predicate evaluation, summarisation |
| Waveform I/O | wellen | FST/VCD parsing, memory-mapped lazy loading |
Testing
uv run pytest tests/ -v
Project Structure
tsunami/
├── pyproject.toml # maturin build backend, uv managed
├── Cargo.toml # wellen + pyo3 deps
├── src/ # Rust crate (PyO3 cdylib)
│ ├── lib.rs # PyO3 module entry
│ ├── query.rs # Core signal queries
│ ├── predicate.rs # Expr enum, evaluation engine
│ └── summarise.rs # Anomaly detection, period inference
├── python/tsunami/
│ ├── __init__.py # Public API re-exports
│ ├── _engine.pyi # Type stubs for Rust module
│ ├── predicate.py # Python DSL (Expr dataclasses + operators)
│ ├── time_parse.py # ns/us/cyc -> ps normalisation
│ ├── server.py # MCP server (FastMCP)
│ └── cli.py # CLI entry point
└── tests/
├── test_engine.py # Rust engine integration tests
├── test_predicate.py # DSL unit tests
└── test_time_parse.py # Time parser tests
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
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 tsunami_wave-0.1.0.tar.gz.
File metadata
- Download URL: tsunami_wave-0.1.0.tar.gz
- Upload date:
- Size: 286.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 |
7ab4472c4e7a4a368b28de414c6507387673ba8a87110f1e7da92dde1af56ad1
|
|
| MD5 |
9c98bee0b07346b7cd70b382b55e02e1
|
|
| BLAKE2b-256 |
349c0ecd81cbcede6caee8f64a88795869e78c6a9bbf746e86292a96966dfa63
|
Provenance
The following attestation bundles were made for tsunami_wave-0.1.0.tar.gz:
Publisher:
release.yml on zarubaf/tsunami
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
tsunami_wave-0.1.0.tar.gz -
Subject digest:
7ab4472c4e7a4a368b28de414c6507387673ba8a87110f1e7da92dde1af56ad1 - Sigstore transparency entry: 1091372698
- Sigstore integration time:
-
Permalink:
zarubaf/tsunami@8e167e995914defaeb3b78b73a777c6f95226c67 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/zarubaf
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@8e167e995914defaeb3b78b73a777c6f95226c67 -
Trigger Event:
push
-
Statement type:
File details
Details for the file tsunami_wave-0.1.0-pp310-pypy310_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.
File metadata
- Download URL: tsunami_wave-0.1.0-pp310-pypy310_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
- Upload date:
- Size: 658.6 kB
- Tags: PyPy, manylinux: glibc 2.17+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c1a67c27132a4394224e3df77f43950fdb38936deebb14860c22eafd2b79de2f
|
|
| MD5 |
d87222e4919fbe26b7569789cc928b97
|
|
| BLAKE2b-256 |
3574d19917e83a0a0641bb88a7b827fa6351aed899d722e0c9eed285ecce6383
|
Provenance
The following attestation bundles were made for tsunami_wave-0.1.0-pp310-pypy310_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl:
Publisher:
release.yml on zarubaf/tsunami
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
tsunami_wave-0.1.0-pp310-pypy310_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl -
Subject digest:
c1a67c27132a4394224e3df77f43950fdb38936deebb14860c22eafd2b79de2f - Sigstore transparency entry: 1091372826
- Sigstore integration time:
-
Permalink:
zarubaf/tsunami@8e167e995914defaeb3b78b73a777c6f95226c67 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/zarubaf
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@8e167e995914defaeb3b78b73a777c6f95226c67 -
Trigger Event:
push
-
Statement type:
File details
Details for the file tsunami_wave-0.1.0-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.
File metadata
- Download URL: tsunami_wave-0.1.0-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
- Upload date:
- Size: 661.0 kB
- Tags: PyPy, manylinux: glibc 2.17+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3d1a0c948e84558a038ac1ba2711af41b4abf2e0dcea5a1a5f4aae3155fef3c4
|
|
| MD5 |
7a4411a0128835c90507e7ae429bdbf9
|
|
| BLAKE2b-256 |
9872001b3ec6ead3afda479e932ee8ada8d90b5cc7c535f12cec6bcdbc0c75b7
|
Provenance
The following attestation bundles were made for tsunami_wave-0.1.0-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl:
Publisher:
release.yml on zarubaf/tsunami
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
tsunami_wave-0.1.0-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl -
Subject digest:
3d1a0c948e84558a038ac1ba2711af41b4abf2e0dcea5a1a5f4aae3155fef3c4 - Sigstore transparency entry: 1091373000
- Sigstore integration time:
-
Permalink:
zarubaf/tsunami@8e167e995914defaeb3b78b73a777c6f95226c67 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/zarubaf
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@8e167e995914defaeb3b78b73a777c6f95226c67 -
Trigger Event:
push
-
Statement type:
File details
Details for the file tsunami_wave-0.1.0-cp312-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.
File metadata
- Download URL: tsunami_wave-0.1.0-cp312-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
- Upload date:
- Size: 655.7 kB
- Tags: CPython 3.12+, manylinux: glibc 2.17+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
47077b03e3a4bbfdac1b6c798c7042b69890473ff6914a30eb1acbe63773f463
|
|
| MD5 |
847c1c9146b924401a08c1b5fe29fc6c
|
|
| BLAKE2b-256 |
5e3542005437ae79bf39691070e3a0266fe145466ae7d17d5f5e13efd1b1878a
|
Provenance
The following attestation bundles were made for tsunami_wave-0.1.0-cp312-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl:
Publisher:
release.yml on zarubaf/tsunami
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
tsunami_wave-0.1.0-cp312-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl -
Subject digest:
47077b03e3a4bbfdac1b6c798c7042b69890473ff6914a30eb1acbe63773f463 - Sigstore transparency entry: 1091372937
- Sigstore integration time:
-
Permalink:
zarubaf/tsunami@8e167e995914defaeb3b78b73a777c6f95226c67 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/zarubaf
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@8e167e995914defaeb3b78b73a777c6f95226c67 -
Trigger Event:
push
-
Statement type:
File details
Details for the file tsunami_wave-0.1.0-cp312-abi3-macosx_11_0_arm64.whl.
File metadata
- Download URL: tsunami_wave-0.1.0-cp312-abi3-macosx_11_0_arm64.whl
- Upload date:
- Size: 597.2 kB
- Tags: CPython 3.12+, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a8cb0cd9980214418b676962f41b8ff73ef3e03559077f22834d1ca707bc0aca
|
|
| MD5 |
3dffacfd55a6f2731767c0ff0b65d985
|
|
| BLAKE2b-256 |
f8dd3c41513929d952a7ddbe5b223d9536f34b73cc3f0f645f58203879bf76c8
|
Provenance
The following attestation bundles were made for tsunami_wave-0.1.0-cp312-abi3-macosx_11_0_arm64.whl:
Publisher:
release.yml on zarubaf/tsunami
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
tsunami_wave-0.1.0-cp312-abi3-macosx_11_0_arm64.whl -
Subject digest:
a8cb0cd9980214418b676962f41b8ff73ef3e03559077f22834d1ca707bc0aca - Sigstore transparency entry: 1091372889
- Sigstore integration time:
-
Permalink:
zarubaf/tsunami@8e167e995914defaeb3b78b73a777c6f95226c67 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/zarubaf
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@8e167e995914defaeb3b78b73a777c6f95226c67 -
Trigger Event:
push
-
Statement type:
File details
Details for the file tsunami_wave-0.1.0-cp312-abi3-macosx_10_12_x86_64.whl.
File metadata
- Download URL: tsunami_wave-0.1.0-cp312-abi3-macosx_10_12_x86_64.whl
- Upload date:
- Size: 614.6 kB
- Tags: CPython 3.12+, macOS 10.12+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9403d708afe18aef2db949bfa52db7a222483ef17ef7f74cb4e3fa76d28fc135
|
|
| MD5 |
fd1de86b1cfb9023f54272b93bd94e8b
|
|
| BLAKE2b-256 |
fa8f03e1d77d653ccdae49e6ef9cfe05912c8b31c6e748133c62fd506460026e
|
Provenance
The following attestation bundles were made for tsunami_wave-0.1.0-cp312-abi3-macosx_10_12_x86_64.whl:
Publisher:
release.yml on zarubaf/tsunami
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
tsunami_wave-0.1.0-cp312-abi3-macosx_10_12_x86_64.whl -
Subject digest:
9403d708afe18aef2db949bfa52db7a222483ef17ef7f74cb4e3fa76d28fc135 - Sigstore transparency entry: 1091372763
- Sigstore integration time:
-
Permalink:
zarubaf/tsunami@8e167e995914defaeb3b78b73a777c6f95226c67 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/zarubaf
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@8e167e995914defaeb3b78b73a777c6f95226c67 -
Trigger Event:
push
-
Statement type:
File details
Details for the file tsunami_wave-0.1.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.
File metadata
- Download URL: tsunami_wave-0.1.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 668.9 kB
- Tags: CPython 3.8, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
38e5f2f7532fbdda8bb392ce29cf9a4467b94402b74fd124dc3762095f5a097f
|
|
| MD5 |
2c5bb4e9a9cbeeab142ba9ffdc0a4c2a
|
|
| BLAKE2b-256 |
b44b59d5f117c616f0914a6a5cfdfc7beaf10ae0a90216adcb8929d290f3c920
|
Provenance
The following attestation bundles were made for tsunami_wave-0.1.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:
Publisher:
release.yml on zarubaf/tsunami
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
tsunami_wave-0.1.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl -
Subject digest:
38e5f2f7532fbdda8bb392ce29cf9a4467b94402b74fd124dc3762095f5a097f - Sigstore transparency entry: 1091373028
- Sigstore integration time:
-
Permalink:
zarubaf/tsunami@8e167e995914defaeb3b78b73a777c6f95226c67 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/zarubaf
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@8e167e995914defaeb3b78b73a777c6f95226c67 -
Trigger Event:
push
-
Statement type: