code wiki / _hdl_build / nx_rv64_snapshot_gate.nx
nx_rv64_snapshot_gate.nx
buildroot/runtime/_hdl_build/nx_rv64_snapshot_gate.nx
about
nx_rv64_snapshot_gate.nx -- prove DETERMINISTIC snapshot/restore (F107i). Runs a compute program to halt
(reference hash A). Then on a second sim: run PARTWAY, snapshot, run to halt -> hash B (== A proves the
snapshot is non-disturbing + the continuation is deterministic); RESTORE the snapshot, run to halt -> hash
B2 (== A proves restore rewinds + continues byte-identically). Exact because the sim is bit-deterministic
(no float) -- the sovereign determinism exceed bet. Self-checking. expect_exit:0
dependencies 11 imports · 0 importers
diagram shows first 10 each side; +1 more imports, +0 more importers in the complete lists below.
imports: nx_syscalls.nxnishi_hdl_primitives.nxrv64im_min_decoder.nxrv64im_min_alu.nxrv64im_min_regfile.nxrv64im_min_csr.nxrv64im_min_clint.nxrv64im_min_uart.nxrv64im_min_virtio.nxrv64im_min_sim.nxnx_rv64_asm.nx
imported by: nobody (leaf or entry point)
call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown
structs
| none |
consts
| 25 | const SN_MEMB: i64 = 0x80000000 |
| 26 | const SN_MEMS: i64 = 65536 |
| 27 | const SN_SCRATCH_OFF: i64 = 0x2000 |
functions
| 18 | func g_puts(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 } |
| 19 | func g_ph(v: i64) -> i64 |
| 29 | func state_hash(rf: *NxRv64imRegfile, mem: *u8, memsz: i64) -> i64 |
| 42 | func rd64(mem: *u8, off: i64) -> i64 { var v: i64=0; var i: i64=0; while i<8 { v=v|((mem[off+i] as i64)<<(i*8)); i=i+1 } return v } called by 1: main |
| 44 | func build_prog(out: *u8) -> i64 |
| 65 | func mk_sim(code: *u8, nb: i64, out_rf: *i64, out_mem: *i64) -> i64 called by 1: main calls 6: sys_mmapnx_rv64im_rf_initnx_rv64im_csr_initnx_clint_initnx_uart_initnx_rv64im_sim_init |
| 80 | func main() -> i64 |