code wiki / (root) / nx_isa_manager.nx

nx_isa_manager.nx

buildroot/runtime/nx_isa_manager.nx

43395 B1148 linesdepth 3pulls 3 transitivereach 0 importersview sourcekind tooltopic isa
docsdependenciesstructsconstsfunctions

about

nx_isa_manager.nx -- THE MASTER ISA MANAGER. WHAT IT IS: not another conformance gate. The gates measure ONE architecture each and answer "does this emulator obey its manual". This organ measures THE POPULATION and answers a different question: of every ISA the estate has declared in scope, which ones does anything at all measure, which have an emulator nobody rules on, which are declared and untouched, and what is the next actionable name in each of those classes. THE DENOMINATOR IS PUBLISHED. knowledge/isa_targets.conf is the population and it is READ, never inferred. A coverage ratio whose denominator is "the ISAs I happened to think of" flatters itself by omission; 14 of 122 is an honest number and 14 of 14 is not. impl AND ext ROWS ARE NOT TARGETS AND ARE EXCLUDED FROM EVERY EMITTER/EMULATOR RATIO. An impl row is a HOST that implements another row's ISA (Phytium implements aarch64) and an ext row is an EXTENSION of a base ISA (SVE extends aarch64). Counting either in a codegen ratio double-counts the base ISA and inflates the number in the one direction nobody audits. They get their own named state, NOT-A-TARGET, so they are visible and excluded at the same time. HOW A NEW ISA JOINS -- NO EDIT TO THIS ORGAN, EVER: 1. add a row to knowledge/isa_targets.conf. It reads DECLARED-ONLY. 2. write buildroot/runtime/nx_emu_<id>.nx. It reads EMULATOR-ONLY. 3. write buildroot/runtime/nx_isa_<id>_gate.nx, or import nx_emu_<id>.nx from nx_isa_conform_gate.nx. It reads GATE-PRESENT-UNRUN. 4. let that gate bank "<id> <passed>" into knowledge/status/isa_<id>.ratchet, or into the core gate's shared knowledge/status/isa_conform.ratchet. It reads MEASURED-GREEN. If the organs are already named something other than the conf id, add ONE row to knowledge/isa_emu_alias.conf. That file is DATA and the manager reports how many rows it used and names any alias whose id is not in the population, because an alias for an undeclared id is a typo that silently hides a target. DISCOVERY IS A PROBE, NOT A LIST. There is no array of architecture

dependencies 2 imports · 0 importers

nx_gate_verdict.nx nx_syscalls.nx nx_isa_manager.nx

imports: nx_gate_verdict.nxnx_syscalls.nx

imported by: nobody (leaf or entry point)

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main gv_head gv_puts sys_write gv_ctr sys_mmap nxa_die sys_write ↻ sys_exit nxa_lock_take nxa_lock_addr sys_write ↻ nxa_lock_give nxa_lock_addr ↻ nxa_report_overrun sys_write ↻ nxa_dump_printable sys_write ↻ nxa_dump_sizes sys_write ↻ sys_mmap ↻ im_kread gv_cat im_kroot sys_read_file sys_openat_rd sys_lseek sys_mmap ↻ sys_read sys_munmap sys_close gv_puts ↻ gv_num sys_mmap ↻ sys_write ↻ sys_munmap ↻ im_nl sys_mmap ↻ sys_write ↻ im_slice_eq

structs

none

consts

75const IM_CONF_NAME: *u8 = "isa_targets.conf"
76const IM_ALIAS_NAME: *u8 = "isa_emu_alias.conf"
77const IM_CORE_GATE: *u8 = "nx_isa_conform_gate.nx"
78const IM_CORE_RATCH: *u8 = "status/isa_conform.ratchet"
79const IM_RATCH_PRE: *u8 = "status/isa_"
80const IM_RATCH_SUF: *u8 = ".ratchet"
81const IM_EMU_PRE: *u8 = "nx_emu_"
82const IM_GATE_PRE: *u8 = "nx_isa_"
83const IM_GATE_SUF: *u8 = "_gate.nx"
84const IM_NX_SUF: *u8 = ".nx"
90const IM_ROOTS: i64 = 4
97const IM_KROOTS: i64 = 2
106const IM_MAX_TARGETS: i64 = 512
107const IM_MAX_ALIAS: i64 = 256
108const IM_PATH_BYTES: i64 = 1024
109const IM_SLICE_BYTES: i64 = 256
110const IM_BOX_BYTES: i64 = 16
111const IM_ALIAS_COLS: i64 = 4
112const IM_WORD: i64 = 8
113const IM_ALIAS_TAG: i64 = 6
114const IM_ISA_TAG: i64 = 4
121const IM_FIELDS_AFTER_TAG: i64 = 6
128const IM_GATE_FLOOR: i64 = 6
129const IM_EMU_FLOOR: i64 = 6
132const IM_NL: i64 = 10
133const IM_CR: i64 = 13
134const IM_SPACE: i64 = 32
135const IM_PIPE: i64 = 124
136const IM_DIG_LO: i64 = 48
137const IM_DIG_HI: i64 = 57
138const IM_BYTE_M: i64 = 255
139const IM_PERMIL: i64 = 1000
140const IM_B10: i64 = 10
141const IM_SEEK_END: i64 = 2
142const IM_NUL: i64 = 0
147const IM_C_CPU: i64 = 0
148const IM_C_MCU: i64 = 1
149const IM_C_GPU: i64 = 2
150const IM_C_ACCEL: i64 = 3
151const IM_C_DSP: i64 = 4
152const IM_C_VM: i64 = 5
153const IM_C_FPGA: i64 = 6
154const IM_C_LEGACY: i64 = 7
155const IM_C_IMPL: i64 = 8
156const IM_C_EXT: i64 = 9
157const IM_C_NISHI: i64 = 10
158const IM_C_UNKNOWN: i64 = 11
159const IM_C_COUNT: i64 = 12
180const IM_S_UNSET: i64 = -1
181const IM_S_GREEN: i64 = 0
182const IM_S_RED: i64 = 1
183const IM_S_UNRUN: i64 = 2
184const IM_S_EMUONLY: i64 = 3
185const IM_S_DECLARED: i64 = 4
186const IM_S_NOTARGET: i64 = 5
187const IM_S_COUNT: i64 = 6
405const IM_A_IDOFF: i64 = 0
406const IM_A_IDLEN: i64 = 1
407const IM_A_CLS: i64 = 2
408const IM_A_SRC: i64 = 3
409const IM_A_SOFF: i64 = 4
410const IM_A_SLEN: i64 = 5
411const IM_A_STATE: i64 = 6
412const IM_A_SCORE: i64 = 7
413const IM_A_GATE: i64 = 8
414const IM_A_EMU: i64 = 9
415const IM_A_RATSRC: i64 = 10
416const IM_A_COUNT: i64 = 11
418const IM_SRC_CONF: i64 = 0
419const IM_SRC_ALIAS: i64 = 1
423const IM_RS_NONE: i64 = 0
424const IM_RS_PER: i64 = 1
425const IM_RS_CORE: i64 = 2

functions

91func im_root(i: i64) -> *u8
called by 2: im_probe_rootsmain
98func im_kroot(i: i64) -> *u8
called by 1: im_kread
161func im_class_name(c: i64) -> *u8
called by 1: main
189func im_state_name(s: i64) -> *u8
called by 1: main
199func im_state_meaning(s: i64) -> *u8
called by 1: main
211func im_nl() -> i64
called by 1: main calls 2: sys_mmapsys_write
219func im_slice_eq(buf: *u8, off: i64, len: i64, s: *u8) -> i64
called by 2: im_class_ofmain
233func im_slice_eq_slice(a: *u8, ao: i64, al: i64, b: *u8, bo: i64, bl: i64) -> i64
244func im_cat_slice(d: *u8, o: i64, buf: *u8, off: i64, len: i64) -> i64
257func im_puts_slice(scratch: *u8, buf: *u8, off: i64, len: i64) -> i64
called by 1: main calls 2: im_cat_slicegv_puts
268func im_exists(path: *u8) -> i64
279func im_probe_roots(scratch: *u8, pre: *u8, buf: *u8, off: i64, len: i64, suf: *u8) -> i64
297func im_kread(scratch: *u8, name: *u8, lenbox: *i64) -> *u8
called by 1: main calls 3: gv_catim_krootsys_read_file
313func im_contains(buf: *u8, n: i64, s: *u8) -> i64
called by 1: im_contains_slug
339func im_contains_slug(scratch: *u8, buf: *u8, n: i64, pre: *u8, sb: *u8, so: i64, sl: i64, suf: *u8) -> i64
called by 1: main calls 3: gv_catim_cat_sliceim_contains
352func im_digits_at(buf: *u8, n: i64, p0: i64) -> i64
called by 1: im_ratchet_score
376func im_ratchet_score(buf: *u8, n: i64, sb: *u8, so: i64, sl: i64) -> i64
called by 1: main calls 2: im_slice_eq_sliceim_digits_at
426func im_ratsrc_name(r: i64) -> *u8
called by 1: main
432func im_cell(tab: *i64, i: i64, f: i64) -> i64 { return tab[i * IM_A_COUNT + f] }
called by 1: main
433func im_setcell(tab: *i64, i: i64, f: i64, v: i64) -> i64
called by 1: main
438func im_permil(a: i64, b: i64) -> i64
called by 1: main
443func im_class_of(buf: *u8, off: i64, len: i64) -> i64
called by 1: main calls 1: im_slice_eq
461func im_is_target(c: i64) -> i64
called by 1: main
471func im_classify(is_target: i64, score: i64, gate: i64, emu: i64) -> i64
called by 1: main
482func main(argc: i64, argv: *i64) -> i64