Neah/node_modules/vcd-parser/docs/vcd-parser/1.0.1/VCDParser.html
2025-04-24 19:06:27 +02:00

1412 lines
18 KiB
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>JSDoc: Namespace: VCDParser</title>
<script src="scripts/prettify/prettify.js"> </script>
<script src="scripts/prettify/lang-css.js"> </script>
<!--[if lt IE 9]>
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
<link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
</head>
<body>
<div id="main">
<h1 class="page-title">Namespace: VCDParser</h1>
<section>
<header>
<h2>VCDParser</h2>
</header>
<article>
<div class="container-overview">
<div class="description">A namespace.</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="vcd-parser.js.html">vcd-parser.js</a>, <a href="vcd-parser.js.html#line1">line 1</a>
</li></ul></dd>
</dl>
</div>
<h3 class="subsection-title">Methods</h3>
<h4 class="name" id="~parse"><span class="type-signature">(inner) </span>parse<span class="signature">(content, opts<span class="signature-attributes">opt</span>, cb<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {Promise.&lt;<a href="VCDParser.html#~ParsedData">VCDParser~ParsedData</a>>}</span></h4>
<div class="description">
Parse VCD text content and generate a valid JSON representation.
The function returns a promise unless a callback is provided.
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Attributes</th>
<th>Default</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>content</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="attributes">
</td>
<td class="default">
</td>
<td class="description last">The text content of the VCD file</td>
</tr>
<tr>
<td class="name"><code>opts</code></td>
<td class="type">
<span class="param-type"><a href="VCDParser.html#~Options">VCDParser~Options</a></span>
</td>
<td class="attributes">
&lt;optional><br>
</td>
<td class="default">
{}
</td>
<td class="description last">Optional configuration to customize the parsing process</td>
</tr>
<tr>
<td class="name"><code>cb</code></td>
<td class="type">
<span class="param-type"><a href="VCDParser.html#~ParseCallback">VCDParser~ParseCallback</a></span>
</td>
<td class="attributes">
&lt;optional><br>
</td>
<td class="default">
null
</td>
<td class="description last">Optional callback if you don't prefer to use promises</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="vcd-parser.js.html">vcd-parser.js</a>, <a href="vcd-parser.js.html#line9">line 9</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
Promise object that resolves with the parsed data
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Promise.&lt;<a href="VCDParser.html#~ParsedData">VCDParser~ParsedData</a>></span>
</dd>
</dl>
<h5>Example</h5>
<pre class="prettyprint"><code>const VCDParser = require('vcd-parser');
VCDParser.parse(`
$date
Tue Feb 12 14:01:15 2019
$end
$version
Icarus Verilog
$end
$timescale
1ns
$end
$scope module test_tb $end
$var reg 1 ! clk $end
$var wire 1 " rst $end
$upscope $end
$enddefinitions $end
#0
$dumpvars
0"
0!
$end
#15
1"
#20
1!
#40
0!
#60
1!
#80
0!
#100
1!
#115
`).then(parsedData => {
console.log(parsedData);
// {
// "date": "Tue Feb 12 14:01:15 2019",
// "version": "Icarus Verilog",
// "timescale": "1ns",
// "endtime": "115",
// "scale": "1ns",
// "signal": [
// {
// "type": "reg",
// "size": 1,
// "refName": "!",
// "signalName": "clk",
// "module": "test_tb",
// "name": "test_tb.clk",
// "wave": [
// [
// "0",
// "0"
// ],
// [
// "20",
// "1"
// ],
// [
// "40",
// "0"
// ],
// [
// "60",
// "1"
// ],
// [
// "80",
// "0"
// ],
// [
// "100",
// "1"
// ]
// ]
// },
// {
// "type": "wire",
// "size": 1,
// "refName": "\"",
// "signalName": "rst",
// "module": "test_tb",
// "name": "test_tb.rst",
// "wave": [
// [
// "0",
// "0"
// ],
// [
// "15",
// "1"
// ]
// ]
// }
// ]
// }
}).catch(err => {
console.error(err);
}).</code></pre>
<h3 class="subsection-title">Type Definitions</h3>
<h4 class="name" id="~Options">Options</h4>
<div class="description">
The optional configuration for the VCD parser
</div>
<h5>Type:</h5>
<ul>
<li>
<span class="param-type">Object</span>
</li>
</ul>
<h5 class="subsection-title">Properties:</h5>
<table class="props">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>compress</code></td>
<td class="type">
<span class="param-type">boolean</span>
</td>
<td class="description last">Compress the output wave by ignoring the unchanged values</td>
</tr>
<tr>
<td class="name"><code>expandAmbigousBus</code></td>
<td class="type">
<span class="param-type">boolean</span>
</td>
<td class="description last">If the bus has some ambigous value (z | x), it gets expanded to represent the whole bus signal</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="vcd-parser.js.html">vcd-parser.js</a>, <a href="vcd-parser.js.html#line412">line 412</a>
</li></ul></dd>
</dl>
<h4 class="name" id="~ParseCallback"><span class="type-signature"></span>ParseCallback<span class="signature">(err, parsedJSON)</span><span class="type-signature"></span></h4>
<div class="description">
The callback for the parsing function.
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>err</code></td>
<td class="type">
<span class="param-type">error</span>
</td>
<td class="description last">The error generated while parsing</td>
</tr>
<tr>
<td class="name"><code>parsedJSON</code></td>
<td class="type">
<span class="param-type">ParsedData</span>
</td>
<td class="description last">The JSON document generated by the parser</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="vcd-parser.js.html">vcd-parser.js</a>, <a href="vcd-parser.js.html#line446">line 446</a>
</li></ul></dd>
</dl>
<h4 class="name" id="~ParsedData">ParsedData</h4>
<div class="description">
The parsed VCD object generated by the parser
</div>
<h5>Type:</h5>
<ul>
<li>
<span class="param-type">Object</span>
</li>
</ul>
<h5 class="subsection-title">Properties:</h5>
<table class="props">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Attributes</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code><"meta"></code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="attributes">
&lt;optional><br>
</td>
<td class="description last">The values of different initial meta-data, e.g. date, timescale..etc</td>
</tr>
<tr>
<td class="name"><code>endtime</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="attributes">
</td>
<td class="description last">The endtime of the simulation</td>
</tr>
<tr>
<td class="name"><code>scale</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="attributes">
</td>
<td class="description last">The time-scale unit of the simulation</td>
</tr>
<tr>
<td class="name"><code>signal</code></td>
<td class="type">
<span class="param-type">Array.&lt;<a href="VCDParser.html#~Signal">VCDParser~Signal</a>></span>
</td>
<td class="attributes">
</td>
<td class="description last">The signal values of the simulation</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="vcd-parser.js.html">vcd-parser.js</a>, <a href="vcd-parser.js.html#line437">line 437</a>
</li></ul></dd>
</dl>
<h4 class="name" id="~Signal">Signal</h4>
<div class="description">
The object representing one signal data
</div>
<h5>Type:</h5>
<ul>
<li>
<span class="param-type">Object</span>
</li>
</ul>
<h5 class="subsection-title">Properties:</h5>
<table class="props">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>name</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last">The full name of the signal</td>
</tr>
<tr>
<td class="name"><code>type</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last">The type of the signal, e.g. wire, reg,..etc</td>
</tr>
<tr>
<td class="name"><code>size</code></td>
<td class="type">
<span class="param-type">number</span>
</td>
<td class="description last">The size/width of the signal in bits</td>
</tr>
<tr>
<td class="name"><code>refName</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last">The reference for this signal used inside the VCD file</td>
</tr>
<tr>
<td class="name"><code>module</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last">The name of the top module for which this signal belongs</td>
</tr>
<tr>
<td class="name"><code>wave</code></td>
<td class="type">
<span class="param-type">Array.&lt;<a href="VCDParser.html#~SignalValue">VCDParser~SignalValue</a>></span>
</td>
<td class="description last">The values of the signal at different points of time</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="vcd-parser.js.html">vcd-parser.js</a>, <a href="vcd-parser.js.html#line426">line 426</a>
</li></ul></dd>
</dl>
<h4 class="name" id="~SignalValue">SignalValue</h4>
<div class="description">
The value of a signal at a specific point of time, represnted as a tuple [time, value]
</div>
<h5>Type:</h5>
<ul>
<li>
<span class="param-type">Array.&lt;number></span>
</li>
</ul>
<h5 class="subsection-title">Properties:</h5>
<table class="props">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>0</code></td>
<td class="type">
<span class="param-type">number</span>
</td>
<td class="description last">The time of the event</td>
</tr>
<tr>
<td class="name"><code>1</code></td>
<td class="type">
<span class="param-type">number</span>
</td>
<td class="description last">The value of the signal at that event</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="vcd-parser.js.html">vcd-parser.js</a>, <a href="vcd-parser.js.html#line419">line 419</a>
</li></ul></dd>
</dl>
</article>
</section>
</div>
<nav>
<h2><a href="index.html">Home</a></h2><h3>Namespaces</h3><ul><li><a href="VCDParser.html">VCDParser</a></li></ul>
</nav>
<br class="clear">
<footer>
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.4</a> on Sun Jul 05 2020 21:57:23 GMT+0200 (Eastern European Standard Time)
</footer>
<script> prettyPrint(); </script>
<script src="scripts/linenumber.js"> </script>
</body>
</html>