exception warn instead of error for no valid args

This commit is contained in:
James Cherry 2020-04-24 19:53:22 -07:00
parent 749c511875
commit 4eee0ca83e
1 changed files with 76 additions and 79 deletions

View File

@ -1513,11 +1513,11 @@ proc set_sense { args } {
if { [info exists keys(-type)] } { if { [info exists keys(-type)] } {
set type $keys(-type) set type $keys(-type)
if { $type == "data" } { if { $type == "data" } {
sdc_warn "set_sense -type data not supported." sta_warn "set_sense -type data not supported."
} elseif { $type == "clock" } { } elseif { $type == "clock" } {
set_clock_sense_cmd1 "set_sense" $args set_clock_sense_cmd1 "set_sense" $args
} else { } else {
sdc_error "set_sense -type clock|data" sta_error "set_sense -type clock|data"
} }
} }
} }
@ -1528,7 +1528,7 @@ define_cmd_args "set_clock_sense" \
[-clock clocks] pins} [-clock clocks] pins}
proc set_clock_sense { args } { proc set_clock_sense { args } {
sdc_warn "set_clock_sense is deprecated as of SDC 2.1. Use set_sense -type clock." sta_warn "set_clock_sense is deprecated as of SDC 2.1. Use set_sense -type clock."
set_clock_sense_cmd1 "set_clock_sense" $args set_clock_sense_cmd1 "set_clock_sense" $args
} }
@ -1905,19 +1905,15 @@ proc set_false_path { args } {
check_exception_pins $from $to check_exception_pins $from $to
if { $arg_error } { if { $arg_error } {
delete_from_thrus_to $from $thrus $to delete_from_thrus_to $from $thrus $to
sta_error "set_false_path command failed." } else {
}
check_for_key_args $cmd args check_for_key_args $cmd args
if { $args != {} } { if { $args != {} } {
delete_from_thrus_to $from $thrus $to sta_warn "'$args' ignored."
sta_error "positional arguments not supported."
} }
if { ($from == "NULL" && $thrus == "" && $to == "NULL") } { if { ($from == "NULL" && $thrus == "" && $to == "NULL") } {
delete_from_thrus_to $from $thrus $to delete_from_thrus_to $from $thrus $to
sta_error "-from, -through or -to required." sta_warn "-from, -through or -to required."
} } else {
if [info exists flags(-reset_path)] { if [info exists flags(-reset_path)] {
reset_path_cmd $from $thrus $to $min_max reset_path_cmd $from $thrus $to $min_max
} }
@ -1925,6 +1921,8 @@ proc set_false_path { args } {
set comment [parse_comment_key keys] set comment [parse_comment_key keys]
make_false_path $from $thrus $to $min_max $comment make_false_path $from $thrus $to $min_max $comment
}
}
} }
################################################################ ################################################################
@ -2050,9 +2048,7 @@ proc set_path_delay { cmd args min_max } {
set to [parse_to_arg keys flags arg_error] set to [parse_to_arg keys flags arg_error]
if { $arg_error } { if { $arg_error } {
delete_from_thrus_to $from $thrus $to delete_from_thrus_to $from $thrus $to
sta_error "set_path_delay command failed." } else {
}
check_for_key_args $cmd args check_for_key_args $cmd args
if { [llength $args] == 0 } { if { [llength $args] == 0 } {
delete_from_thrus_to $from $thrus $to delete_from_thrus_to $from $thrus $to
@ -2062,8 +2058,7 @@ proc set_path_delay { cmd args min_max } {
check_float "$cmd delay" $delay check_float "$cmd delay" $delay
set delay [time_ui_sta $delay] set delay [time_ui_sta $delay]
} else { } else {
delete_from_thrus_to $from $thrus $to sta_warn "'$args' ignored."
sta_error "extra positional arguments."
} }
set ignore_clk_latency [info exists flags(-ignore_clock_latency)] set ignore_clk_latency [info exists flags(-ignore_clock_latency)]
@ -2076,6 +2071,7 @@ proc set_path_delay { cmd args min_max } {
make_path_delay $from $thrus $to $min_max $ignore_clk_latency \ make_path_delay $from $thrus $to $min_max $ignore_clk_latency \
$delay $comment $delay $comment
}
} }
################################################################ ################################################################
@ -2183,9 +2179,7 @@ proc set_multicycle_path { args } {
check_exception_pins $from $to check_exception_pins $from $to
if { $arg_error } { if { $arg_error } {
delete_from_thrus_to $from $thrus $to delete_from_thrus_to $from $thrus $to
sta_error "set_multicycle_path command failed." } else {
}
check_for_key_args $cmd args check_for_key_args $cmd args
if { [llength $args] == 0 } { if { [llength $args] == 0 } {
delete_from_thrus_to $from $thrus $to delete_from_thrus_to $from $thrus $to
@ -2194,8 +2188,7 @@ proc set_multicycle_path { args } {
set path_multiplier $args set path_multiplier $args
check_integer "path multiplier" $path_multiplier check_integer "path multiplier" $path_multiplier
} else { } else {
delete_from_thrus_to $from $thrus $to sta_warn "'$args' ignored."
sta_error "extra positional arguments."
} }
set start [info exists flags(-start)] set start [info exists flags(-start)]
@ -2217,6 +2210,7 @@ proc set_multicycle_path { args } {
make_multicycle_path $from $thrus $to $min_max $use_end_clk \ make_multicycle_path $from $thrus $to $min_max $use_end_clk \
$path_multiplier $comment $path_multiplier $comment
}
} }
################################################################ ################################################################
@ -2794,7 +2788,7 @@ proc parse_from_arg { keys_var arg_error_var } {
if {$from_pins == {} && $from_insts == {} && $from_clks == {}} { if {$from_pins == {} && $from_insts == {} && $from_clks == {}} {
upvar 1 $arg_error_var arg_error upvar 1 $arg_error_var arg_error
set arg_error 1 set arg_error 1
sta_error "no valid objects specified for $key." sta_warn "no valid objects specified for $key."
return "NULL" return "NULL"
} }
return [make_exception_from $from_pins $from_clks $from_insts $tr] return [make_exception_from $from_pins $from_clks $from_insts $tr]
@ -2811,10 +2805,13 @@ proc parse_thrus_arg { args_var arg_error_var } {
set tr "" set tr ""
if { $arg == "-through" } { if { $arg == "-through" } {
set tr "rise_fall" set tr "rise_fall"
set key "-through"
} elseif { $arg == "-rise_through" } { } elseif { $arg == "-rise_through" } {
set tr "rise" set tr "rise"
set key "-rise_through"
} elseif { $arg == "-fall_through" } { } elseif { $arg == "-fall_through" } {
set tr "fall" set tr "fall"
set key "-fall_through"
} }
if { $tr != "" } { if { $tr != "" } {
if { [llength $args] > 1 } { if { [llength $args] > 1 } {
@ -2824,7 +2821,7 @@ proc parse_thrus_arg { args_var arg_error_var } {
if {$pins == {} && $insts == {} && $nets == {}} { if {$pins == {} && $insts == {} && $nets == {}} {
upvar 1 $arg_error_var arg_error upvar 1 $arg_error_var arg_error
set arg_error 1 set arg_error 1
sta_error "no valid objects specified for -through." sta_warn "no valid objects specified for $key"
} else { } else {
lappend thrus [make_exception_thru $pins $nets $insts $tr] lappend thrus [make_exception_thru $pins $nets $insts $tr]
} }
@ -2873,7 +2870,7 @@ proc parse_to_arg1 { keys_var end_rf arg_error_var } {
if {$to_pins == {} && $to_insts == {} && $to_clks == {}} { if {$to_pins == {} && $to_insts == {} && $to_clks == {}} {
upvar 1 $arg_error_var arg_error upvar 1 $arg_error_var arg_error
set arg_error 1 set arg_error 1
puts "Error: no valid objects specified for $key." sta_warn "no valid objects specified for $key."
return "NULL" return "NULL"
} }
return [make_exception_to $to_pins $to_clks $to_insts $to_rf $end_rf] return [make_exception_to $to_pins $to_clks $to_insts $to_rf $end_rf]