nx_rvc_run_suite.nx
buildroot/runtime/nx_rvc_run_suite.nx
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
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
structs
| none |
consts
| 31 | const RVC_MEM_BASE: i64 = 0x80000000 |
| 32 | const RVC_PAGE: i64 = 4096 |
| 33 | const RVC_TX_CAP: i64 = 4096 // UART tx scratch; arch-test emits no console output, this is unused headroom |
| 38 | const RVC_MAX_STEPS: i64 = 8000000 |
| 39 | const RVC_V_PASS: i64 = 0 |
| 40 | const RVC_V_FAIL: i64 = 1 |
| 41 | const RVC_V_UNSUP: i64 = 2 |
| 43 | const RVC_R_VERDICT: i64 = 0 |
| 44 | const RVC_R_MISMATCH:i64 = 1 // first differing word index, or -1 |
| 45 | const RVC_R_STEPS: i64 = 2 |
| 46 | const RVC_R_HALTCODE:i64 = 3 |
| 47 | const RVC_R_DONE: i64 = 4 // 1 if tohost was set |
| 48 | const RVC_R_NWORDS: i64 = 5 |
| 49 | const RVC_R_GOT: i64 = 6 // first differing word: what the sim produced |
| 50 | const RVC_R_EXP: i64 = 7 // first differing word: what the reference holds |
| 51 | const RVC_R_N: i64 = 8 |
| 229 | const RVC_MAXGROUPS: i64 = 16 |
| 230 | const RVC_GNAME_CAP: i64 = 32 |
functions
| 53 | func 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 } |
| 54 | func rvc_num(v: i64) -> i64 |
| 72 | func rvc_hex32(v: i64) -> i64 |
| 85 | func rvc_roundup(v: i64, m: i64) -> i64 { return ((v + m - 1) / m) * m } called by 1: rvc_run_img |
| 88 | func rvc_parse_hex(buf: *u8, pos: i64, endp: *i64) -> i64 |
| 109 | func rvc_next_bar(buf: *u8, pos: i64) -> i64 called by 1: rvc_run_suite |
| 116 | func rvc_cat(dst: *u8, off: i64, s: *u8) -> i64 called by 1: rvc_run_one |
| 122 | func rvc_cat_field(dst: *u8, off: i64, buf: *u8, a: i64, b: i64) -> i64 |
| 131 | func rvc_run_img(img: *u8, ilen: i64, entry: i64, begin: i64, endsig: i64, tohost: i64, mem_need: i64, |
| 182 | func rvc_parse_ref(buf: *u8, len: i64, ref_words: *i64, cap: i64) -> i64 |
| 200 | func rvc_run_one(root: *u8, group: *u8, test: *u8, entry: i64, begin: i64, endsig: i64, tohost: i64, |
| 234 | func rvc_run_suite(pinpath: *u8, root: *u8) -> i64 called by 2: rvc_selftestmain calls 8: sys_mmapsys_read_filervc_putsrvc_next_barrvc_parse_hexrvc_run_one+2 |
| 348 | func rvc_st_wr32(buf: *u8, off: i64, w: i64) -> i64 called by 1: rvc_st_build |
| 358 | func rvc_st_build(buf: *u8, first_illegal: i64) -> i64 |
| 374 | func rvc_selftest() -> i64 |
| 425 | func rvc_run_suite_live() -> i64 { return RVC_V_PASS } |
| 427 | func main(argc: i64, argv: *i64) -> i64 |