@@ -102,9 +102,9 @@ def extractTagFromFile(
102102 value = parsedMetrics [occurrence ]
103103 value = value .strip ()
104104 try :
105- jsonFile [jsonTag ] = float (value )
105+ jsonFile [jsonTag ] = t (value )
106106 except BaseException :
107- jsonFile [jsonTag ] = str ( value )
107+ jsonFile [jsonTag ] = value
108108 else :
109109 # Only print a warning if the defaultNotFound is not set
110110 print (
@@ -256,6 +256,14 @@ def extract_metrics(
256256 # =========================================================================
257257 merge_jsons (logPath , metrics_dict , "2_*.json" )
258258
259+ extractTagFromFile (
260+ "floorplan__swapped_arithmetic_module_count" ,
261+ metrics_dict ,
262+ r"^\[INFO RSZ-\d+\] (\d+) arithmetic instances have swapped.*" ,
263+ logPath + "/2_1_floorplan.log" ,
264+ defaultNotFound = 0 ,
265+ )
266+
259267 # Place
260268 # =========================================================================
261269 merge_jsons (logPath , metrics_dict , "3_*.json" )
@@ -284,6 +292,19 @@ def extract_metrics(
284292 rptPath + "/6_finish.rpt" ,
285293 )
286294
295+ extractTagFromFile (
296+ "placeopt__swapped_arithmetic_module_count" ,
297+ metrics_dict ,
298+ r"^\[INFO RSZ-\d+\] (\d+) arithmetic instances have swapped.*" ,
299+ logPath + "/3_4_place_resized.log" ,
300+ defaultNotFound = 0 ,
301+ )
302+
303+ floorplan_swapped = metrics_dict .get ("floorplan__swapped_arithmetic_module_count" , 0 )
304+ placeopt_swapped = metrics_dict .get ("placeopt__swapped_arithmetic_module_count" , 0 )
305+ total_swapped = int (floorplan_swapped ) + int (placeopt_swapped )
306+ metrics_dict ["finish__swapped_arithmetic_module_count" ] = total_swapped
307+
287308 extractGnuTime ("finish" , metrics_dict , logPath + "/6_report.log" )
288309
289310 # Accumulate time
0 commit comments