summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Friesel <daniel.friesel@uos.de>2020-12-15 14:55:32 +0100
committerDaniel Friesel <daniel.friesel@uos.de>2020-12-15 14:55:32 +0100
commit383cf6c3fd40c015776fc888f4304cf9cfff88fe (patch)
treecc28be791dd5f88519f5913b1c38bc755248197c
parent07740687927b803d8a005304b0ec26c3bd20f104 (diff)
support benchmarks with EnergyTrace++
-rwxr-xr-xbin/generate-dfa-benchmark.py2
-rw-r--r--lib/runner.py12
2 files changed, 11 insertions, 3 deletions
diff --git a/bin/generate-dfa-benchmark.py b/bin/generate-dfa-benchmark.py
index 39ab962..e1b6537 100755
--- a/bin/generate-dfa-benchmark.py
+++ b/bin/generate-dfa-benchmark.py
@@ -65,6 +65,8 @@ Options:
sync = bar (Barcode mode (default): synchronize measurements via barcodes embedded in the energy trace)
sync = la (Logic Analyzer mode (WIP): An external logic analyzer captures transition timing)
sync = timing (Timing mode (WIP): The on-board cycle counter captures transition timing)
+ plusplus = 0 (default, EnergyTrace measurements with about 3.7 kHz sample rate, energy only)
+ plusplus = 1 (EnergyTrace++ measurements with about 1 kHz sample rate, energy and cpu state)
--trace-filter=<transition,transition,transition,...>[ <transition,transition,transition,...> ...]
Only consider traces whose beginning matches one of the provided transition sequences.
diff --git a/lib/runner.py b/lib/runner.py
index d368a37..59f69c4 100644
--- a/lib/runner.py
+++ b/lib/runner.py
@@ -142,7 +142,7 @@ class SerialMonitor:
self.ser.close()
-# TODO Optionale Kalibrierung mit bekannten Widerständen an GPIOs am Anfang
+# TODO Optionale Kalibrierung mit bekannten Widerständen an GPIOs am Anfang (EnergyTrace selbst macht nur bis 1,5mA)
# TODO Sync per LED? -> Vor und ggf nach jeder Transition kurz pulsen
# TODO Für Verbraucher mit wenig Energiebedarf: Versorgung direkt per GPIO
# -> Zu Beginn der Messung ganz ausknipsen
@@ -154,15 +154,21 @@ class EnergyTraceMonitor(SerialMonitor):
# Zusätzliche key-value-Argumente von generate-dfa-benchmark.py --energytrace=... landen hier
# (z.B. --energytrace=var1=bar,somecount=2 => EnerygTraceMonitor(..., var1="bar", somecount="2")).
# Soald das EnergyTraceMonitor-Objekt erzeugt wird, beginnt die Messung (d.h. hier: msp430-etv wird gestartet)
- def __init__(self, port: str, baud: int, callback=None, voltage=3.3):
+ def __init__(
+ self, port: str, baud: int, callback=None, voltage=3.3, plusplus=False
+ ):
super().__init__(port=port, baud=baud, callback=callback)
self._voltage = voltage
+ self._plusplus = plusplus
self._output = time.strftime("%Y%m%d-%H%M%S.etlog")
self._start_energytrace()
def _start_energytrace(self):
print("[%s] Starting Measurement" % type(self).__name__)
- cmd = ["msp430-etv", "--save", self._output, "0"]
+ if self._plusplus:
+ cmd = ["msp430-etv", "--with-hardware-states", "--save", self._output, "0"]
+ else:
+ cmd = ["msp430-etv", "--save", self._output, "0"]
self._logger = subprocess.Popen(
cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE, universal_newlines=True
)