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
      • Counting Transfers in a Valid/Ready Trace
      • Which Cycle Drops VALID Illegally?
      • Payload Changes While Stalled
      • Both Sides Wait: The Handshake Deadlock
      • Registered READY Overflows a FIFO
      • Register Slice: 50% Throughput Without Data Errors
    • APB Protocol Puzzles
    • 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

←Valid/Ready Handshake Puzzles
  1. Topics
  2. DV Interview Puzzles
  3. Bus and Interface Protocol Puzzles
  4. Valid/Ready Handshake Puzzles
  5. Payload Changes While Stalled
On this page

    VLSI DV Interview PuzzlesAll levels

    Payload Changes While Stalled

    Same rule family: while VALID is high and READY is low, the payload must hold its value. VALID is high for all 7 cycles. Find the violating cycle, list the beats the receiver actually gets, and say which intended beat is lost.

    Puzzle

    Difficulty: Easy · Puzzle 3 of 6 · Topic: Valid/Ready Handshake Puzzles

    Same rule family: while VALID is high and READY is low, the payload must hold its value. VALID is high for all 7 cycles. Find the violating cycle, list the beats the receiver actually gets, and say which intended beat is lost.

    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
    25
    26
    27
    `timescale 1ns/1ns
    module tb;
      localparam int N = 7;
      //                        cycle: 0123456
      localparam bit [0:N-1] VALID = 7'b1111111;
      localparam bit [0:N-1] READY = 7'b0010010;
      localparam bit [27:0]  DATA  = {4'h3, 4'h3, 4'h3, 4'h7, 4'h9, 4'h9, 4'h2};
      bit clk = 0;
      int cyc = 0, bad = 0;
      bit pv = 0, pr = 0;
      bit [3:0] pd = 0;
      always #5 clk = ~clk;
      wire       valid = VALID[cyc];
      wire       ready = READY[cyc];
      wire [3:0] data  = DATA[(N-1-cyc)*4 +: 4];
      always @(posedge clk) begin
        if (pv && !pr && valid && data !== pd) begin
          bad++;
          $display("VIOLATION cycle %0d: data changed 0x%0h -> 0x%0h while valid && !ready", cyc, pd, data);
        end
        if (valid && ready) $display("cycle %0d: transfer data=0x%0h", cyc, data);
        pv <= valid; pr <= ready; pd <= data;
        if (cyc == N-1) $display("violations = %0d", bad);
        cyc <= cyc + 1;
      end
      initial #(10*N) $finish;
    endmodule

    Hint

    Compare the data in each stalled cycle with the data in the cycle before it.

    Step-by-step solution

    Diagram
    1) DATA by cycle: 3, 3, 3, 7, 9, 9, 2. READY is high only in cycles 2 and 5.
    2) Cycles 0-1 stall with data 3 (stable). Cycle 2 transfers 3.
    3) Cycle 3 offers a new beat, 7, and READY is low: stall.
    4) Cycle 4 shows 9 while the previous cycle was a stall of 7 -> violation (data changed 7 -> 9). READY is still low.
    5) Cycle 5 transfers 9. Cycle 6 shows 2 after a completed transfer, which is a fresh beat and legal.

    Answer

    Answer: Violation in cycle 4 (7 changed to 9 while stalled). The receiver gets 3 in cycle 2 and 9 in cycle 5; the beat 7 is never delivered. The change to 2 in cycle 6 is legal.

    How this was checked

    Checked by running the code in Verilator 5; the printed output supports the answer above. Only the change that happens after a stall (cycle 4) is flagged; the beat 7 never transfers.

    Why candidates get it wrong

    The data change at cycle 3 (3 -> 7) is NOT the violation: it follows the completed transfer in cycle 2, so it is a new beat. The violation is the change during the stall at cycle 4, and it silently loses a beat, so no protocol error appears at the receiver.

    Interviewer follow-up

    Does the stability rule cover only the data field? Model answer: No. Every payload and sideband signal qualified by VALID (data, LAST, strobes, ID, USER, address and control on a command channel) must be held while stalled. A LAST or USER bit that flips during a stall is the most common real violation because it is easy to forget.

    Related topics

    • Back to Valid/Ready Handshake Puzzles

    • Bus and Interface Protocol Puzzles section

    Previous

    263 / 293

    Next: Both Sides Wait: The Handshake Deadlock

    Up next

    Up nextBoth Sides Wait: The Handshake Deadlock

    Sign in to save progress

    Practice this lessonPrevious lessonReport an error

    See also

    • Counting Transfers in a Valid/Ready Trace
    • Registered READY Overflows a FIFO
    • Register Slice: 50% Throughput Without Data Errors