summaryrefslogtreecommitdiff
path: root/bin/generate-dfa-benchmark.py
diff options
context:
space:
mode:
authorDaniel Friesel <daniel.friesel@uos.de>2019-09-02 15:51:13 +0200
committerDaniel Friesel <daniel.friesel@uos.de>2019-09-02 15:51:13 +0200
commitbcd014c15b5d9e68f3764a8ae09fa5f20a22dfe8 (patch)
tree5cc7317078a2fea918254f45cb597236000081e1 /bin/generate-dfa-benchmark.py
parent2932819d909fba5d52dba2549889f05aa979aaa8 (diff)
Add basic auto-generated energy accounting code for online model eval
Diffstat (limited to 'bin/generate-dfa-benchmark.py')
-rwxr-xr-xbin/generate-dfa-benchmark.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/bin/generate-dfa-benchmark.py b/bin/generate-dfa-benchmark.py
index 8f061a0..3e4b9a2 100755
--- a/bin/generate-dfa-benchmark.py
+++ b/bin/generate-dfa-benchmark.py
@@ -36,7 +36,7 @@ import io
import yaml
from aspectc import Repo
from automata import PTA
-from codegen import MultipassDriver
+from codegen import MultipassDriver, StaticStateOnlyAccounting
from harness import OnboardTimerHarness
opt = dict()
@@ -102,6 +102,7 @@ def benchmark_from_runs(pta: PTA, runs: list, harness: OnboardTimerHarness, benc
outbuf.write('arch.delay_ms({:d}); // {}\n'.format(opt['sleep'], transition.destination.name))
outbuf.write(harness.stop_run(num_traces))
+ outbuf.write('{}getEnergy();\n'.format(class_prefix))
outbuf.write('\n')
num_traces += 1
@@ -240,7 +241,7 @@ if __name__ == '__main__':
repo = Repo('/home/derf/var/projects/multipass/build/repo.acp')
- drv = MultipassDriver(opt['dummy'], pta, repo.class_by_name[opt['dummy']], enum=enum)
+ drv = MultipassDriver(opt['dummy'], pta, repo.class_by_name[opt['dummy']], enum=enum, accounting=StaticStateOnlyAccounting(opt['dummy'], pta))
with open('/home/derf/var/projects/multipass/src/driver/dummy.cc', 'w') as f:
f.write(drv.impl)
with open('/home/derf/var/projects/multipass/include/driver/dummy.h', 'w') as f: