Processor Model

Some of a system’s work belongs on a general-purpose core, not an accelerator: a scheduler, a control loop, bookkeeping that branches on every element. waveflow.cpu models that core the way Waveflow models hardware — loosely timed: the software’s result is computed at once, in Python, and only its duration is simulated.

  Python function ──► (result, counters) ──► cost model ──► cycles, energy ──► Processor charges
  (your software)      "scanned 12, moved 3"   (calibrated)                       one timed event

The three pieces

  • SwFunction — a piece of software. Its function returns its result and the work it did, as counters (items scanned, elements moved, samples processed). Its cost models map those counters to cycles and to dynamic energy in pJ. Counters, not input size, because control code costs what it did: a scheduler that finds its task at the head of a queue is cheap however long the queue is. A function prices each distinct set of counters once and remembers it; replacing its models or its working_set starts afresh, but a working_set must depend on the counters alone, and a model must not be refitted while the function is in use.
  • Processor — a SimObj with N cores, a priority ready queue, a context-switch cost and optional preemption. yield from cpu.execute(func, *args) runs the function when a core is granted and returns its result once the charged time has elapsed. See Scheduling.
  • A calibrated platform — the cost models, measured and fitted. The shipped one is the Cortex-A53 of the RFSoC 4x2, measured on gem5 and priced by McPAT. See Calibration, and Using it in a DSE for the configuration, area and leakage side.

What it charges, and what it does not

The processor charges compute. Bus and memory-mapped traffic a task issues goes through its MMIFMaster and is timed by the bus model, outside the task — never twice. A task that talks to hardware is split at each interaction: one execute per stretch of pure computation.

Every number it reports carries a confidence (EXACT, INTERPOLATED, EXTRAPOLATED, UNCALIBRATED), computed when a report is asked for, so a design-space exploration can see when a configuration has left the region the models were measured over.

Pages


Table of contents

  • Scheduling - How a Processor runs software: N cores sharing one priority ready queue (lower number is more urgent, first-come first-served among equals), a context switch charged when a core changes software thread, optional preemption with an exact remaining-cycles rule, interrupts as the most urgent tasks, and the report: latency, queueing delay, utilization, energy, footprint and confidence per function.
  • Calibration - How the shipped Cortex-A53 platform was calibrated and how accurate it is. Ground truth is gem5 v25.1's HPI in-order core in syscall-emulation mode, configured as the RFSoC 4x2's A53 (1.2 GHz, 32 KB L1s, 1 MB L2, DDR4-2400), running code compiled by Vitis 2025.1's aarch64 gcc 13.3.0; energy and area come from McPAT at 22 nm. Six C kernels with bit-exact Python twins, 305 pre-registered points split fit / validation / test, models fitted by relative-error least squares, and the one-time test result per family -- including the documented misses on small operations and on back-to-back sequences.
  • Using it in a DSE - Using the calibrated processor in a design-space exploration: a CpuPlatform turns the shipped A53 calibration into configurations (core count, caches, static power, switch cost), calibrated software functions and an area model, each with its confidence. The cache-regime features carry the cycle models to other cache sizes without refitting; the known limits are small operations, back-to-back sequences and the gem5/McPAT approximations.