# Timing: cycles, the bus, the multiplier Sources: ARM60 data sheet DS3553 ("DS") chapters 5 and 7 (DOC); arm7tdmi-python's docs/timing.md for the ARM7TDMI comparison (its rows come from ARM's TRM; DOC). ## The bus (DS 2.0, 5.1) One bus, two-phase MCLK, stretched by the memory system (MCLK held, or nWAIT low) for slow devices. Each cycle is one of: **N** (non-sequential, nMREQ low and SEQ low), **S** (sequential: address the same as or 4 above the last), **I** (internal, no request), **C** (coprocessor register transfer). nMREQ and SEQ are given a cycle ahead, so the memory system knows the next cycle's type; nOPC marks fetches, nRW direction, nBW byte or word, nTRANS user mode, LOCK the SWP pair. An I cycle followed by S at the same address can be merged into one memory access by the memory manager (DS 7.2): the 3DO's MADAM may do this (U7). This is arm7tdmi-python's contract: one callback per cycle, internal cycles included, each with address, width (8 or 32 here; no 16) and the access kind (SEQ, CODE, LOCK). The board turns cycles into time (on the 3DO: MADAM stretches MCLK; 3do-python docs/memory-map.md). ## Instruction cycle counts (DS 7.17 table 23, checked against the per-cycle tables 7.1-7.16) | Instruction | Cycles | Additional | | --- | --- | --- | | Data processing | 1S | +1I for shift by register; +1N +1S if R15 written (table 8; C1) | | MRS, MSR | 1S | | | LDR | 1S+1N+1I | +1S+1N if R15 loaded | | STR | 2N | | | LDM | nS+1N+1I | +1S+1N if R15 loaded | | STM | (n-1)S+2N | | | SWP | 1S+2N+1I | | | B, BL | 2S+1N | | | SWI, exception entry | 2S+1N | | | MUL, MLA | 1S+mI | m below | | CDP | 1S+bI | | | LDC, STC | (n-1)S+2N+bI | | | MRC | 1S+bI+1C | (C2) | | MCR | 1S+(b+1)I+1C | (C2) | | condition false | 1S | | On the 3DO no coprocessor answers, so CDP/LDC/STC/MRC/MCR take the undefined-instruction path (DS 7.15: the cycles of a coprocessor-absent trap). ## The multiplier (DS 4.6, 7.3) A 2-bit Booth multiplier with early termination: in the first cycle the accumulator (MLA) or zero (MUL) is set up and Rs loaded into the Booth shifter; then each internal cycle retires two multiplier bits, and the instruction ends when the remaining multiplier is zero ("possibly after an additional cycle to clear a pending borrow"). Table 23's m: multiplying by 0 or 1 takes 1S+1I; by a value in [2^(2m-3), 2^(2m-1)-1] takes 1S+mI for 1 < m < 16; by 2^29 or more (so every negative Rs, read unsigned) 1S+16I. MUL and MLA cost the same. Contrast ARM7TDMI: m = 1-4 by Rs's sign-extended byte groups, MLA one cycle more (arm7tdmi-python docs/timing.md). The flags: MULS sets N and Z, C "is set to a meaningless value", V unaffected (DS 4.6). Which value C takes is U8 (arm7tdmi-python models the ARM7's via zaydlang's hardware-fuzzed multiplier; the ARM6's Booth datapath differs, so that model does not carry over). ## Contradictions and unknowns - C1: the summary table 23 says "+1I +1N if R15 written" for data processing; the per-cycle table 8 shows the refill as an N then an S cycle (the same as ARM7TDMI's +1S+1N). The per-cycle table is taken; the summary row is a slip. - C2: table 23 gives MRC 1S+bI+1C and MCR 1S+(b+1)I+1C; ARM7TDMI's data sheet summary gives MCR 1N+bI+1C, MRC 1S+(b+1)I+1C (read 2026-11-26 from a copy later set aside, see provenance.md). Irrelevant on the 3DO (no coprocessor); recorded for a future board. - U7: whether MADAM merges I-then-S cycles; whether it treats SEQ to a new DRAM page as N. - U8: the C flag after MULS/MLAS on the ARM6. - U9: the synchroniser's exact delay (1-3 cycles, DS 3.4.8) relative to the board's interrupt edge. ## Modelling level Cycle level on the bus (charter axis B): every N/S/I/C cycle with its address, in chip order, like arm7tdmi-python. The evidence (the data sheet's per-cycle tables) supports it, and the 3DO's MADAM charges by cycle type (3dodev wiki latency table: sequential RAM 2 ticks, non-sequential 5; tier 3).