6502 Circuit Model
Scope
This document describes the architectural circuit blocks that SLeeLa can model reliably. It is not a transistor-for-transistor recreation.
Major blocks
- Register section
- A accumulator
- X and Y index registers
- S stack pointer
- PC high/low
- status register
- ALU
- arithmetic;
- logic;
- shifts/rotates;
- flag generation.
- Address path
- low/high address components;
- address latches;
- effective-address formation.
- Data path
- data latch;
- internal data movement;
- external data bus buffer.
- Control
- instruction register;
- instruction decode;
- PLA/control logic;
- timing control;
- interrupt logic.
- Clock
- clock input;
- phi1/phi2 phase sequencing.
Internal buses
The 6502 analysis literature identifies internal buses and latches such as:
- ADL/ABL;
- ADH/ABH;
- SB;
- DB;
- DL.
SLeeLa represents these as couplers or internal timing channels only when needed by a specific simulation.
Accuracy boundary
Gate-level or transistor-level work should be added only from sufficiently reliable die analysis or a validated hardware recreation. The MAME 6502 implementation specifically targets exact bus-cycle behavior and has been compared against gate-level simulation, making it useful as a behavioral/timing reference.
Sources:
- https://tinymachines.ai/6502/archive/wiki/6502_datapath.html
- https://github.com/mamedev/mame/blob/master/docs/source/techspecs/m6502.rst