Read the decoder's map like a route matrix. Find which target owns each address, how many routes there are, and what each answer costs.
Hardware context: The fabric of ap_soc v1.5: generated decoders, a four-manager AHB-Lite matrix, default subordinates and two bridges. Counting the routes and the cost of each answer.
The matrix of ap_soc v1.5 has four managers and five targets. The managers are 0 debug, 1 DMA, 2 core data port and 3 core instruction port. Its decoder is generated from map.json. Boot ROM is at 0x0000_0000 (4 KiB), ap_clint at 0x0200_0000 (64 KiB) and ap_plic at 0x0C00_0000 (4 MiB). The bridge owns the whole APB window, 0x1000_0000 to 0x1000_FFFF. SRAM is at 0x8000_0000 (64 KiB). Behind the bridge, a hole of the APB window is answered by the APB multiplexor. Recorded on the seat (record-v7-labs.mjs): an SRAM read took 1 cycle, a fast APB read 2 and a slow APB read 11. An AHB hole took 2, an APB hole 3. Enter a code or a whole number.
This worksheet uses named constants. The first three entries show how to record your decisions.
Replace each unresolved value of 65535 with your result.
Signals in the Timeline
| Signal | Width | Role |
|---|---|---|
question | 8 | input of each check |
Full specification
| Code | The AHB target that owns the address |
|---|---|
| 1 | Boot ROM |
| 2 | ap_clint |
| 3 | ap_plic |
| 4 | The AHB-to-APB bridge |
| 5 | SRAM |
| 6 | No target: the manager's own default subordinate |
| Entry | Your decision |
|---|---|
| ROM_TOP | Address 0x0000_0FFC. |
| CLINT_END | Address 0x0201_0000. |
| PLIC_TOP | Address 0x0C3F_FFFC. |
| APB_HOLE | Address 0x1000_7000, a page no APB block owns. |
| SRAM_ABOVE | Address 0x8001_0000. |
| SLOW | Address 0x1000_8004, ap_pwrctl STATUS on the slow APB. |
| CELLS | Cells of the route matrix: every manager against every target and the default subordinate. |
| BENCH_CELLS | Cells the bench can drive without the processor: the seat, the DMA and the debug manager, each against the six columns. |
| HOLE_COST | Extra cycles an APB hole's ERROR costs over an AHB hole's, as recorded. |
| SLOW_COST | How many times a fast APB read the recorded slow APB read took, rounded down. |
| ROUTE_ROWS | Rows of a route test for a map of WINDOWS windows. Each window needs its first word, its last word and the hole after it. Each of three managers runs them. Use 3 × 3 × WINDOWS. |
Examples
Example 1
ROM TOP- Input
Address 0x0000_0FFC.
- Output
matches = 1
The last word of the 4 KiB ROM window.
Example 2
CLINT END- Input
Address 0x0201_0000.
- Output
matches = 1
ap_clint's window is 64 KiB: it ends at 0x0200_FFFF.
Example 3
PLIC TOP- Input
Address 0x0C3F_FFFC.
- Output
matches = 1
The last word of ap_plic's 4 MiB window.
Constraints and Contract
- Keep the parameter and named constants. Use the numeric codes and units on this page.
- For ROUTE_ROWS, enter a constant expression using WINDOWS. Only this entry changes with the parameter. The supported integer range is 3 through 16, inclusive.
Hints
Hint 1
Compare the address with each base and size.
Hint 2
Every APB address goes to the bridge first, hole or not.
Hint 3
Subtract or divide the latencies given.
What the grader checks: Each check compares the full eight-bit answer. Parameter trials change one condition and keep the other decisions fixed.
15 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