The Sensitivity List
A procedural always block does not execute continuously. The block suspends execution until an event listed in its sensitivity list occurs. The sensitivity list syntax specifies the inferred hardware type: combinational logic, transparent latches, or clocked registers.
Definition of the Sensitivity List
The sensitivity list follows the always keyword inside parentheses prefixed by an @ symbol:
always @(a or b or c) begin
y = a & b & c;
end
The block executes when input a, b, or c transitions. While inputs remain static, the block suspends execution.
The Four Syntactic Trigger Forms
1. Level-Sensitive Trigger: @(signal)
Fires on any logical transition (rising or falling edge). Models combinational logic or transparent latches:
always @(a) begin
y = ~a;
end
2. Positive Edge-Trigger: @(posedge clk)
Fires only when the signal transitions from low to high (0 to 1, 0 to x, or x to 1). Infers a positive edge-triggered D flip-flop:
always @(posedge clk) begin
q <= d;
end
3. Negative Edge-Trigger: @(negedge clk)
Fires only when the signal transitions from high to low (1 to 0). Infers a negative edge-triggered flip-flop. Used in double data rate (DDR) interfaces.
4. Multiple Asynchronous Triggers
Combines clock and reset transitions using keyword or or commas ,:
always @(posedge clk or negedge rst_n) begin
if (!rst_n)
q <= 1'b0;
else
q <= d;
end
Both keyword or and comma separators are valid in IEEE 1364-2001.
Hardware Synthesis Inference Rules
The sensitivity list declares the physical hardware architecture to the synthesis tool (Figure 1):
- Edge Qualifiers Present: The tool infers sequential flip-flops.
- No Edge Qualifiers: The tool infers combinational logic gates. If output variables are not assigned under all conditions, the tool infers transparent latches.
Incomplete Sensitivity Lists in Combinational Logic
A complete combinational block must list every signal read within the procedural body:
`timescale 1ns / 1ps
`default_nettype none
module and_gate (
input wire a,
input wire b,
output reg y
);
always @(a or b) begin
y = a & b;
end
endmodule
If an engineer omits an input from the sensitivity list, simulation diverges from physical hardware:
// Defect: Incomplete sensitivity list
always @(a) begin
y = a & b;
end
The simulator executes this block only when a changes. If b toggles while a remains constant, the simulator does not re-evaluate y. In physical silicon, the AND gate responds immediately to transitions on b. This difference creates a simulation-synthesis mismatch.
Practice Exercise
Identify the trigger type and the inferred hardware for each block header:
always @(posedge clk) begin ... end // Header A
always @(a or b or c or d) begin ... end // Header B
always @(negedge rst_n or posedge clk) begin ... end // Header C
always @(*) begin ... end // Header D
always @(posedge data_in) begin ... end // Header E
Solution
- Header A: Edge-triggered list. Infers a positive edge-triggered flip-flop.
- Header B: Level-sensitive list with four explicit inputs. Infers combinational gates (or latches if assignments are incomplete).
- Header C: Edge-triggered list with asynchronous control. Infers a flip-flop with active-low asynchronous reset.
- Header D: Automatic combinational sensitivity list. Infers combinational logic.
- Header E: Design defect. Clocking a flip-flop directly from a multi-bit data net creates severe clock skew and timing violations.
Manual sensitivity lists require tedious maintenance. The next article examines the wildcard operator @(*), which generates complete combinational sensitivity lists automatically.