A small top level disagrees with its document in three places. Find the first wrong row, then repair every one.
Hardware context: An excerpt of the ap_soc architecture document and a small top level. Specification reading and spec-against-RTL checks
A top level decodes four devices, wires three interrupt requests and spreads five reset sources. A bench walks nine rows of its document, one row in each cycle.
Run the failing bench. Select the first cycle and the signal that differ from the document, and name the cause. Then repair the RTL. The owners have checked the three tables below: the document is right.
Signals in the Timeline
| Signal | Width | Role |
|---|---|---|
snapshot | 9 | input of each check |
Full specification
| Device | First address | Size |
|---|---|---|
| Watchdog | 0x1000_3000 | 0x1000 |
| ap_sysctl | 0x1000_4000 | 0x1000 |
| SPI | 0x1000_5000 | 0x1000 |
| DMA | 0x1000_6000 | 0x1000 |
| reserved | 0x1000_7000 | 0x9000, up to 0x1000_FFFF |
| Source | Device |
|---|---|
| 4 | SPI |
| 5 | DMA |
| 6 | Watchdog |
| 1 to 3 | other blocks: always 0 here |
| Source | Processor (reset_core) | Bus and devices (reset_bus) | Debug logic (reset_debug) |
|---|---|---|---|
| Power-on (por) | yes | yes | yes |
| Reset pin (pin_reset) | yes | yes | no |
| Watchdog (wdt_reset) | yes | yes | no |
| Software (sw_reset) | yes | yes | no |
| Debugger (dbg_reset) | yes | no | no |
Diagnose the Failing Run
The test below runs the buggy design. Read its log, then find where it first goes wrong in the waveform.
Log
Waveform
Click a signal at a cycle to select it. Or focus the waveform and use the arrow keys: Left and Right move one cycle, Up and Down one signal.
Step 3 is optional: fix the code in the editor, then run the tests.
Examples
Example 1
The Watchdog Region- Input
addr=0x10003000, requests wdt/spi/dma=000, resets=00000
- Output
sel_wdt = 1, sel_sysctl = 0, sel_spi = 0, sel_dma = 0, sel_reserved = 0, irq_source = 'b000000, reset_core = 0, reset_bus = 0, reset_debug = 0
Only the watchdog select rises at 0x1000_3000.
Example 2
A DMA Request- Input
addr=0x00000000, requests wdt/spi/dma=001, resets=00000
- Output
sel_wdt = 0, sel_sysctl = 0, sel_spi = 0, sel_dma = 0, sel_reserved = 0, irq_source = 'b010000, reset_core = 0, reset_bus = 0, reset_debug = 0
DMA raises source 5 and no other.
Example 3
Power-On Reset- Input
addr=0x00000000, requests wdt/spi/dma=000, resets=10000
- Output
sel_wdt = 0, sel_sysctl = 0, sel_spi = 0, sel_dma = 0, sel_reserved = 0, irq_source = 'b000000, reset_core = 1, reset_bus = 1, reset_debug = 1
A power-on reset reaches the processor, the bus and the debug logic.
Constraints and Contract
- Keep module device_top and its ports. The design is combinational. Every input carries a known binary value.
Hints
Hint 1
Walk the bench cycle by cycle. For each cycle, find its row in the tables.
Hint 2
The first error is not the only one. After each repair, run again.
Hint 3
Check each table in both directions: a device at the wrong place, and a place with the wrong device.
What the grader checks: The bench of the diagnosis walks nine rows. The fix cases check every region of the window at both ends, and addresses outside it. They also check all eight request patterns and all 32 reset patterns. One row uses an address drawn for each submission.
150 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