V2.1.1 Read the Map and the Registers

EasyImplement12 minIcarus Verilog · serverReview the topic

Read map.json and the register files of ap_soc v1.5 the way a chip test does. Turn names into addresses, reset values and the answer each access must get.

Hardware context: The hand-off package of ap_soc v1.5: map.json, regs/*.json, connect.csv, pins.csv, irq.csv. Generating register and map tests.

Work from the rows below, copied from tools/soc/ap_soc/map.json and regs/*.json. Codes for the kind of an address: 1 a device window, 2 memory, 3 reserved, 4 no row at all (a hole). Yes is 1, no is 0.

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

Replace each unresolved value of 4294967295 with your result.

Signals in the Timeline

SignalWidthRole
question8input of each check
Full specification
Region (map.json v1.5)BaseSizeKind
Boot ROM0x000000000x00001000rom
ap_clint0x020000000x00010000device
ap_plic0x0C0000000x00400000device
UART00x100000000x00001000device
GPIO0x100010000x00001000device
Timer and PWM0x100020000x00001000device
Watchdog0x100030000x00001000device
ap_sysctl0x100040000x00001000device
SPI0x100050000x00001000device
DMA0x100060000x00001000device
ap_pwrctl0x100080000x00001000device
Reserved APB expansion (4 KiB)0x100090000x00001000reserved
Reserved APB expansion (8 KiB)0x1000A0000x00002000reserved
Reserved APB expansion (16 KiB)0x1000C0000x00004000reserved
SRAM0x800000000x00010000ram
Reserved SRAM expansion0x800100000x00010000reserved
Register (regs/*.json)OffsetReset
UART0 DIV0x100x10
ap_pwrctl STATUS0x04read only
ap_plic PRIORITY(n), n = 1 to 160x04 + 4 x (n - 1)0
ap_sysctl CHIP_ID0x000x2A53_10C5
ap_sysctl CLK_GATE0x14bits 4:0 all 1
Watchdog KEY, CONTROL, SERVICE0x00, 0x04, 0x08write only: a read answers ERROR
EntryYour decision
UART_DIV_ADDRAddress of UART0 DIV.
DIV_RESETWhat a read of DIV returns after reset.
PWRCTL_STATUS_ADDRAddress of ap_pwrctl STATUS.
CLINT_BYTESBytes in the ap_clint window.
PRIO9_ADDRAddress of ap_plic PRIORITY(9), the power controller's source.
KIND_7000Kind of the address 0x1000_7000.
KIND_9000Kind of the address 0x1000_9000.
SRAM_LAST_WORDAddress of the last word of SRAM.
GPIO_REGISTERSRegisters in regs/gpio.json.
WDOG_READ_ERRORDoes a read of watchdog KEY answer ERROR?
CHIP_IDWhat a read of CHIP_ID returns.
CLK_GATE_RESETWhat a read of CLK_GATE returns after reset.
PRIO_ADDRAddress of ap_plic PRIORITY(N).

Examples

Example 1

UART DIV ADDR
Input
Address of UART0 DIV.
Output
matches = 1

Base 0x1000_0000 plus offset 0x10.

Example 2

DIV RESET
Input
What a read of DIV returns after reset.
Output
matches = 1

The reset value 0x10 is 16 clk_sys cycles a bit.

Example 3

PWRCTL STATUS ADDR
Input
Address of ap_pwrctl STATUS.
Output
matches = 1

Base 0x1000_8000 plus 0x04.

Constraints and Contract

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

Hints

Hint 1

Every register address is its window's base plus its offset.

Hint 2

An address in no row is a hole; a reserved row is owned by nobody yet. Both must answer ERROR.

Hint 3

A read of a write-only register answers ERROR, by the chip's one rule.

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

17 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

UART DIV ADDR

Input
Address of UART0 DIV.
Expected output
matches = 1

Base 0x1000_0000 plus offset 0x10.

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

Icarus Verilog · server