2026-02-13 11:19:09 +01:00
|
|
|
# Test Sta.cc and WorstSlack.cc uncovered code paths:
|
|
|
|
|
# - Sta::worstSlack(MinMax) single-arg form
|
|
|
|
|
# - WorstSlack queue-related operations
|
|
|
|
|
# - Sta::checkFanout on specific pin
|
|
|
|
|
# - report_tns, report_wns with corner variants
|
|
|
|
|
# - Sta::findDelays level form
|
|
|
|
|
# - various report_checks combos that exercise uncovered lines
|
|
|
|
|
# Covers: Sta.cc worstSlack, checkFanout, WorstSlack.cc
|
|
|
|
|
read_liberty ../../test/nangate45/Nangate45_typ.lib
|
|
|
|
|
read_verilog search_test1.v
|
|
|
|
|
link_design search_test1
|
|
|
|
|
|
|
|
|
|
create_clock -name clk -period 10 [get_ports clk]
|
|
|
|
|
set_input_delay -clock clk 1.0 [get_ports in1]
|
|
|
|
|
set_input_delay -clock clk 1.0 [get_ports in2]
|
|
|
|
|
set_output_delay -clock clk 2.0 [get_ports out1]
|
|
|
|
|
|
|
|
|
|
# Force timing
|
|
|
|
|
report_checks > /dev/null
|
|
|
|
|
|
|
|
|
|
puts "--- worst_slack max ---"
|
|
|
|
|
set ws_max [sta::worst_slack_cmd max]
|
|
|
|
|
puts "worst_slack max: $ws_max"
|
|
|
|
|
|
|
|
|
|
puts "--- worst_slack min ---"
|
|
|
|
|
set ws_min [sta::worst_slack_cmd min]
|
|
|
|
|
puts "worst_slack min: $ws_min"
|
|
|
|
|
|
|
|
|
|
puts "--- total_negative_slack ---"
|
|
|
|
|
set tns_max [sta::total_negative_slack_cmd max]
|
|
|
|
|
puts "tns max: $tns_max"
|
|
|
|
|
set tns_min [sta::total_negative_slack_cmd min]
|
|
|
|
|
puts "tns min: $tns_min"
|
|
|
|
|
|
|
|
|
|
puts "--- total_negative_slack_corner ---"
|
2026-02-23 15:05:29 +01:00
|
|
|
set corner [sta::cmd_scene]
|
|
|
|
|
set tns_corner [sta::total_negative_slack_scene_cmd $corner max]
|
2026-02-13 11:19:09 +01:00
|
|
|
puts "tns corner max: $tns_corner"
|
2026-02-23 15:05:29 +01:00
|
|
|
set tns_corner_min [sta::total_negative_slack_scene_cmd $corner min]
|
2026-02-13 11:19:09 +01:00
|
|
|
puts "tns corner min: $tns_corner_min"
|
|
|
|
|
|
2026-02-23 15:05:29 +01:00
|
|
|
puts "--- worst_slack_scene ---"
|
|
|
|
|
set ws_corner_max [sta::worst_slack_scene $corner max]
|
2026-02-13 11:19:09 +01:00
|
|
|
puts "worst_slack corner max: $ws_corner_max"
|
2026-02-23 15:05:29 +01:00
|
|
|
set ws_corner_min [sta::worst_slack_scene $corner min]
|
2026-02-13 11:19:09 +01:00
|
|
|
puts "worst_slack corner min: $ws_corner_min"
|
|
|
|
|
|
|
|
|
|
puts "--- report_tns ---"
|
|
|
|
|
report_tns
|
|
|
|
|
report_tns -min
|
|
|
|
|
report_tns -max
|
|
|
|
|
|
|
|
|
|
puts "--- report_wns ---"
|
|
|
|
|
report_wns
|
|
|
|
|
report_wns -min
|
|
|
|
|
report_wns -max
|
|
|
|
|
|
|
|
|
|
puts "--- report_worst_slack ---"
|
|
|
|
|
report_worst_slack -min
|
|
|
|
|
report_worst_slack -max
|
|
|
|
|
|
|
|
|
|
puts "--- worst_slack_vertex ---"
|
|
|
|
|
set wv_max [sta::worst_slack_vertex max]
|
|
|
|
|
if { $wv_max != "NULL" } {
|
|
|
|
|
puts "worst_slack_vertex max pin: [get_full_name [$wv_max pin]]"
|
2026-02-23 15:05:29 +01:00
|
|
|
# TODO: Vertex is_clock and has_downstream_clk_pin removed from SWIG
|
|
|
|
|
puts " is_clock: skipped (API removed)"
|
|
|
|
|
puts " has_downstream_clk_pin: skipped (API removed)"
|
2026-02-13 11:19:09 +01:00
|
|
|
}
|
|
|
|
|
set wv_min [sta::worst_slack_vertex min]
|
|
|
|
|
if { $wv_min != "NULL" } {
|
|
|
|
|
puts "worst_slack_vertex min pin: [get_full_name [$wv_min pin]]"
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
puts "--- vertex_worst_arrival_path ---"
|
|
|
|
|
if { $wv_max != "NULL" } {
|
2026-02-20 05:05:07 +01:00
|
|
|
set warr [sta::vertex_worst_arrival_path $wv_max max]
|
|
|
|
|
if { $warr != "NULL" } {
|
|
|
|
|
puts "worst_arrival_path pin: [get_full_name [$warr pin]]"
|
|
|
|
|
puts "worst_arrival_path arrival: [$warr arrival]"
|
2026-02-13 11:19:09 +01:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
puts "--- vertex_worst_slack_path ---"
|
|
|
|
|
if { $wv_max != "NULL" } {
|
2026-02-20 05:05:07 +01:00
|
|
|
set wslk [sta::vertex_worst_slack_path $wv_max max]
|
|
|
|
|
if { $wslk != "NULL" } {
|
|
|
|
|
puts "worst_slack_path pin: [get_full_name [$wslk pin]]"
|
|
|
|
|
puts "worst_slack_path slack: [$wslk slack]"
|
2026-02-13 11:19:09 +01:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
puts "--- checkFanout (report_check_types -max_fanout) ---"
|
|
|
|
|
set_max_fanout 2 [current_design]
|
|
|
|
|
report_check_types -max_fanout
|
|
|
|
|
report_check_types -max_fanout -verbose
|
|
|
|
|
report_check_types -max_fanout -violators
|
|
|
|
|
|
|
|
|
|
puts "--- checkCapacitance ---"
|
|
|
|
|
set_max_capacitance 0.001 [current_design]
|
|
|
|
|
report_check_types -max_capacitance
|
|
|
|
|
report_check_types -max_capacitance -verbose
|
|
|
|
|
|
|
|
|
|
puts "--- checkSlew ---"
|
|
|
|
|
set_max_transition 0.1 [current_design]
|
|
|
|
|
report_check_types -max_slew
|
|
|
|
|
report_check_types -max_slew -verbose
|
|
|
|
|
|
|
|
|
|
puts "--- report_checks with various sorting ---"
|
|
|
|
|
report_checks -sort_by_slack -format end
|
|
|
|
|
report_checks -sort_by_slack -format slack_only
|
|
|
|
|
report_checks -sort_by_slack -format summary
|
|
|
|
|
|
|
|
|
|
puts "--- report_checks multi-path ---"
|
2026-02-23 15:05:29 +01:00
|
|
|
report_checks -path_delay max -endpoint_count 5 -group_path_count 5
|
|
|
|
|
report_checks -path_delay min -endpoint_count 5 -group_path_count 5
|
2026-02-13 11:19:09 +01:00
|
|
|
|
|
|
|
|
puts "--- report_checks unique_paths_to_endpoint ---"
|
2026-02-23 15:05:29 +01:00
|
|
|
report_checks -path_delay max -endpoint_count 3 -unique_paths_to_endpoint
|
2026-02-13 11:19:09 +01:00
|
|
|
|
|
|
|
|
puts "--- report_path_end with prev_end ---"
|
test: Fix post-merge build errors and regolden .ok files
After merging upstream changes, fix all build errors in C++ test files
and regolden Tcl test golden files to match updated code output.
Build fixes:
- dcalc/test/cpp/TestDcalc.cc: Fix const char* loop iterations, use
EXPECT_NEAR for uninitialized subnormal float comparison
- liberty/test/cpp/TestLibertyStaBasicsB.cc: Wrap tests using removed
LibertyBuilder() default constructor in #if 0
- liberty/test/cpp/TestLibertyStaCallbacks.cc: Fix LibertyBuilder()
call to use sta_->debug()/report(); wrap old visitor tests in #if 0
- search/test/cpp/TestSearchStaDesignB.cc: Fix pg->name() nullptr
comparison (now returns std::string&)
- search/test/cpp/TestSearchStaInit.cc: Fix 5 clkPinsInvalid/isIdealClock
tests to expect throw (API now requires linked network)
Tcl test fixes:
- Remove calls to removed APIs: report_path_end_header/footer, report_path_end2
from 6 search test scripts; regolden their .ok files
- Regolden .ok files for liberty (15), graph (1), network (8),
parasitics (3), sdc (3), util (2), verilog (8) modules to reflect
upstream format changes (timing arcs output, pin ordering, spacing)
All 6103 tests now pass.
Signed-off-by: Jaehyun Kim <jhkim@precisioninno.com>
2026-03-11 09:11:08 +01:00
|
|
|
# report_path_end2 removed from API
|
2026-02-13 11:19:09 +01:00
|
|
|
|
|
|
|
|
puts "--- path group names ---"
|
|
|
|
|
set groups [sta::path_group_names]
|
|
|
|
|
puts "path groups: $groups"
|
|
|
|
|
|
|
|
|
|
puts "--- report_checks with -corner ---"
|
2026-02-23 15:05:29 +01:00
|
|
|
set corner [sta::cmd_scene]
|
|
|
|
|
report_checks -path_delay max -corner $corner
|
|
|
|
|
report_checks -path_delay min -corner $corner
|
2026-02-13 11:19:09 +01:00
|
|
|
|
|
|
|
|
puts "--- design_power ---"
|
2026-02-23 15:05:29 +01:00
|
|
|
set pwr [sta::design_power [sta::cmd_scene]]
|
2026-02-20 07:32:08 +01:00
|
|
|
puts "design_power: $pwr"
|
2026-02-13 11:19:09 +01:00
|
|
|
|
|
|
|
|
puts "--- set_report_path_field_properties ---"
|
2026-02-20 05:05:07 +01:00
|
|
|
sta::set_report_path_field_properties "delay" "Dly" 10 0
|
2026-02-13 11:19:09 +01:00
|
|
|
report_checks -path_delay max > /dev/null
|
2026-02-20 05:05:07 +01:00
|
|
|
sta::set_report_path_field_width "delay" 12
|
2026-02-13 11:19:09 +01:00
|
|
|
report_checks -path_delay max > /dev/null
|
|
|
|
|
|
|
|
|
|
puts "--- set_report_path_sigmas ---"
|
2026-02-20 05:05:07 +01:00
|
|
|
sta::set_report_path_sigmas 1
|
2026-02-13 11:19:09 +01:00
|
|
|
report_checks -path_delay max > /dev/null
|
2026-02-20 05:05:07 +01:00
|
|
|
sta::set_report_path_sigmas 0
|
2026-02-13 11:19:09 +01:00
|
|
|
|
|
|
|
|
puts "--- set_report_path_no_split ---"
|
|
|
|
|
sta::set_report_path_no_split 1
|
|
|
|
|
report_checks -path_delay max > /dev/null
|
|
|
|
|
sta::set_report_path_no_split 0
|
|
|
|
|
|
|
|
|
|
puts "--- graph loops ---"
|
|
|
|
|
|
|
|
|
|
puts "--- pocv ---"
|
2026-02-20 05:05:07 +01:00
|
|
|
puts "pocv_enabled: [sta::pocv_enabled]"
|
2026-02-13 11:19:09 +01:00
|
|
|
|
|
|
|
|
puts "--- report_annotated_delay ---"
|
2026-02-20 05:05:07 +01:00
|
|
|
report_annotated_delay
|
2026-02-13 11:19:09 +01:00
|
|
|
|
|
|
|
|
puts "--- report_annotated_check ---"
|
2026-02-20 05:05:07 +01:00
|
|
|
report_annotated_check
|