code wiki / _hdl_build / nx_energy_model_test.nx
nx_energy_model_test.nx
buildroot/runtime/_hdl_build/nx_energy_model_test.nx
about
nx_energy_model_test.nx -- prove the state-independent energy model end to end,
pure NishiLang, on THIS box (no PMU, no RAPL, on AC -- yet we still get a number).
1. MEASURE a charge-independent activity count (rdtsc cycles over a real workload).
2. ESTIMATE energy from the documented PRIOR coefficient (labeled as a prior).
3. CALIBRATE: given a real joule reading for a known activity, recover the
coefficient and show energy(activity, calibrated) round-trips exactly -- this
is the math a real RAPL/INA/discharge reading drives on a sensor-equipped node.
4. MONOTONIC: 2x the activity -> 2x the energy (sanity).
The point proven: a real energy ESTIMATE with NO power sensor and IN ANY power
state, because the input (cycles) is charge-independent. Known answer: exit 0.
dependencies 1 imports · 0 importers
imports: nx_energy_model.nx
imported by: nobody (leaf or entry point)
call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown
structs
| none |
consts
| 26 | const EMT_ITERS: i64 = 5000000 |
functions
| 16 | func _emit(name: *u8, v: i64) -> i64 called by 1: main |
| 28 | func emt_work(seed: i64) -> i64 called by 1: main |
| 35 | func main() -> i64 |