* undo changes not related to my changes
This commit is contained in:
parent
3a039a619f
commit
d184681eae
@ -11,6 +11,7 @@ module.exports = () => {
|
|||||||
|
|
||||||
const s = new stream.Writable();
|
const s = new stream.Writable();
|
||||||
|
|
||||||
|
// const lifee = new EventEmitter();
|
||||||
|
|
||||||
// gets called by c with 1 argument, a number
|
// gets called by c with 1 argument, a number
|
||||||
const lifemit = s.emit.bind(s);
|
const lifemit = s.emit.bind(s);
|
||||||
@ -19,10 +20,10 @@ module.exports = () => {
|
|||||||
|
|
||||||
// gets called by c with 5 arguments
|
// gets called by c with 5 arguments
|
||||||
// string eventName
|
// string eventName
|
||||||
// number state->time
|
// bigint state->time
|
||||||
// int command
|
// int command
|
||||||
// int state->value
|
// bigint state->value
|
||||||
// int state->mask
|
// bigint state->mask
|
||||||
|
|
||||||
const triemit = triee.emit.bind(triee);
|
const triemit = triee.emit.bind(triee);
|
||||||
let triemit2 = triemit;
|
let triemit2 = triemit;
|
||||||
|
@ -4,8 +4,7 @@
|
|||||||
"description": "Value Change Dump (VCD) parser",
|
"description": "Value Change Dump (VCD) parser",
|
||||||
"main": "lib/index.js",
|
"main": "lib/index.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"testlint": "eslint bin lib && nyc -r=text -r=lcov mocha",
|
"test": "eslint bin lib && nyc -r=text -r=lcov mocha",
|
||||||
"test": "nyc -r=text -r=lcov mocha",
|
|
||||||
"testonly": "nyc -r=text -r=lcov mocha",
|
"testonly": "nyc -r=text -r=lcov mocha",
|
||||||
"watch": "mocha --watch",
|
"watch": "mocha --watch",
|
||||||
"install": "node bin/build.js",
|
"install": "node bin/build.js",
|
||||||
|
13
vcd_spans.c
13
vcd_spans.c
@ -70,7 +70,6 @@ int commandSpan(vcd_parser_t* state, const unsigned char* p, const unsigned char
|
|||||||
napi_env env = state->napi_env;
|
napi_env env = state->napi_env;
|
||||||
|
|
||||||
if (state->command == 5) { // $upscope
|
if (state->command == 5) { // $upscope
|
||||||
// printf("commandSpan sp goes from %d to %d\n", state->stackPointer, state->stackPointer-1);
|
|
||||||
state->stackPointer -= 1;
|
state->stackPointer -= 1;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -89,7 +88,6 @@ int commandSpan(vcd_parser_t* state, const unsigned char* p, const unsigned char
|
|||||||
set_property_string("status", "simulation");
|
set_property_string("status", "simulation");
|
||||||
emit_lifee("$enddefinitions");
|
emit_lifee("$enddefinitions");
|
||||||
#endif
|
#endif
|
||||||
// printf("commandSpan END\n");
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -105,14 +103,11 @@ int scopeIdentifierSpan(vcd_parser_t* state, const unsigned char* p, const unsig
|
|||||||
ASSERT(state->info, napi_get_named_property(env, state->info, "stack", &stack))
|
ASSERT(state->info, napi_get_named_property(env, state->info, "stack", &stack))
|
||||||
|
|
||||||
// get the top of the stack in top
|
// get the top of the stack in top
|
||||||
// printf("Got stack %d\n", state->stackPointer);
|
|
||||||
ASSERT(top, napi_get_element(env, stack, state->stackPointer, &top))
|
ASSERT(top, napi_get_element(env, stack, state->stackPointer, &top))
|
||||||
|
|
||||||
// set top.prop to new object
|
// set top.prop to new object
|
||||||
// printf("Set top of stack[%d].%s to {}\n", state->stackPointer, (char*)state->tmpStr);
|
|
||||||
ASSERT(top, napi_set_named_property(env, top, state->tmpStr, obj))
|
ASSERT(top, napi_set_named_property(env, top, state->tmpStr, obj))
|
||||||
|
|
||||||
// printf("Set top+1 of stack to top %d, %d\n", state->stackPointer, state->stackPointer+1);
|
|
||||||
state->stackPointer += 1;
|
state->stackPointer += 1;
|
||||||
ASSERT(top, napi_set_element(env, stack, state->stackPointer, obj))
|
ASSERT(top, napi_set_element(env, stack, state->stackPointer, obj))
|
||||||
#else
|
#else
|
||||||
@ -178,7 +173,6 @@ int idSpan(vcd_parser_t* state, const unsigned char* p, const unsigned char* end
|
|||||||
|
|
||||||
const int valueWords = (state->digitCount >> 6) + 1;
|
const int valueWords = (state->digitCount >> 6) + 1;
|
||||||
uint64_t* value = state->value;
|
uint64_t* value = state->value;
|
||||||
// value = &foo;
|
|
||||||
uint64_t* mask = state->mask;
|
uint64_t* mask = state->mask;
|
||||||
if (stringEq((state->trigger), p, endp)) {
|
if (stringEq((state->trigger), p, endp)) {
|
||||||
const uint8_t command = state->command;
|
const uint8_t command = state->command;
|
||||||
@ -190,8 +184,6 @@ int idSpan(vcd_parser_t* state, const unsigned char* p, const unsigned char* end
|
|||||||
value[0] = 1;
|
value[0] = 1;
|
||||||
mask[0] = 0;
|
mask[0] = 0;
|
||||||
}
|
}
|
||||||
// printf("valueWords %d %d %d\n", valueWords, (int)command, state->digitCount);
|
|
||||||
// printf("\ntriee %llx\n", *value);
|
|
||||||
#ifndef VCDWASM
|
#ifndef VCDWASM
|
||||||
napi_value undefined, eventName, aTime, aCommand, aValue, aMask, return_val;
|
napi_value undefined, eventName, aTime, aCommand, aValue, aMask, return_val;
|
||||||
ASSERT(undefined, napi_get_undefined(env, &undefined))
|
ASSERT(undefined, napi_get_undefined(env, &undefined))
|
||||||
@ -200,14 +192,10 @@ int idSpan(vcd_parser_t* state, const unsigned char* p, const unsigned char* end
|
|||||||
ASSERT(aCommand, napi_create_int32(env, command, &aCommand))
|
ASSERT(aCommand, napi_create_int32(env, command, &aCommand))
|
||||||
ASSERT(aValue, napi_create_bigint_words(env, 0, valueWords, value, &aValue))
|
ASSERT(aValue, napi_create_bigint_words(env, 0, valueWords, value, &aValue))
|
||||||
ASSERT(aMask, napi_create_bigint_words(env, 0, valueWords, mask, &aMask))
|
ASSERT(aMask, napi_create_bigint_words(env, 0, valueWords, mask, &aMask))
|
||||||
|
|
||||||
|
|
||||||
napi_value* argv[] = {&eventName, &aTime, &aCommand, &aValue, &aMask};
|
napi_value* argv[] = {&eventName, &aTime, &aCommand, &aValue, &aMask};
|
||||||
ASSERT(state->triee, napi_call_function(env, undefined, state->triee, 5, *argv, &return_val))
|
ASSERT(state->triee, napi_call_function(env, undefined, state->triee, 5, *argv, &return_val))
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
|
||||||
// printf("\ntriee %lx\n", *value);
|
|
||||||
strcopy(p, endp, state->tmpStr);
|
strcopy(p, endp, state->tmpStr);
|
||||||
emit_triee(state->tmpStr, state->time, command, valueWords, value, mask);
|
emit_triee(state->tmpStr, state->time, command, valueWords, value, mask);
|
||||||
#endif
|
#endif
|
||||||
@ -242,6 +230,7 @@ int onDigit(
|
|||||||
maskCout = mask[i] >> 63;
|
maskCout = mask[i] >> 63;
|
||||||
mask[i] = (mask[i] << 1) + maskCin;
|
mask[i] = (mask[i] << 1) + maskCin;
|
||||||
maskCin = maskCout;
|
maskCin = maskCout;
|
||||||
|
|
||||||
}
|
}
|
||||||
state->digitCount += 1;
|
state->digitCount += 1;
|
||||||
return 0;
|
return 0;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user