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
    • Reset Puzzles
      • A Reset Pulse Between Two Clock Edges
      • The Counter Nobody Reset
      • Asynchronous Assert, Synchronous Release
      • Reset Has Lower Priority Than Enable
      • Reset Release Order Across Domains
      • Reset Released With a Blocking Assignment
    • Clock Gating & Clock Mux Puzzles
    • CDC Basics Puzzles
    • Verifying CDC & Reset Puzzles
    • Clock, Reset & CDC Puzzles: Tricky Q&A
  • Bus and Interface Protocol Puzzles25
  • Interview Prep: Puzzle Rounds7
  • DV Puzzle Cheatsheet
Loading lesson

←Reset Puzzles
  1. Topics
  2. DV Interview Puzzles
  3. Clock, Reset & CDC Puzzles
  4. Reset Puzzles
  5. Reset Release Order Across Domains
On this page

    VLSI DV Interview PuzzlesAll levels

    Reset Release Order Across Domains

    A producer and a consumer share one clock but have separate resets. The producer sends exactly one beat in the first cycle after its reset releases. The producer is released at t=12, the consumer at t=42. How many beats are sent and how many are received? Give the minimum fix for the ordering.

    Puzzle

    Difficulty: Medium · Puzzle 5 of 6 · Topic: Reset Puzzles

    A producer and a consumer share one clock but have separate resets. The producer sends exactly one beat in the first cycle after its reset releases. The producer is released at t=12, the consumer at t=42. How many beats are sent and how many are received? Give the minimum fix for the ordering.

    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;
      reg clk = 0;
      always #5 clk = ~clk;                       // one clock, two reset domains
      reg rstp_n = 0, rstc_n = 0;
      reg p_valid, p_done;
      reg [3:0] rx;
      integer sent = 0;
      // producer: sends exactly one beat, in the first cycle after its own reset releases
      always @(posedge clk)
        if (!rstp_n) begin p_valid <= 1'b0; p_done <= 1'b0; end
        else         begin p_valid <= !p_done; p_done <= 1'b1; end
      // consumer: counts the beats it receives
      always @(posedge clk)
        if (!rstc_n)      rx <= 4'd0;
        else if (p_valid) rx <= rx + 1;
      always @(posedge clk) if (p_valid) sent <= sent + 1;
      initial begin
        #12 rstp_n = 1;                           // producer leaves reset first
        #30 rstc_n = 1;                           // consumer leaves reset at t=42
        #18 $display("t=%0d beats sent=%0d received=%0d", $time, sent, rx);
        #1  $finish;
      end
    endmodule

    Hint

    Look at what the consumer does at the edge where valid is high.

    Step-by-step solution

    Diagram
    1) The producer leaves reset at t=12. At the edge at t=15 it raises p_valid; the edge at t=25 lowers it, so valid is high for one cycle (visible at the edge at t=25).
    2) The tb counter sees p_valid high at that edge: sent=1.
    3) The consumer is still in reset at t=25 (it is released at t=42), so its reset branch runs and the beat is ignored.
    4) After t=42 the producer never sends again: received stays 0.
    5) Fix: release the consumer before (or at least not after) the producer, or make the producer wait for an explicit ready from the consumer before it sends.

    Answer

    Answer: sent=1, received=0: the only beat is lost because the consumer was still in reset. Release the receiver's reset first (or gate the sender on the receiver's ready) so nothing is sent into a block that is still in reset.

    How this was checked

    Checked by running the code in Icarus Verilog 13; the printed output supports the answer above. Icarus: one beat is sent while the consumer is still in reset; it is never received.

    Why candidates get it wrong

    Treating reset release as one global event. Reset domains release at different times and a block that comes out early talks to a block that is still in reset. Verification must check reset release order, not only that every block is eventually reset.

    Interviewer follow-up

    If you cannot change the release order, how does a ready/valid interface still lose the beat? Model answer: it does not, provided the sender holds valid until it sees ready and the receiver drives ready low during reset; the sender then simply waits until the consumer is out of reset.

    Related topics

    • Back to Reset Puzzles

    • Clock, Reset & CDC Puzzles section

    Previous

    240 / 293

    Next: Reset Released With a Blocking Assignment

    Up next

    Up nextReset Released With a Blocking Assignment

    Sign in to save progress

    Practice this lessonPrevious lessonReport an error

    See also

    • A Reset Pulse Between Two Clock Edges
    • The Counter Nobody Reset
    • Asynchronous Assert, Synchronous Release