vcd-parser
A Node.js parsing tool for Value Change Dump (VCD) files and generating a readable JSON document. It can be used with different hardware simulation tools such as Icarus Iverilog.
Installation
npm install --save vcd-parser
Usage example
const VCDParser = ;VCDParser ;
API Documentation
Promise.<ParsedData>
VCDParser.parse(content, [opts], [cb]) ⇒ Parse VCD text content and generate a valid JSON representation. The function returns a promise unless a callback is provided.
Returns: Promise.<ParsedData>
- that resolves with the parsed data
Param | Type | Default | Description |
---|---|---|---|
content | string |
The text content of the VCD file | |
[opts] | Options |
{} |
Optional configuration to customize the parsing process |
[cb] | ParseCallback |
|
Optional callback if you don't prefer to use promises |
Object
VCDParser:Options : The optional configuration for the VCD parser
Properties
Name | Type | Description |
---|---|---|
compress | boolean |
Compress the output wave by ignoring the unchanged values |
expandAmbigousBus | boolean |
If the bus has some ambigous value (z or x), it gets expanded to represent the whole bus signal |
Object
VCDParser:ParsedData : The parsed VCD object generated by the parser
Properties
Name | Type | Description |
---|---|---|
[...meta] | string |
The values of different initial meta-data, e.g. date, timescale..etc |
endtime | string |
The endtime of the simulation |
scale | string |
The time-scale unit of the simulation |
signal | Array.<Signal> |
The signal values of the simulation |
Object
VCDParser:Signal : The object representing one signal data
Properties
Name | Type | Description |
---|---|---|
name | string |
The full name of the signal |
type | string |
The type of the signal, e.g. wire, reg,..etc |
size | number |
The size/width of the signal in bits |
refName | string |
The reference for this signal used inside the VCD file |
module | string |
The name of the top module for which this signal belongs |
wave | Array.<SignalValue> |
The values of the signal at different points of time |
Array.<number>
VCDParser:SignalValue : The value of a signal at a specific point of time, represnted as a tuple [time, value]
Properties
Name | Type | Description |
---|---|---|
0 | number |
The time of the event |
1 | number |
The value of the signal at that event |
function
VCDParser:ParseCallback : The callback for the parsing function.
Param | Type | Description |
---|---|---|
err | error |
The error generated while parsing |
parsedJSON | ParsedData |
The JSON document generated by the parser |