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
  • UVM Testbench Puzzles25
  • Clock, Reset & CDC Puzzles25
  • Bus and Interface Protocol Puzzles25
    • Valid/Ready Handshake Puzzles
    • APB Protocol Puzzles
      • Setup, Access and Completed Transfers
      • Two Wait States: Total Cycles and Write Moment
      • When Is PSLVERR Real?
      • Can Two Transfers Fit in Three Cycles?
      • Write Data Changes in a Wait State
      • Sampling PRDATA One Cycle Too Early
    • AXI Protocol Puzzles
    • FIFO, Arbitration and Credit Puzzles
    • Bus and Interface Protocol Puzzles: Tricky Q&A
  • Interview Prep: Puzzle Rounds7
  • DV Puzzle Cheatsheet
Loading lesson

←APB Protocol Puzzles
  1. Topics
  2. DV Interview Puzzles
  3. Bus and Interface Protocol Puzzles
  4. APB Protocol Puzzles
  5. When Is PSLVERR Real?
On this page

    VLSI DV Interview PuzzlesAll levels

    When Is PSLVERR Real?

    APB4. PSLVERR is high in cycles 2, 5 and 6 of the trace below (7 cycles). A checker flags a failed transfer only where the protocol makes PSLVERR meaningful. How many transfers does it report as errors, and at which cycle?

    Puzzle

    Difficulty: Medium · Puzzle 3 of 6 · Topic: APB Protocol Puzzles

    APB4. PSLVERR is high in cycles 2, 5 and 6 of the trace below (7 cycles). A checker flags a failed transfer only where the protocol makes PSLVERR meaningful. How many transfers does it report as errors, and at which cycle?

    Code

    tb.sv
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    `timescale 1ns/1ns
    module tb;
      localparam int N = 7;
      //                          cycle: 0123456
      localparam bit [0:N-1] PSEL     = 7'b0111110;
      localparam bit [0:N-1] PENABLE  = 7'b0011010;
      localparam bit [0:N-1] PREADY   = 7'b0001010;
      localparam bit [0:N-1] PSLVERR  = 7'b0010011;
      bit clk = 0;
      int cyc = 0, n = 0, errs = 0;
      always #5 clk = ~clk;
      wire psel = PSEL[cyc], penable = PENABLE[cyc], pready = PREADY[cyc], pslverr = PSLVERR[cyc];
      always @(posedge clk) begin
        if (psel && penable && pready) begin
          n++;
          if (pslverr) errs++;
          if (pslverr) $display("cycle %0d: transfer #%0d ERROR (PSLVERR=1)", cyc, n);
          else         $display("cycle %0d: transfer #%0d OKAY", cyc, n);
        end
        if (cyc == N-1) $display("errors = %0d of %0d transfers", errs, n);
        cyc <= cyc + 1;
      end
      initial #(10*N) $finish;
    endmodule

    Hint

    Find the cycles where PSEL, PENABLE and PREADY are all high, then look at PSLVERR only there.

    Step-by-step solution

    Diagram
    1) PSEL=0111110, PENABLE=0011010, PREADY=0001010, PSLVERR=0010011.
    2) Cycle 1: setup. Cycle 2: access with PREADY=0 -> wait state. PSLVERR=1 here is not valid yet.
    3) Cycle 3: access with PREADY=1 -> transfer 1 completes with PSLVERR=0 -> OKAY.
    4) Cycle 4: setup. Cycle 5: access with PREADY=1 and PSLVERR=1 -> transfer 2 completes with an error.
    5) Cycle 6: PSEL=0, PSLVERR=1 is ignored.

    Answer

    Answer: One error: transfer #2, reported at cycle 5. PSLVERR in cycle 2 (wait state) and cycle 6 (idle) is not sampled.

    How this was checked

    Checked by running the code in Verilator 5; the printed output supports the answer above. PSLVERR is sampled only at the completing access cycles 3 and 5.

    Why candidates get it wrong

    PSLVERR is only considered in the last cycle of a transfer (PSEL, PENABLE and PREADY all high); the spec recommends, but does not require, driving it low otherwise. A checker that treats any high PSLVERR as an error reports 3 false failures here.

    Interviewer follow-up

    A write ends with PSLVERR=1. Can the testbench assume the register was not updated? Model answer: No. The spec says an error response does not guarantee that the register or memory kept its old value. The scoreboard should mark the target unknown or follow the specific slave's documentation, not silently model 'no change'.

    Related topics

    • Back to APB Protocol Puzzles

    • Bus and Interface Protocol Puzzles section

    Previous

    269 / 293

    Next: Can Two Transfers Fit in Three Cycles?

    Up next

    Up nextCan Two Transfers Fit in Three Cycles?

    Sign in to save progress

    Practice this lessonPrevious lessonReport an error

    See also

    • Setup, Access and Completed Transfers
    • Write Data Changes in a Wait State
    • Sampling PRDATA One Cycle Too Early