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
| Signal | Width | Role |
|---|---|---|
question | 8 | input of each check |
Full specification
| Region (map.json v1.5) | Base | Size | Kind |
|---|---|---|---|
| Boot ROM | 0x00000000 | 0x00001000 | rom |
| ap_clint | 0x02000000 | 0x00010000 | device |
| ap_plic | 0x0C000000 | 0x00400000 | device |
| UART0 | 0x10000000 | 0x00001000 | device |
| GPIO | 0x10001000 | 0x00001000 | device |
| Timer and PWM | 0x10002000 | 0x00001000 | device |
| Watchdog | 0x10003000 | 0x00001000 | device |
| ap_sysctl | 0x10004000 | 0x00001000 | device |
| SPI | 0x10005000 | 0x00001000 | device |
| DMA | 0x10006000 | 0x00001000 | device |
| ap_pwrctl | 0x10008000 | 0x00001000 | device |
| Reserved APB expansion (4 KiB) | 0x10009000 | 0x00001000 | reserved |
| Reserved APB expansion (8 KiB) | 0x1000A000 | 0x00002000 | reserved |
| Reserved APB expansion (16 KiB) | 0x1000C000 | 0x00004000 | reserved |
| SRAM | 0x80000000 | 0x00010000 | ram |
| Reserved SRAM expansion | 0x80010000 | 0x00010000 | reserved |
| Register (regs/*.json) | Offset | Reset |
|---|---|---|
| UART0 DIV | 0x10 | 0x10 |
| ap_pwrctl STATUS | 0x04 | read only |
| ap_plic PRIORITY(n), n = 1 to 16 | 0x04 + 4 x (n - 1) | 0 |
| ap_sysctl CHIP_ID | 0x00 | 0x2A53_10C5 |
| ap_sysctl CLK_GATE | 0x14 | bits 4:0 all 1 |
| Watchdog KEY, CONTROL, SERVICE | 0x00, 0x04, 0x08 | write only: a read answers ERROR |
| Entry | Your decision |
|---|---|
| UART_DIV_ADDR | Address of UART0 DIV. |
| DIV_RESET | What a read of DIV returns after reset. |
| PWRCTL_STATUS_ADDR | Address of ap_pwrctl STATUS. |
| CLINT_BYTES | Bytes in the ap_clint window. |
| PRIO9_ADDR | Address of ap_plic PRIORITY(9), the power controller's source. |
| KIND_7000 | Kind of the address 0x1000_7000. |
| KIND_9000 | Kind of the address 0x1000_9000. |
| SRAM_LAST_WORD | Address of the last word of SRAM. |
| GPIO_REGISTERS | Registers in regs/gpio.json. |
| WDOG_READ_ERROR | Does a read of watchdog KEY answer ERROR? |
| CHIP_ID | What a read of CHIP_ID returns. |
| CLK_GATE_RESET | What a read of CLK_GATE returns after reset. |
| PRIO_ADDR | Address 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