RTL (GS rasterizer, EE core stub, platform bridge, LPDDR4B path), sim regression (272 TBs), docs, and tooling. Copyrighted PS2 content (BIOS, game code, GS dumps, and all dump-derived textures/traces) is excluded via .gitignore and stays local. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
9.9 KiB
Wave 2 Mini-Plan: DMAC Channel 2 to GIF to BGCOLOR
This document defines the first Wave 2 implementation target after the completed Wave 1 milestones and the generated-golden Phase 1 harness.
The target is deliberately narrow:
- establish DMAC as real transfer ownership, not just register plumbing,
- establish GIF as the first programmatic ingress into the GS path,
- produce a visible result through the existing Milestone A video chain.
Working milestone name:
programmable BGCOLOR via DMA/GIF
That means:
- software- or testbench-visible programming of DMAC channel 2 intent,
- a minimal packet path into GIF,
- a narrow GIF-to-GS handoff that updates
gs_stubBGCOLOR, - visible raster output change through
platform_video_stub, - end-to-end traces proving each stage participated.
Why this path goes first
This is the best next Wave 2 target because it:
- starts from the DMAC contract, which is central PS2 structure,
- keeps the first new ingress path graphics-visible,
- extends Milestone A instead of redoing it,
- avoids pulling in IOP/SIF policy too early,
- sets up a natural bridge into later VIF/VU and broader GIF work.
Deliverables
The first Wave 2 pass should land:
rtl/dmac/dmac_reg_stub.svrtl/gif_gs/gif_path_stub.sv- one integrated testbench:
sim/tb/integration/tb_bgcolor_via_dma.sv
- trace vocabulary additions in:
rtl/debug/trace_pkg.sv
- a short README or note in the integration TB directory if one does not already exist
Scope boundary
This plan is not trying to implement:
- generic EE main RAM,
- full DMAC arbitration,
- full GIF decoding,
- any drawing primitive,
- GS VRAM,
- VIF/VU,
- SIF,
- IOP interaction.
The point is to create the smallest correct-shaped programmatic path:
channel 2 intent -> minimal DMA payload -> minimal GIF packet -> gs_stub BGCOLOR
dmac_reg_stub exact scope
Status target:
- channel-2-focused, not a pretend full DMAC
Owns in this phase
- selected DMAC register shell for channel 2,
- channel state machine for a single programmed transfer,
- transfer-start / transfer-active / transfer-done transitions,
- narrow payload handoff into
gif_path_stub, - trace events for register writes and transfer lifecycle.
Explicit non-goals
- multi-channel fairness or arbitration,
- linked-list / chain mode completeness,
- stall/ring semantics,
- interrupt-controller integration beyond trace-visible placeholders,
- memory-backed payload fetch from real EE RAM.
First-pass data source
For the first integrated proof, allow a testbench-provided or locally-loaded payload path rather than requiring real main RAM first.
Acceptable phase-1 shapes:
- a tiny internal payload register/FIFO loaded through a narrow debug/test port,
- or a direct payload input interface used only by the integration testbench.
Not acceptable:
- a
dmac_reg_stubthat stops at register writes and never emits payload.
Recommended channel-2 register surface
Implement only what is needed to express one narrow transfer cleanly.
Suggested first surface:
CHCRfor channel 2- start bit / direction / mode subset as needed
MADR- recorded for trace and future upgrade path
QWC- transfer length in 16-byte units
- optional
TADR- only if the implementation wants to reserve chain-mode shape early
Suggested interpretation for first pass:
- one direct transfer mode only
QWC == 1is sufficient for the first visible proofMADRmay be recorded and traced even if the payload is not yet fetched from real memory
Minimal state machine
Recommended states:
IDLEARMEDACTIVEDONE
Behavior:
- CPU/testbench writes register values
- start condition on
CHCR - one payload issued toward
gif_path_stub - wait for
gif_path_stubaccept/done handshake - transition to
DONE - optionally clear busy/start-visible state and return to
IDLE
dmac_reg_stub acceptance criteria
dmac_reg_stub is not "done" when registers can be written.
It is done for this phase when:
- channel 2 can be programmed into a single transfer sequence,
- it emits a payload/handshake toward
gif_path_stub, - traces show start, active transfer, and done,
- the integrated testbench proves that this sequence ultimately changes
gs_stubBGCOLOR.
gif_path_stub exact scope
Status target:
- minimal GIF ingress and decode sufficient for BGCOLOR update only
Owns in this phase
- accepting one narrow DMA-fed packet stream,
- extracting just enough tag/selection information to identify the path,
- decoding only the BGCOLOR-relevant payload form,
- forwarding a GS privileged-register-style write into
gs_stub, - trace events for GIF tag and GS-write handoff.
Explicit non-goals
- PATH arbitration completeness,
- packed register lists beyond what BGCOLOR requires,
- image transfer paths,
- primitive drawing,
- texture or VRAM-visible behavior.
Recommended first packet shape
Keep the first proof simple and explicit.
Suggested approach:
- a synthetic single-packet format representing:
- PATH source = channel 2 / GIF
- destination register = BGCOLOR
- payload = 24-bit RGB value
This can be encoded as either:
- a tiny project-local "GIF-like" packet for the first integrated proof, or
- a very narrow real GIFtag/register pair if Claude wants to stay closer to the real packet model immediately.
My recommendation:
- use a narrow real-looking shape, but only if it stays easy to trace
- otherwise use a project-local packet format and document it clearly as a temporary ingress format
PATH selection
For this phase, hard-scope the path to one source:
- PATH = channel 2 / DMAC GIF path
No arbitration needed yet. Just make the trace name the source explicitly so future work can preserve the boundary.
gif_path_stub acceptance criteria
- accepts one payload from
dmac_reg_stub - emits a trace that identifies a GIF-side handoff/tag
- issues one BGCOLOR update into
gs_stub - integrated testbench sees the new color on the platform video side
Trace vocabulary additions
Wave 2 needs trace events that express transfer ownership and GIF ingress without overfitting future behavior.
Recommended additions to trace_pkg.sv:
EV_DMA_CFGEV_DMA_STARTEV_DMA_BEATEV_DMA_DONEEV_GIFTAGEV_GS_WRITE
These names keep the event model readable while leaving room for later detail.
Recommended payload schemas
DMAC EV_DMA_CFG
arg0 = channelarg1 = CHCR subsetarg2 = MADRarg3 = QWCflags = optional mode bits
DMAC EV_DMA_START
arg0 = channelarg1 = qwcarg2 = payload words/beats plannedarg3 = path id
DMAC EV_DMA_BEAT
arg0 = channelarg1 = beat indexarg2 = low payload word or packet idarg3 = remaining count
For wide payloads, trace summary over full raw data is acceptable in this phase.
DMAC EV_DMA_DONE
arg0 = channelarg1 = beats transferredarg2 = completion codearg3 = path id
GIF EV_GIFTAG
arg0 = path sourcearg1 = tag summary or local packet typearg2 = register targetarg3 = payload summary
GS EV_GS_WRITE
arg0 = register offsetarg1 = write valuearg2 = source idarg3 = reserved
Trace policy note
Do not delete or overload EV_MODE / EV_BGCOLOR.
Wave 2 should add ingress/transfer visibility, not destroy the simple Wave 1 events that already make debugging easy.
Integrated testbench shape
Recommended file:
sim/tb/integration/tb_bgcolor_via_dma.sv
This should be the first cross-subsystem Wave 2 harness.
DUT chain
dmac_reg_stubgif_path_stubgs_stubplatform_video_stubtrace_sink_stubinstances for at least:- DMAC
- GIF
- GS
- PLAT
Suggested stimulus model
Use a fully controlled synthetic transfer first.
Sequence:
- reset chain
- confirm default mid-grey frame behavior
- configure channel 2 registers
- provide one payload representing a BGCOLOR update
- trigger transfer start
- wait for transfer-done trace/event
- confirm:
- GIF saw a tag/payload
- GS latched the new BGCOLOR
- platform output changed on active pixels
- frame event occurred after the color change
Recommended checks
- one
EV_DMA_CFG - one
EV_DMA_START - at least one
EV_DMA_BEAT - one
EV_DMA_DONE - one
EV_GIFTAG - one GS-side write event (
EV_GS_WRITEand/orEV_BGCOLOR) - visible raster color change during active pixels
Pass criteria
Suggested summary line:
[tb_bgcolor_via_dma] dma_start=1 dma_done=1 giftag=1 gs_write=1 frames=... errors=0
A pass requires:
- zero errors
- at least one trace event from each stage
- end-to-end visible color change
Implementation order inside Wave 2
Recommended order:
- extend
trace_pkg.svwith Wave 2 events - implement
dmac_reg_stub - implement
gif_path_stub - add integration TB
- wire
Makefiletarget(s) - update
sim/README.md
Rationale:
- event vocabulary first keeps instrumentation coherent
- DMAC first preserves ownership
- GIF second provides the first consumer
- the integration TB defines success better than isolated unit benches here
Interaction with existing milestones
This work does not replace Wave 1 milestones.
It creates a new intermediate milestone:
Milestone A+: visible screen color change driven through DMAC/GIF ownership
That is the right next visible proof before:
- fuller EE work,
- real memory-backed command fetch,
- IOP/SIF bring-up.
Guardrails
- Do not let
dmac_reg_stubbecome a dead-end register shell. - Do not let
gif_path_stubaccept direct testbench writes that bypass DMAC in the integrated proof. - Do not broaden to generic drawing before the BGCOLOR path is working.
- Do not pull in IOP/SIF just to make Wave 2 feel larger.
Exit criteria for mini-plan acceptance
This mini-plan is accepted when Claude can implement:
- a channel-2-focused
dmac_reg_stub, - a narrow
gif_path_stub, - one integrated DMA/GIF/BGCOLOR testbench,
- with traces proving each stage, not just end-state color.