18. Introduction to Timing Checks
​
Timing checks are system tasks used within specify blocks to verify that timing constraints are met during simulation. They detect violations like setup time violations, hold time violations, and pulse width violations that could cause circuit malfunction in real hardware.
​
Why Timing Checks?
​
-
Verify Timing Constraints: Ensure design meets timing requirements
​
-
Detect Violations: Find setup, hold, width violations early
​
-
Prevent Metastability: Catch conditions that cause unstable states
​
-
Library Characterization: Define cell timing requirements
​
-
STA Correlation: Match static timing analysis results
​
Where Timing Checks are Used
​
-
Inside specify blocks of modules
​
-
Standard cell libraries
​
-
Memory models (SRAM, Register File)
​
-
Sequential elements (Flip-flops, Latches)
​
-
Interface timing verification
​
Timing Check Reporting
​
When a timing violation occurs, simulators report:
​
-
Violation type (setup, hold, width, etc.)
​
-
Time of violation
​
-
Actual vs required timing
​
-
Instance path where violation occurred
​
-
Severity level (error, warning)
Complete Timing Checks Overview
.png)
18.1. $setup - Setup Time Check
​
The setup time is the minimum time that a data signal must be stable BEFORE the active edge of the clock. This ensures the data is properly captured by the flip-flop.
​
Syntax
​
$setup(data_event, reference_event, limit);
$setup(data_event, reference_event, limit, notifier);
​
Parameters
.png)
Industry-Standard Examples
Verilog
Timing Diagram
SETUP TIME VIOLATION:
tsu (Setup Time)
<------>
DATA: ----X======X------
change
CLK: ________|‾‾‾‾‾‾|___
↑
Clock edge
PASS: Data change > tsu before clock
FAIL: Data change < tsu before clock
18.2. $hold - Hold Time Check
The hold time is the minimum time that a data signal must remain stable AFTER the active edge of the clock. This ensures data is not corrupted during capture.
Syntax
$hold(reference_event, data_event, limit);
$hold(reference_event, data_event, limit, notifier);
Industry-Standard Examples
Verilog
Timing Diagram
​
HOLD TIME VIOLATION:
th (Hold Time)
<------>
DATA: ----========X------
change
CLK: ________|‾‾‾‾‾‾|___
↑
Clock edge
PASS: Data change > th after clock
FAIL: Data change < th after clock
18.3. $setuphold - Combined Setup and Hold
​
$setuphold combines setup and hold checks in a single statement, which is more efficient and commonly used in standard cell libraries.
​
Syntax
​
$setuphold(reference_event, data_event, setup_limit, hold_limit);
$setuphold(reference_event, data_event, setup_limit, hold_limit, notifier);
​
Industry-Standard Examples
Verilog
18.4. $width - Pulse Width Check
​
$width checks that a signal's pulse (high or low) meets the minimum width requirement. This is critical for clock signals and control signals.
​
Syntax
​
$width(controlled_reference_event, limit);
$width(controlled_reference_event, limit, threshold, notifier);
​
Width Types
.png)
Industry-Standard Examples
Verilog
Timing Diagram
​
PULSE WIDTH CHECK:
<--- twidth_high --->
CLK: __|‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾|___
↑ ↑
posedge negedge
<--- twidth_low --->
CLK: ‾‾|__________________|‾‾‾
↑ ↑
negedge posedge
