test: remove empty if-bodies and meaningless status prints

Negate conditions in empty if-body assertions so the FAIL message
is printed directly (e.g. `if { $x != 0 } { } else { puts FAIL }`
becomes `if { $x == 0 } { puts FAIL }`).  Remove dead if/else blocks
where both branches were empty, strip meaningless status-only puts
from Tcl tests and their .ok golden files, and wrap a long line in
search_report_gated_datacheck.tcl to stay within 80 columns.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Jaehyun Kim <jhkim@precisioninno.com>
This commit is contained in:
Jaehyun Kim 2026-02-22 23:43:31 +09:00
parent a58d7e4cc6
commit e0f47a92f4
18 changed files with 30 additions and 95 deletions

View File

@ -23,14 +23,12 @@ set lib [sta::find_liberty NangateOpenCellLibrary]
# Operating conditions queries
############################################################
set op_cond [$lib find_operating_conditions typical]
if { $op_cond != "NULL" } {
} else {
if { $op_cond == "NULL" } {
puts "INFO: no operating_conditions named typical"
}
set def_op [$lib default_operating_conditions]
if { $def_op != "NULL" } {
} else {
if { $def_op == "NULL" } {
puts "INFO: no default operating conditions"
}
@ -143,14 +141,12 @@ $port_iter2 finish
# Exercises: findWireload, findWireloadSelection
############################################################
set wl [$lib find_wireload "1K_hvratio_1_1"]
if { $wl != "NULL" } {
} else {
if { $wl == "NULL" } {
puts "INFO: wireload not found"
}
set wls [$lib find_wireload_selection "WireloadSelection"]
if { $wls != "NULL" } {
} else {
if { $wls == "NULL" } {
puts "INFO: wireload selection not found"
}
@ -162,14 +158,12 @@ read_liberty ../../test/sky130hd/sky130hd_tt.lib
set sky_lib [sta::find_liberty sky130_fd_sc_hd__tt_025C_1v80]
set sky_op [$sky_lib find_operating_conditions "tt_025C_1v80"]
if { $sky_op != "NULL" } {
} else {
if { $sky_op == "NULL" } {
puts "INFO: sky130 no named operating conditions"
}
set sky_def_op [$sky_lib default_operating_conditions]
if { $sky_def_op != "NULL" } {
} else {
if { $sky_def_op == "NULL" } {
puts "INFO: sky130 no default operating conditions"
}

View File

@ -18,9 +18,6 @@ puts "sdfxtp_1 area = $sdf_area"
# Check test_cell exists
set tc [$sdf_cell test_cell]
if {$tc != "NULL" && $tc ne ""} {
} else {
}
# Query scan ports
foreach port_name {SCD SCE CLK D Q} {

View File

@ -13,29 +13,25 @@ puts "current_design: $design"
puts "--- make_net new_net1 ---"
set new_net [make_net new_net1]
if { $new_net != 0 } {
} else {
if { $new_net == 0 } {
puts "FAIL: make_net returned 0"
}
puts "--- verify new net exists ---"
set found_net [get_nets new_net1]
if { [llength $found_net] > 0 } {
} else {
if { [llength $found_net] <= 0 } {
puts "FAIL: new_net1 not found"
}
puts "--- make_instance new_buf BUF_X1 ---"
set new_inst [make_instance new_buf NangateOpenCellLibrary/BUF_X1]
if { $new_inst != 0 } {
} else {
if { $new_inst == 0 } {
puts "FAIL: make_instance returned 0"
}
puts "--- verify new instance exists ---"
set found_inst [get_cells new_buf]
if { [llength $found_inst] > 0 } {
} else {
if { [llength $found_inst] <= 0 } {
puts "FAIL: new_buf not found"
}

View File

@ -35,16 +35,10 @@ if { $ng_lib != "NULL" } {
}
set ng_fast [sta::find_liberty NangateOpenCellLibrary_fast]
if { $ng_fast != "NULL" } {
}
set sky_lib [sta::find_liberty sky130_fd_sc_hd__tt_025C_1v80]
if { $sky_lib != "NULL" } {
}
set ihp_lib [sta::find_liberty sg13g2_stdcell_typ_1p20V_25C]
if { $ihp_lib != "NULL" } {
}
# Liberty library iterator
set lib_iter [sta::liberty_library_iterator]

View File

@ -1410,7 +1410,6 @@ Path Type: min
0.08 slack (MET)
data_check applied
--- find_timing_paths with data check ---
Found 10 paths with data check
is_data_check: 1 pin=reg2/D role=data check setup

View File

@ -76,8 +76,6 @@ set_data_check -from [get_pins reg1/CK] -to [get_pins reg2/D] -setup 0.2
set_data_check -from [get_pins reg1/CK] -to [get_pins reg2/D] -hold 0.1
report_checks -path_delay max -format full_clock_expanded
report_checks -path_delay min -format full_clock_expanded
puts "data_check applied"
puts "--- find_timing_paths with data check ---"
set paths_dc [find_timing_paths -path_delay max -endpoint_path_count 10]
puts "Found [llength $paths_dc] paths with data check"

View File

@ -27,7 +27,6 @@ puts "--- min_period_check_slack ---"
set min_period_slack_check [sta::min_period_check_slack]
if { $min_period_slack_check != "NULL" } {
sta::report_min_period_check $min_period_slack_check 1
puts "Min period slack check reported"
}
puts "--- report_min_period_checks ---"

View File

@ -5,10 +5,7 @@
--- min_period_check_slack short ---
--- min_period_violations short/verbose ---
Min period violations count: 1
Violations short report done
Violations verbose report done
--- max_skew_check_slack ---
No max skew check found (expected for Nangate45)
--- max_skew_violations ---
Max skew violations count: 1
--- report_check_types -max_skew (short) ---

View File

@ -36,10 +36,8 @@ if { $min_check != "NULL" } {
# Short report (verbose=0) triggers reportCheck(check, false)
# which calls reportPeriodHeaderShort + reportShort
sta::report_min_period_check $min_check 0
puts "Min period short report done"
# Verbose report (verbose=1)
sta::report_min_period_check $min_check 1
puts "Min period verbose report done"
}
puts "--- min_period_violations short/verbose ---"
@ -48,10 +46,8 @@ puts "Min period violations count: [llength $viols]"
if { [llength $viols] > 0 } {
# Short report: triggers reportChecks(checks, false)
sta::report_min_period_checks $viols 0
puts "Violations short report done"
# Verbose report: triggers reportChecks(checks, true)
sta::report_min_period_checks $viols 1
puts "Violations verbose report done"
}
puts "--- max_skew_check_slack ---"
@ -60,8 +56,6 @@ if { $max_skew_slack != "NULL" } {
sta::report_max_skew_check $max_skew_slack 0
sta::report_max_skew_check $max_skew_slack 1
puts "Max skew check reported"
} else {
puts "No max skew check found (expected for Nangate45)"
}
puts "--- max_skew_violations ---"

View File

@ -1439,7 +1439,6 @@ Fanout Cap Slew Delay Time Description
0.08 slack (MET)
data check full_clock_expanded done
--- Data check all formats ---
Startpoint: reg1 (rising edge-triggered flip-flop clocked by clk)
Endpoint: reg2 (falling edge-triggered data to data check clocked by clk)
@ -1636,7 +1635,6 @@ clk -5.38
}
]
}
data check all formats done
--- Data check path iteration ---
Data check max paths: 10
is_data_check: 1 role=data check setup pin=reg2/D

View File

@ -40,7 +40,13 @@ puts "--- Gated clock path detail ---"
set gated_paths [find_timing_paths -path_delay max -endpoint_path_count 15 -group_path_count 30]
puts "Total max paths: [llength $gated_paths]"
foreach pe $gated_paths {
puts " type: is_gated=[$pe is_gated_clock] is_check=[$pe is_check] is_output=[$pe is_output_delay] is_latch=[$pe is_latch_check] is_data=[$pe is_data_check] is_path_delay=[$pe is_path_delay] is_uncon=[$pe is_unconstrained]"
puts " type: is_gated=[$pe is_gated_clock]\
is_check=[$pe is_check]\
is_output=[$pe is_output_delay]\
is_latch=[$pe is_latch_check]\
is_data=[$pe is_data_check]\
is_path_delay=[$pe is_path_delay]\
is_uncon=[$pe is_unconstrained]"
puts " pin=[get_full_name [$pe pin]] role=[$pe check_role] slack=[$pe slack]"
puts " margin=[$pe margin] data_arr=[$pe data_arrival_time] data_req=[$pe data_required_time]"
puts " target_clk: [get_name [$pe target_clk]]"
@ -105,7 +111,6 @@ set_data_check -from [get_pins reg1/CK] -to [get_pins reg2/D] -setup 0.3
set_data_check -from [get_pins reg1/CK] -to [get_pins reg2/D] -hold 0.15
report_checks -path_delay max -format full_clock_expanded -fields {capacitance slew fanout}
report_checks -path_delay min -format full_clock_expanded -fields {capacitance slew fanout}
puts "data check full_clock_expanded done"
puts "--- Data check all formats ---"
report_checks -path_delay max -format full
@ -115,7 +120,6 @@ report_checks -path_delay max -format end
report_checks -path_delay max -format summary
report_checks -path_delay max -format slack_only
report_checks -path_delay max -format json
puts "data check all formats done"
puts "--- Data check path iteration ---"
set dc_paths [find_timing_paths -path_delay max -endpoint_path_count 10]

View File

@ -63,7 +63,6 @@ set mpc [sta::min_period_check_slack]
if { $mpc != "NULL" } {
sta::report_min_period_check $mpc 0
sta::report_min_period_check $mpc 1
} else {
}
puts "--- report_min_period_checks ---"
@ -83,7 +82,6 @@ set msc [sta::max_skew_check_slack]
if { $msc != "NULL" } {
sta::report_max_skew_check $msc 0
sta::report_max_skew_check $msc 1
} else {
}
############################################################
@ -163,7 +161,6 @@ set mpws [sta::min_pulse_width_check_slack "NULL"]
if { $mpws != "NULL" } {
sta::report_mpw_check $mpws 0
sta::report_mpw_check $mpws 1
} else {
}
############################################################

View File

@ -25,15 +25,13 @@ report_units
puts "--- elapsed_run_time ---"
set elapsed [elapsed_run_time]
if { $elapsed >= 0 } {
} else {
if { $elapsed < 0 } {
puts "FAIL: elapsed_run_time returned negative"
}
puts "--- user_run_time ---"
set user_time [user_run_time]
if { $user_time >= 0 } {
} else {
if { $user_time < 0 } {
puts "FAIL: user_run_time returned negative"
}
@ -49,8 +47,7 @@ if { [file exists $log_file] } {
set log_content [read $fh]
close $fh
file delete $log_file
if { [string length $log_content] > 0 } {
} else {
if { [string length $log_content] <= 0 } {
puts "INFO: log file was empty"
}
} else {
@ -70,8 +67,7 @@ unsuppress_msg 999
puts "--- with_output_to_variable ---"
with_output_to_variable result { report_units }
puts "captured output length: [string length $result]"
if { [string length $result] > 0 } {
} else {
if { [string length $result] <= 0 } {
puts "FAIL: with_output_to_variable captured empty output"
}

View File

@ -41,8 +41,7 @@ if { [file exists $log_file1] } {
set content [read $fh]
close $fh
set len [string length $content]
if { $len > 100 } {
} else {
if { $len <= 100 } {
puts "INFO: log file unexpectedly small: $len"
}
} else {
@ -77,8 +76,6 @@ foreach {fname label} [list $log_file2 "log" $redir_file2 "redirect"] {
set content [read $fh]
close $fh
set len [string length $content]
if { $len > 0 } {
}
}
}
@ -110,8 +107,6 @@ if { [file exists $append_file] } {
set content [read $fh]
close $fh
set len [string length $content]
if { $len > 200 } {
}
}
#---------------------------------------------------------------
@ -167,9 +162,6 @@ suppress_msg 100 200 300
# Trigger some warnings by reading nonexistent files
# catch: intentionally testing error handling for nonexistent file path
set rc [catch { read_liberty "/nonexistent/path.lib" } msg]
if { $rc != 0 } {
}
unsuppress_msg 100 200 300
#---------------------------------------------------------------

View File

@ -49,8 +49,7 @@ if { $nproc > 0 } {
#---------------------------------------------------------------
puts "--- memory_usage ---"
set mem [sta::memory_usage]
if { $mem >= 0 } {
} else {
if { $mem < 0 } {
puts "FAIL: memory_usage negative"
}
@ -209,8 +208,7 @@ report_checks
report_checks -path_delay min
report_units
log_end
if { [file exists $lfile] } {
} else {
if { [file exists $lfile] == 0 } {
puts "INFO: log file not created"
}
@ -220,20 +218,12 @@ if { [file exists $lfile] } {
puts "--- error paths ---"
# catch: intentionally testing error for nonexistent liberty file
set rc [catch { read_liberty "/nonexistent/path/file.lib" } msg]
if { $rc != 0 } {
}
# catch: intentionally testing error for nonexistent verilog file
set rc [catch { read_verilog "/nonexistent/path/file.v" } msg]
if { $rc != 0 } {
}
# catch: intentionally testing error for nonexistent SPEF file
set rc [catch { read_spef "/nonexistent/path/file.spef" } msg]
if { $rc != 0 } {
}
# catch: intentionally testing error for nonexistent SDF file
set rc [catch { read_sdf "/nonexistent/path/file.sdf" } msg]
if { $rc != 0 } {
}

View File

@ -110,16 +110,14 @@ sta::set_debug "delay_calc" 0
puts "--- FileNotWritable error path ---"
# catch: intentionally testing FileNotWritable error for nonexistent directory
set rc [catch { write_sdf "/nonexistent_dir/no_write.sdf" } msg]
if { $rc != 0 } {
} else {
if { $rc == 0 } {
puts "INFO: no error for bad write path"
}
# Try write to read-only path
# catch: intentionally testing FileNotWritable error for /proc path
set rc [catch { log_begin "/proc/nonexistent_log" } msg]
if { $rc != 0 } {
} else {
if { $rc == 0 } {
log_end
puts "INFO: log_begin succeeded on /proc path"
}

View File

@ -146,13 +146,9 @@ if { [file exists $rf] } {
puts "--- error handling ---"
# catch: intentionally testing error for nonexistent liberty file
set rc [catch { read_liberty "/nonexistent/path/test.lib" } msg]
if { $rc != 0 } {
}
# catch: intentionally testing error for nonexistent verilog file
set rc [catch { read_verilog "/nonexistent/path/test.v" } msg]
if { $rc != 0 } {
}
#---------------------------------------------------------------
# Fuzzy equality

View File

@ -56,8 +56,7 @@ if { [file exists $redir_file] } {
set fh [open $redir_file r]
set content [read $fh]
close $fh
if { [string length $content] > 0 } {
} else {
if { [string length $content] <= 0 } {
puts "INFO: redirect file was empty"
}
} else {
@ -81,8 +80,7 @@ if { [file exists $append_file] } {
set fh [open $append_file r]
set content [read $fh]
close $fh
if { [string length $content] > 0 } {
} else {
if { [string length $content] <= 0 } {
puts "INFO: appended redirect file was empty"
}
} else {
@ -106,8 +104,7 @@ if { [file exists $log_file2] } {
set fh [open $log_file2 r]
set log_content [read $fh]
close $fh
if { [string length $log_content] > 0 } {
} else {
if { [string length $log_content] <= 0 } {
puts "INFO: log file was empty (may be expected)"
}
} else {
@ -119,8 +116,7 @@ if { [file exists $log_file2] } {
#---------------------------------------------------------------
puts "--- FileNotReadable error path ---"
set rc [catch { read_liberty "/nonexistent/file/path.lib" } msg]
if { $rc != 0 } {
} else {
if { $rc == 0 } {
puts "INFO: no error for nonexistent file"
}