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')
read from str:
import pyvcdr
a = pyvcdr.VcdR()
a.parse_str('$var wire 1 ! D0 $end\n#0 0!\n')
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.
- import error fix and pep8 sytle fix by @EtlamGit
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.
CHANGE:
- V0.8 2021.10.9 add parse_str function.
- V0.7 2021.5.9 BUG FIX: import error fix and pep8 sytle fix. thanks to @EtlamGit.
- V0.6 2021.5.8. add suport for bBrR data support.
Metadata
Release files for pyvcdr 0.0.9
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| pyvcdr-0.0.9.tar.gz | 4.1 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pyvcdr-0.0.9-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 9.1 kB
Release files / pyvcdr-0.0.9.tar.gz
| Download URL | pyvcdr-0.0.9.tar.gz |
|---|---|
| Size | 4.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e9d2dbe667a84d29810b30b0f6ceb63ed0c99ffb6ea9f00e54fd0b4ceaadb9d8
|
|
BLAKE2b-256 checksum How to use checksums |
728bb1a1b401c7317e04c67cdfc588ac49589c747855876feadb0a9fb3a30273
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.63.0 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.9
|
Release files / pyvcdr-0.0.9-py3-none-any.whl
| Download URL | pyvcdr-0.0.9-py3-none-any.whl |
|---|---|
| Size | 4.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
7ecf75de69c77f7f13ccda16552eccb1cbf6e8be8bc9b1f34d551bcf89548912
|
|
BLAKE2b-256 checksum How to use checksums |
6bb44ae32cda9a183041f0229ce9b71debe29c8ccba14ad638e13dcd487fdf91
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.63.0 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.9
|
Security for pyvcdr 0.0.9
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.