S6.9.1 Choose for Three Devices

EasyImplement12 minIcarus Verilog · serverReview the topic

Pick a service method for a startup latch, a door switch and a capture port under three different deadlines.

Hardware context: ap_soc UART0 transmit path. Firmware bring-up and service budgeting

Use this board’s exercise budgets. The method codes are 1 for polling, 2 for interrupts and 3 for DMA.

This worksheet uses named constants. The first three entries show how to record your decisions.

Replace unresolved entries with your decisions.

Signals in the Timeline

SignalWidthRole
question8input of each check
Full specification

The startup latch is ready on its first read. The core must wait here and the latch has no interrupt or DMA request.

The door switch can interrupt but cannot request DMA. Its next change is unpredictable. The core must sleep until then.

The capture port supports all three methods. Minimize occupied core cycles. For N bytes the costs are 5N, 5 + 3N and 12 + N in code order. The 5 is one handler entry for the block. Choose the smaller code on a tie.

EntryYour decision
POLL_COSTHow many occupied cycles would polling two capture bytes cost?
IRQ_COSTHow many cycles for interrupt service on three capture bytes?
DMA_COSTHow many cycles for a seven-byte capture using DMA?
LATCHWhich method can read the startup latch?
DOORWhich method lets the core sleep until the switch changes?
ENTRYHow many occupied cycles does interrupt service cost for one capture byte?
SETUPHow many occupied cycles does DMA cost for four capture bytes?
BLOCK_1Choose for a capture of 1 bytes.
BLOCK_2Choose for a capture of 2 bytes.
BLOCK_3Choose for a capture of 3 bytes.
BLOCK_4Choose for a capture of 4 bytes.
BLOCK_6Choose for a capture of 6 bytes.
BLOCK_16Choose for a capture of 16 bytes.
CAPTUREChoose for a capture of COUNT bytes.

Examples

Example 1

POLL COST
Input
How many occupied cycles would polling two capture bytes cost?
Output
entry = 10

Two groups of five cost ten cycles.

Example 2

IRQ COST
Input
How many cycles for interrupt service on three capture bytes?
Output
entry = 14

Five entry cycles plus three groups of three gives fourteen.

Example 3

DMA COST
Input
How many cycles for a seven-byte capture using DMA?
Output
entry = 19

Twelve setup cycles plus seven byte cycles gives nineteen.

Constraints and Contract

  • Keep the parameter and named constants. Use the numeric codes and units on this page.
  • For CAPTURE, enter a constant expression using COUNT. Only this entry changes with the parameter. The supported integer range is 1 through 16, inclusive.

Hints

Hint 1

Remove methods the device cannot support.

Hint 2

Decide whether the core can stay awake.

Hint 3

Charge entry and setup once per block in this budget.

What the grader checks: Each check compares the full eight-bit answer. Parameter trials change one condition and keep the other decisions fixed.

18 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

POLL COST

Input
How many occupied cycles would polling two capture bytes cost?
Expected output
entry = 10

Two groups of five cost ten cycles.

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

Icarus Verilog · server