diff options
author | Daniel Friesel <daniel.friesel@uos.de> | 2019-09-06 15:12:00 +0200 |
---|---|---|
committer | Daniel Friesel <daniel.friesel@uos.de> | 2019-09-06 15:12:00 +0200 |
commit | 1a7c8bdb477987eb6e0f6710e68148c4d46e01ab (patch) | |
tree | 526e415450d6bd547c26bfa061c2d9a450e6aee5 /bin | |
parent | 56fe4ce54cebc8151f784a56ac545795531e6909 (diff) |
Add static state-only online accounting with immediate energy calculation
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/generate-dfa-benchmark.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/bin/generate-dfa-benchmark.py b/bin/generate-dfa-benchmark.py index 3e4b9a2..640f4a1 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, StaticStateOnlyAccounting +from codegen import * from harness import OnboardTimerHarness opt = dict() @@ -102,7 +102,8 @@ 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)) + if dummy: + outbuf.write('kout << "[Energy] " << {}getEnergy() << endl;\n'.format(class_prefix)) outbuf.write('\n') num_traces += 1 @@ -241,6 +242,8 @@ if __name__ == '__main__': repo = Repo('/home/derf/var/projects/multipass/build/repo.acp') + pta.set_random_energy_model() + 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) |