code wiki / _hdl_build / nx_cost_oracle.nx

nx_cost_oracle.nx

buildroot/runtime/_hdl_build/nx_cost_oracle.nx

3289 B80 linesdepth 2pulls 2 transitivereach 3 importersview sourcekind librarytopic cost
docsdependenciesstructsconstsfunctions

about

nx_cost_oracle.nx -- compare declared counted costs, not elapsed-time performance. Retired instructions, switching events and bytes can be reproducible under a matched workload and measurement model. Their metric IDs alone do not establish reproducibility, workload equivalence, hardware portability, energy consumption or lower observed latency. This API has no timing/sampling contract and therefore continues to reject wall-clock inputs. A measured timing comparison belongs in an explicitly sampled contract. license_tier: ORIGINAL

dependencies 1 imports · 2 importers

nx_syscalls.nx nx_cost_oracle.nx nx_boolsynth4.nx nx_cost_oracle_test.nx

imports: nx_syscalls.nx

imported by: nx_boolsynth4.nxnx_cost_oracle_test.nx

structs

none

consts

10const CO_WALLCLOCK: i64 = 0
11const CO_INSN: i64 = 1
12const CO_TOGGLES: i64 = 2
13const CO_BYTES: i64 = 3
14const CO_REJECT: i64 = 0 - 1
15const CO_TIE: i64 = 0
17const CO_A_FASTER: i64 = 1
18const CO_B_FASTER: i64 = 2
19const CO_I64_MAX: i64 = 9223372036854775807

functions

23func co_metric_deterministic(kind: i64) -> i64
called by 2: co_fair_verdictmain
32func co_reproducible(samples: *i64, n: i64) -> i64
called by 1: main
41func co_abs(x: i64) -> i64
called by 1: main
50func co_fair_verdict(kind: i64, cost_a: i64, cost_b: i64, margin: i64) -> i64
called by 1: main calls 1: co_metric_deterministic
66func co_wallclock_flips(a_samples: *i64, b_samples: *i64, n: i64) -> i64
called by 1: main