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 Half-Cycle Path: Rising to Falling Edge

Verilog Static Timing Analysis

A rising-edge flip-flop feeding a falling-edge flip-flop; the duty cycle sets the time of the path

Open in IDE
design.v
module sta_half (input clk, d, output q);
  reg r1, r2;
  always @(posedge clk)
    r1 <= d;
  always @(negedge clk)
    r2 <= r1;
  assign q = r2;
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 clk -period 2.0 [get_ports clk]
set_input_delay  0.4 -clock clk [get_ports d]
set_output_delay 0.4 -clock clk [get_ports q]

# Exercise: use a 25 percent duty cycle (replace the create_clock line above).
# create_clock -name clk -period 2.0 -waveform {0 0.5} [get_ports clk]
Admin mode — edit and delete controls are visible on each row. Use the IDE to add new snippets via File → Save as Snippet.