code wiki / _hdl_build / nx_mmbench_lib.nx

nx_mmbench_lib.nx

buildroot/runtime/_hdl_build/nx_mmbench_lib.nx

6113 B133 linesdepth 2pulls 2 transitivereach 2 importersview sourcekind bench
docsdependenciesstructsconstsfunctions

about

nx_mmbench_lib.nx -- the TESTABLE CORE of the media-manager + companion ruler. Shared by nx_mmbench (the shipping tool) AND nx_mmbench_gate (the proof), so the gate's negative control exercises THE CODE THAT ACTUALLY SHIPS rather than a copy of it (rule 15 / refbench shape). The whole honesty claim of the ruler rests on aud() below: if aud() does not really downgrade an unbacked claim, every coverage number the tool prints is decoration. The gate mutation-tests it. license_tier: ORIGINAL expect_exit: 0

dependencies 1 imports · 2 importers

nx_syscalls.nx nx_mmbench_lib.nx nx_mmbench.nx nx_mmbench_gate.nx

imports: nx_syscalls.nx

imported by: nx_mmbench.nxnx_mmbench_gate.nx

structs

none

consts

10const V_HAVE: i64 = 2
11const V_PART: i64 = 1
12const V_GAP: i64 = 0
13const MMB_SCRATCH: i64 = 32
63const MMB_BINCAP: i64 = 4194304 // 4 MiB scan cap -- DECLARED (law L011), never a silent partial

functions

15func sw(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 1: main calls 1: sys_write
16func sn(v: i64) -> i64
called by 1: main calls 2: sys_mmapsys_write
30func have(path: *u8) -> i64 { let fd: i64 = sys_openat_rd(path); if fd<0 { return 0 } sys_close(fd); return 1 }
called by 3: mainaudwired calls 2: sys_openat_rdsys_close
39func aud(v: i64, ev: i64) -> i64
called by 2: mainmain calls 1: have
58func wired(wire: i64) -> i64
called by 3: mainwired_refusable calls 1: have
73func bin_ref(binpath: *u8, needle: *u8) -> i64
109func wired_ref(wire: i64, sb: i64, needle: i64) -> i64
called by 3: mainmainusable_ref calls 2: wiredbin_ref
118func usable(built_v: i64, wire: i64) -> i64
called by 1: main calls 1: wired
123func usable_ref(built_v: i64, wire: i64, sb: i64, needle: i64) -> i64
calls 1: wired_ref
127func vstr(v: i64) -> *u8 { if v==2 { return "HAVE" as *u8 } if v==1 { return "PARTIAL" as *u8 } return "GAP" as *u8 }
called by 1: main
128func streq(a: *u8, b: *u8) -> i64
called by 2: mainmain