code wiki / _hdl_build / rv64im_min_multi_tier_roi.nx
rv64im_min_multi_tier_roi.nx
buildroot/runtime/_hdl_build/rv64im_min_multi_tier_roi.nx
about
rv64im_min_multi_tier_roi.nx -- per-tier ROI matrix + ranker.
Extends rv64im_min_hot_report.nx (commit 772abfb) from single-
workload ROI to multi-tier ROI per the WORKLOAD_TARGETS.md +
hardened-field-not-just-AI cardinal.
Input: one NxFuncCycles report per workload tier (W0/W1/W2)
Output: ranked list of silicon candidates with per-tier ROI
vectors + min-across-tiers + weighted-sum aggregate
The killer constraint per WORKLOAD_TARGETS.md:
"Sovereign silicon needs to serve the whole workload set, not
over-fit one. Avoids the trap of adding a 7000-gate vector
MAC unit because it triples GEMM throughput, but doubles
silicon cost for the sprinkler controller that never uses it."
So the ranker offers TWO views:
min_across_tiers -- pick the candidate whose worst tier still
has positive ROI. Conservative; ensures
no tier is starved.
weighted_sum -- pick the candidate whose operator-weighted
ROI sum is highest. Lets the operator
tune ("W0 matters 4x more than W2 because
field deployments outnumber data center
units 1000-to-1").
Status: SEED. 2026-05-26. Multi-tier matrix builder + dual
rankers. Future commits add temporal weighting (recency of
measurement) + confidence intervals (sim-vs-silicon delta).
dependencies 5 imports · 0 importers
imports: nx_syscalls.nxnishi_hdl_primitives.nxrv64im_min_sim.nxrv64im_min_symtab.nxrv64im_min_hot_report.nx
imported by: nobody (leaf or entry point)
structs
| 66 | struct NxTierROIVector |
consts
| 42 | const NX_TIER_W0: i64 = 0 // hardened field embedded (sprinkler/sensor) |
| 43 | const NX_TIER_W1: i64 = 1 // automotive sensor / leak detection / DSP |
| 44 | const NX_TIER_W2: i64 = 2 // edge AI inference |
| 45 | const NX_TIER_N: i64 = 3 |
| 91 | const NX_TIER_WEIGHT_W0: i64 = 50 // hardened field primary |
| 92 | const NX_TIER_WEIGHT_W1: i64 = 30 // auto/sensor secondary |
| 93 | const NX_TIER_WEIGHT_W2: i64 = 20 // edge AI tertiary |
functions
| 47 | func nx_tier_is_valid(t: i64) -> i64 |
| 53 | func nx_tier_name(t: i64) -> *u8 |
| 106 | func nx_multi_tier_cycles_saved(hot: *NxFuncCycles, n_hot: i64, |
| 136 | func nx_multi_tier_build_matrix(hot_w0: *NxFuncCycles, n_w0: i64, sym_w0: *NxSymtab, |
| 178 | func nx_multi_tier_rank_by_min(matrix: *NxTierROIVector, n: i64, |
| 204 | func nx_multi_tier_rank_by_weighted(matrix: *NxTierROIVector, n: i64, |
| 234 | func nx_multi_tier_print_report(matrix: *NxTierROIVector, n: i64) -> i64 calls 1: sys_write |