X-propagation is the way an unknown value, written as X in Verilog and SystemVerilog, spreads from its source through the logic of a design during simulation. The danger is that RTL simulation handles X inconsistently: some constructs hide an X and turn it into a clean 0 or 1 (X-optimism), while others turn known values into X (X-pessimism). Optimism can hide real bugs until silicon, and pessimism wastes debug time on failures that real hardware would never show. The cure is to limit where X values can come from, write RTL that does not swallow them, and check for them with assertions, X-propagation simulation modes and formal tools.
Key takeaways
- X means "unknown in simulation". Real hardware always holds a 0 or a 1 (or is metastable for a while); it never holds an X.
- Main X sources: flops and memories without reset or initialisation, undriven or multiply-driven nets, powered-down domains, timing check violations in gate-level simulation, and explicit X assignments.
- In Verilog RTL,
iftreats an X condition as false andcaseskips every item when the select is X. Both are optimistic. - Gate-level logic is pessimistic: a mux built from AND and OR gates outputs X when the select is X, even when both data inputs are equal.
- Defend in layers: reset what matters, isolate powered-down outputs, add X assertions on control signals, run simulator X-propagation modes and formal X checks, and keep some gate-level simulation.
What is X-propagation?
X-propagation refers to unknown or uncertain values (represented by X in hardware description languages such as Verilog) spreading through a digital design and affecting its behaviour. X values can arise from various sources, such as uninitialised signals, power gating, reset logic, timing violations, or differences between simulation and synthesis semantics. X-propagation can cause problems in design verification, synthesis and silicon testing, as it can mask or introduce bugs, make coverage results misleading, or lead to simulation results that do not match the hardware.
Verilog uses four values: 0, 1, X (unknown) and Z (high impedance). A Z that reaches a gate input is read as X. The simulator has to decide, for every operator and statement, what an X input produces at the output. Those decisions are defined by the language standard (IEEE 1364 for Verilog, IEEE 1800 for SystemVerilog), and they are not always the same as what a gate would do.
What are the sources of X values?
Uninitialised storage and undriven nets
X values have existed in logic design forever, and are commonly used to represent the state of uninitialised signals, such as nets that are not driven, or storage elements that have no reset. For example, a flip-flop without a set or reset pin will have an X output until it receives a valid input and a clock edge. Similarly, a memory location that has not been initialised will read as X until it is written. Two drivers fighting on the same net with opposite values also resolve to X.
Power gating
Another source of X values is power gating, a technique to save energy by switching off parts of the circuit that are not in use. When a logic block is powered down, its outputs no longer give a reliable value to downstream logic, which may not have been designed to cope. Power-aware simulation with an IEEE 1801 (UPF) power intent file models this by corrupting the outputs of the off domain to X. Isolation cells clamp those outputs to a known value, and retention registers keep chosen state through the off period. A missing isolation cell shows up in simulation as X spreading out of the off domain.
Reset logic
Reset logic is another potential cause of X values, especially if it is weak or incomplete. Reset logic brings the system to a known state after power-up or after an error. However, reset costs area and routing, so it is common not to reset every flop, especially in datapaths. That is fine as long as the unreset flops are always written before they are used. Logic that has been designed with uninitialised memories and a weak reset strategy is prone to bugs that X-propagation can hide.
Timing violations
Timing violations can also generate X values in simulation. A timing violation occurs when a signal does not meet the setup or hold requirement of a flip-flop or a latch, which on silicon can make it metastable: the output may sit between logic levels or settle late, to either value. In gate-level simulation, cell models with timing checks usually drive the flop output to X when a check fails. On silicon, the final value depends on factors such as noise, temperature and process variation.
Simulation and synthesis semantics
The last source is the difference between how simulators and synthesis tools interpret X. For synthesis, an X assignment is a don't care, so the tool may implement it as 0 or 1, whichever needs less logic. For simulation, X is an unknown, and how it travels depends on the operator. For a basic gate the rule is simple: if any input has the controlling value, the output is known. For a NOR gate the controlling value is 1, so a NOR with one X input and another input at 1 gives 0. Only when all the other inputs are 0 (non-controlling) does the X reach the output. Behavioural constructs such as if and case follow different rules, described below, and that is where most simulation and silicon mismatches come from.
| Construct | Behaviour with an X input in RTL simulation | Effect |
|---|---|---|
if (cond) | X condition is treated as false, else branch runs | Optimistic |
case (sel) | X select matches no item (unless an item is written with X); default runs if present, otherwise nothing is assigned | Optimistic |
sel ? a : b | Result is a bitwise merge: bits where a and b agree are known, others are X | Close to real hardware |
| AND, OR, NAND, NOR gates | Known output if any input is controlling, else X | Accurate per gate |
| Gate-level mux, reconvergent logic | X when select is X, even if both data inputs are equal | Pessimistic |
Arithmetic (+, *, compare) | Any X bit makes the whole result X | Pessimistic |
What is the impact of X-propagation?
X-propagation can have negative effects on several parts of the design flow, such as verification, synthesis and testing.
Verification: X-propagation can reduce the quality of verification by hiding or creating bugs. If an X value is turned into a known value by optimistic simulation code (such as if-else or case statements), it may mask a bug that would otherwise be detected. If an X value is propagated pessimistically (such as when signals reconverge in gate-level logic), it may create false failures that would not occur on silicon. Coverage can also mislead: a branch may be counted as hit because an X condition sent simulation down the else branch, not because the stimulus reached it.
Synthesis: X-propagation can lead to mismatches between RTL simulation and the synthesised netlist. If an X is used as a don't care for optimisation (such as a default X assignment in a case statement), the gates may do something the RTL simulation never showed. If a powered-down output is left without isolation, the netlist passes a floating or undefined value to live logic, which can cause glitches, leakage current or wrong behaviour on silicon.
Testing: X-propagation can lead to non-deterministic behaviour on silicon. If uninitialised state or metastability (for example in reset synchronisation) reaches control logic, the outcome can depend on noise, temperature or process variation. In manufacturing test, unknown values reaching scan cells have to be masked, which reduces coverage. This makes testing and debug harder and less reliable.
Why is X-propagation important for VLSI verification?
X-propagation causes problems for VLSI verification in two ways: X-optimism and X-pessimism.
X-optimism
X-optimism is when a simulator produces a known value at an output that should be unknown. This can hide functional bugs in the RTL that only show up in gate-level simulation or in hardware. Consider this if-else code:
// if-else conditionals
reg out_1;
always @(*) begin
if (condition)
out_1 = 1'b1;
else
out_1 = 1'b0;
end
If condition is X, then out_1 should also be X, but the simulator treats the X condition as false and assigns 0, which may not match the hardware.
A case statement is optimistic too. The multiplexer below is sometimes given as an example of pessimism, but it is the opposite:
// multiplexer
reg out_2;
always @(*) begin
case (sel)
2'b00: out_2 = in_0;
2'b01: out_2 = in_1;
2'b10: out_2 = in_2;
2'b11: out_2 = in_3;
endcase
end
Case items are compared with the case equality rules, in which X only matches X. When sel is 2'bxx no item matches, there is no default, and out_2 simply keeps its previous value. The simulator does not produce X. Real hardware would output one of the four inputs, and which one is unknown. So the RTL shows a stable, believable value where the honest answer is "unknown". Adding default: out_2 = 1'bx; makes the X visible in simulation; synthesis treats it as a don't care.
X-pessimism
X-pessimism is when a simulator produces an unknown value at an output that would be known in hardware. This causes false failures and wasted debug. The classic example is a mux written as gates:
assign y_gate = (a & s) | (b & ~s);
With a = b = 1 the output is 1 in hardware whatever s is. In simulation, with s = X, both AND terms are X and X | X is X. Gate-level netlists are full of such structures, which is why gate-level simulation often shows X that RTL never did, typically from unreset flops whose outputs reconverge. The conditional operator s ? a : b handles the same case better, because it merges a and b bit by bit and returns 1.
A runnable demonstration
The module below puts these cases side by side. It was compiled and run with Icarus Verilog 12.0.
// X-optimism and X-pessimism demo
module xprop_demo;
reg condition;
reg [1:0] sel;
reg in_0, in_1, in_2, in_3;
reg a, b, s;
reg out_1, out_2, out_3;
wire y_gate, y_tern;
// 1. if-else: X on the condition takes the else branch
always @(*) begin
if (condition)
out_1 = 1'b1;
else
out_1 = 1'b0;
end
// 2. case with no default: X on sel matches no item, out_2 keeps its old value
always @(*) begin
case (sel)
2'b00: out_2 = in_0;
2'b01: out_2 = in_1;
2'b10: out_2 = in_2;
2'b11: out_2 = in_3;
endcase
end
// 3. case with an X-aware default
always @(*) begin
case (sel)
2'b00: out_3 = in_0;
2'b01: out_3 = in_1;
2'b10: out_3 = in_2;
2'b11: out_3 = in_3;
default: out_3 = 1'bx;
endcase
end
// 4. gate-level mux: pessimistic when a == b and s is X
assign y_gate = (a & s) | (b & ~s);
// 5. conditional operator: merges a and b bit by bit when s is X
assign y_tern = s ? a : b;
initial begin
in_0 = 1; in_1 = 0; in_2 = 1; in_3 = 0;
condition = 1'b1; sel = 2'b01; a = 1; b = 1; s = 0;
#1 $display("known : out_1=%b out_2=%b out_3=%b y_gate=%b y_tern=%b",
out_1, out_2, out_3, y_gate, y_tern);
condition = 1'bx; sel = 2'bxx; s = 1'bx;
#1 $display("X in : out_1=%b out_2=%b out_3=%b y_gate=%b y_tern=%b",
out_1, out_2, out_3, y_gate, y_tern);
$finish;
end
endmodule
Simulator output:
known : out_1=1 out_2=0 out_3=0 y_gate=1 y_tern=1
X in : out_1=0 out_2=0 out_3=x y_gate=x y_tern=1
Read the second line. out_1 became 0 (if-else optimism). out_2 kept its old value 0 (case optimism). out_3, with an X default, shows the X honestly. y_gate is X although hardware would give 1 (pessimism), and y_tern is 1, which matches hardware.
What are the best practices to avoid and detect X-propagation?
No single technique is enough. The practices below are grouped by where in the flow they apply.
In RTL design
- Use resettable flops for all control state: state machines, valid bits, counters, enables. Datapath flops without reset are acceptable if they are always written before they are read.
- Initialise memories, or make sure every read is qualified by a valid bit that is reset.
- Use robust reset logic, with synchronised reset release, and make sure it covers all critical parts of the design.
- Use proper power gating techniques: isolation on every output of a switchable domain, retention where state must survive, and power-aware simulation with the UPF file.
- Follow coding guidelines that avoid X-optimism and X-pessimism: give every case a default (an X default for don't care, or a safe value), avoid
casex, usecasezcarefully, and prefer the conditional operator for simple muxes. - Avoid timing violations and make sure signals meet setup and hold requirements; use proper synchronisers for clock domain crossings.
In simulation
- Add X checks on control signals, valid bits and handshakes. In SystemVerilog, an assertion such as
assert property (@(posedge clk) disable iff (!rst_n) !$isunknown(sel));does this. A Verilog-2005 version is shown below. - Use the X-propagation simulation modes of commercial simulators. They change how
ifandcasehandle X: the tool evaluates every branch the X could select and merges the results, so an X select produces X only on the bits where the branches disagree. This removes most RTL optimism without the pessimism of gate-level simulation. - Use randomisation of uninitialised state (where the simulator supports it) to check that the design does not depend on the power-up values of unreset flops.
- Run gate-level simulation with timing on a selected set of tests, to catch what RTL cannot: reset and initialisation sequences, synchroniser behaviour and synthesis of don't cares.
// Simple X checker for a select bus (Verilog-2005)
module xcheck (input wire clk, input wire rst_n, input wire [1:0] sel);
always @(posedge clk) begin
// Reduction XOR returns X if any bit of sel is X or Z
if (rst_n && (^sel === 1'bx))
$display("ERROR t=%0t: sel is unknown (%b)", $time, sel);
end
endmodule
module xcheck_tb;
reg clk = 0, rst_n = 0;
reg [1:0] sel;
xcheck u (.clk(clk), .rst_n(rst_n), .sel(sel));
always #5 clk = ~clk;
initial begin
#12 rst_n = 1; sel = 2'b01;
#10 sel = 2'b1x;
#10 sel = 2'b10;
#10 $finish;
end
endmodule
Icarus Verilog 12.0 prints one error for this test, at the clock edge where sel is 2'b1x. The trick is the reduction XOR: ^sel returns X if any bit is X or Z, and the case equality operator === can compare against X directly.
With formal and static tools
- Use formal X-propagation checks to prove that X values from unreset flops, memories or powered-down domains cannot reach outputs or critical control logic, and to make sure illegal states are unreachable.
- Use lint and reset-domain checks to report undriven nets, multiple drivers, missing defaults and flops that miss reset.
- Use equivalence checking between RTL and netlist, with care around X assignments, to find where synthesis made a don't-care choice the RTL did not show.
- Use X-analysis and tracing features of the debug tools to follow an X back to its source on a failing test.
Common mistakes
- Believing a clean RTL simulation means no X problems. Optimistic constructs can hide every X.
- Resetting everything "to be safe". It costs area and routing, and hides real sequencing bugs that a targeted X check would expose.
- Using
casex, which treats X on the select as a wildcard and matches the wrong item. - Filtering X out of gate-level simulation by forcing flops to 0, which removes the very check the run was meant to do.
- Forgetting that a Z that reaches logic becomes X.
FAQ
Does X exist in real silicon?
No. Every node in silicon has a voltage, which logic reads as 0 or 1, possibly after a period of metastability. X is a simulation concept meaning "the model does not know which".
Is X-optimism or X-pessimism worse?
Optimism is usually worse because it hides bugs that reach silicon. Pessimism costs debug time, but the failures are visible.
Should I write default: x in case statements?
For outputs that are truly don't care in unused states, an X default lets synthesis optimise and makes the X visible in simulation. For safety-related or control logic, a safe known default is often preferred. Pick a rule per block and apply it consistently.
Can formal verification replace X-propagation simulation?
Formal X checks are exhaustive for the logic and properties they cover, but they have capacity limits on large designs. Most teams use formal on control logic and resets, and simulator X-propagation modes for full-chip regressions.
Summary
X-propagation is a common and challenging issue in digital design, because it can affect verification, synthesis and test results. X values arise from uninitialised storage, power gating, weak reset logic, timing violations and the gap between simulation and synthesis semantics. To avoid or contain it, use resettable flops for control state, proper power gating with isolation, robust reset logic, X-aware coding, X assertions, simulator X-propagation modes, formal X checks and targeted gate-level simulation.
Additional resources
- X-propagation in SOC design flow (Karthik Vippala, YouTube)
- Formal X-Propagation Verification (FXP) with VC Formal (Synopsys, YouTube)
- X-Verification: what happens when unknown values propagate through a design (Lisa Piper, Real Intent, YouTube)



Your comments will be moderated before it appears here.