https://github.com/nic30/pydigitalwavetools
Python library for operations with VCD and other digital wave files
https://github.com/nic30/pydigitalwavetools
digital-wave-files python vcd vcd-parser
Last synced: 11 months ago
JSON representation
Python library for operations with VCD and other digital wave files
- Host: GitHub
- URL: https://github.com/nic30/pydigitalwavetools
- Owner: Nic30
- License: mit
- Created: 2018-04-10T22:21:38.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2024-06-06T21:34:49.000Z (about 2 years ago)
- Last Synced: 2024-12-13T20:44:30.301Z (over 1 year ago)
- Topics: digital-wave-files, python, vcd, vcd-parser
- Language: Python
- Homepage:
- Size: 103 KB
- Stars: 47
- Watchers: 6
- Forks: 6
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# pyDigitalWaveTools
[](https://circleci.com/gh/Nic30/pyDigitalWaveTools)
[](https://coveralls.io/github/Nic30/pyDigitalWaveTools?branch=master)
[](http://badge.fury.io/py/pyDigitalWaveTools)
[](http://pydigitalwavetools.readthedocs.io/en/latest/?badge=latest)
[](https://img.shields.io/pypi/pyversions/pyDigitalWaveTools.svg)
python library for operations with VCD and other digital wave files
## Feature list
* parse VCD (std 2009) files to intermediate format
* write VCD files, user specified formatters for user types, predefined formatters for vectors, bits and enum values
* dump intermediate format as simple json
## Hello pyDigitalWaveTools
Here is a simple example how to use the VCD parser:
```python
#!/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))
```
## Output json format
```
scope
{ "name": ""
"children" : {"" : child}
}
child can be scope or signal record
signal record
{ "name": ""
"type": {"sigType": "",
"width": },
"data": [],
}
data record format
[
## Related open source
* [verilog-vcd-parser](https://github.com/ben-marshall/verilog-vcd-parser) - Python, A parser for Value Change Dump (VCD) files as specified in the IEEE System Verilog 1800-2012 standard.
* [pyvcd](https://github.com/SanDisk-Open-Source/pyvcd) - Python, vcd writer, GTKWave config writer
* [vcdvcd](https://github.com/cirosantilli/vcdvcd) - Python, vcd parser, dump pretty printer