Writing Basic SDC Constraints
A synthesis compiler cannot optimize a digital circuit without explicit timing targets. Without timing constraints, tools apply generic default optimizations that fail to satisfy physical system requirements. Designers specify timing specifications using Synopsys Design Constraints (SDC), the industry-standard Tcl-based constraint format.
Defining Primary Clocks with create_clock
The create_clock command defines the operational clock frequency for synchronous timing analysis:
create_clock -name clk -period 5.0 [get_ports clk]
This command specifies a 5.0 ns period (200 MHz target frequency) applied to input port clk.
By default, the compiler assumes a 50 percent duty cycle (2.5 ns high, 2.5 ns low).
To specify asymmetric clock waveforms, use the -waveform argument:
create_clock -name clk -period 5.0 -waveform {0 2.0} [get_ports clk]
This specifies a clock that remains high for 2.0 ns and low for 3.0 ns (40 percent duty cycle).
Port Boundary Constraints: Input and Output Delays
Internal register-to-register paths run from internal flip-flops to internal flip-flops. However, module boundary ports connect to external circuits. The tool requires boundary specifications to model external delays:
# Upstream logic consumes up to 1.2 ns before data reaches the input port
set_input_delay -clock clk 1.2 [get_ports data_in]
# Downstream capture flip-flops require 1.5 ns of setup margin after output pins
set_output_delay -clock clk 1.5 [get_ports data_out]
Omitting these constraints causes the tool to assume zero external arrival delay and zero external setup requirements. This unrealistic assumption produces false-positive timing reports that fail during chip-level integration.
Standard Minimal SDC Constraint File
A standard constraint file includes clock definitions, boundary delays, and asynchronous exemptions:
# 1. Clock definition: 200 MHz target (5.0 ns period)
create_clock -name clk -period 5.0 [get_ports clk]
# 2. Input delay constraints: model external driving logic
set_input_delay -clock clk 1.0 [get_ports {data_in[*]}]
set_input_delay -clock clk 0.5 [get_ports enable]
# 3. Output delay constraints: model downstream capture logic
set_output_delay -clock clk 1.0 [get_ports {data_out[*]}]
# 4. Asynchronous false paths: exempt asynchronous reset pins from STA checks
set_false_path -from [get_ports rst_n]
The set_false_path command instructs the timing engine to exempt specific pins from synchronous setup and hold checks.
Exempt asynchronous reset signals (rst_n) because their release is managed by dedicated synchronizers (Section 7.5).
Never apply set_false_path to synchronous data lines to conceal timing violations.
Hazards of Unconstrained Synthesis
An unconstrained design produces misleading reports. If a synthesis compiler has no target clock period, it does not prioritize critical paths or evaluate resource sharing trade-offs. A timing report showing zero violations against an empty SDC file provides zero verification value. Always verify SDC constraints before accepting timing reports.
Verification Exercise
A module operates on a 250 MHz clock.
External driving logic delays input signal cmd_in by 0.8 ns after the clock edge.
Downstream circuits require output signal result_out to arrive 1.0 ns before the capturing clock edge.
Write the complete SDC constraint file.
View Solution
Calculate target clock period:
$$T_{clk} = \frac{1}{250\text{ MHz}} = 4.0\text{ ns}$$
Specify the SDC constraints:
# 250 MHz target clock definition
create_clock -name clk -period 4.0 [get_ports clk]
# Boundary delay constraints
set_input_delay -clock clk 0.8 [get_ports cmd_in]
set_output_delay -clock clk 1.0 [get_ports result_out]
Static timing analysis uses these constraints to verify that internal logic paths leave adequate timing margin.
SDC constraints define operating frequencies and boundary delays for synthesis engines. The next article explains how synthesis compilers optimize gate-level structures to satisfy these constraints.