dump initial timestamp "t0"
This commit is contained in:
parent
baa48eeee0
commit
51296f30b8
@ -85,6 +85,7 @@ b0000000000001111 {u
|
|||||||
date: ' Wed Sep 18 22:59:07 2019\n ',
|
date: ' Wed Sep 18 22:59:07 2019\n ',
|
||||||
version: ' Generated by VerilatedVcd ',
|
version: ' Generated by VerilatedVcd ',
|
||||||
timescale: ' 1ns ',
|
timescale: ' 1ns ',
|
||||||
|
t0: 1,
|
||||||
varId: 'u)',
|
varId: 'u)',
|
||||||
wires: {
|
wires: {
|
||||||
top: {
|
top: {
|
||||||
|
@ -83,6 +83,7 @@ b0000000000001111 {u
|
|||||||
date: ' Wed Sep 18 22:59:07 2019\n ',
|
date: ' Wed Sep 18 22:59:07 2019\n ',
|
||||||
version: ' Generated by VerilatedVcd ',
|
version: ' Generated by VerilatedVcd ',
|
||||||
timescale: ' 1ns ',
|
timescale: ' 1ns ',
|
||||||
|
t0: 1,
|
||||||
varId: 'u)',
|
varId: 'u)',
|
||||||
wires: {
|
wires: {
|
||||||
top: {
|
top: {
|
||||||
|
2
vcd.c
2
vcd.c
@ -1,5 +1,6 @@
|
|||||||
#define NAPI_VERSION 1
|
#define NAPI_VERSION 1
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
#include <limits.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include "vcd_parser.h"
|
#include "vcd_parser.h"
|
||||||
#include <node_api.h>
|
#include <node_api.h>
|
||||||
@ -135,6 +136,7 @@ METHOD(init) {
|
|||||||
state->tmpStr2 = tmpStr2;
|
state->tmpStr2 = tmpStr2;
|
||||||
state->value = valueBuf;
|
state->value = valueBuf;
|
||||||
state->mask = maskBuf;
|
state->mask = maskBuf;
|
||||||
|
state->time = UINT64_MAX;
|
||||||
state->digitCount = 0;
|
state->digitCount = 0;
|
||||||
|
|
||||||
napi_value status;
|
napi_value status;
|
||||||
|
14
vcd_spans.c
14
vcd_spans.c
@ -1,6 +1,7 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
#include <limits.h>
|
||||||
#include "vcd_parser.h"
|
#include "vcd_parser.h"
|
||||||
|
|
||||||
#ifndef VCDWASM
|
#ifndef VCDWASM
|
||||||
@ -261,6 +262,17 @@ int onDigit(
|
|||||||
}
|
}
|
||||||
|
|
||||||
int timeSpan(vcd_parser_t* state, const unsigned char* p, const unsigned char* endp) {
|
int timeSpan(vcd_parser_t* state, const unsigned char* p, const unsigned char* endp) {
|
||||||
state->time = strtoul((const char *)p, (char **)&endp, 10);
|
int64_t time = strtoul((const char *)p, (char **)&endp, 10);
|
||||||
|
if (state->time == UINT64_MAX) {
|
||||||
|
#ifndef VCDWASM
|
||||||
|
napi_env env = state->napi_env;
|
||||||
|
napi_value val;
|
||||||
|
ASSERT(val, napi_create_int32(env, time, &val))
|
||||||
|
ASSERT(state->info, napi_set_named_property(env, state->info, "t0", val))
|
||||||
|
#else
|
||||||
|
set_property_int("t0", time);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
state->time = time;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
#include <limits.h>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include "vcd_parser.h"
|
#include "vcd_parser.h"
|
||||||
|
|
||||||
@ -119,6 +120,7 @@ int init(
|
|||||||
state->value = valueBuf;
|
state->value = valueBuf;
|
||||||
state->mask = maskBuf;
|
state->mask = maskBuf;
|
||||||
state->digitCount = 0;
|
state->digitCount = 0;
|
||||||
|
state->time = UINT64_MAX;
|
||||||
|
|
||||||
set_property_string("status", "declaration");
|
set_property_string("status", "declaration");
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user