S4.6.1 Route the Response by ID

HardImplement30 minIcarus Verilog · serverReview the topic

Return a tagged read to one of three managers while quarantining a stale response.

Hardware context: AXI response and write routing slice. Bus fabric integration

You are wiring the diagnostic return port on an ap_soc expansion. Each manager can have one pending read. A response carries a five-bit tag. The upper two bits name ports 0 through 2. The low three bits carry the original ID.

tickets stores the expected local ID for each port. Port zero uses bits 2 through 0. Port one uses bits 5 through 3 and port two uses bits 8 through 6.

Signals in the Timeline

SignalWidthRole
sample10input of each check
Full specification

With valid low, drive every output low. With valid high, check that the port exists, has a pending read and holds the matching ID.

On a match, offer a one-hot response and expose its local_id, including while stalled. Assert take only when that manager is ready. On any invalid tag or missing ticket, raise only fault. A supervisor resolves faults separately.

Examples

Example 1

DMA Accepts
Input
valid=1, tag=01110, tickets [0,1,2]=1/6/3, pending=010, ready=010
Output
offer = 'b010, local_id = 'b110, take = 1, fault = 0

Port one has a matching ticket and can take the word.

Example 2

CPU Stalls
Input
valid=1, tag=00001, tickets [0,1,2]=1/6/3, pending=001, ready=110
Output
offer = 'b001, local_id = 'b001, take = 0, fault = 0

The offer survives while only other ports are ready.

Example 3

Unexpected Reply
Input
valid=1, tag=10011, tickets [0,1,2]=1/6/7, pending=111, ready=111
Output
offer = 'b000, local_id = 'b000, take = 0, fault = 1

The pending ticket differs from the received ID.

Constraints and Contract

  • Implement combinational return_port. The upstream register holds valid and tag steady until take or supervisor intervention. The fault policy is local to this exercise.

Hints

Hint 1

Separate the return address from the local ticket.

Hint 2

Trace one manager that is waiting while its neighbor is ready.

Hint 3

What does the supervisor see between responses?

What the grader checks: Binary requests, every received and stored ID pair, port codes, idle cycles and backpressure at the diagnostic return port.

806 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

DMA Accepts

Input
valid=1, tag=01110, tickets [0,1,2]=1/6/3, pending=010, ready=010
Expected output
offer = 'b010, local_id = 'b110, take = 1, fault = 0

Port one has a matching ticket and can take the word.

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

Icarus Verilog · server