diff options
author | Lennart <lekaiser@uos.de> | 2020-07-13 13:06:11 +0200 |
---|---|---|
committer | Lennart <lekaiser@uos.de> | 2020-07-13 13:06:11 +0200 |
commit | b5f7fd47d1ee66f20af50fae145990d4665b56c3 (patch) | |
tree | 540a8b84f28680dbce605702d2a0792d722c8514 /lib/harness.py | |
parent | 0bda106da0af4b9ba72f31930669fb5da1311d28 (diff) |
Added first version, kinda working but some tweaks needed. src directory of repository 'ba-lennart-kaiser' needs to in the python execution path
Diffstat (limited to 'lib/harness.py')
-rw-r--r-- | lib/harness.py | 33 |
1 files changed, 32 insertions, 1 deletions
diff --git a/lib/harness.py b/lib/harness.py index fe6cb9a..3b9db89 100644 --- a/lib/harness.py +++ b/lib/harness.py @@ -405,15 +405,46 @@ class OnboardTimerHarness(TransitionHarness): ret = '#include "driver/counter.h"\n' ret += "#define PTALOG_TIMING\n" ret += super().global_code() + if self.energytrace_sync == "led": + #TODO Make nicer + ret += """\nvoid runLASync(){ + // ======================= LED SYNC ================================ + ptalog.passTransition(0); + ptalog.startTransition(); + gpio.led_toggle(0); + gpio.led_toggle(1); + ptalog.stopTransition(counter); + + for (unsigned char i = 0; i < 4; i++) { + arch.sleep_ms(250); + } + + ptalog.passTransition(0); + ptalog.startTransition(); + gpio.led_toggle(0); + gpio.led_toggle(1); + ptalog.stopTransition(counter); + // ======================= LED SYNC ================================ + arch.sleep_ms(250); +}\n\n""" return ret def start_benchmark(self, benchmark_id=0): - ret = "counter.start();\n" + ret = "" + if self.energytrace_sync == "led": + ret += "runLASync();\n" + ret += "counter.start();\n" ret += "counter.stop();\n" ret += "ptalog.passNop(counter);\n" ret += super().start_benchmark(benchmark_id) return ret + def stop_benchmark(self): + ret = super().stop_benchmark() + if self.energytrace_sync == "led": + ret += "runLASync();\n" + return ret + def pass_transition( self, transition_id, transition_code, transition: object = None ): |