summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDaniel Friesel <daniel.friesel@uos.de>2019-08-15 11:49:05 +0200
committerDaniel Friesel <daniel.friesel@uos.de>2019-08-15 11:49:05 +0200
commitd38c3a191c44806d87584b7bd6052072820bcea3 (patch)
tree2f280d7612212a6d9b8d76f36956255aeff75d69 /lib
parent45952580a0acd645d032509908d0a82f72bd9c74 (diff)
Fix generate-dfa-benchmark leaving out benchmark parts when splitting runs
Diffstat (limited to 'lib')
-rwxr-xr-xlib/dfatool.py2
-rw-r--r--lib/harness.py25
2 files changed, 24 insertions, 3 deletions
diff --git a/lib/dfatool.py b/lib/dfatool.py
index e318e81..528eabc 100755
--- a/lib/dfatool.py
+++ b/lib/dfatool.py
@@ -537,7 +537,7 @@ class TimingData:
for filename in self.filenames:
with open(filename, 'r') as f:
log_data = json.load(f)
- self.traces_by_fileno.append(log_data['traces'])
+ self.traces_by_fileno.extend(log_data['traces'])
self._concatenate_analyzed_traces()
def get_preprocessed_data(self, verbose = True):
diff --git a/lib/harness.py b/lib/harness.py
index 020bc72..af74977 100644
--- a/lib/harness.py
+++ b/lib/harness.py
@@ -11,15 +11,30 @@ import re
# generated otherwise and it should also work with AnalyticModel (which does
# not have states)
class TransitionHarness:
+ """Foo."""
def __init__(self, gpio_pin = None, pta = None, log_return_values = False):
+ """
+ Create a new TransitionHarness
+
+ :param gpio_pin: multipass GPIO Pin used for transition synchronization, e.g. `GPIO::p1_0`. Optional.
+ The GPIO output is high iff a transition is executing
+ :param pta: PTA object
+ :param log_return_values: Log return values of transition function calls?
+ """
self.gpio_pin = gpio_pin
self.pta = pta
self.log_return_values = log_return_values
self.reset()
+ def copy(self):
+ new_object = __class__(gpio_pin = self.gpio_pin, pta = self.pta, log_return_values = self.log_return_values)
+ new_object.traces = self.traces.copy()
+ new_object.trace_id = self.trace_id
+ return new_object
+
def reset(self):
self.traces = []
- self.trace_id = 1
+ self.trace_id = 0
self.synced = False
def global_code(self):
@@ -102,12 +117,18 @@ class TransitionHarness:
pass
class OnboardTimerHarness(TransitionHarness):
+ """Bar."""
def __init__(self, counter_limits, **kwargs):
super().__init__(**kwargs)
- self.trace_id = 0
self.trace_length = 0
self.one_cycle_in_us, self.one_overflow_in_us, self.counter_max_overflow = counter_limits
+ def copy(self):
+ new_harness = __class__((self.one_cycle_in_us, self.one_overflow_in_us, self.counter_max_overflow), gpio_pin = self.gpio_pin, pta = self.pta, log_return_values = self.log_return_values)
+ new_harness.traces = self.traces.copy()
+ new_harness.trace_id = self.trace_id
+ return new_harness
+
def global_code(self):
ret = '#include "driver/counter.h"\n'
ret += '#define PTALOG_TIMING\n'