code wiki / _hdl_build / nx_rvc_kat.nx

nx_rvc_kat.nx

buildroot/runtime/_hdl_build/nx_rvc_kat.nx

2611 B28 linesdepth 3pulls 3 transitivereach 0 importersview sourcekind tool
docsdependenciesstructsconstsfunctions

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

nx_syscalls.nx nx_rvc_expand.nx nx_rvc_kat.nx

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

main g_puts sys_write ck g_puts ↻ g_ph g_puts ↻ sys_mmap sys_write ↻ nx_rvc_expand rvc_bit rvc_i rvc_s rvc_sext rvc_u rvc_r rvc_j rvc_b nx_rvc_is_compressed sys_mmap ↻ sys_write ↻ sys_exit

structs

none

consts

none

functions

6func 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 }
called by 3: g_phckmain calls 1: sys_write
7func 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 }
called by 1: ck calls 3: g_putssys_mmapsys_write
8func 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 }
called by 1: main calls 2: g_putsg_ph
10func main() -> i64