Skip to main content

A vcd wave file read library

Project description

pyvcdr

this is a python library for vcd wave file read.

install:

pip install pyvcdr

or just copy pyvcdr.py file to your project.

readfile:

    import pyvcdr
    a = pyvcdr.VcdR()
    a.read_file('./test1.vcd')

use the data:

after read. their are two ways to access the data. first is access data by signal:

    print(a.signals[0])#Signal(wire, 1, !, D0)
    print(a.signals[1])#Signal(wire, 1, ", D1)
    print(a.signals[2])#Signal(wire, 1, #, D2)
    print(a.signals[1].module)#D1
    for i in a.signals[1].steps:
        print(i)
        #(0, '1') time, val
        #(1250, '0')
        #(6250, '1')
        #。。。

second is access data by time:

    for i in a.time_values:
        print('time:', i[0], '. sig:', i[1], '. val:', i[2])
        #(0, 'D0', '0')
        #(0, 'D1', '1')
        #(0, 'D2', '1')
        #(1250, 'D1', '0')
        #(6250, 'D1', '1')
        #(10000, 'D1', '0')
        #(15000, 'D1', '1')
        #...

why I write this code:

I need a python vcd file read program.

I used this library first: https://github.com/westerndigitalcorporation/pyvcd but it could not read file. just write is supported.

then this one: https://github.com/em-/python-vcd/tree/master/vcd it works, but is very very slow.

info and thanks:

the class Signal is from pyvcd library.

any issues:

I just write it for my file read. so it may not fit some IEEE 1364-2005 protocol. if it do not work for you, add an issue on github: https://github.com/Jiangshan00001/pyvcdr

post the file that could not work. or you can also change the code yourself.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyvcdr-0.0.4.tar.gz (3.7 kB view details)

Uploaded Source

Built Distribution

pyvcdr-0.0.4-py3-none-any.whl (4.2 kB view details)

Uploaded Python 3

File details

Details for the file pyvcdr-0.0.4.tar.gz.

File metadata

  • Download URL: pyvcdr-0.0.4.tar.gz
  • Upload date:
  • Size: 3.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.10.0 pkginfo/1.7.0 requests/2.21.0 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.7.0

File hashes

Hashes for pyvcdr-0.0.4.tar.gz
Algorithm Hash digest
SHA256 e6e2b15b1efaae0aaccbe597a52424da78cb6fe5330b6e856487c418191e0abf
MD5 0aa454a5ad38d24a47ae26ea3c423728
BLAKE2b-256 913d657379ceaef4df48dc1954111972e9ca1db29e2680e3d5d45a6317d43d25

See more details on using hashes here.

File details

Details for the file pyvcdr-0.0.4-py3-none-any.whl.

File metadata

  • Download URL: pyvcdr-0.0.4-py3-none-any.whl
  • Upload date:
  • Size: 4.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.10.0 pkginfo/1.7.0 requests/2.21.0 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.7.0

File hashes

Hashes for pyvcdr-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 2b9ac551c40027355576599f8467f107ec5a87a91396920a13842a16ab2e7e71
MD5 64ce6d44d54dd2c9c722e51c20638e62
BLAKE2b-256 a3a516a7c60aacff3ea033b6bcc34a795f3208971a7114b72d7779fcd736be68

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page