summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xbin/eval-online-model-accuracy.py2
-rwxr-xr-xlib/automata.py9
-rw-r--r--lib/harness.py2
3 files changed, 9 insertions, 4 deletions
diff --git a/bin/eval-online-model-accuracy.py b/bin/eval-online-model-accuracy.py
index 49157e5..b4c137e 100755
--- a/bin/eval-online-model-accuracy.py
+++ b/bin/eval-online-model-accuracy.py
@@ -164,7 +164,7 @@ if __name__ == '__main__':
real_durations = list()
model_energies = list()
# duration in µs
- # Bei kurzer Dauer (z.B. nur [1e2]) performt auc uint32_t für Energie gut, sonst nicht so (weil overflow)
+ # Bei kurzer Dauer (z.B. nur [1e2]) performt auch uint32_t für Energie gut, sonst nicht so (weil overflow)
for sleep_duration in [1e2, 1e3, 1e4, 1e5, 1e6]:
runs = pta.dfs(opt['depth'], with_arguments=True, with_parameters=True, trace_filter=opt['trace-filter'], sleep=sleep_duration)
for run in runs:
diff --git a/lib/automata.py b/lib/automata.py
index d36acd7..a80796c 100755
--- a/lib/automata.py
+++ b/lib/automata.py
@@ -575,6 +575,8 @@ class PTA:
kwargs['is_interrupt'] = transition['is_interrupt']
if 'return_value' in transition:
kwargs['return_value_handlers'] = transition['return_value']
+ if 'codegen' in transition:
+ kwargs['codegen'] = transition['codegen']
if 'loop' in transition:
for state_name in transition['loop']:
pta.add_transition(state_name, state_name, trans_name,
@@ -784,7 +786,7 @@ class PTA:
ret.append((transition, arguments, param))
yield ret
- def bfs(self, depth: int = 10, orig_state: str = 'UNINITIALIZED', transition_filter=None, state_filter=None):
+ def bfs(self, depth: int = 10, orig_state: str = 'UNINITIALIZED', param_dict: dict = None, with_parameters: bool = False, transition_filter=None, state_filter=None):
"""
Return a generator object for breadth-first search of traces starting at orig_state.
@@ -804,6 +806,9 @@ class PTA:
:param orig_state: initial state for breadth-first search
:param depth: search depth, default 10
+ :param param_dict: initial parameter values
+ :param with_arguments: perform dfs with argument values
+ :param with_parameters: include parameters in trace?
:param transition_filter: If set, only follow a transition if transition_filter(transition object) returns true. Default None.
:param state_iflter: If set, only follow a state if state_filter(state_object) returns true. Default None.
"""
@@ -935,4 +940,4 @@ class PTA:
transition.timeout_function = param_model(transition.name, 'timeout')['function']
except KeyError:
print('[W] skipping model update of transition {} due to missing data'.format(state.name))
- pass \ No newline at end of file
+ pass
diff --git a/lib/harness.py b/lib/harness.py
index 7a336e5..59b5fa0 100644
--- a/lib/harness.py
+++ b/lib/harness.py
@@ -330,7 +330,7 @@ class OnboardTimerHarness(TransitionHarness):
log_data_target['parameter'][parameter_name].append(parameter_value)
def parser_cb(self, line):
- #print('[HARNESS] got line {}'.format(line))
+ # print('[HARNESS] got line {}'.format(line))
res = re.match(r'\[PTA\] nop=(\S+)/(\S+)', line)
if res:
self.nop_cycles = int(res.group(1))