Skip to content

Commit 8c51037

Browse files
committed
pdn: validate -layers and -cut_pitch arguments in add_sroute_connect
Add missing existence and length checks for required arguments to prevent downstream errors and improve error messages. - PDN 1193: error when -layers is missing - PDN 1194: error when -cut_pitch is missing - PDN 1195: error when -layers does not have exactly 2 elements - PDN 1196: error when -cut_pitch does not have exactly 2 values Signed-off-by: Suhrid Marwah <suhridmarwah07@gmail.com>
1 parent 9b0caf1 commit 8c51037

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

src/pdn/src/pdn.tcl

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -670,6 +670,19 @@ proc add_sroute_connect { args } {
670670
-metalspaces -ongrid -insts} \
671671
flags {}
672672

673+
if { ![info exists keys(-layers)] } {
674+
utl::error PDN 1193 "The -layers argument is required."
675+
}
676+
if { [llength $keys(-layers)] != 2 } {
677+
utl::error PDN 1195 "The -layers argument must be a list of 2 layers."
678+
}
679+
if { ![info exists keys(-cut_pitch)] } {
680+
utl::error PDN 1194 "The -cut_pitch argument is required."
681+
}
682+
if { [llength $keys(-cut_pitch)] != 2 } {
683+
utl::error PDN 1196 "The -cut_pitch argument must be a list of 2 pitch values."
684+
}
685+
673686
set l0 [pdn::get_layer [lindex $keys(-layers) 0]]
674687
set l1 [pdn::get_layer [lindex $keys(-layers) 1]]
675688

0 commit comments

Comments
 (0)