code wiki / (root) / nx_rvc_run_suite.nx

nx_rvc_run_suite.nx

buildroot/runtime/nx_rvc_run_suite.nx

21437 B443 linesdepth 6pulls 17 transitivereach 0 importersview sourcekind tooltopic rvc
docsdependenciesstructsconstsfunctions

about

nx_rvc_run_suite.nx -- nishios NO3: run the published RISC-V architectural test suite on the SOVEREIGN rv64im_min_sim and report the pass count PER TEST GROUP against the repo's Spike-generated reference signatures. Watch symbol: rvc_run_suite. THE SUBJECT is our sim (rv64im_min_sim via nx_bootcap's ONE machine composition). The corpus is third-party (riscv-non-isa/riscv-arch-test 2.7.4): the test .S sources are assembled by an ORACLE/BUILD-TOOL gcc on the laptop (never on the sovereign chain) and the .reference_output signatures are the repo's own Spike-generated vectors. So this gate compares OUR execution against a published third-party reference -- exactly what "architectural compliance" means. Corpus is pinned (riscv_arch_test.pin, pipe-row grammar, sha256 per file) so the population is fixed + citable. COMPLETION MARKER: RVMODEL_HALT writes 1 to the `tohost` symbol (a RAM word) then spins. We poll that word; when nonzero the test has signalled done. Then we dump [begin_signature, end_signature) as little-endian 32-bit words and compare, word for word, against the reference. VERDICTS (never one percentage; per group, partition printed and summed): PASS completed (tohost set) AND every signature word matches FAIL completed but a signature word differs (the sim executed something wrong) UNSUPPORTED did not complete: an illegal/unimplemented instruction halted it, or it never wrote tohost within the step budget (a hang) -- reported apart from FAIL because it is NOT "the sim computed a wrong value", it is "the sim cannot run this test". A memory big enough for the whole image is DERIVED from the pinned mem_end (the linker's _end), never guessed: the branch tests (jal/beq/...) place their signature ~586 KB above mem_base, so the fixed 64 KB boot RAM cannot hold them -- nx_bootcap.bootcap_machine_mem takes the size (one composition). license_tier: ORIGINAL (the debugger/assembler/references are third-party oracles; nothing of them ships)

dependencies 2 imports · 0 importers

nx_syscalls.nx nx_bootcap.nx nx_rvc_run_suite.nx

imports: nx_syscalls.nxnx_bootcap.nx

imported by: nobody (leaf or entry point)

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

main rvc_selftest sys_mmap nxa_die sys_write sys_exit nxa_lock_take nxa_lock_addr sys_write ↻ nxa_lock_give nxa_lock_addr ↻ nxa_report_overrun sys_write ↻ nxa_dump_printable sys_write ↻ nxa_dump_sizes sys_write ↻ rvc_st_build rvc_st_wr32 rvc_run_img rvc_roundup sys_mmap ↻ bootcap_machine_mem rvc_run_suite sys_mmap ↻ sys_read_file sys_openat_rd sys_lseek sys_mmap ↻ sys_read sys_munmap sys_close rvc_puts sys_write ↻ rvc_next_bar rvc_parse_hex rvc_run_one sys_mmap ↻ rvc_cat sys_read_file ↻

structs

none

consts

31const RVC_MEM_BASE: i64 = 0x80000000
32const RVC_PAGE: i64 = 4096
33const RVC_TX_CAP: i64 = 4096 // UART tx scratch; arch-test emits no console output, this is unused headroom
38const RVC_MAX_STEPS: i64 = 8000000
39const RVC_V_PASS: i64 = 0
40const RVC_V_FAIL: i64 = 1
41const RVC_V_UNSUP: i64 = 2
43const RVC_R_VERDICT: i64 = 0
44const RVC_R_MISMATCH:i64 = 1 // first differing word index, or -1
45const RVC_R_STEPS: i64 = 2
46const RVC_R_HALTCODE:i64 = 3
47const RVC_R_DONE: i64 = 4 // 1 if tohost was set
48const RVC_R_NWORDS: i64 = 5
49const RVC_R_GOT: i64 = 6 // first differing word: what the sim produced
50const RVC_R_EXP: i64 = 7 // first differing word: what the reference holds
51const RVC_R_N: i64 = 8
229const RVC_MAXGROUPS: i64 = 16
230const RVC_GNAME_CAP: i64 = 32

functions

53func rvc_puts(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } sys_write(1, s, n); return 0 }
54func rvc_num(v: i64) -> i64
72func rvc_hex32(v: i64) -> i64
called by 1: rvc_run_suite calls 2: sys_mmapsys_write
85func rvc_roundup(v: i64, m: i64) -> i64 { return ((v + m - 1) / m) * m }
called by 1: rvc_run_img
88func rvc_parse_hex(buf: *u8, pos: i64, endp: *i64) -> i64
109func rvc_next_bar(buf: *u8, pos: i64) -> i64
called by 1: rvc_run_suite
116func rvc_cat(dst: *u8, off: i64, s: *u8) -> i64
called by 1: rvc_run_one
122func rvc_cat_field(dst: *u8, off: i64, buf: *u8, a: i64, b: i64) -> i64
131func rvc_run_img(img: *u8, ilen: i64, entry: i64, begin: i64, endsig: i64, tohost: i64, mem_need: i64,
182func rvc_parse_ref(buf: *u8, len: i64, ref_words: *i64, cap: i64) -> i64
called by 1: rvc_run_one calls 2: sys_mmaprvc_parse_hex
200func rvc_run_one(root: *u8, group: *u8, test: *u8, entry: i64, begin: i64, endsig: i64, tohost: i64,
234func rvc_run_suite(pinpath: *u8, root: *u8) -> i64
348func rvc_st_wr32(buf: *u8, off: i64, w: i64) -> i64
called by 1: rvc_st_build
358func rvc_st_build(buf: *u8, first_illegal: i64) -> i64
called by 1: rvc_selftest calls 1: rvc_st_wr32
374func rvc_selftest() -> i64
425func rvc_run_suite_live() -> i64 { return RVC_V_PASS }
427func main(argc: i64, argv: *i64) -> i64