Ready-to-run snippets

Code Examples

Ready-to-run Verilog, SystemVerilog, and UVM examples. Click any to open it live in the IDE.

← All examples

STA Two Clocks: Clock Groups

Verilog Static Timing Analysis

A path from a 2.0 ns clock to a 3.0 ns clock, and what an asynchronous clock group removes

Open in IDE
design.v
module sta_cdc (input clka, clkb, d, output q);
  reg ra, rb;
  always @(posedge clka) ra <= d;
  always @(posedge clkb) rb <= ra;
  assign q = rb;
endmodule
constraints.sdc
# Run synthesis first, then STA. With PRO you can edit this file and run STA again without synthesis,
# and pick another library and corner in the drop-down.
create_clock -name clka -period 2.0 [get_ports clka]
create_clock -name clkb -period 3.0 [get_ports clkb]
set_input_delay  0.4 -clock clka [get_ports d]
set_output_delay 0.4 -clock clkb [get_ports q]

# Exercise: declare the clocks unrelated and watch the path from ra to rb disappear.
# set_clock_groups -asynchronous -group clka -group clkb
Admin mode — edit and delete controls are visible on each row. Use the IDE to add new snippets via File → Save as Snippet.