/VCD2R

a small R package to read VCD (Value Change Dump) files and play a bit with the data

Primary LanguageR

NOTE This tool was useful and served its purpose, but has now been dormant for quite some time. The repo will be archived as of May 2023 for future reference.

VCD2R - Reading Value Change Dump Files into R

Huh?

This is (hopefully) going to be a neat little package to read uncompressed VCD files into R for toggle counting, power estimation and simple side-channel analysis (on a teaching level).

Install from GitHub

install.packages(c("devtools")) # if you haven't done that before
devtools::install_github("wamserma/VCD2R",dependencies=TRUE,upgrade_dependencies=TRUE)

Building the Package manually

clone the git repository

git clone https://github.com/wamserma/VCD2R.git 

install the build dependencies

install.packages(c("devtools", "roxygen2", "testthat", "knitr", "covr"))

open project in RStudio and hit Ctrl + Shift + L

converting VCD+ to VCD

If you have a .vpd file e.g. from Synopsys VCS, you can convert it to an (uncompressed) VCD file by calling

vcs -vpd2vcd inter.vpd inter.vcd

if you want to capture version information, you might want to use

echo '$version' > inter.vcd
vcs -vpd2vcd | head -5 >> inter.vcd
echo '$end' >> inter.vcd
echo '$date' $'\n''dumped:' $(date -r inter.vpd -R) $'\n''converted:' $(date -R) $'\n''$end' >> inter.vcd
vcs -vpd2vcd inter.vpd -q >> inter.vcd

parsers in other languages

I made this because I wanted a stream oriented parser to make toggle count statistics in R. As far as I know, there is no other [R] VCD parser. Below is a list with parsers in other languages, without making any assurance on functionality or performance (some are just for parsing, some can also do toggle counts).

Haskell

VCD on Hackage

Python

verilog_VCD
vcd_parser

Java

VCDFileParser (download needs registering)

C/C++

cppVCD
vcdparser
Covered has a built-in VCD parser