code wiki / _hdl_build / nx_rvc_kat.nx
nx_rvc_kat.nx
buildroot/runtime/_hdl_build/nx_rvc_kat.nx
about
nx_rvc_kat.nx -- KAT for the RVC expander: expand known compressed instructions, check the 32-bit equivalents against
hand-computed base encodings (before hooking into the sim). expect_exit: 0
dependencies 2 imports · 0 importers
imports: nx_syscalls.nxnx_rvc_expand.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
| none |
functions
| 6 | 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 } |
| 7 | func g_ph(v: i64) -> i64 { g_puts("0x" as *u8); let b: *u8=sys_mmap(12); var i: i64=7; while i>=0 { let nib: i64=(v>>(i*4))&15; if nib<10 { b[7-i]=(48+nib) as u8 } else { b[7-i]=(87+nib) as u8 } i=i-1 } sys_write(1,b,8); return 0 } |
| 8 | func ck(name: *u8, got: i64, exp: i64) -> i64 { var c: i64=0; if got==exp { c=1 } if c==1 { g_puts(" PASS " as *u8) } else { g_puts(" FAIL " as *u8) } g_puts(name); g_puts(" got="); g_ph(got); g_puts(" exp="); g_ph(exp); g_puts("\n" as *u8); return c } |
| 10 | func main() -> i64 |