Python library for operations with VCD and other digital wave files
MIT License
python library for operations with VCD and other digital wave files
Here is a simple example how to use the VCD parser:
#!/usr/bin/env python3
import json
import sys
from pyDigitalWaveTools.vcd.parser import VcdParser
if len(sys.argv) > 1:
fname = sys.argv[1]
else:
print('Give me a vcd file to parse')
sys.exit(-1)
with open(fname) as vcd_file:
vcd = VcdParser()
vcd.parse(vcd_file)
data = vcd.scope.toJson()
print(json.dumps(data, indent=4, sort_keys=True))
scope
{ "name": "<scope name>"
"children" : {"<children name>" : child}
}
child can be scope or signal record
signal record
{ "name": "<signal name>"
"type": {"sigType": "<vcd signal type>",
"width": <bit width of signal (integer)>},
"data": [<data records>],
}
data record format
[<time (number)>, <value (string, format dependent on datatype)>]