Home /Modules/cpu/TIMING.md

TIMING.md

lib/cpu/6502/TIMING.md · 71 line(s) · markdown

6502 Timing

Clock model

The 6502 uses a two-phase clocking model. SLeeLa treats the clock as an event source rather than assuming that one instruction equals one clock.

Timing records

Each cycle can record:

Instruction timing

Instruction duration depends on:

Therefore:

instruction latency != clock period

and

instruction cycles * clock period = approximate elapsed instruction time

when no external wait state is inserted.

Circuit timing

The internal datapath uses clock-phase-sensitive transfers. Public transistor-level analyses show latches and buses whose values become effective on particular clock phases.

SLeeLa records this as observable/derived timing and does not claim an exact transistor simulation.

Sources:

Expert timing, voltages, and variable clocks (shared across all CPU models)

The per-CPU timing above is the architectural/behavioral view for this part. The adjustable, quality-first timing system is shared by every CPU model in lib/cpu and is documented once, in the package guide:

Every CPU model (this one included) inherits the clock/overclock surface from SLCPURuntime and can be assembled with those shared expert-timing, voltage, and component options; they are a build-layer concern, not re-declared per CPU.