Home /Modules/cpu/ROSTER-AND-NET-RESULTS.md

ROSTER-AND-NET-RESULTS.md

lib/cpu/ROSTER-AND-NET-RESULTS.md · 103 line(s) · markdown

CPU Roster, Fleet & Net Results

This document covers the "choose from a full roster of CPUs and simulate a real world with net results" surface of lib/cpu.

The pieces

ClassRole
SLCPUCatalogThe by-name roster of runnable CPU models — the missing CPU family alongside SLHardwareRegistry's memory/SSD/HDD/USB/GPU catalogs. Pick a processor by key ("6502", "arm", "riscv", "x86", "ps5", "xbox-series-x", …) with make(key) instead of hard-coding new SL6502CPU(). list()/keyAt(i) enumerate the roster for a chooser.
SLCPUFleetA selected set of CPUs run as a group to produce net results. select(key)/selectAll() assemble the fleet from the catalog; runAcross(...) runs a workload on every member; scoreboard() reports the aggregate.
SLCPURuntimeThe runnable CPU base (admission + runWorkload + clock). Every SL<ARCH>CPU extends it.
SLClockPolicySpec clock, overclock-to-target, stability ceiling, effectiveMHz()/speedRatioMilli() — feeds the fleet's aggregate-throughput accounting.
SLWorkload / SLCPUResourceThe unit of work and its bounded grant (memory words + instruction budget).

From roster to net results

   SLCPUCatalog            choose              SLCPUFleet
  (full roster of   ->  select(key) /    ->  (chosen CPUs)
   runnable CPUs)        selectAll()              |
                                                  | runAcross(workload)
                                                  v
                                     per-CPU runWorkload()  (same result,
                                     each within its grant   any architecture)
                                                  |
                                                  v
                                     NET RESULTS scoreboard:
                                       net output (sum of observables)
                                       aggregate spec vs. effective MHz
                                       completed / rejected counts
                                       fastest / slowest member
                                       retired instruction total

Net results, defined

Creator over the network

The SleelaVMCreator chain (Creator → SLVM → Sleela CPU → program) extends to a distributed fleet: a creator dispatches a workload to every node of a fleet "over the network," accounts per-hop latency and delivery, and aggregates the fleet's net results — the world-level view of running real work on many machines at once.

Run it

The runnable aggregate examples/world-net-results.sleela inlines a faithful behavioral model of all of the above (the split lib/cpu/SL* classes are the discovery surface; the aggregate is the executable twin, exactly as autocad/creator/creator.sleela is for the AutoCAD Creator). It builds the roster, chooses a fleet, runs work to produce net results, overclocks and re-runs, drives the same over the Creator network across the whole roster, and ends with a SELF-CHECK.

make -C lib/cpu world     # -> out/world.log, prints the scoreboards + SELF-CHECK

make world also runs verify, which fails the build unless the simulation's SELF-CHECK: PASS line is present.

The roster (brands & families)

Every architecture folder under lib/cpu/ ships a runnable SL<ARCH>CPU (extends SLCPURuntime) and is eligible for the catalog. The roster spans:

New brands/models are added by extending the data-driven generator tools/generate-cpu-models.py (one proven pattern applied with accurate per-arch metadata) and registering them in SLCPUCatalog so they are selectable by name.

Fidelity

These are behavioral models for net-result accounting, not cycle-accurate emulators (see CPU.md "Note on fidelity"). Instruction retirement and observable output are deterministic and reproducible; per-architecture bus and timing detail live in each arch folder's markdown and the SLTiming* classes.