wavedrom / vcdrom

VCD viewer
https://vc.drom.io
MIT License
78 stars 11 forks source link

load streaming JSON #25

Open drom opened 2 years ago

drom commented 2 years ago

Load streaming JSON messages:

https://en.wikipedia.org/wiki/JSON_streaming

Standard fields:

Immediate events

...
{"t":2334534, "n":"MY_WRITE", ...}
...

Sequence (transaction)

...
{"t0":345345, "t1":34564556, "n":"SEQ_NAME", "n1":"END_BAR", "n0":"BEGIN_FOO", ....}
...
mslijepc commented 1 year ago

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?

mslijepc commented 1 year ago

should we name differently signals from different adapters? they will be in different files

drom commented 1 year ago

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

tannewt commented 1 year ago

This would be great to connect to logic analyzer hardware.