Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 45 additions & 0 deletions .trinity/seals/analog_AnalogSarTraceRaw.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
{
"built_by": "t27c-bootstrap@0.5.2+42a4860c4",
"closure": [
{
"spec": "specs/analog/linear.t27",
"spec_hash": "sha256:3ddef7be183aba583ed285334ee389b48a65b41335e98914514235db7c4e5d62"
},
{
"spec": "specs/analog/raw_writer.t27",
"spec_hash": "sha256:aeeb1e59ef814992e7e73a1c68b4889fcac1a936ec8c921aa99d1fbb96083ce8"
},
{
"spec": "specs/analog/sar_adc.t27",
"spec_hash": "sha256:208a64705a1d07ff14d3131d999135a3d5da6c7cb9bc2e919430d7e60b34db68"
},
{
"spec": "specs/analog/sar_cdac.t27",
"spec_hash": "sha256:a7c45039214a8b2e92333a88befc95af33ff482ce08af3be97e2c5b8be3eacd3"
}
],
"config": "gen=c,rust,verilog,zig;tests=zig",
"gen_hash_c": "sha256:160dc9b78f778e599ce800c518b9cb5cac8bec1b50be823472ab8890c4436955",
"gen_hash_rust": "sha256:298f6204a606d74987239deaf8a9dde957de62be01b006a19ac2b369a62744ab",
"gen_hash_verilog": "sha256:db5eee359b5ed3b795ad2d15e9c407334174ee9a0dc589417b76a7c342f0f870",
"gen_hash_zig": "sha256:383b0d777455d6b2725e27b7b9142c1d17fbd2234e872efe71a2fa67adb9479a",
"module": "AnalogSarTraceRaw",
"ring": 12,
"seal_schema": 2,
"sealed_at": "2026-10-19T20:10:04Z",
"sealed_by": "t27c-bootstrap@0.5.2",
"spec_hash": "sha256:e05b73741ad6dfe52d51fcec902c21862a8fd4b7b504de212236aebef85936d4",
"spec_path": "specs/analog/sar_trace_raw.t27",
"tests": {
"failed": 0,
"failing": [],
"forced": false,
"passed": 7,
"total": 7,
"vacuous": 0
},
"toolchain": {
"test_runner": "sha256:8512b80da533b79289110fca4a65f3336abd7a059ca4b72ea595d5e33ff8ad10",
"zig": "0.16.0"
}
}
44 changes: 44 additions & 0 deletions specs/analog/decks/sar_trace_raw.cir
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
m5b read back of a sar trace raw file
* specs/analog/decks/sar_trace_raw.cir -- the read-back of specs/analog/sar_trace_raw.t27 (#11148). The deck simulates nothing: its one resistor only gives
* ngspice a circuit, and the control block loads RAW files, prints them and writes them back, so that the doubles ngspice read can be compared with the doubles
* the spec pins. Run: ngspice -b sar_trace_raw.cir (from a directory that holds the four files below; ngspice-47 exits 1, "incomplete or empty netlist", after the
* control block has run, because the deck has no analysis).
* The files are decoded from the text of the spec, not written by another program:
* sar_trace_bin.raw the constants TR_BIN_H0, TR_BIN_H1, TR_BIN_H2 joined and read as hex (500 bytes), for example
* grep '^pub const TR_BIN_H' specs/analog/sar_trace_raw.t27 | sed 's/.*= "//; s/";$//' | tr -d '\n' | xxd -r -p > sar_trace_bin.raw
* sar_trace_asc.raw the constants TR_ASC0, TR_ASC1, TR_ASC2 joined, with the escapes \t and \n read as a tab and a line feed (1004 bytes)
* flip_bin.raw sar_trace_bin.raw with the lowest bit of byte 356 (the first byte of v(vdn) at point 3) flipped: the spec's changed-byte control
* short_bin.raw sar_trace_bin.raw with the line "No. Points: 8" changed to "No. Points: 9": the spec's wrong-point-count control
* ngspice names the plots tran1 .. tran3 as it loads them and writes the variables of a loaded plot in its own order (time, code, v(vdn), v(vdp)); rb_bin.raw and
* rb_asc.raw are the binary files it writes back.
R1 1 0 1k
.control
version
set numdgt=16
echo ==== BINARY: load
load sar_trace_bin.raw
echo ==== BINARY: display
display
echo ==== BINARY: print all
print all
set filetype=binary
write rb_bin.raw all
echo ==== ASCII: load
load sar_trace_asc.raw
echo ==== ASCII: display
display
echo ==== ASCII: print all
print all
set filetype=binary
write rb_asc.raw all
echo ==== FLIPPED BYTE: load
load flip_bin.raw
echo ==== FLIPPED BYTE: print all
print all
echo ==== WRONG POINT COUNT: load
load short_bin.raw
echo ==== WRONG POINT COUNT: print all
print all
echo ==== DONE
.endc
.end
Loading
Loading