vcdvcd
raw JSON → 2.6.0 verified Fri May 01 auth: no python
A Python library for parsing Verilog Value Change Dump (VCD) files, with a built-in command-line viewer vcdcat. Current version 2.6.0, released 2024. Development is stable with occasional updates.
pip install vcdvcd Common errors
error ModuleNotFoundError: No module named 'vcdvcd' ↓
cause Library not installed.
fix
pip install vcdvcd
error AttributeError: 'VCDVCD' object has no attribute 'signals' ↓
cause Using an old import or attribute name; signals may not be populated if VCD file has no signals, or incorrect version.
fix
Ensure you are using from vcdvcd import VCDVCD and that the file is valid. Check vcd.signals is a list.
Warnings
gotcha Signal hierarchy uses dots internally; signals are stored with full hierarchical reference (e.g., 'top.sub.sig') even if the VCD uses dollar var. Querying without the full path will return None. ↓
fix Use vcd.signals to list available references and use the full dotted name.
gotcha Time values are stored as strings by default. vcds and changes are lists with time as first element (also string). ↓
fix Convert times to int if needed: int(time_value).
deprecated The old import from vcdvcd import VCD is deprecated and may be removed. Use VCDVCD. ↓
fix Change import to: from vcdvcd import VCDVCD
Imports
- VCDVCD
from vcdvcd import VCDVCD
Quickstart
from vcdvcd import VCDVCD
# Parse a VCD file
vcd = VCDVCD('trace.vcd')
# Iterate over signals
for signal in vcd.signals:
print(signal.reference, signal.times, signal.tv)
# Get a specific signal by reference (hierarchical name)
signal_data = vcd.get_signal_data('top.clk')
if signal_data:
print(signal_data.tv)