-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Non stream mode required #17
Comments
You can totally feed this parser with a single chunk. That will make it non-streaming. |
That example does not checks the value changes... Let's see this example: 'use strict';
const vcd = require('vcd-stream');
const inst = vcd.parser();
inst.on("$enddefinitions", () => {
console.log(inst.info.wires)
// {
// top: { clock: '"}G', leaf: { counter: '{u' }, fruit: { point: 'u)' } }
// }
});
inst.change.on('"}G', (time, cmd) => {
console.log(`change: "}G @${time} cmd: ${cmd}`) // < < < < < < What is the meaning of cmd?
});
inst.change.on('u)', (time, cmd) => {
console.log(`change: u) @${time} cmd: ${cmd}`)
});
inst.change.on('{u', (time, cmd) => {
console.log(`change: {u @${time} cmd: ${cmd}`)
});
inst.write(`
$version Generated by VerilatedVcd $end
$date Wed Sep 18 22:59:07 2019
$end
$timescale 1ns $end
$scope module top $end
$var wire 1 "}G clock $end
$scope module leaf $end
$var wire 64 {u counter [63:0] $end
$upscope $end
$scope module fruit $end
$var wire 4 u) point [3:0] $end
$upscope $end
$upscope $end
$enddefinitions $end
`
);
inst.write(`
#1
0"}G
#2
1"}G
#300
0"}G
b1111000000000000 {u
#301
b0000111100000000 {u
#302
b0000000011110000 {u
#303
b0000000000001111 {u
`
); This prints out: {
top: { clock: '"}G', leaf: { counter: '{u' }, fruit: { point: 'u)' } }
}
change: "}G @1 cmd: 14
change: "}G @2 cmd: 15
change: "}G @300 cmd: 14
change: {u @300 cmd: 19
change: {u @301 cmd: 19
change: {u @302 cmd: 19
change: {u @303 cmd: 19 What is the meaning of cmd? |
cmd is enum: https://github.com/wavedrom/vcd/blob/master/bin/build.js#L87 {
14: 0,
15: 1,
19: binary string starts with `b`
} |
The format from from |
I think we have to discuss the format of the data on cmd=19, 20 here #16 |
I like this stream reader behavior, but it is overkill when the whole file is available. I just want a method, which gives back the fully parsed file, with all of the value changes.
I need a similar behavior to this, (just, that has some bug...)
The text was updated successfully, but these errors were encountered: