[scripts] Fix trace generations for sections with no loads
@@ -18,6 +18,7 @@ import csv
from csv import DictWriter
from ctypes import c_int32, c_uint32
from collections import deque, defaultdict
+import warnings
from itertools import compress
@@ -482,6 +483,7 @@ def eval_perf_metrics(perf_metrics: list, id: int):
seg['cycles'] = cycles
seg['total_ipc'] = seg['snitch_occupancy']
# Detailed load/store info
+ if seg['snitch_loads'] > 0:
tile_id = int(id // 4)
seq_region = [x == MEM_REGIONS['Sequential'] for x in seg['snitch_load_region']]
itl_region = [x == MEM_REGIONS['Interleaved'] for x in seg['snitch_load_region']]
@@ -490,6 +492,8 @@ def eval_perf_metrics(perf_metrics: list, id: int):
seq_loads_global = np.logical_and(np.array(seq_region), np.invert(np.array(loc_loads)))
itl_loads_local = np.logical_and(np.array(itl_region), np.array(loc_loads))
itl_loads_global = np.logical_and(np.array(itl_region), np.invert(np.array(loc_loads)))
+ with warnings.catch_warnings():
+ warnings.simplefilter("ignore", category=RuntimeWarning)
seg.update({
'seq_loads_local': np.count_nonzero(seq_loads_local),
'seq_loads_global': np.count_nonzero(seq_loads_global),
@@ -500,6 +504,7 @@ def eval_perf_metrics(perf_metrics: list, id: int):
'itl_latency_local': np.mean(np.array(seg['snitch_load_latency'])[itl_loads_local]),
'itl_latency_global': np.mean(np.array(seg['snitch_load_latency'])[itl_loads_global]),
})
+ if seg['snitch_stores'] > 0:
seq_region = [x == MEM_REGIONS['Sequential'] for x in seg['snitch_store_region']]
itl_region = [x == MEM_REGIONS['Interleaved'] for x in seg['snitch_store_region']]
loc_stores = [x == tile_id for x in seg['snitch_store_tile']]
