Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Nic30/pyDigitalWaveTools

Open more actions menu

Repository files navigation

pyDigitalWaveTools

CircleCI Coverage Status PyPI version Documentation Status Python version

Python library for operations with VCD and other digital wave files. The VCD spec is a part of verilog standard e.g. IEEE.1364-2005, IEEE.1800-2017

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:

#!/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": "<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)>]

Related open source

  • verilog-vcd-parser - Python, A parser for Value Change Dump (VCD) files as specified in the IEEE System Verilog 1800-2012 standard.
  • pyvcd - Python, vcd writer, GTKWave config writer
  • vcdvcd - Python, vcd parser, dump pretty printer

About

Python library for operations with VCD and other digital wave files

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

Morty Proxy This is a proxified and sanitized view of the page, visit original site.