@@ -126,6 +126,17 @@ def read_nets_rc(file_names):
126126 print ("No net RC data found." , file = stderr )
127127 exit (1 )
128128
129+ for key , name in (
130+ ("grt_res" , "GRT resistance" ),
131+ ("grt_cap" , "GRT capacitance" ),
132+ ("rcx_res" , "RCX resistance" ),
133+ ("rcx_cap" , "RCX capacitance" ),
134+ ):
135+ count = sum (1 for net in nets if net [key ] == 0.0 )
136+
137+ if count > 0 :
138+ print (f"Found { count } nets with zero { name } ." )
139+
129140 return nets
130141
131142
@@ -180,6 +191,16 @@ def read_segments_rc(file_names):
180191 print ("No segment RC data found." , file = stderr )
181192 exit (1 )
182193
194+ for key , name in (("resistances" , "resistance" ), ("capacitances" , "capacitance" )):
195+ count = sum (
196+ 1
197+ for segments in layer_segments .values ()
198+ for value in segments [key ]
199+ if value == 0.0
200+ )
201+ if count > 0 :
202+ print (f"Found { count } segments with zero { name } ." )
203+
183204 return routing_layers , layer_segments , layer_net_type_length
184205
185206
@@ -265,15 +286,6 @@ def plot_grt_rcx_diff(nets, quantity, name, unit, scale, discrepancy_threshold):
265286 args .segments_rc_file
266287)
267288
268- if args .nets_rc_file :
269- nets = read_nets_rc (args .nets_rc_file )
270-
271- if args .plot_cap :
272- plot_grt_rcx_diff (nets , "cap" , "Capacitance" , cap_unit , cap_scale , 1e-12 )
273-
274- if args .plot_res :
275- plot_grt_rcx_diff (nets , "res" , "Resistance" , res_unit , res_scale , 1e3 )
276-
277289################################################################
278290
279291# Use linear regression to find the layer resistances and capacitances.
@@ -387,3 +399,17 @@ def wire_rc_fit(target_net_type=None):
387399 )
388400 )
389401print ("" )
402+
403+ ################################################################
404+
405+ # The plots come after the commands so that a plot with no data does not
406+ # withhold them.
407+
408+ if args .nets_rc_file :
409+ nets = read_nets_rc (args .nets_rc_file )
410+
411+ if args .plot_cap :
412+ plot_grt_rcx_diff (nets , "cap" , "Capacitance" , cap_unit , cap_scale , 1e-12 )
413+
414+ if args .plot_res :
415+ plot_grt_rcx_diff (nets , "res" , "Resistance" , res_unit , res_scale , 1e3 )
0 commit comments