S10.7.1 Translate the Device Access

HardImplement22 minIcarus Verilog · serverReview the topic

Follow two streams through both tables and locate the first decision that stops a byte write.

Hardware context: Two-stage DMA page filter. Virtualised device access

Use these exercise values. All addresses are eight bits. Each page holds sixteen bytes. All numbers in the tables are decimal.

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

Signals in the Timeline

SignalWidthRole
question8input of each check
Full specification
StreamContextStage 1: device page → guest page (rights)
6A4 → 2 (RW), 5 → 3 (RW), 6 → 4 (R)
7B4 → 2 (RW)
ContextStage 2: guest page → physical page (rights)
A2 → 9 (RW), 3 → 8 (R), 4 → 7 (RW)
B2 → 10 (RW)

Unlisted entries are absent. Stop at the first failure. Fault codes are 1 for unknown stream, 2 for stage one, 3 for stage two.

EntryYour decision
OFFSETOffset of device byte 75 within its page?
DEVICE_PAGEDevice page containing byte 75?
GUEST_PAGEStream 6 reads byte 75. Which guest page?
A_BYTEStream 6 writes byte 75. Which physical byte?
B_BYTEStream 7 writes byte 75. Which physical byte?
READ_BYTEStream 6 reads byte 95. Which physical byte?
FIRST_FAULTStream 6 writes byte 96. Give the fault code.
NEXT_FAULTStream 6 writes byte 80. Give the fault code.
NO_CONTEXTStream 2 reads byte 75. Give the fault code.
LAST_SOURCEStream 6 reads four consecutive bytes starting at 78. Which physical byte supplies the fourth?
PREFIXStream 6 writes four bytes starting at 78, checking each byte before issue. How many reach SRAM before the fault?
ATOMICRepeat that write with all pages checked before any byte issues. How many bytes reach SRAM?
READ_PHYSICALStream 6 reads BYTE_ADDR. Return the complete physical byte address.

Examples

Example 1

OFFSET
Input
Offset of device byte 75 within its page?
Output
matches = 1

75 is four full pages plus eleven bytes.

Example 2

DEVICE PAGE
Input
Device page containing byte 75?
Output
matches = 1

The four complete pages supply the page number.

Example 3

GUEST PAGE
Input
Stream 6 reads byte 75. Which guest page?
Output
matches = 1

Context A maps device page four to guest page two.

Constraints and Contract

  • Keep the parameter and named constants. Use the numeric codes and units on this page.
  • For READ_PHYSICAL, enter a constant expression using BYTE_ADDR. Only this entry changes with the parameter. The supported integer range is 64 through 95, inclusive.
  • Replace each unfinished FF entry with your decision.

Hints

Hint 1

Start with the stream on the request.

Hint 2

Split the byte address once and retain the remainder.

Hint 3

A write needs permission in both selected entries.

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

13 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

OFFSET

Input
Offset of device byte 75 within its page?
Expected output
matches = 1

75 is four full pages plus eleven bytes.

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

Icarus Verilog · server