vcdrom
vcdrom copied to clipboard
load streaming JSON
Load streaming JSON messages:
https://en.wikipedia.org/wiki/JSON_streaming
Standard fields:
t-- time stamp (in time units compatible with VCD) optional field. If omitted,tis current time stampn-- signal name
Immediate events
...
{"t":2334534, "n":"MY_WRITE", ...}
...
Sequence (transaction)
...
{"t0":345345, "t1":34564556, "n":"SEQ_NAME", "n1":"END_BAR", "n0":"BEGIN_FOO", ....}
...
for the read and writes, I can do sequence
e.g. for read
{"t0":123, "t1":234, "t2":235, "t3":236, "n":"READ_TRANS", "n0":"BegReqE", "n1":"EndReqE", "n2":"rresp_t", "n3":"rresp_t_end"}
For signal:
{"t":123, "n":"r_valid, start", "MSG": "initial value"}
{"t":125, "n ":"r_valid, end", "MSG": "beginning of loop"}
{"t":125, "n":"r_valid, start"}
Ok?
should we name differently signals from different adapters? they will be in different files
Specs
NDJSON | \n | .ndjson | http://ndjson.org | https://github.com/ndjson/ndjson-spec
JSONL | \n | .jsonl | https://jsonlines.org
RFC7464 | 0x1e ... 0x0a | .json-seq | https://www.rfc-editor.org/rfc/rfc7464
Libraries
NDJSON | js | https://github.com/ndjson/ndjson.js JSONL, NDJSON | js | https://github.com/uhop/stream-json/wiki/jsonl-Parser
Parser code: https://github.com/uhop/stream-json/blob/master/jsonl/Parser.js#L25
Tools
JQ | https://github.com/stedolan/jq FX | https://fx.wtf
This would be great to connect to logic analyzer hardware.