@@ -127,6 +127,8 @@ def extractTagFromFile(jsonTag, jsonFile, pattern, file, count=False,
127127
128128def extractGnuTime (prefix , jsonFile , file ):
129129
130+ if not os .path .isfile (file ):
131+ return
130132 extractTagFromFile (
131133 prefix +
132134 '__runtime__total' ,
@@ -249,7 +251,7 @@ def extract_metrics(cwd, platform, design, flow_variant, output, hier_json):
249251
250252 hierarchicalSynth = os .environ .get ('SYNTH_HIERARCHICAL' )
251253
252- if hierarchicalSynth == '1' :
254+ if hierarchicalSynth == '1' :
253255 extractTagFromFile ('synth__design__instance__area__stdcell' ,
254256 metrics_dict ,
255257 'Chip area for top module.*: +(\S+)' ,
@@ -259,11 +261,9 @@ def extract_metrics(cwd, platform, design, flow_variant, output, hier_json):
259261 metrics_dict ,
260262 'Chip area for module.*: +(\S+)' ,
261263 rptPath + '/synth_stat.txt' )
262- extractGnuTime ('synth' , metrics_dict , logPath + '/1_1_yosys.log' )
263264
264265 # Clocks
265266 # =========================================================================
266-
267267 clk_list = read_sdc (resultPath + '/2_floorplan.sdc' )
268268 metrics_dict ['constraints__clocks__count' ] = len (clk_list )
269269 metrics_dict ['constraints__clocks__details' ] = clk_list
@@ -272,24 +272,16 @@ def extract_metrics(cwd, platform, design, flow_variant, output, hier_json):
272272 # =========================================================================
273273 merge_jsons (logPath , metrics_dict , "2_*.json" )
274274
275- extractGnuTime ('floorplan' , metrics_dict , logPath + '/2_4_floorplan_macro.log' )
276-
277275 # Place
278276 # =========================================================================
279-
280277 merge_jsons (logPath , metrics_dict , "3_*.json" )
281- extractGnuTime ('globalplace' , metrics_dict , logPath + '/3_4_place_resized.log' )
282- extractGnuTime ('placeopt' , metrics_dict , logPath + '/3_4_place_resized.log' )
283- extractGnuTime ('detailedplace' , metrics_dict , logPath + '/3_5_place_dp.log' )
284278
285279 # CTS
286280 # =======================================================================
287-
288281 merge_jsons (logPath , metrics_dict , "4_*.json" )
289282
290283 # Global Route
291284 # =========================================================================
292-
293285 merge_jsons (logPath , metrics_dict , "5_*.json" )
294286 extractTagFromFile ('globalroute__timing__clock__slack' ,
295287 metrics_dict ,
@@ -310,6 +302,25 @@ def extract_metrics(cwd, platform, design, flow_variant, output, hier_json):
310302 # Accumulate time
311303 # =========================================================================
312304
305+ extractGnuTime ('synth' , metrics_dict , logPath + '/1_1_yosys.log' )
306+ extractGnuTime ('floorplan' , metrics_dict , logPath + '/2_1_floorplan.log' )
307+ extractGnuTime ('floorplan_io' , metrics_dict , logPath + '/2_2_floorplan_io.log' )
308+ extractGnuTime ('floorplan_tdms' , metrics_dict , logPath + '/2_3_floorplan_tdms.log' )
309+ extractGnuTime ('floorplan_macro' , metrics_dict , logPath + '/2_4_floorplan_macro.log' )
310+ extractGnuTime ('floorplan_tap' , metrics_dict , logPath + '/2_5_floorplan_tapcell.log' )
311+ extractGnuTime ('floorplan_pdn' , metrics_dict , logPath + '/2_6_floorplan_pdn.log' )
312+ extractGnuTime ('globalplace_skip_io' , metrics_dict , logPath + '/3_1_place_gp_skip_io.log' )
313+ extractGnuTime ('globalplace_io' , metrics_dict , logPath + '/3_2_place_iop.log' )
314+ extractGnuTime ('globalplace' , metrics_dict , logPath + '/3_3_place_gp.log' )
315+ extractGnuTime ('placeopt' , metrics_dict , logPath + '/3_4_place_resized.log' )
316+ extractGnuTime ('detailedplace' , metrics_dict , logPath + '/3_5_place_dp.log' )
317+ extractGnuTime ('cts' , metrics_dict , logPath + '/4_1_cts.log' )
318+ extractGnuTime ('cts_fill' , metrics_dict , logPath + '/4_2_cts_fillcell.log' )
319+ extractGnuTime ('globalroute' , metrics_dict , logPath + '/5_1_grt.log' )
320+ extractGnuTime ('detailedroute' , metrics_dict , logPath + '/5_2_route.log' )
321+ extractGnuTime ('finish_merge' , metrics_dict , logPath + '/6_1_merge.log' )
322+ extractGnuTime ('finish' , metrics_dict , logPath + '/6_report.log' )
323+
313324 failed = False
314325 total = timedelta ()
315326 for key in metrics_dict :
0 commit comments