# Test clock sense variants (positive, negative, stop), unset_clock_uncertainty, # unset_clock_groups, exception priority and overrides. # Targets: # Sdc.cc: setClockSense (with and without clocks, positive/negative/stop), # clkStopPropagation, clkStopSense, removeClockSense (via unset_clock_sense), # setClockUncertainty, removeClockUncertainty, # unsetInterClockUncertainty, deleteInterClockUncertaintiesReferencing, # removeClockGroups, clockGroupsAreSame, clockGroupMembers, # setClockInsertion/removeClockInsertion, # makeGroupPath (multiple from/to merging) # WriteSdc.cc: writeClockSenses (positive/negative/stop with clocks), # writeClockGroups (logically_exclusive, physically_exclusive, asynchronous), # writeClockUncertainty, writeInterClockUncertainties, # writeClockInsertions, writePropagatedClkPins, # writeExceptions (overriding false_path with multicycle) # ExceptionPath.cc: FalsePath::overrides, MultiCyclePath::overrides, # PathDelay::overrides, intersectsPts, mergeable, # ExceptionFrom::intersectsPts, ExceptionTo::intersectsPts, # ExceptionTo with endTransition (rise/fall) source ../../test/helpers.tcl read_liberty ../../test/nangate45/Nangate45_typ.lib read_verilog sdc_test2.v link_design sdc_test2 # Create clocks create_clock -name clk1 -period 10 [get_ports clk1] create_clock -name clk2 -period 20 [get_ports clk2] create_clock -name vclk -period 5 set_input_delay -clock clk1 2.0 [get_ports in1] set_input_delay -clock clk1 2.0 [get_ports in2] set_input_delay -clock clk2 2.0 [get_ports in3] set_output_delay -clock clk1 3.0 [get_ports out1] set_output_delay -clock clk2 3.0 [get_ports out2] # Clock sense: positive, negative, stop # Positive sense on a pin with specific clock set_clock_sense -positive -clocks [get_clocks clk1] [get_pins buf1/Z] # Negative sense on a pin with specific clock set_clock_sense -negative -clocks [get_clocks clk1] [get_pins inv1/ZN] # Stop sense (should prevent clock propagation) set_clock_sense -stop_propagation -clocks [get_clocks clk2] [get_pins or1/ZN] # Clock sense without -clocks (applies to all clocks on pin) set_clock_sense -positive [get_pins and1/ZN] # Clock sense negative without specific clock set_clock_sense -negative [get_pins nand1/ZN] # Write to exercise writeClockSenses set sdc1 [make_result_file sdc_sense1.sdc] write_sdc -no_timestamp $sdc1 # Overwrite clock sense with a different sense on the same pin # (this exercises the hasKey path in setClockSense) set_clock_sense -negative -clocks [get_clocks clk1] [get_pins buf1/Z] report_checks # Clock uncertainty: set and unset # Simple uncertainty set_clock_uncertainty -setup 0.2 [get_clocks clk1] set_clock_uncertainty -hold 0.1 [get_clocks clk1] set_clock_uncertainty -setup 0.3 [get_clocks clk2] set_clock_uncertainty -hold 0.15 [get_clocks clk2] # Inter-clock uncertainty set_clock_uncertainty -from [get_clocks clk1] -to [get_clocks clk2] -setup 0.35 set_clock_uncertainty -from [get_clocks clk1] -to [get_clocks clk2] -hold 0.18 set_clock_uncertainty -from [get_clocks clk2] -to [get_clocks clk1] -setup 0.32 set_clock_uncertainty -from [get_clocks clk2] -to [get_clocks clk1] -hold 0.16 # Write before unset set sdc2 [make_result_file sdc_sense2.sdc] write_sdc -no_timestamp $sdc2 # Unset simple uncertainty unset_clock_uncertainty -setup [get_clocks clk1] unset_clock_uncertainty -hold [get_clocks clk1] # Unset inter-clock uncertainty unset_clock_uncertainty -from [get_clocks clk1] -to [get_clocks clk2] -setup unset_clock_uncertainty -from [get_clocks clk1] -to [get_clocks clk2] -hold report_checks # Clock insertion (source latency) set_clock_latency -source -early 0.3 [get_clocks clk1] set_clock_latency -source -late 0.5 [get_clocks clk1] set_clock_latency -source -rise -early 0.25 [get_clocks clk1] set_clock_latency -source -fall -late 0.55 [get_clocks clk1] # Remove clock insertion unset_clock_latency -source [get_clocks clk1] # Clock groups: all three types # Asynchronous set_clock_groups -asynchronous -name async1 -group {clk1} -group {clk2} # Unset clock groups unset_clock_groups -asynchronous -name async1 # Logically exclusive set_clock_groups -logically_exclusive -name logic1 -group {clk1} -group {clk2} # Unset unset_clock_groups -logically_exclusive -name logic1 # Physically exclusive set_clock_groups -physically_exclusive -name phys1 -group {clk1} -group {vclk} # Write to exercise writeClockGroups set sdc3 [make_result_file sdc_sense3.sdc] write_sdc -no_timestamp $sdc3 # Unset unset_clock_groups -physically_exclusive -name phys1 # Exception overrides: same from/to with different types # First set a max_delay set_max_delay -from [get_ports in1] -to [get_ports out1] 8.0 # Then override with false_path on same from/to set_false_path -from [get_ports in1] -to [get_ports out1] # False path with rise/fall on to endpoint set_false_path -from [get_ports in2] -rise_to [get_ports out1] set_false_path -from [get_ports in2] -fall_to [get_ports out1] # False path with rise/fall from set_false_path -rise_from [get_ports in3] -to [get_ports out2] set_false_path -fall_from [get_ports in3] -to [get_ports out2] # Multicycle with setup and hold on same path set_multicycle_path -setup 2 -from [get_ports in1] -to [get_ports out2] set_multicycle_path -hold 1 -from [get_ports in1] -to [get_ports out2] # Multicycle between clocks set_multicycle_path -setup 3 -from [get_clocks clk1] -to [get_clocks clk2] set_multicycle_path -hold 2 -from [get_clocks clk1] -to [get_clocks clk2] # Max/min delay with through set_max_delay -from [get_ports in2] -through [get_pins buf1/Z] -to [get_ports out2] 6.0 set_min_delay -from [get_ports in2] -through [get_pins buf1/Z] -to [get_ports out2] 0.5 # Group path with multiple from objects group_path -name grp_multi \ -from [list [get_ports in1] [get_ports in2] [get_clocks clk1]] \ -to [list [get_ports out1] [get_ports out2]] # Write exceptions with all types set sdc4 [make_result_file sdc_sense4.sdc] write_sdc -no_timestamp $sdc4 set sdc5 [make_result_file sdc_sense5.sdc] write_sdc -no_timestamp -compatible $sdc5 # Unset exceptions and re-report unset_path_exceptions -from [get_ports in1] -to [get_ports out1] unset_path_exceptions -from [get_ports in2] -rise_to [get_ports out1] unset_path_exceptions -from [get_ports in2] -fall_to [get_ports out1] report_checks