Description: VCD (Value Change Dump) file is widely used in dustry. A VCD file is an ASCII file, which contains header information, variable definitions and the value changes for specified variables, or all variables, in a given design. Attached VCD_format.pdf gives a simple introduction to VCD file format. More information about VCD file format can be found in Web.
Please write a tool to parse a VCD file. It reads in the VCD file specified in the command line, counts the value changes for each variable and output a file which states the name and counts for value change low-to-high and high-to-low for each variable. A example VCD file is also attached for testing purpose.
RULES:
1. $date, $version, $comment and $dump* can be ignored
2. Output file name is <design_name>.toggle, where design_name is the topmost module name in the VCD file.
For example, if the 1st $scope line in the file:
$scope module AAA_tmax_testbench_1_16 $end
the output file name should be AAA_tmax_t
To Search:
File list (Check if you may need any files):
gtkwave-3.2.1
.............\.gtkwaverc
.............\aclocal.m4
.............\ANALOG_README.TXT
.............\autogen.sh
.............\autom4te.cache
.............\..............\output.0
.............\..............\requests
.............\..............\traces.0
.............\CHANGELOG.TXT
.............\config.h
.............\config.h.in
.............\config.log
.............\config.status
.............\configure
.............\configure.ac
.............\contrib
.............\.......\Makefile
.............\.......\Makefile.am
.............\.......\Makefile.in
.............\.......\pccts
.............\.......\.....\antlr
.............\.......\.....\.....\.deps
.............\.......\.....\.....\.....\antlr.Po
.............\.......\.....\.....\.....\bits.Po
.............\.......\.....\.....\.....\build.Po
.............\.......\.....\.....\.....\egman.Po
.............\.......\.....\.....\.....\err.Po
.............\.......\.....\.....\.....\fcache.Po
.............\.......\.....\.....\.....\fset.Po
.............\.......\.....\.....\.....\fset2.Po
.............\.......\.....\.....\.....\gen.Po
.............\.......\.....\.....\.....\globals.Po
.............\.......\.....\.....\.....\hash.Po
.............\.......\.....\.....\.....\lex.Po
.............\.......\.....\.....\.....\main.Po
.............\.......\.....\.....\.....\misc.Po
.............\.......\.....\.....\.....\mrhoist.Po
.............\.......\.....\.....\.....\pred.Po
.............\.......\.....\.....\.....\scan.Po
.............\.......\.....\.....\.....\set.Po
.............\.......\.....\.....\antlr.1
.............\.......\.....\.....\antlr.c
.............\.......\.....\.....\antlr.g
.............\.......\.....\.....\antlr.r
.............\.......\.....\.....\antlr1.txt
.............\.......\.....\.....\antlr68K.make
.............\.......\.....\.....\AntlrMS.mak
.............\.......\.....\.....\AntlrMSVC50.dsp
.............\.......\.....\.....\AntlrMSVC50.dsw
.............\.......\.....\.....\AntlrMSVC50.mak
.............\.......\.....\.....\AntlrMSVC60.dsp
.............\.......\.....\.....\AntlrMSVC60.dsw
.............\.......\.....\.....\antlrPPC.make
.............\.......\.....\.....\bits.c
.............\.......\.....\.....\build.c
.............\.......\.....\.....\egman.c
.............\.......\.....\.....\err.c
.............\.......\.....\.....\fcache.c
.............\.......\.....\.....\fset.c
.............\.......\.....\.....\fset2.c
.............\.......\.....\.....\gen.c
.............\.......\.....\.....\generic.h
.............\.......\.....\.....\globals.c
.............\.......\.....\.....\hash.c
.............\.......\.....\.....\hash.h
.............\.......\.....\.....\lex.c
.............\.......\.....\.....\main.c
.............\.......\.....\.....\Makefile
.............\.......\.....\.....\Makefile.am
.............\.......\.....\.....\Makefile.in
.............\.......\.....\.....\makefile.VMS
.............\.......\.....\.....\makefile1
.............\.......\.....\.....\misc.c
.............\.......\.....\.....\mode.h
.............\.......\.....\.....\mrhoist.c
.............\.......\.....\.....\parser.dlg
.............\.......\.....\.....\pred.c
.............\.......\.....\.....\proto.h
.............\.......\.....\.....\README
.............\.......\.....\.....\scan.c
.............\.......\.....\.....\stdpccts.h
.............\.......\.....\.....\syn.h
.............\.......\.....\.....\tokens.h
.............\.......\.....\.....\watantlr.mak
.............\.......\.....\CHANGES_FROM_131.txt
.............\.......\.....\CHANGES_FROM_133.txt
.............\.......\.....\CHANGES_FROM_133_BEFORE_MR13.txt
.............\.......\.....\CHANGES_SUMMARY.txt
.............\.......\.....\dlg
.............\.......\.....\...\.deps
.............\.......\.....\...\.....\automata.Po
.............\.......\.....\...\.....\dlg_a.Po
.............\.......\.....\...\.....\dlg_p.Po
.............\.......\.....\...\.....\err.Po
.............\.......\.....\...\.....\main.Po
.............\.......\.....\...\.....\output.Po
.............\.......\.....\...\.....\relabel.Po
.............\.......\.