Skip to content
DenseChip
Learn
PracticeCode labInterview

DenseChip

Navigate

Menu

LearnPracticeCode labInterview

Tools

All toolsSV editorCode repoResume
DenseChip

Practice, courses, and chip-design tools in one focused workspace.

LearnPracticeCode labInterviewToolsLearning paths

© 2026 DenseChip

AboutRoadmapCareersInternshipsFAQContactPrivacyTerms
Skip to lesson

Course contents

  • How to Use This Course
  • The NanoSoC Tour
  • Reading Path
  • SoC Glossary10
  • SoC Metrics Reference
  • SoC Cheatsheet
  • What SoC Integration Is12
  • Architecture and Budgets21
  • Memory Maps and Address Decode26
    • Designing the Address Map
    • Implementing Address Decode
    • Decode Errors and Default Slaves
      • DECERR Versus SLVERR Versus PSLVERR
      • Default-Slave Design
      • Debugging Address Hangs and Mismatches
    • Register Maps and Banks
    • Security and Privilege Regions
    • The Software View and the Hardware-Software Contract
    • IP-XACT and Automated Assembly
    • Memory-Map Verification
  • Interconnect and Bus Fabrics26
  • Clock and Reset Architecture24
  • Power Architecture21
  • Interrupts, DMA and Peripherals15
  • Memories, Boot and Security21
  • IP Integration and Handoff21
  • Top-Level Verification and Bring-up21
  • Package, Pads and I/O18
  • Chip Signoff and Tapeout18
  • SoC Interview Prep16
  • Capstone: Integrate NanoSoC14
Loading lesson

←Decode Errors and Default Slaves
  1. Topics
  2. SoC Design
  3. Memory Maps and Address Decode
  4. Decode Errors and Default Slaves
  5. Debugging Address Hangs and Mismatches
On this page

    Part 3 of 14, lesson 11 of 26Part 3 of 14/Memory Maps and Address Decode/Lesson 11 of 26All levels

    Debugging Address Hangs and Mismatches

    A method for a bad address: classify, place on the map, reproduce, bisect with readback, fix the owning level.

    Why it matters

    The chip hangs after fetching its first instructions. That sentence opens the whiteboard triage question, and the structured answer starts at the address: which address hung, who should have answered, and what came back instead. Guessing wastes days; a method that turns every symptom into a location takes minutes. This lesson teaches that method and demonstrates it on two decode bugs planted in the NanoSoC map for exactly this purpose.

    The core idea

    Every address symptom falls into one of three classes. A hang means no response arrived: suspect a missing default slave, a bridge that dropped PREADY, a block whose clock was gated off while software accesses it (a clear clock-enable bit has the same symptom), or a reset that left one side of an interface unreleased. The 256-cycle bridge watchdog of NanoSoC converts such a hang into a SLVERR after its timeout, which is a fifth error source to include in the sweep. Wrong data means the wrong slave answered: suspect an overlapping window, a slot boundary off by a nibble, or an alias the software did not know about. An error response means the right machinery declined: place the address on the map, read the response table, and decide whether the software address or the hardware policy is wrong, remembering that a faulted but mapped address answers SLVERR from the fault responder while only true holes answer DECERR from the default slave. The method then runs in five steps: classify the symptom, place the address on the map and predict the responder, reproduce with a single access, bisect with readback to the owning level, and fix that level with a regression check.

    Symptom

    First suspect

    Localising readback

    Fix and check

    Hang, no response

    Missing default slave or dropped PREADY

    Single read to a known hole: must return, never hang

    Add the default slave; sweep every hole

    Wrong data

    Overlap, wide window, alias

    Write one slave, read back its neighbours

    Narrow the select; neighbour-readback test

    Unexpected error

    Wrong offset, width wiring, secure state

    One register works, the rest fail

    Fix the wiring or the state; walk every offset

    Planted bug one: the 8 KB decode window

    The symptom is corrupt DMA output: every word comes out with bit 0 flipped and COUNT correct, because the data was XORed with KEY equal to 1 that nobody wrote. The bisection starts with readback: after touching only the SBR, read back all five DMA registers. KEY has changed while nothing wrote to the DMA, so the write went somewhere it should not. The cause is a slot select drawn one bit too wide: the DMA select used addr[15:13] equal to zero instead of addr[15:12] equal to zero, an 8 KB window covering both slot 0 and slot 1. Writing SBR CTRL at 0x4000_100C drove offset 0x0C into both slaves, and offset 0x0C in the DMA is KEY. The fix narrows the select to the full nibble, and the check that would have caught it writes every SBR register and reads back every DMA register, failing on any cross-talk. Know the whole collision table, because 0x0C is only the one that corrupts data: SBR offset 0x00 (SRC_ADDR) lands on DMA CTRL and silently clears IRQ_EN, offset 0x08 overwrites DMA LEN, and only 0x04 (STATUS written with its clear bits zero) and 0x10 (read-only COUNT) are harmless.

    Planted bug two: byte-versus-word paddr wiring

    The symptom is a wall of errors with one silent exception: STATUS, LEN and KEY return PSLVERR, and a COUNT read returns the STATUS value with no error at all (offset 0x10 shifted right by two is 0x04). The pattern is the diagnosis: exactly one offset reads correctly, and it is offset zero, which survives any shift. The wrapper wired paddr to apb_paddr bits 9 down to 2, a word index, instead of bits 7 down to 0, a byte offset. Address 0x04 arrives as paddr 0x01, which the DMA correctly rejects, while 0x00 arrives as 0x00 and works. The fix wires paddr to apb_paddr[7:0], restoring the documented alias, and the checks that would have caught it are two: a register walk over every DMA offset through the front door, and a connectivity check that paddr bit i is driven by apb_paddr bit i for all eight bits. Either one fails on the day the bug is introduced.

    What the review looks for

    • The debug plan for the section names the three symptom classes and the readback that bisects each.

    • Every decode bug fix arrives with its regression check: neighbour readback for overlaps, offset walks for wiring, hole sweeps for defaults.

    • The two planted bugs above are in the verification plan by name, with the exact addresses that expose them.

    Verify and debug

    Keep a debugger attached through the debug access and reproduce each symptom with a single access before changing anything: one write of 1 to 0x4000_100C followed by a DMA KEY readback for the first bug, one read to 0x4000_0004 for the second. Confirm the fix the same way, then run the full sweep: every mapped register, every hole, both security states for the secure rows. If the symptom moves instead of disappearing, two bugs overlap and the method restarts from classification, not from the last fix.

    A register-offset table typed in word units instead of byte offsets: every register after the first lands four times too far, or a quarter of the way, depending on direction. The symptom mimics a decode bug exactly. Check the units of one known register (STATUS must be at byte offset 0x04) before suspecting any gate.

    If handed the hanging chip, say the method out loud: classify, place on the map, single-access reproduce, readback bisection, fix the owning level. Interviewers score the structure before the answer; the two planted bugs are your worked examples.

    Check yourself A write to 0x4000_1008 (SBR LEN) changes DMA LEN at offset 0x08. Which level is guilty and what is the one-line fix?

    The slot decoder: its DMA select is wider than one slot, reaching into slot 1. Narrow the DMA select to addr[15:12] equal to zero so each 4 KB slot selects exactly one slave.

    Related topics

    • Default-Slave Design

    • Holes, Aliases and Reserved Space

    • Hardware Debug Interview: The Chip Hangs, What Do You Do?

    • Hardware Debug: Hangs and Deadlocks

    Previous

    49 / 289

    Next: Register Maps and Banks

    Up next

    Up nextRegister Maps and Banks

    Sign in to save progress

    Practice this lessonPrevious lessonReport an error

    See also

    • DECERR Versus SLVERR Versus PSLVERR