code wiki / _hdl_build / nx_gen_machine.nx

nx_gen_machine.nx

buildroot/runtime/_hdl_build/nx_gen_machine.nx

5790 B146 linesdepth 3pulls 3 transitivereach 0 importersview sourcekind tooltopic gen
docsdependenciesstructsconstsfunctions

about

AUTHORED BY nx_machine_gen from a DATA spec (op-fragments + examples) -- a machine the team authored from DATA, not hand-written. license_tier: ORIGINAL

dependencies 2 imports · 0 importers

nx_syscalls.nx nx_itoa_lib.nx nx_gen_machine.nx

imports: nx_syscalls.nxnx_itoa_lib.nx

imported by: nobody (leaf or entry point)

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

main sys_mmap gm_rand gm_fit gm_eval gm_xa gm_xb gm_abs gm_xy gm_tourney gm_rand ↻ gm_eval ↻ gm_xa ↻ gm_xb ↻ gm_xy ↻ gm_p sys_write gm_pn nxi_out nxi_fd sys_mmap ↻ ccz_cat_num sys_write ↻ sys_munmap sys_exit

structs

none

consts

4const EVO_MAGIC_2862933555777941757: i64 = 2862933555777941757
5const EVO_MAGIC_3037000493: i64 = 3037000493
6const EVO_MAGIC_2000000: i64 = 2000000
7const EVO_MAGIC_1000000: i64 = 1000000
8const EVO_MAGIC_2654435761: i64 = 2654435761
9const EVO_MAGIC_12345: i64 = 12345
10const EVO_MAGIC_1000000000: i64 = 1000000000
11const GLEN: i64 = 4
12const EVO_P: i64 = 256
13const EVO_G: i64 = 2000
14const EVO_T: i64 = 5
15const NTRAIN: i64 = 6
16const NHELD: i64 = 4

functions

17func gm_rand(s: *i64) -> i64 { s[0] = s[0] * EVO_MAGIC_2862933555777941757 + EVO_MAGIC_3037000493; return (s[0] >> 17) & 0x3fffffff }
called by 2: gm_tourneymain
18func gm_abs(x: i64) -> i64 { if x < 0 { return 0 - x } return x }
called by 1: gm_fit
19func gm_xa(i: i64) -> i64
called by 2: gm_fitmain
32func gm_xb(i: i64) -> i64
called by 2: gm_fitmain
45func gm_xy(i: i64) -> i64
called by 2: gm_fitmain
58func gm_eval(pop: *i64, base: i64, a: i64, b: i64) -> i64
called by 2: gm_fitmain
73func gm_fit(pop: *i64, base: i64) -> i64
called by 1: main calls 5: gm_evalgm_xagm_xbgm_absgm_xy
85func gm_tourney(fit: *i64, state: *i64) -> i64
called by 1: main calls 1: gm_rand
92func gm_p(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
97func gm_pn(v: i64) -> i64 { nxi_out(v); return 0 }
called by 1: main calls 1: nxi_out
98func main() -> i64