Introduction - If you have any usage issues, please Google them yourself
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