S6.12.2 The Last Byte Never Moved

MediumFix20 minIcarus Verilog · serverReview the topic

A channel reports success while the destination still holds an old byte. Repair its retirement counter.

Hardware context: ap_soc one-channel DMA. Peripheral capture and fault isolation

The supplied ap_soc adapter stops a transfer early. Its remaining count owns the destination write permission. As soon as busy drops, the adapter stops offering bytes. Repair the counter and its notification.

Signals in the Timeline

SignalWidthRole
clk1stimulus, the same for every design
reset1stimulus, the same for every design
fault1stimulus, the same for every design
done1stimulus, the same for every design
busy1stimulus, the same for every design
remaining4stimulus, the same for every design
Full specification

Synchronous active-high reset clears every output. In idle, start loads the four-bit byte length. An empty job pulses done. Ignore start while busy.

busy is high exactly while remaining is nonzero. Decrement once per accepted destination byte (valid and ready). Stalls and unused error indications preserve the count.

The final successful acceptance clears busy and pulses done. An accepted error abandons the job, clears remaining and pulses only fault. Both notifications clear on the next edge unless a new job produces another notification.

Examples

Example 1

Start a Pair
Input
Start length 2.
Output
fault = 0, done = 0, busy = 1, remaining = 2

Two writes are owed.

Example 2

First Byte Accepted
Input
Commit the first byte of a pair.
Output
fault = 0, done = 0, busy = 1, remaining = 1

One byte still needs a destination write.

Example 3

Final Acceptance
Input
Start length 1 and accept its only byte.
Output
fault = 0, done = 1, busy = 0, remaining = 0

Completion pulses as the count reaches zero.

Constraints and Contract

  • Use rising edges. Keep the interface and the error and reset behavior while repairing the last-byte failure.

Hints

Hint 1

Write down what remaining counts before each edge.

Hint 2

Stretch the next write with ready low.

Hint 3

Try the two-byte ticket before trying a long burst.

What the grader checks: Every four-bit length, waits on both handshake inputs, mid-copy reset and errors at each position in a four-byte transfer.

27 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

Start a Pair

Input
Start length 2.
Expected output
fault = 0, done = 0, busy = 1, remaining = 2

Two writes are owed.

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

Icarus Verilog · server