diff options
author | Daniel Friesel <derf@finalrewind.org> | 2018-01-29 15:32:52 +0100 |
---|---|---|
committer | Daniel Friesel <derf@finalrewind.org> | 2018-01-29 15:32:52 +0100 |
commit | 4ce047e96b74c58a44b3f80320a8c03f43bc8fea (patch) | |
tree | 4184e52b4a394567b8c39c25fc66dd84b473fac4 /lib/dfatool.py | |
parent | 18afba9273d1fa2cce2ed66f8c5f102e59fa962f (diff) |
weed out clipping measurements as early as possible
Diffstat (limited to 'lib/dfatool.py')
-rwxr-xr-x | lib/dfatool.py | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/lib/dfatool.py b/lib/dfatool.py index 60ccefd..3e3a0b5 100755 --- a/lib/dfatool.py +++ b/lib/dfatool.py @@ -188,6 +188,18 @@ class RawData: on_isa = online_trace_part['isa']) return False + # Clipping in UNINITIALIZED (offline_idx == 0) can happen during + # calibration and is handled by MIMOSA + if offline_idx != 0 and offline_trace_part['clip_rate'] != 0: + processed_data['error'] = 'Offline #{off_idx:d} (online {on_name:s} @ {on_idx:d}/{on_sub:d}) was clipping {clip:f}% of the time'.format( + off_idx = offline_idx, on_idx = online_run_idx, + on_sub = online_trace_part_idx, + on_name = online_trace_part['name'], + clip = offline_trace_part['clip_rate'] * 100, + ) + return False + + if online_trace_part['isa'] == 'state' and online_trace_part['name'] != 'UNINITIALIZED': online_prev_transition = traces[online_run_idx]['trace'][online_trace_part_idx-1] online_next_transition = traces[online_run_idx]['trace'][online_trace_part_idx+1] @@ -236,7 +248,6 @@ class RawData: 'duration' : [], 'power_std' : [], 'energy' : [], - 'clipping' : [], 'paramkeys' : [], 'param': [], } @@ -256,8 +267,6 @@ class RawData: offline_trace_part['uW_std']) online_trace_part['offline_aggregates']['energy'].append( offline_trace_part['uW_mean'] * (offline_trace_part['us'] - 20)) - online_trace_part['offline_aggregates']['clipping'].append( - offline_trace_part['clip_rate']) online_trace_part['offline_aggregates']['paramkeys'].append(paramkeys) online_trace_part['offline_aggregates']['param'].append(paramvalue) if online_trace_part['isa'] == 'transition': @@ -341,7 +350,7 @@ class EnergyModel: def _aggregate_to_ndarray(self, aggregate): for elem in aggregate.values(): - for key in ['clipping', 'power', 'power_std', 'energy', 'duration', 'timeout', 'rel_energy_prev', 'rel_energy_next']: + for key in ['power', 'power_std', 'energy', 'duration', 'timeout', 'rel_energy_prev', 'rel_energy_next']: if key in elem: elem[key] = np.array(elem[key]) @@ -408,7 +417,6 @@ class EnergyModel: print('[W] Got no data for {} {}'.format(name, key)) except FloatingPointError as fpe: print('[W] Got no data for {} {}: {}'.format(name, key, fpe)) - print(lut_model) def lut_median_getter(name, key, param, **kwargs): return lut_model[(name, tuple(param))][key] |