code wiki / _hdl_build / rv64im_min_cpu_crosscheck.nx
rv64im_min_cpu_crosscheck.nx
buildroot/runtime/_hdl_build/rv64im_min_cpu_crosscheck.nx
about
nx_rv64im_cpu_crosscheck.nx -- 1:1 proof: our sovereign RV64IM CPU sim
vs qemu-system-riscv64 (canonical reference) on the SAME ELF.
Loads cpu_crosscheck_prog.elf (sum of squares 1..20 = 2870, printed via
UART, exercising MUL/DIVU/REMU/branches/loads) into the sim, runs it,
and emits the captured UART byte stream to stdout + a proof file. The
off-box harness then diffs our UART against qemu's UART and the known
answer 2870. Asserts our output contains "SUM=2870".
expect_exit: 0
license_tier: ORIGINAL
dependencies 10 imports · 0 importers
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_sim.nxrv64im_min_elf_loader.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
| 24 | const CC_MEM_BASE: i64 = 0x80000000 |
| 25 | const CC_MEM_SIZE: i64 = 0x400000 // 4 MiB (covers prog + 0x80100000 buf + 0x80200000 stack) |
| 26 | const CC_TX_CAP: i64 = 4096 |
| 27 | const CC_MAX_STEPS: i64 = 1000000 |
functions
| 29 | func _contains(hay: *u8, hlen: i64, needle: *u8, nlen: i64) -> i64 called by 1: main |
| 47 | func _slen(s: *u8) -> i64 called by 1: main |
| 53 | func main() -> i64 |