Virtus Cyber Academy

IP-Pack Interaction Patterns: Doorbell, Scratchpad, Descriptor

1,916 words · ~9 min read
Markdown PDF

*VCA-CSA-101 cross-chapter quick-reference handout. Anchors: §25.4 (canonical address map + 3-pattern overview); §5.7 (Memory-Mapped I/O); §12.6 (Driver-Layer OS Services). *

Purpose: the three structurally-distinct CPU-IP interaction patterns every Virtus Console student encounters at least once across CSA-101 Chapters 5 / 11 / 12 and the M0-2 IP Pack labs. Print and pin during Lab 5.4 (Virtus Console bring-up), Lab 11.3 (HDMI end-to-end), Lab 12.4 (Console drawing capstone), Lab 12.5 (audio-capstone silicon-cert). Each pattern names when to reach for it, why it exists, what its tradeoffs are, and which IP-Pack peripherals exemplify it.


At a glance

Pattern Latency CPU work per transaction Best for
Doorbell register One AXI cycle (write); polling cost variable on read side One sw to a single MMIO offset Sparse, low-priority events (vsync; buffer-half-empty; edge interrupts)
Scratchpad memory One AXI cycle per word One sw per word; many writes amortise the handshake Bulk data transfer where the IP consumes at its own clock domain (tile-map fills; sample buffers; regfiles)
Descriptor-ring One AXI cycle to advance the head pointer; IP autonomous after Build descriptor in scratchpad, then ring the head doorbell Streaming workloads where CPU and IP cooperate on a queue (audio playback; frame DMA; future VCP integration)

The three patterns compose. A descriptor-ring uses a scratchpad (for the descriptor entries themselves) and a doorbell (to advance the head pointer). A scratchpad-only design is the simplest case; a doorbell-only design is the second simplest; a descriptor-ring is the most complex and the most production-shaped.


Pattern 1: Doorbell register

Shape. Single bit (or single 32-bit word) at a fixed MMIO offset. CPU writes a 1 to "ring the doorbell"; the IP reacts. The IP also exposes a status bit the CPU can read to know whether the IP has completed work (or has new work pending).

Mechanism.

Where it lives in the IP Pack.

Tradeoffs.

When to reach for it. When the event is sparse, the payload is empty (or tiny), and you are fine with the CPU-side loop polling, or when you are setting up the future-CSA-201-interrupt infrastructure and want a working CSA-101 placeholder.


Pattern 2: Scratchpad memory

Shape. A region of CPU-readable / CPU-writable memory inside the IP, accessible via AXI4-Lite as a contiguous address window. The IP consumes the memory's contents on its own clock domain; the CPU writes via plain sw instructions. There is no explicit "go" signal, the IP's state machine reads the scratchpad continuously.

Mechanism.

Where it lives in the IP Pack.

Tradeoffs.

When to reach for it. When you have bulk data the IP needs to read at its own clock domain, and you don't need the CPU to know exactly when the IP has finished. Most CSA-101 IP-Pack uses fall here.


Pattern 3: Descriptor-ring

Shape. A circular buffer of fixed-size descriptor entries in scratchpad memory, plus a head pointer the CPU advances and a tail pointer the IP advances. Each descriptor carries the parameters for one work unit (e.g., "play this audio buffer at this volume for this many samples"). The CPU enqueues by writing a descriptor and bumping head; the IP dequeues by reading the descriptor at tail and bumping tail.

Mechanism.

Where it lives in the IP Pack.

Tradeoffs.

When to reach for it. When CPU and IP need to cooperate on a streaming workload, when work units are heterogeneous (need parameter passing not just bit-set), or when you want the CPU to be free to do other work between batches. Audio capstone (Lab 12.5) is the canonical CSA-101 use site.


Cross-chapter placement table

Chapter Section Pattern introduced Lab anchor
Ch 5 §5.7 (Memory-Mapped I/O) Scratchpad memory (HDMI tile-map; GPIO regfile) Lab 5.4 (Virtus Console bring-up)
Ch 5 §5.10 (sim-then-silicon) Doorbell register (HDMI vsync polling in sim) (sidebar; no lab)
Ch 11 §11.10 (end-to-end demo) Scratchpad memory (Console.printChar to tile-map) Lab 11.3 (HDMI end-to-end)
Ch 12 §12.6 (driver-layer OS services) All three patterns (driver implementations) Lab 12.4 (Console drawing capstone)
Ch 12 §12.8 (audio integration) Descriptor-ring (audio playback queue) Lab 12.5 (audio-capstone silicon-cert)
Ch 12 §12.12 (heterogeneous-multi-processor sidebar) Doorbell + descriptor-ring (VCP forward-pointer) (sidebar; no lab)
CSA-201 §14 (driver-writing track) Descriptor-ring with chained descriptors (DMAC patterns) Driver-track capstone

Forward-compatibility notes


Where to read more