Skip to content

Commit 582b419

Browse files
committed
Use same error code for all -filter errors
1 parent 677a905 commit 582b419

File tree

4 files changed

+18
-32
lines changed

4 files changed

+18
-32
lines changed

doc/messages.txt

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ Warning: 0000 duplicated
120120
0347 Sdc.tcl:401 current_design for other than top cell not supported.
121121
0348 Sdc.tcl:467 patterns argument not supported with -of_objects.
122122
0349 Sdc.tcl:500 instance '$pattern' not found.
123-
0350 Sdc.tcl:506 unsupported instance -filter expression.
123+
0350 Sdc.tcl:432 unsupported $object_type -filter expression.
124124
0351 Sdc.tcl:533 clock '$pattern' not found.
125125
0352 Sdc.tcl:562 positional arguments not supported with -of_objects.
126126
0353 Sdc.tcl:589 library '$lib_name' not found.
@@ -134,10 +134,8 @@ Warning: 0000 duplicated
134134
0361 Sdc.tcl:805 net '$pattern' not found.
135135
0362 Sdc.tcl:837 patterns argument not supported with -of_objects.
136136
0363 Sdc.tcl:874 pin '$pattern' not found.
137-
0364 Sdc.tcl:879 unsupported pin -filter expression.
138137
0365 Sdc.tcl:904 patterns argument not supported with -of_objects.
139138
0366 Sdc.tcl:918 port '$pattern' not found.
140-
0367 Sdc.tcl:924 unsupported port -filter expression.
141139
0368 Sdc.tcl:957 -add requires -name.
142140
0369 Sdc.tcl:962 -name or port_pin_list must be specified.
143141
0370 Sdc.tcl:970 missing -period argument.
@@ -269,7 +267,6 @@ Warning: 0000 duplicated
269267
0526 Search.tcl:1013 specify one of -setup and -hold.
270268
0527 Search.tcl:1063 unknown path group '$name'.
271269
0540 Sta.tcl:158 -from/-to arguments not supported with -of_objects.
272-
0541 Sta.tcl:174 unsupported timing arc -filter expression.
273270
0560 Util.tcl:44 $cmd $key missing value.
274271
0561 Util.tcl:61 $cmd $key missing value.
275272
0562 Util.tcl:71 $cmd $arg is not a known keyword or flag.
@@ -574,8 +571,3 @@ Warning: 0000 duplicated
574571
2121 Sdc.i:105 unknown analysis type
575572
2122 Sdc.i:232 unknown wire load mode
576573
2140 StaTclTypes.i:431 Delay calc arg requires 5 or 6 args.
577-
2351 Sdc.tcl:538 unsupported clock -filter expression.
578-
2354 Sdc.tcl:608 unsupported liberty cell -filter expression.
579-
2357 Sdc.tcl:681 unsupported liberty port -filter expression.
580-
2359 Sdc.tcl:720 unsupported liberty library -filter expression.
581-
2361 Sdc.tcl:810 unsupported net -filter expression.

etc/FindMessages.tcl

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ exec tclsh $0 ${1+"$@"}
1313
# Find warning/error message IDs and detect collisions.
1414
# Usage: FindMessages.tcl > doc/messages.txt
1515

16-
proc scan_file { file warn_regexp is_filter_objs } {
16+
proc scan_file { file warn_regexp } {
1717
global msgs
1818

1919
if { [file exists $file] } {
@@ -22,11 +22,7 @@ proc scan_file { file warn_regexp is_filter_objs } {
2222
set file_line 1
2323

2424
while { ![eof $in_stream] } {
25-
if { !$is_filter_objs && [regexp -- $warn_regexp $line ignore1 ignore2 msg_id msg] } {
26-
lappend msgs "$msg_id $file $file_line $msg"
27-
}
28-
if { $is_filter_objs && [regexp -- $warn_regexp $line ignore1 ignore2 object_type msg_id] } {
29-
set msg "\"unsupported $object_type -filter expression.\""
25+
if { [regexp -- $warn_regexp $line ignore1 ignore2 msg_id msg] } {
3026
lappend msgs "$msg_id $file $file_line $msg"
3127
}
3228
gets $in_stream line
@@ -52,11 +48,10 @@ foreach subdir $subdirs {
5248
set files_tcl [concat $files_tcl [glob -nocomplain [file join $subdir "*.tcl"]]]
5349
}
5450
set warn_regexp_tcl {(sta_warn|sta_error|sta_warn_error) ([0-9]+) (".+")}
55-
set warn_regexp_tcl_filter_objs {(filter_objs) \S+ \S+ \S+ "([^"]+)" ([0-9]+)}
5651

57-
proc scan_files {files warn_regexp is_filter_objs } {
52+
proc scan_files {files warn_regexp } {
5853
foreach file $files {
59-
scan_file $file $warn_regexp $is_filter_objs
54+
scan_file $file $warn_regexp
6055
}
6156
}
6257

@@ -84,8 +79,7 @@ proc report_msgs { } {
8479
}
8580

8681
set msgs {}
87-
scan_files $files_c $warn_regexp_c 0
88-
scan_files $files_tcl $warn_regexp_tcl 0
89-
scan_files $files_tcl $warn_regexp_tcl_filter_objs 1
82+
scan_files $files_c $warn_regexp_c
83+
scan_files $files_tcl $warn_regexp_tcl
9084
check_msgs
9185
report_msgs

sdc/Sdc.tcl

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -407,7 +407,7 @@ proc current_design { {design ""} } {
407407
################################################################
408408

409409
# Generic get_* filter.
410-
proc filter_objs { filter objects filter_function object_type error_code } {
410+
proc filter_objs { filter objects filter_function object_type } {
411411
set filter_regexp1 {@?([a-zA-Z_]+) *(==|!=|=~|!~) *([0-9a-zA-Z_\*]+)}
412412
set filter_or_regexp "($filter_regexp1) *\\|\\| *($filter_regexp1)"
413413
set filter_and_regexp "($filter_regexp1) *&& *($filter_regexp1)"
@@ -429,7 +429,7 @@ proc filter_objs { filter objects filter_function object_type error_code } {
429429
} elseif { [regexp $filter_regexp1 $filter ignore attr_name op arg] } {
430430
set filtered_objects [$filter_function $attr_name $op $arg $objects]
431431
} else {
432-
sta_error $error_code "unsupported $object_type -filter expression."
432+
sta_error 350 "unsupported $object_type -filter expression."
433433
}
434434
return $filtered_objects
435435
}
@@ -503,7 +503,7 @@ proc get_cells { args } {
503503
}
504504
}
505505
if [info exists keys(-filter)] {
506-
set insts [filter_objs $keys(-filter) $insts filter_insts "instance" 350]
506+
set insts [filter_objs $keys(-filter) $insts filter_insts "instance"]
507507
}
508508
return $insts
509509
}
@@ -535,7 +535,7 @@ proc get_clocks { args } {
535535
}
536536
}
537537
if [info exists keys(-filter)] {
538-
set clocks [filter_objs $keys(-filter) $clocks filter_clocks "clock" 2351]
538+
set clocks [filter_objs $keys(-filter) $clocks filter_clocks "clock"]
539539
}
540540
return $clocks
541541
}
@@ -605,7 +605,7 @@ proc get_lib_cells { args } {
605605
}
606606
}
607607
if [info exists keys(-filter)] {
608-
set cells [filter_objs $keys(-filter) $cells filter_lib_cells "liberty cell" 2354]
608+
set cells [filter_objs $keys(-filter) $cells filter_lib_cells "liberty cell"]
609609
}
610610
return $cells
611611
}
@@ -678,7 +678,7 @@ proc get_lib_pins { args } {
678678
}
679679
}
680680
if [info exists keys(-filter)] {
681-
set ports [filter_objs $keys(-filter) $ports filter_lib_pins "liberty port" 2357]
681+
set ports [filter_objs $keys(-filter) $ports filter_lib_pins "liberty port"]
682682
}
683683
return $ports
684684
}
@@ -717,7 +717,7 @@ proc get_libs { args } {
717717
}
718718
}
719719
if [info exists keys(-filter)] {
720-
set libs [filter_objs $keys(-filter) $libs filter_liberty_libraries "liberty library" 2359]
720+
set libs [filter_objs $keys(-filter) $libs filter_liberty_libraries "liberty library"]
721721
}
722722
return $libs
723723
}
@@ -807,7 +807,7 @@ proc get_nets { args } {
807807
}
808808
}
809809
if [info exists keys(-filter)] {
810-
set nets [filter_objs $keys(-filter) $nets filter_nets "net" 2361]
810+
set nets [filter_objs $keys(-filter) $nets filter_nets "net"]
811811
}
812812
return $nets
813813
}
@@ -876,7 +876,7 @@ proc get_pins { args } {
876876
}
877877
}
878878
if [info exists keys(-filter)] {
879-
set pins [filter_objs $keys(-filter) $pins filter_pins "pin" 364]
879+
set pins [filter_objs $keys(-filter) $pins filter_pins "pin"]
880880
}
881881
return $pins
882882
}
@@ -921,7 +921,7 @@ proc get_ports { args } {
921921
}
922922
}
923923
if [info exists keys(-filter)] {
924-
set ports [filter_objs $keys(-filter) $ports filter_ports "port" 367]
924+
set ports [filter_objs $keys(-filter) $ports filter_ports "port"]
925925
}
926926
return $ports
927927
}

tcl/Sta.tcl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ proc get_timing_edges_cmd { cmd cmd_args } {
171171
cmd_usage_error $cmd
172172
}
173173
if [info exists keys(-filter)] {
174-
set arcs [filter_objs $keys(-filter) $arcs filter_timing_arcs "timing arc" 541]
174+
set arcs [filter_objs $keys(-filter) $arcs filter_timing_arcs "timing arc"]
175175
}
176176
return $arcs
177177
}

0 commit comments

Comments
 (0)