added simulation time
This commit is contained in:
parent
7a7204ecf4
commit
01c4e20712
11
bin/build.js
11
bin/build.js
@ -17,6 +17,7 @@ const inDeclaration = p.node('inDeclaration');
|
|||||||
const enddefinitions = p.node('inDeclarationEnd');
|
const enddefinitions = p.node('inDeclarationEnd');
|
||||||
const simulation = p.node('simulation');
|
const simulation = p.node('simulation');
|
||||||
const inSimulation = p.node('inSimulation');
|
const inSimulation = p.node('inSimulation');
|
||||||
|
const simulationTime = p.node('simulationTime');
|
||||||
|
|
||||||
declaration
|
declaration
|
||||||
.match([' ', '\n', '\t'], declaration)
|
.match([' ', '\n', '\t'], declaration)
|
||||||
@ -40,15 +41,23 @@ enddefinitions
|
|||||||
simulation
|
simulation
|
||||||
.match([' ', '\n', '\t'], simulation)
|
.match([' ', '\n', '\t'], simulation)
|
||||||
.select({
|
.select({
|
||||||
'$dumpall': 101, '$dumpoff': 102, '$dumpon': 103, '$dumpvars': 104,
|
'$dumpall': 8, '$dumpoff': 9, '$dumpon': 10, '$dumpvars': 11,
|
||||||
'$comment': 1
|
'$comment': 1
|
||||||
}, p.invoke(p.code.store('command'), commandSpan.start(inSimulation)))
|
}, p.invoke(p.code.store('command'), commandSpan.start(inSimulation)))
|
||||||
|
.select({'#': 12}, p.invoke(p.code.store('command'), commandSpan.start(simulationTime)))
|
||||||
|
.select({'0': 13}, p.invoke(p.code.store('command'), commandSpan.start(simulationTime)))
|
||||||
|
.select({'1': 14}, p.invoke(p.code.store('command'), commandSpan.start(simulationTime)))
|
||||||
.otherwise(p.error(2, 'Expected simulation command'));
|
.otherwise(p.error(2, 'Expected simulation command'));
|
||||||
|
|
||||||
inSimulation
|
inSimulation
|
||||||
.match('$end', commandSpan.end(simulation))
|
.match('$end', commandSpan.end(simulation))
|
||||||
.skipTo(inSimulation);
|
.skipTo(inSimulation);
|
||||||
|
|
||||||
|
simulationTime
|
||||||
|
.match([' ', '\n', '\r', '\t'], commandSpan.end(simulation))
|
||||||
|
.skipTo(simulationTime);
|
||||||
|
|
||||||
|
|
||||||
// Build
|
// Build
|
||||||
|
|
||||||
const artifacts = p.build(declaration);
|
const artifacts = p.build(declaration);
|
||||||
|
2
vcd.c
2
vcd.c
@ -142,7 +142,7 @@ napi_value Init(napi_env env, napi_value exports) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
int commandSpan(vcd_parser_t* s, const unsigned char* p, const unsigned char* endp) {
|
int commandSpan(vcd_parser_t* s, const unsigned char* p, const unsigned char* endp) {
|
||||||
printf("%d:%.*s\n", s->command, (int)(endp - p - 4), p);
|
printf("(%d)%.*s\n", s->command, (int)(endp - p), p);
|
||||||
return 0;
|
return 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user