diff options
author | Daniel Friesel <daniel.friesel@uos.de> | 2021-01-08 09:27:48 +0100 |
---|---|---|
committer | Daniel Friesel <daniel.friesel@uos.de> | 2021-01-08 09:27:48 +0100 |
commit | a9bcdbac59c5061c836805b35940360fb3535618 (patch) | |
tree | 6d25eb832b5d95a36a451503b7283b5c00d6b0c6 /lib | |
parent | a0165f6957904ba45c5d40475bcb687a02536083 (diff) |
model transition power, not energy
in contrast to duration/energy, duration/power are independent
Diffstat (limited to 'lib')
-rw-r--r-- | lib/lennart/DataProcessor.py | 7 | ||||
-rw-r--r-- | lib/loader.py | 66 | ||||
-rw-r--r-- | lib/model.py | 2 |
3 files changed, 54 insertions, 21 deletions
diff --git a/lib/lennart/DataProcessor.py b/lib/lennart/DataProcessor.py index e2cfbd2..b969d5c 100644 --- a/lib/lennart/DataProcessor.py +++ b/lib/lennart/DataProcessor.py @@ -82,10 +82,7 @@ class DataProcessor: if sync_start is not None: if (pre_outliers_ts - sync_start) > self.power_sync_len: datasync_timestamps.append( - ( - sync_start, - pre_outliers_ts, - ) + (sync_start, pre_outliers_ts) ) sync_start = None @@ -187,7 +184,7 @@ class DataProcessor: if et_timestamps_start <= index <= et_timestamps_end: candidate_indexes.append(index) - if len(candidate_indexes) >= 2: + if len(candidate_indexes) == 2: drift = self.et_timestamps[candidate_indexes[0]] - expected_start_ts compensated_timestamps.append(expected_start_ts + drift) diff --git a/lib/loader.py b/lib/loader.py index 0d8231d..f87d976 100644 --- a/lib/loader.py +++ b/lib/loader.py @@ -648,12 +648,20 @@ class RawData: } if online_trace_part["isa"] == "transition": online_trace_part["offline_attributes"].extend( - ["rel_energy_prev", "rel_energy_next", "timeout"] + [ + "rel_energy_prev", + "rel_energy_next", + "rel_power_prev", + "rel_power_next", + "timeout", + ] ) online_trace_part["offline_aggregates"]["rel_energy_prev"] = [] online_trace_part["offline_aggregates"]["rel_energy_next"] = [] + online_trace_part["offline_aggregates"]["rel_power_prev"] = [] + online_trace_part["offline_aggregates"]["rel_power_next"] = [] online_trace_part["offline_aggregates"]["timeout"] = [] - elif "plot" in offline_trace_part: + if "plot" in offline_trace_part: online_trace_part["offline_support"] = [ "power_traces", "timestamps", @@ -687,6 +695,12 @@ class RawData: offline_trace_part["uW_mean_delta_next"] * (offline_trace_part["us"] - 20) ) + online_trace_part["offline_aggregates"]["rel_power_prev"].append( + offline_trace_part["uW_mean_delta_prev"] + ) + online_trace_part["offline_aggregates"]["rel_power_next"].append( + offline_trace_part["uW_mean_delta_next"] + ) online_trace_part["offline_aggregates"]["timeout"].append( offline_trace_part["timeout"] ) @@ -766,6 +780,14 @@ class RawData: if "plot" in offline_trace_part: online_trace_part["offline_support"] = ["power_traces"] online_trace_part["offline_aggregates"]["power_traces"] = list() + if online_trace_part["isa"] == "transition": + online_trace_part["offline_aggregates"][ + "offline_attributes" + ].extend(["rel_power_prev", "rel_power_next"]) + online_trace_part["offline_aggregates"]["rel_energy_prev"] = list() + online_trace_part["offline_aggregates"]["rel_energy_next"] = list() + online_trace_part["offline_aggregates"]["rel_power_prev"] = list() + online_trace_part["offline_aggregates"]["rel_power_next"] = list() offline_aggregates = online_trace_part["offline_aggregates"] @@ -786,9 +808,23 @@ class RawData: if "plot" in offline_trace_part: offline_aggregates["power_traces"].append(offline_trace_part["plot"][1]) - # if online_trace_part['isa'] == 'transition': - # offline_aggregates['rel_energy_prev'].append(offline_trace_part['W_mean_delta_prev'] * offline_trace_part['s'] * 1e12) - # offline_aggregates['rel_energy_next'].append(offline_trace_part['W_mean_delta_next'] * offline_trace_part['s'] * 1e12) + if online_trace_part["isa"] == "transition": + offline_aggregates["rel_energy_prev"].append( + offline_trace_part["W_mean_delta_prev"] + * offline_trace_part["s"] + * 1e12 + ) + offline_aggregates["rel_energy_next"].append( + offline_trace_part["W_mean_delta_next"] + * offline_trace_part["s"] + * 1e12 + ) + offline_aggregates["rel_power_prev"].append( + offline_trace_part["W_mean_delta_prev"] * 1e6 + ) + offline_aggregates["rel_power_next"].append( + offline_trace_part["W_mean_delta_next"] * 1e6 + ) def _concatenate_traces(self, list_of_traces): """ @@ -840,11 +876,13 @@ class RawData: - `param`: List of lists, each sub-list contains the parameter values for this measurement. Typically, all sub-lists are the same. - `rel_energy_prev`: (only for transitions) transition energy relative to previous state mean power, pJ - `rel_energy_next`: (only for transitions) transition energy relative to next state mean power, pJ + - `rel_power_prev`: (only for transitions) powerrelative to previous state mean power, µW + - `rel_power_next`: (only for transitions) power relative to next state mean power, µW - `timeout`: (only for transitions) duration of previous state, us - * `offline_attributes`: List containing the keys of `offline_aggregates` which are meant to be part of themodel. + * `offline_attributes`: List containing the keys of `offline_aggregates` which are meant to be part of the model. This list ultimately decides which hardware/software attributes the model describes. If isa == state, it contains power, duration, energy - If isa == transition, it contains power, duration, energy, rel_energy_prev, rel_energy_next, timeout + If isa == transition, it contains power, rel_power_prev, rel_power_next, duration, timeout * `online`: List of online estimations for this state/transition. Each entry contains a result for this state/transition during one benchmark execution. Entry contents for isa == state: - `time`: state/transition @@ -1140,9 +1178,9 @@ def _add_trace_data_to_aggregate(aggregate, key, element): # TODO do not hardcode values aggregate[key]["attributes"] = [ "duration", - "energy", - "rel_energy_prev", - "rel_energy_next", + "power", + "rel_power_prev", + "rel_power_next", ] # Uncomment this line if you also want to analyze mean transition power # aggregate[key]['attributes'].append('power') @@ -1186,6 +1224,8 @@ def pta_trace_to_aggregate(traces, ignore_trace_indexes=[]): - timeout: [int(us)] Dauer des vorherigen Zustands - rel_energy_prev: [int(pJ)] - rel_energy_next: [int(pJ)] + - rel_power_prev: [int(µW)] + - rel_power_next: [int(µW)] ] ] ignore_trace_indexes -- list of trace indexes. The corresponding taces will be ignored. @@ -1817,12 +1857,6 @@ class EnergyTraceWithLogicAnalyzer: # if "P15_8MW" in name: # print(name, energy_trace_new[number]["W_mean"]) - # add next/prev state W_mean_delta - for number, item in enumerate(energy_trace_new): - if item["isa"] == "transition" and 0 < number < len(energy_trace_new) - 1: - item["W_mean_delta_prev"] = energy_trace_new[number - 1] - item["W_mean_delta_next"] = energy_trace_new[number + 1] - # st = "" # for i, x in enumerate(energy_trace_new[-10:]): # #st += "(%s|%s|%s)" % (energy_trace[i-10]["name"],x['W_mean'],x['s']) diff --git a/lib/model.py b/lib/model.py index f368314..781a29c 100644 --- a/lib/model.py +++ b/lib/model.py @@ -678,6 +678,8 @@ class PTAModel: - timeout: list of duration of previous state in µs - rel_energy_prev: transition energy relative to previous state mean power in pJ - rel_energy_next: transition energy relative to next state mean power in pJ + - rel_power_prev: transition power relative to previous state mean power in µW + - rel_power_next: transition power relative to next state mean power in µW """ def __init__( |