S0.2.1 Who Owns This Address

EasyImplement12 minIcarus Verilog · serverReview the topic

Find the owner and the offset of real 32-bit addresses in a memory map.

Hardware context: ap_soc memory map, four regions. Reading a memory map during bring-up

A decoder is being checked against this part of the ap_soc v1.0 memory map. For each address, decide which region contains it and how far inside it lies.

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
CodeOwnerFirst address (base)Size
1Boot ROM0x0000_00000x1000
2UART00x1000_00000x1000
3GPIO0x1000_10000x1000
4SRAM0x8000_00000x1_0000

Use code 9 for an address that no region in this table contains. Enter offsets in bytes, as plain numbers.

EntryYour decision
OWNER_AOwner code of address 0x1000_0000.
OFFSET_AOffset of 0x1000_0000 inside its region.
OWNER_BOwner code of address 0x1000_1004.
OFFSET_BOffset of 0x1000_1004 inside its region.
OWNER_COwner code of address 0x0000_0FFC.
OWNER_DOwner code of address 0x0000_1000.
OWNER_EOwner code of address 0x1000_0FFF.
OWNER_FOwner code of address 0x8000_FFFF.
OWNER_GOwner code of address 0x8001_0000.
UART_REGRegisters are four bytes wide. Which UART0 register number contains address 0x1000_000C?
GPIO_DIGITSHow many leading hex digits must match to select GPIO?
GPIO_REG_OFFSETOffset in bytes of GPIO register number N. Registers are four bytes wide, and the first one is number 0.

Examples

Example 1

OWNER A
Input
Owner code of address 0x1000_0000.
Output
matches = 1

UART0 starts exactly at 0x1000_0000.

Example 2

OFFSET A
Input
Offset of 0x1000_0000 inside its region.
Output
matches = 1

The address equals the base, so nothing is left after subtracting.

Example 3

OWNER B
Input
Owner code of address 0x1000_1004.
Output
matches = 1

GPIO runs from 0x1000_1000 to 0x1000_1FFF.

Constraints and Contract

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

Hints

Hint 1

The last address of a region is its base plus its size, minus one.

Hint 2

An address belongs to a region only if it is at least the base and at most the last address.

Hint 3

What is left is the offset inside the region.

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

12 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 1 problem 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

OWNER A

Input
Owner code of address 0x1000_0000.
Expected output
matches = 1

UART0 starts exactly at 0x1000_0000.

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

Icarus Verilog · server