V7.1.1 Read the Route Matrix

EasyImplement12 minIcarus Verilog · serverReview the topic

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

SignalWidthRole
question8input of each check
Full specification
CodeThe AHB target that owns the address
1Boot ROM
2ap_clint
3ap_plic
4The AHB-to-APB bridge
5SRAM
6No target: the manager's own default subordinate
EntryYour decision
ROM_TOPAddress 0x0000_0FFC.
CLINT_ENDAddress 0x0201_0000.
PLIC_TOPAddress 0x0C3F_FFFC.
APB_HOLEAddress 0x1000_7000, a page no APB block owns.
SRAM_ABOVEAddress 0x8001_0000.
SLOWAddress 0x1000_8004, ap_pwrctl STATUS on the slow APB.
CELLSCells of the route matrix: every manager against every target and the default subordinate.
BENCH_CELLSCells the bench can drive without the processor: the seat, the DMA and the debug manager, each against the six columns.
HOLE_COSTExtra cycles an APB hole's ERROR costs over an AHB hole's, as recorded.
SLOW_COSTHow many times a fast APB read the recorded slow APB read took, rounded down.
ROUTE_ROWSRows 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

Report a problem with this page

Your code SystemVerilogSaved locally
Ln 1, Col 1Tab indents · Ctrl/⌘ + Enter runs samples
Not run yet

ROM TOP

Input
Address 0x0000_0FFC.
Expected output
matches = 1

The last word of the 4 KiB ROM window.

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

Icarus Verilog · server