S4.4.3 Starve the Low-Priority Manager

MediumBreak It22 minIcarus Verilog · server3 hidden designsReview the topic

Build a periodic workload that starves DMA even though the processor requests at most half the time.

Hardware context: ap_soc destination arbiter. DMA and processor memory sharing

DMA always wants a read. Three ap_soc test ports each offer two service edges in a repeating four-edge period. The fair arbiter prefers CPU initially and puts the winner last after service. Each faulty copy gives CPU fixed priority at one port.

Write task stimulus(). Each try_period(port,issue) tests one port from a fresh start. Issue bits describe CPU demand pulses on edges 0 through 3, with bit 0 first.

Signals in the Timeline

SignalWidthRole
hidden_bug8input of each check
Full specification
PortService edgesDelay from CPU pulse to arbiter
0 · ROM0 and 3Zero edges
1 · SRAM1 and 2One edge
2 · Local timer0 and 1Two edges

At each service edge the port sees the CPU pulse from the stated number of edges earlier. Pulses repeat across the period boundary. A pulse outside a service slot expires. These are workload rules for the exercise.

The observer asks whether DMA got zero beats in four edges. A different order alone cannot expose a fault. If fixed priority denies DMA throughout a period, repeating that pattern keeps denying it.

Examples

Run samples checks your input rules and any explicitly public sample faults. Submit runs every hidden faulty copy on the server. The worked bug examples below describe Submit results.

Example 1

A Legal Pulse
Input
try_period(1, 4'b0001)
Output
inputs_legal = yes

The CPU pulse at edge zero reaches SRAM at edge one. DMA can still take edge two.

Example 2

A Distinguishing Replay
Input
Observed DMA beats in the period: fair 1, faulty 0
Output
caught = yes

The observer can distinguish these runs because DMA went unserved in just one of them.

Example 3

A Delayed Replay
Input
At SRAM, both CPU pulses arrive on service edges. DMA gets one beat with round robin and zero with fixed priority.
Output
caught = yes

The one-edge delay moves the pulses into the two arbitration slots.

Constraints and Contract

  • Try at most three periods. Use binary inputs on implemented ports and assert at most two issue bits per period. DMA keeps requesting even during CPU gaps.

Hints

Hint 1

Mark available edges before writing stimulus.

Hint 2

Work backward from arrival to issue.

Hint 3

Wrap an issue before edge zero into the previous period.

What the grader checks: Periodic workloads compared against three local scheduling faults. The observer measures starvation within the submitted period.

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

See all 3 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

A Legal Pulse

Input
try_period(1, 4'b0001)
Expected output
inputs_legal = yes

The CPU pulse at edge zero reaches SRAM at edge one. DMA can still take edge two.

Run samples executes all 1 public checks. Check all tests runs 4 checks on the server.

Icarus Verilog · server