S8.8.2 Remove the Bottleneck

HardOptimize40 minIcarus Verilog · serverReview the topic

Use both lanes of a DMA write port. Keep accepting receive bytes through short RAM stalls without joining different packets.

Hardware context: UART receive queue and DMA sink. SoC bandwidth budgeting

The starter submits every byte as its own RAM word. A two-lane RAM that grants every other cycle could keep up with a continuous stream of pairs. Your packer must use that capacity.

Signals in the Timeline

SignalWidthRole
sample12input of each check
Full specification

Transfers occur on rising edges when valid and ready are high. A synchronous active-high reset discards partial input and pending output. It has priority over both transfers.

Pack consecutive bytes from one packet in little-endian order. Emit a full word on its second byte. A last byte with no partner emits a word with zero in the upper lane. word_last belongs to the accepted final byte.

Use a registered output offer and space for one additional low byte. A consumed word can be replaced on that edge. A stalled word and its flags must hold.

Examples

Example 1

Reset
Input
reset=1, valid=0, byte=0x00, last=0, RAM ready=1
Output
ready = 1, valid = 0, pair = 0, last = 0, data = 0x0

Input is ready. No RAM word is pending.

Example 2

First Byte
Input
reset=0, valid=1, byte=0x41, last=0, RAM ready=1
Output
ready = 1, valid = 0, pair = 0, last = 0, data = 0x0

A waits for its partner without spending a RAM grant.

Example 3

Final Partner
Input
reset=0, valid=1, byte=0x42, last=1, RAM ready=1
Output
ready = 1, valid = 1, pair = 1, last = 1, data = 0x4241

Both lanes are valid. The last flag accompanies 0x4241.

Constraints and Contract

  • Assert in_ready whenever the output slot is free or being consumed. While that slot is blocked, accept exactly one unpaired nonfinal byte when the partial slot is empty. in_last participates in readiness even when in_valid is low.
  • After the accepting edge, a completed word must be visible. Assert two_bytes for pairs. Payload and flags are ignored when word_valid is low. The source holds a refused offer until accepted or reset.

Hints

Hint 1

Track the low byte independently from the word waiting at RAM.

Hint 2

Work out whether this byte needs the output slot now.

Hint 3

Follow a RAM departure and a pair completion on the same edge.

What the grader checks: Clocked offers under sparse and sustained grants, odd and even packet lengths, one-bit payload patterns and resets during traffic.

421 checks on Icarus Verilog · server. Run the examples first, then check the full regression. Full checks use the server judge. Downloads contain your source only; samples require the simulation service. A passing result establishes the tested cases, not a proof for all possible inputs.

See all 2 problems on this path

Report a problem with this page

Your code SystemVerilogSaved locally
Ln 1, Col 1Tab indents · Ctrl/⌘ + Enter runs samples
Not run yet

Reset

Input
reset=1, valid=0, byte=0x00, last=0, RAM ready=1
Expected output
ready = 1, valid = 0, pair = 0, last = 0, data = 0x0

Input is ready. No RAM word is pending.

Run samples executes all 3 public checks. Check all tests runs 421 checks on the server.

Icarus Verilog · server