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. Which Cycle Drops VALID Illegally?
On this page

    VLSI DV Interview PuzzlesAll levels

    Which Cycle Drops VALID Illegally?

    Rule under test (AXI4 / AXI4-Stream): once VALID is asserted it must stay asserted until the beat is accepted (VALID and READY both high at an edge). The trace below runs 7 cycles. Which cycle, if any, violates the rule, and what happens to the dropped beat?

    Puzzle

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

    Rule under test (AXI4 / AXI4-Stream): once VALID is asserted it must stay asserted until the beat is accepted (VALID and READY both high at an edge). The trace below runs 7 cycles. Which cycle, if any, violates the rule, and what happens to the dropped beat?

    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
    `timescale 1ns/1ns
    module tb;
      localparam int N = 7;
      //                        cycle: 0123456
      localparam bit [0:N-1] VALID = 7'b1101010;
      localparam bit [0:N-1] READY = 7'b0110011;
      bit clk = 0;
      int cyc = 0, bad = 0;
      bit pv = 0, pr = 0;               // previous-cycle valid / ready
      always #5 clk = ~clk;
      wire valid = VALID[cyc];
      wire ready = READY[cyc];
      always @(posedge clk) begin
        if (pv && !pr && !valid) begin
          bad++;
          $display("VIOLATION cycle %0d: valid dropped while the previous beat was still waiting for ready", cyc);
        end
        if (valid && ready) $display("cycle %0d: transfer", cyc);
        pv <= valid;
        pr <= ready;
        if (cyc == N-1) $display("violations = %0d", bad);
        cyc <= cyc + 1;
      end
      initial #(10*N) $finish;
    endmodule

    Hint

    VALID falling is only a problem if the previous cycle was a stall (VALID high, READY low).

    Step-by-step solution

    Diagram
    1) VALID = 1101010, READY = 0110011.
    2) Cycle 0: VALID=1, READY=0 -> stall. Cycle 1: VALID=1, READY=1 -> transfer.
    3) Cycle 2: VALID falls. The previous cycle was a transfer, so this is legal.
    4) Cycle 3: VALID=1, READY=0 -> stall. Cycle 4: VALID falls while the previous beat was never accepted -> violation.
    5) Cycle 5: VALID=1, READY=1 transfers a beat, but it is a new offer; the beat that was stalled in cycle 3 was withdrawn and is lost. Cycle 6: VALID falls after a transfer, legal.

    Answer

    Answer: Only cycle 4 violates the rule. The beat offered in cycle 3 was withdrawn without being accepted. Falling VALID in cycles 2 and 6 is legal because the previous cycle completed a transfer.

    How this was checked

    Checked by running the code in Verilator 5; the printed output supports the answer above. The checker looks at the previous cycle: only cycle 4 follows a stall, so it is the only violation.

    Why candidates get it wrong

    Flagging every falling edge of VALID is wrong: VALID may drop right after a completed transfer. The check needs the PREVIOUS cycle (VALID high and READY low) as a condition, so a stateless 'VALID fell' rule gives false failures at cycles 2 and 6.

    Interviewer follow-up

    Is READY allowed to drop while VALID is low or high without a handshake? Model answer: Yes. The hold rule applies to the source (VALID and payload) only; a sink may deassert READY at any time, including after seeing VALID, which is why a source can never assume READY will still be high next cycle.

    Related topics

    • Back to Valid/Ready Handshake Puzzles

    • Bus and Interface Protocol Puzzles section

    Previous

    262 / 293

    Next: Payload Changes While Stalled

    Up next

    Up nextPayload Changes While Stalled

    Sign in to save progress

    Practice this lessonPrevious lessonReport an error

    See also

    • Both Sides Wait: The Handshake Deadlock
    • Registered READY Overflows a FIFO
    • Register Slice: 50% Throughput Without Data Errors