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 Puzzle Bank
  • SystemVerilog Language Puzzles25
  • Difficulty Guide
  • Full Topic Map
  • Interview-Day Tips
  • Study Route: One Week Before the Interview
  • Study Route: Two Weeks
  • Study Route: Four Weeks (Full Course)4
  • OOP & Testbench Puzzles25
  • Concurrency & Timing Puzzles25
  • Randomization & Constraint Puzzles25
  • SVA Assertion Puzzles25
  • Functional Coverage Puzzles25
  • Logic & Aptitude Puzzles25
  • Scenario & Debug Puzzles25
    • Testbench Debug Puzzles: Why Did the Test Hang?
    • Deadlock Scenario Puzzles: Objection and Phase Stalls
    • Scoreboard Puzzles: Mismatch or Ordering Bug?
    • Real Interview Rounds: End-to-End Debug Walkthrough
      • Round: Mid-Test Reset Hangs the Regression
      • Round Walkthrough: Objection Deadlock with Clean Waves
      • Round Walkthrough: APB Reads Return Previous Data
      • Round: Sequencer Grants Nothing After lock()
      • Round: Scoreboard Deadlock Through Bounded Mailboxes
      • Round: Drain Timeout That Never Fires
    • Scenario & Debug Puzzles: Tricky Q&A
  • UVM Testbench Puzzles25
  • Clock, Reset & CDC Puzzles25
  • Bus and Interface Protocol Puzzles25
  • Interview Prep: Puzzle Rounds7
  • DV Puzzle Cheatsheet
Loading lesson

←Real Interview Rounds: End-to-End Debug Walkthrough
  1. Topics
  2. DV Interview Puzzles
  3. Scenario & Debug Puzzles
  4. Real Interview Rounds: End-to-End Debug Walkthrough
  5. Round Walkthrough: APB Reads Return Previous Data
On this page

    VLSI DV Interview PuzzlesAll levels

    Round Walkthrough: APB Reads Return Previous Data

    Interview trace: every APB read returns the data of the PREVIOUS address. Separate a protocol violation in the driver from a monitor sampling bug in five clear steps.

    Puzzle

    Difficulty: Medium · Puzzle 3 of 6 · Topic: Real Interview Rounds: End-to-End Debug Walkthrough

    Interview trace: every APB read returns the data of the PREVIOUS address. Separate a protocol violation in the driver from a monitor sampling bug in five clear steps.

    Code

    design.sv
    1
    2
    3
    4
    5
    6
    7
    always @(posedge pclk) begin
      if (start_read) begin
        psel    <= 1'b1;
        paddr   <= req.addr;
        penable <= 1'b1;   // bug: psel, paddr and penable all change on the same edge
      end
    end

    Hint

    APB setup and enable phases must be distinct and ordered.

    Step-by-step solution

    Diagram
    1) Symptom: read data lags by one transfer under back-to-back traffic.
    2) Hypotheses: APB phase violation in the driver, monitor sampling skew, or a DUT pipeline bug.
    3) Instrumentation: mark SETUP (psel=1, penable=0) and ACCESS (psel=1, penable=1) phases on the waveform and add an SVA: $rose(psel) |=> penable (and !$past(penable) on the first cycle). Compare what the DUT sees with what the monitor samples: if the monitor reports the same address/data pairs the DUT saw, it is not a monitor bug.
    4) Root cause: psel, paddr and penable change on the same edge, so there is no setup cycle. A slave that latches the address in the setup cycle (psel && !penable) never sees it and returns data for the previous address. This symptom assumes a slave that latches the address in the setup cycle; a slave that samples paddr in the access cycle would not show it, but the sequence is still an APB protocol violation.
    5) Fix: drive psel and paddr in the setup cycle, penable in the next, and hold until pready; deassert penable (and psel unless back to back) after the access. Rerun a directed back-to-back read sequence and keep the SVA in regressions.

    Answer

    Answer: Actual bug: the driver asserts psel, paddr and penable on the same edge, so there is no APB setup phase and the slave latches a stale address. Fix: split the transfer into setup (psel, paddr) then access (penable), wait for pready, and deassert correctly.

    How this was checked

    Checked by running the code in Verilator 5; the printed output supports the answer above. Plain-SV model of an APB slave that latches the address in the setup cycle: with no setup phase it returns stale data, with one it is correct.

    Why candidates get it wrong

    Many candidates inspect the scoreboard first; this is protocol timing in the stimulus. An SVA on the setup-to-access order separates driver, monitor and DUT in one run.

    Interviewer follow-up

    Which assertion would you write to enforce APB setup/access sequencing in future regressions? Model answer: Setup then access: assert property (@(posedge pclk) disable iff (!presetn) $rose(psel) |=> (psel && penable)); plus penable never rises without psel and psel && penable && !pready |=> $stable(paddr) && penable (hold until ready).

    Say it out loud

    Reads return previous data, so I look at the protocol timing on the bus before blaming the scoreboard. The root cause is that the driver asserts psel, paddr and penable on the same edge, so there is no APB setup phase and the slave latches a stale address. I confirm it with an SVA on the setup to access order, which separates driver, monitor and DUT in one run. The fix is to split the transfer into setup then access, wait for pready, and deassert correctly.

    Related topics

    • Protocol Violations

    • The Driver: Owning the Pins, One Transfer at a Time

    • Back to Real Interview Rounds: End-to-End Debug Walkthrough

    • Scenario & Debug Puzzles section

    Previous

    206 / 293

    Next: Round: Sequencer Grants Nothing After lock()

    Up next

    Up nextRound: Sequencer Grants Nothing After lock()

    Sign in to save progress

    Practice this lessonPrevious lessonReport an error

    See also

    • Round: Mid-Test Reset Hangs the Regression
    • Round: Scoreboard Deadlock Through Bounded Mailboxes
    • Round: Drain Timeout That Never Fires