code wiki / _hdl_build / nx_cost_oracle.nx
nx_cost_oracle.nx
buildroot/runtime/_hdl_build/nx_cost_oracle.nx
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
imports: nx_syscalls.nx
imported by: nx_boolsynth4.nxnx_cost_oracle_test.nx
structs
| none |
consts
| 10 | const CO_WALLCLOCK: i64 = 0 |
| 11 | const CO_INSN: i64 = 1 |
| 12 | const CO_TOGGLES: i64 = 2 |
| 13 | const CO_BYTES: i64 = 3 |
| 14 | const CO_REJECT: i64 = 0 - 1 |
| 15 | const CO_TIE: i64 = 0 |
| 17 | const CO_A_FASTER: i64 = 1 |
| 18 | const CO_B_FASTER: i64 = 2 |
| 19 | const CO_I64_MAX: i64 = 9223372036854775807 |
functions
| 23 | func co_metric_deterministic(kind: i64) -> i64 |
| 32 | func co_reproducible(samples: *i64, n: i64) -> i64 called by 1: main |
| 41 | func co_abs(x: i64) -> i64 called by 1: main |
| 50 | func co_fair_verdict(kind: i64, cost_a: i64, cost_b: i64, margin: i64) -> i64 |
| 66 | func co_wallclock_flips(a_samples: *i64, b_samples: *i64, n: i64) -> i64 called by 1: main |