code wiki / _hdl_build / nx_energy_model_test.nx

nx_energy_model_test.nx

buildroot/runtime/_hdl_build/nx_energy_model_test.nx

3892 B79 linesdepth 3pulls 3 transitivereach 0 importersview sourcekind gate/prooftopic energy
docsdependenciesstructsconstsfunctions

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

nx_energy_model.nx nx_energy_model_test.nx

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

main emt_work _emit em_energy_fj em_fj_to_nj em_calibrate_fj_per_unit

structs

none

consts

26const EMT_ITERS: i64 = 5000000

functions

16func _emit(name: *u8, v: i64) -> i64
called by 1: main
28func emt_work(seed: i64) -> i64
called by 1: main
35func main() -> i64