DMG-CPU Research
On this page
  1. Why "Oracle"
  2. Status per test (all PASS in run_all.sh)
  3. Measured facts (issue-400 "oracle" answers)
  4. Research notes / open items
  5. Files

SM83 core suite - status (issue #400)

Snapshot of HDL/sm83/Icarus after the SM83-core regression bring-up. The suite drives the real SM83 core netlist (HDL/sm83: Top.v SM83Core + ALU/Bottom/DataMux/Decoder1-3/IDU/IRNots/IRQ/Regs/Seq/ SeqCells/Thingy + _GekkioNames.v) with external_clk.v (the CPU clock generator, same as the ROM harness run.v) and a flat 64K memory model (Bogus_HW bus conventions: reads on MREQ & RD, writes captured at the WR trailing edge with the #1-delayed A/D copies). Every test prints RESULT tb_xxx N PASS/FAIL; run_all.sh reports SUITE OK.

Why "Oracle"

The core netlist is the ground truth for the DMG-CPU: anything observable through its pins (bus cycles, register file, flags, decoder outputs, instruction durations, interrupt dispatch) can be measured on it and compared against documentation or expectations - this suite is the set of automated "questions" and recorded answers.

Status per test (all PASS in run_all.sh)

Test Checks Purpose
tb_sm83_regs 13 Register file + immediate/pair loads, SP, LD (nn),A store, PC at HALT
tb_sm83_alu 160 8-bit ALU (ADD/ADC/SUB/SBC/AND/OR/XOR/CP) over 8 operand pairs - A result + Z/N/H/C flag law per case
tb_sm83_mem 18 Memory addressing: (BC)/(DE)/(HL),A + A,(nn) forms, LDH (n8), HLI/HLD auto-inc/dec
tb_sm83_stack 15 16-bit moves, PUSH/POP incl. AF, ADD HL/SP, LD (nn),SP, CALL/RET, JP cc
tb_sm83_jump 11 JR NZ/Z/NC/C taken + not-taken paths, RST 08/18 (vector page + return push/pop)
tb_sm83_irq 8 IE/IME/IF dispatch: HALT wake, PC push, IF ack-clear, vectors $40/$48/$50, RETI
tb_sm83_cycles 32 Instruction T-state timing via M1-M1 intervals vs the documented SM83 table
tb_sm83_cb 256 CB-prefix + A-rotate/shift/bit law: RLC/RRC/RL/RR/SLA/SRA/SWAP/SRL on A, BIT/RES/SET b,A, RLCA/RLA/RRCA/RRA
tb_sm83_halt 10 HALT modes: clean stop (IME=0/IE=0), IF-after-HALT wake (no vector), halt-bug setup (no stop, no vector)

Measured facts (issue-400 "oracle" answers)

Research notes / open items

Files