Constraints tell the tool what counts as good enough: the clock target and the electrical limits. The tool then picks cells and structures that meet them.
Constraint | Meaning |
|---|---|
create_clock | Defines the clock and its target period. |
set_input_delay | How late inputs arrive relative to the clock. |
set_output_delay | How early outputs must settle relative to the clock. |
set_max_fanout | The most loads one output may drive. |
set_load | The assumed load on an output pin. |
The same RTL under a relaxed clock target leaves a small slow cover acceptable. The block below is an illustrative sketch, not tool output.
illustrative SDC sketch, not tool output
create_clock -period 10.0 [get_ports clk]
set_input_delay 2.0 -clock clk [all_inputs]
set_output_delay 2.0 -clock clk [all_outputs]A tighter target may push the tool toward faster cells or a more parallel structure. The block below sketches that tighter target, again illustrative.
illustrative SDC sketch, not tool output
create_clock -period 5.0 [get_ports clk]
set_input_delay 1.0 -clock clk [all_inputs]
set_output_delay 1.0 -clock clk [all_outputs]The two runs implement the same function with different cells. Which cover wins varies by tool and library, so no transform always helps.
The program below prices a netlist from cell counts at course.lib areas. Its three self-checks repeat the hand arithmetic style of this topic.
import sys
AREA = {"NAND2": 2, "INV": 1, "DFF": 8}
def design_area(counts):
total = 0
for cell in counts:
total += counts[cell] * AREA[cell]
return total
checks = [
(design_area({"NAND2": 5, "INV": 2, "DFF": 1}), 20),
(design_area({"NAND2": 1}), 2),
(design_area({"DFF": 2, "INV": 3}), 19),
]
for i in range(len(checks)):
got, want = checks[i]
if got != want:
print("FAIL: check " + str(i + 1) + " got " + str(got) + " want " + str(want))
sys.exit(1)
print("PASS: area model matches hand arithmetic on 3 checks")A tighter target may accept a larger area for more speed. The model prices that trade by counting cells, never by guessing.
The constraints and the cell library. Either steers mapping, so either can change the result.
19 library units: 2 x 8 + 3 x 1. The program checks exactly this case.