vcdrom icon indicating copy to clipboard operation
vcdrom copied to clipboard

load streaming JSON

Open drom opened this issue 3 years ago • 4 comments

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, t is current time stamp
  • n -- signal name

Immediate events

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

Sequence (transaction)

...
{"t0":345345, "t1":34564556, "n":"SEQ_NAME", "n1":"END_BAR", "n0":"BEGIN_FOO", ....}
...

drom avatar Sep 09 '22 02:09 drom

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 avatar Sep 26 '22 19:09 mslijepc

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

mslijepc avatar Sep 27 '22 12:09 mslijepc

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

drom avatar Sep 27 '22 17:09 drom

This would be great to connect to logic analyzer hardware.

tannewt avatar Nov 01 '22 18:11 tannewt