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

10149 B255 linesdepth 8pulls 19 transitivereach 0 importersview sourcekind orphan librarytopic rv64im
docsdependenciesstructsconstsfunctions

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

nx_syscalls.nx nishi_hdl_primitives.nx rv64im_min_sim.nx rv64im_min_symtab.nx rv64im_min_hot_report.nx rv64im_min_multi_tier_roi.nx

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

66struct NxTierROIVector

consts

42const NX_TIER_W0: i64 = 0 // hardened field embedded (sprinkler/sensor)
43const NX_TIER_W1: i64 = 1 // automotive sensor / leak detection / DSP
44const NX_TIER_W2: i64 = 2 // edge AI inference
45const NX_TIER_N: i64 = 3
91const NX_TIER_WEIGHT_W0: i64 = 50 // hardened field primary
92const NX_TIER_WEIGHT_W1: i64 = 30 // auto/sensor secondary
93const NX_TIER_WEIGHT_W2: i64 = 20 // edge AI tertiary

functions

47func nx_tier_is_valid(t: i64) -> i64
53func nx_tier_name(t: i64) -> *u8
106func nx_multi_tier_cycles_saved(hot: *NxFuncCycles, n_hot: i64,
136func nx_multi_tier_build_matrix(hot_w0: *NxFuncCycles, n_w0: i64, sym_w0: *NxSymtab,
178func nx_multi_tier_rank_by_min(matrix: *NxTierROIVector, n: i64,
204func nx_multi_tier_rank_by_weighted(matrix: *NxTierROIVector, n: i64,
234func nx_multi_tier_print_report(matrix: *NxTierROIVector, n: i64) -> i64
calls 1: sys_write