diff options
author | Daniel Friesel <daniel.friesel@uos.de> | 2019-05-13 12:30:54 +0200 |
---|---|---|
committer | Daniel Friesel <daniel.friesel@uos.de> | 2019-05-13 12:30:54 +0200 |
commit | 349e9f1984584197be379b0033260632ea1c26d4 (patch) | |
tree | 283dbf49c1c7786797faa64c2b95c464e02319e8 | |
parent | b5f5e10a9f73d23b4500e616127bf217a671b535 (diff) |
Protolog: Make cpu/radio classes accessible on the outside
-rw-r--r-- | lib/data_parameters.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/data_parameters.py b/lib/data_parameters.py index e7a14b0..f3cb483 100644 --- a/lib/data_parameters.py +++ b/lib/data_parameters.py @@ -183,6 +183,8 @@ class Protolog: The enriched data can be accessed via the .aggregate class member, see the class documentation for details. """ + self.cpu = None + self.radio = None with open(logfile, 'rb') as f: self.data = ubjson.load(f) self.libraries = set() @@ -272,13 +274,15 @@ class Protolog: cpu_conf = utils.parse_conf_str(cpu_conf_str) if cpu_conf: - cpu = cycles_to_energy.get_class(cpu_conf['model']) + self.cpu_conf = cpu_conf + cpu = self.cpu = cycles_to_energy.get_class(cpu_conf['model']) for key, value in cpu.default_params.items(): if not key in cpu_conf: cpu_conf[key] = value for key in self.aggregate.keys(): for arch in self.aggregate[key].keys(): for lib, val in self.aggregate[key][arch].items(): + # All energy data is stored in nanojoules (nJ) try: val['energy_enc'] = int(val['cycles_enc'] * cpu.get_power(cpu_conf) / cpu_conf['cpu_freq'] * 1e9) except KeyError: @@ -308,7 +312,8 @@ class Protolog: radio_conf = utils.parse_conf_str(radio_conf_str) if radio_conf: - radio = size_to_radio_energy.get_class(radio_conf['model']) + self.radio_conf = radio_conf + radio = self.radio = size_to_radio_energy.get_class(radio_conf['model']) for key, value in radio.default_params.items(): if not key in radio_conf: radio_conf[key] = value |