summaryrefslogtreecommitdiff
path: root/lib/runner.py
diff options
context:
space:
mode:
authorDaniel Friesel <daniel.friesel@uos.de>2020-07-08 13:43:40 +0200
committerDaniel Friesel <daniel.friesel@uos.de>2020-07-08 13:43:40 +0200
commit7b107ef820684cb6aa7f4fe87d2e462e4fffb5c9 (patch)
tree39b6d4653c1b63af375bdaca60c302e442e3334c /lib/runner.py
parent7be50e50ef9e96747ca1badc66e97efdda553bc4 (diff)
prepare for Logic Analyzer and Timing based EnergyTrace sync
Diffstat (limited to 'lib/runner.py')
-rw-r--r--lib/runner.py16
1 files changed, 14 insertions, 2 deletions
diff --git a/lib/runner.py b/lib/runner.py
index 0a32091..0d4d449 100644
--- a/lib/runner.py
+++ b/lib/runner.py
@@ -178,6 +178,12 @@ class EnergyTraceMonitor(SerialMonitor):
"voltage": self._voltage,
}
+class EnergyTraceLogicAnalyzerMonitor(EnergyTraceMonitor):
+ """EnergyTraceLogicAnalyzerMonitor captures EnergyTrace energy data and LogicAnalyzer timing output."""
+
+ def __init__(self, port: str, baud: int, callback=None, voltage=3.3):
+ super().__init__(port=port, baud=baud, callback=callback, voltage=voltage)
+
class MIMOSAMonitor(SerialMonitor):
"""MIMOSAMonitor captures serial output and MIMOSA energy data for a specific amount of time."""
@@ -372,8 +378,14 @@ def get_monitor(arch: str, **kwargs) -> object:
mimosa_kwargs = kwargs.pop("mimosa")
return MIMOSAMonitor(port, arg, **mimosa_kwargs, **kwargs)
elif "energytrace" in kwargs and kwargs["energytrace"] is not None:
- energytrace_kwargs = kwargs.pop("energytrace")
- return EnergyTraceMonitor(port, arg, **energytrace_kwargs, **kwargs)
+ energytrace_kwargs = kwargs.pop("energytrace").copy()
+ sync_mode = energytrace_kwargs.pop("sync")
+ if sync_mode == "la":
+ return EnergyTraceLogicAnalyzerMonitor(
+ port, arg, **energytrace_kwargs, **kwargs
+ )
+ else:
+ return EnergyTraceMonitor(port, arg, **energytrace_kwargs, **kwargs)
else:
kwargs.pop("energytrace", None)
kwargs.pop("mimosa", None)