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

AboutContactPrivacyTerms
Skip to lesson

Course contents

  • RTL Foundations36
  • Combinational Design25
  • Sequential Design27
  • FSM & Control27
  • Timing & Clocking39
  • Reset & CDC34
  • Memory & Buses57
  • Advanced RTL28
  • Senior & Interview76
    • Low-Power RTL Hub
    • DFT and Scan Hub
    • Physical Awareness Hub
    • Waveform Debug Hub
    • STA and ECO Hub
    • RTL-to-Implementation Closure
    • DFT-Ready RTL
    • Capstone: Resilient Streaming Peripheral
    • Principal Design Review
    • Senior RTL Interview Questions & Model Answers
      • Interview: Combinational and Arithmetic
      • Interview: Sequential and Pipelines
      • Interview: FSM and Control
      • Interview: Timing and STA
      • Interview: CDC and Reset
      • Interview: Memories and Buses
      • Interview: Low-Power Design
      • Interview: Debug and ECO
        • X-propagation discipline
        • Why simulation and silicon disagree
        • Capturing an intermittent failure
        • ECO or RTL change
      • Interview: Coding and Whiteboard
  • Glossary and Notation
Loading lesson

‹Interview: Debug and ECO
  1. Topics
  2. RTL Design
  3. Senior & Interview
  4. Senior RTL Interview Questions & Model Answers
  5. Interview: Debug and ECO
  6. X-propagation discipline

Part 9 · Senior · Senior

X-propagation discipline

X-propagation sources and reset discipline, with a testbench contrasting if-else, case, and ternary under X.

On this page

    Why this matters

    Simulation resolves some unknowns optimistically, so a design with missing resets passes and the chip then shows the bug. The interviewer asks about X sources to see if reset discipline is a habit or a slogan.

    After this lesson you can: list where X comes from, show how if, case and ternary treat an X select, and state the three-part discipline that keeps X out of sign-off.

    The question

    The interviewer asks what causes X-propagation and what keeps unknowns out of sign-off simulation. The question tests whether reset discipline is a habit or a slogan.

    Model answer

    Unknowns come from uninitialized flops, incomplete reset, memories with no defined contents, and powered-down domains driving live logic.

    Simulation resolves some X cases optimistically. An if with an X select takes the else branch, and a case with no matching branch holds its old value.

    A ternary with disagreeing inputs yields X instead. Silicon resolves every unknown to 0 or 1, so optimism hides bugs that the chip then shows.

    sel (with a, b)

    y_if

    y_case

    y_mux

    0 (a = 0, b = 1)

    1

    1

    1

    1 (a = 0, b = 1)

    0

    0

    0

    X (a = 0, b = 1)

    1, else branch taken

    0, held from the row above

    X

    X (a = 1, b = 1)

    1

    0, still held

    1, inputs agree

    Each row is one step of the testbench further down, in the same order; the outputs are what the simulation printed for that step.

    • Rows 1 and 2 are ordinary: all three codings agree on a known select.

    • Row 3 is the trap. Only the ternary reports X; the if/else and the case each show a clean value that silicon need not produce.

    • Row 4: the ternary resolves to 1 because both inputs agree, while the case still shows the stale 0 from row 2.

    An RTL X represents digital uncertainty; it is not an analog metastability model. Four-state tests cannot establish synchronizer settling margin or MTBF. Physical CDC closure still needs the canonical synchronizer/protocol review and implemented timing evidence.

    The discipline has three parts: reset every flop that affects behavior or prove the value unreachable, give memories defined contents or model the unknown explicitly, and clamp or isolate powered-off outputs.

    Interview

    Strongest one-line answer: unknowns come from reset, init, and power gaps; close each one, and never let an optimistic branch hide them.

    Solution and testbench

    One module shows all three codings side by side, with a testbench that drives 0, 1, and X through the select.

    x_pessimism.v
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    `timescale 1ns/1ps
    module x_pessimism (
      input wire sel,
      input wire a,
      input wire b,
      output reg y_if,
      output reg y_case,
      output wire y_mux
    );
      always @* begin
        if (sel) y_if = a;
        else y_if = b;
      end
      always @* begin
        // Binary-complete: X/Z retention in simulation does not establish a synthesized latch.
        case (sel)
          1'b0: y_case = b;
          1'b1: y_case = a;
        endcase
      end
      assign y_mux = sel ? a : b;
    endmodule
    

    Each of the four stimulus steps checks all three outputs. Under X with disagreeing inputs, the if/else takes the else branch, the case holds its old value, and the ternary yields X.

    The one-bit case covers both binary values. Its four-state X/Z retention is a simulation semantic, not a physical latch. In contrast, the following snippet leaves sel=0 unassigned, so even a legal binary input requires prior state.

    design.v
    1
    2
    3
    4
    5
    6
    7
    // snippet: genuinely missing binary assignment, unlike the case above.
    always @* begin
      case (sel)
        1'b1: y_incomplete = a;
        // sel=0 has no assignment: storage is required to retain y_incomplete.
      endcase
    end

    Common pitfall

    Treating the if/else result under X as proof the design is safe. The branch choice is a simulation artifact. Hardware with a metastable select can resolve either way.

    Follow-ups

    • Why does the ternary yield X only when the inputs disagree? The operator resolves to the common value when both sides agree. Disagreement with an unknown select leaves no safe choice, so the result is X.

    • How do X sources get found in a large design? Run X-propagation simulation modes, trace each X to reset, init, or power intent, and close them one by one.

    • When is X in simulation acceptable? When the value is provably unreachable, such as a debug bus sampled only in a mode the design never enters. Document the proof rather than relying on optimism.

    Common wrong answers

    • “X means do not care, so it does not matter.” An X in RTL simulation means unknown, not do not care. Silicon resolves it to a real value that the testbench never checked.

    • “Reset everything and the problem is solved.” Full reset costs routing, power, and timing on every flop. Reset what matters and prove the rest unreachable.

    Check yourself The select of an if/else mux is X. Which branch runs in simulation, and what does that prove about the hardware?

    The else branch runs. It proves nothing about the hardware: a metastable select in silicon can resolve either way. The testbench result is optimism, not evidence.

    Check yourself Two flops feed downstream logic but are never reset. Simulation shows no X. Is the design safe?

    Not necessarily. An earlier test sequence may have written them, hiding the unknown. Power-on state in silicon is arbitrary, so an untested reset sequence can still fail.

    Remember

    • X comes from uninitialised flops, incomplete reset, undefined memories and powered-down domains.

    • An X select takes the else branch of an if, holds the old value in a case, and gives X from a ternary with disagreeing inputs.

    • X means unknown, not don't care. Silicon picks a real value the testbench never checked.

    Rule of thumb: close every X at its source: reset it, define it, or clamp it.

    How this was checked

    Three-style bench Run with Icarus Verilog 13.0 (2026-10-16): prints PASS. It drives 0, 1 and X through the select and checks all three outputs at each of four steps. No synthesis result is claimed for either example.

    Keep going

    • Practice: 3-to-8 decoder: unique/priority case and X-propagation

    • Code lab: X-propagation model

    • Interview: run a mock interview on this topic

    Related topics

    • The complete-assignment pattern

    • Mux theory and design patterns

    Previous

    341 / 350

    Next: Why simulation and silicon disagree

    Up next

    Up nextWhy simulation and silicon disagree

    Sign in to save progress

    Practice this lessonReport an error

    See also

    • Capturing an intermittent failure
    • ECO or RTL change