code wiki / _hdl_build / nx_rv64_tier.nx

nx_rv64_tier.nx

buildroot/runtime/_hdl_build/nx_rv64_tier.nx

11581 B187 linesdepth 6pulls 7 transitivereach 9 importersview sourcekind librarytopic rv64
docsdependenciesstructsconstsfunctions

about

nx_rv64_tier.nx -- the TIERED EXECUTION ENGINE (the SOTA emulator architecture: V8/HotSpot/QEMU-TCG-style). It INTERPRETS cold code via the shared fk_step (so it cannot diverge from the golden interpreter), PROFILES loop back-edges, and when a loop header crosses a hotness threshold it JIT-compiles that loop's region and CACHES the native code; on subsequent entries the loop runs NATIVELY. Loops the JIT can't handle (unsupported op / control flow leaving the region) simply stay interpreted -- fail-safe, never miscompiled. This is what makes the JIT accelerate REAL mixed programs, not isolated loops. license_tier: ORIGINAL

dependencies 3 imports · 9 importers

nx_syscalls.nx nx_rv64_fast.nx nx_rv64_jit.nx nx_rv64_tier.nx nx_hwtest_matrix.nx nx_rv64_cjit_gate.nx nx_rv64_ctier_gate.nx nx_rv64_difftest.nx nx_rv64_jit_w_gate.nx nx_rv64_realc_gate.nx nx_rv64_run_bin_tier.nx nx_rv64_tier_gate.nx nx_rv64_toolchain_gate.nx

imports: nx_syscalls.nxnx_rv64_fast.nxnx_rv64_jit.nx

imported by: nx_hwtest_matrix.nxnx_rv64_cjit_gate.nxnx_rv64_ctier_gate.nxnx_rv64_difftest.nxnx_rv64_jit_w_gate.nxnx_rv64_realc_gate.nxnx_rv64_run_bin_tier.nxnx_rv64_tier_gate.nxnx_rv64_toolchain_gate.nx

structs

73struct CReg

consts

none

functions

13func tier_run(opk: *i64, rd: *i64, rs1: *i64, rs2: *i64, imm: *i64, ncount: i64, reg: *i64, mem: *u8, membytes: i64, maxsteps: i64, dev: *NxVirtioMmio, threshold: i64, stats: *i64) -> i64
86func jit_compile_creg(c: *CReg) -> i64
called by 1: tier_run_c calls 2: sys_mmapjit_compile
130func tier_run_c(opk: *i64, rd: *i64, rs1: *i64, rs2: *i64, imm: *i64, nhalf: i64, reg: *i64, mem: *u8, membytes: i64, maxsteps: i64, dev: *NxVirtioMmio, threshold: i64, stats: *i64) -> i64
187func tier_main_ignore() -> i64 { return 0 }