code wiki / _hdl_build / nx_isa_spec_test.nx

nx_isa_spec_test.nx

buildroot/runtime/_hdl_build/nx_isa_spec_test.nx

6318 B131 linesdepth 4pulls 6 transitivereach 0 importersview sourcekind gate/prooftopic isa
docsdependenciesstructsconstsfunctions

about

nx_isa_spec_test.nx -- prove the SPEC-DRIVEN encoder: (1) it reproduces the oracle-verified KAT words (the same ones riscv64-as emits, per nx_emu_rv64_test), (2) instructions added by DATA (xor, or) encode correctly, and (3) a program the SEARCH authored, lowered THROUGH the spec table to BOTH RV64 and AArch64, runs correctly on the sovereign emulators. No per-instruction encoder was hand-written -- each instruction is a data row + one shared format assembler. Known answer: KATs match, both arches execute x*C for the searched constants, exit 0.

dependencies 3 imports · 0 importers

nx_isa_spec.nx nx_emu_rv64.nx nx_emu_arm64.nx nx_isa_spec_test.nx

imports: nx_isa_spec.nxnx_emu_rv64.nxnx_emu_arm64.nx

imported by: nobody (leaf or entry point)

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main is_puts isa_emit isa_assemble is_num is_best is_eval is_run_rv is_put_w isa_emit ↻ emu_rv64_run emu_rv64_run_mem emu_g_ld emu_rv_sext12 emu_ltu emu_srl emu_sext32 emu_g_st emu_rv_bimm emu_rv_jimm sys_read is_run_a64 is_put_w ↻ isa_emit ↻ emu_arm64_run emu_arm64_run_mem a64e_g_ld a64e_wr a64e_rd a64e_subs a64e_ltu a64e_adds a64e_ltu ↻ a64e_shiftreg a64e_srl a64e_udiv a64e_srl ↻ a64e_ltu ↻ a64e_cond a64e_g_st

structs

none

consts

none

functions

15func is_puts(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } sys_write(1, s, n); return 0 }
called by 1: main
16func is_num(v: i64) -> i64
called by 1: main
24func is_put_w(code: *u8, o: i64, w: i64) -> i64
called by 2: is_run_rvis_run_a64
30func is_eval(a: i64, op: i64, b: i64, x: i64) -> i64 { if op == 0 { return (x << a) + (x << b) } return (x << a) - (x << b) }
called by 1: is_best
31func is_best(C: i64, out: *i64) -> i64
called by 1: main calls 1: is_eval
54func is_run_rv(x: i64, a: i64, op: i64, b: i64) -> i64
called by 1: main calls 3: is_put_wisa_emitemu_rv64_run
65func is_run_a64(x: i64, a: i64, op: i64, b: i64) -> i64
called by 1: main calls 3: is_put_wisa_emitemu_arm64_run
75func main() -> i64