summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Friesel <daniel.friesel@uos.de>2020-05-14 09:18:49 +0200
committerDaniel Friesel <daniel.friesel@uos.de>2020-05-14 09:18:49 +0200
commitf057c3af79962cfa953fe3f4b7464cec4a3ba74e (patch)
treec983d1f7251c0b40ebb67608aa03d23a274809e6
parent5a6ecfff51e82981e0a4a1429a9ce977600dae82 (diff)
generate-{dfa-benchmark,dummy-class}: use relative paths
-rwxr-xr-xbin/generate-dfa-benchmark.py12
-rwxr-xr-xbin/generate-dummy-class.py8
2 files changed, 12 insertions, 8 deletions
diff --git a/bin/generate-dfa-benchmark.py b/bin/generate-dfa-benchmark.py
index 1180ee9..fedd12b 100755
--- a/bin/generate-dfa-benchmark.py
+++ b/bin/generate-dfa-benchmark.py
@@ -14,7 +14,7 @@ arguments (so all argument combinations are present in the generated runs).
It expects to be called from a multipass instance and writes data to ../data.
Recommended setup:
-> mkdir data
+> mkdir -p data/cache
> git clone .../dfatool
> git clone .../multipass
> cd multipass
@@ -25,6 +25,9 @@ Options:
Select accounting method for dummy driver generation.
May be followed by a list of key=value driver options, e.g. energy_type=uint64_t
+--data=<data path>
+ Directory in which the measurements will be stored. Default: ../data
+
--dummy=<class name>
Generate and use a dummy driver for online energy model overhead evaluation
@@ -319,6 +322,7 @@ if __name__ == '__main__':
'accounting= '
'arch= '
'app= '
+ 'data= '
'depth= '
'dummy= '
'energytrace= '
@@ -424,7 +428,7 @@ if __name__ == '__main__':
run_flags = ['drivers=dummy']
- repo = Repo('/home/derf/var/projects/multipass/build/repo.acp')
+ repo = Repo('../multipass/build/repo.acp')
if 'accounting' in opt and 'getEnergy' not in map(lambda x: x.name, pta.transitions):
for state in pta.get_state_names():
@@ -443,9 +447,9 @@ if __name__ == '__main__':
else:
accounting_object = None
drv = MultipassDriver(class_name, pta, repo.class_by_name[class_name], enum=enum, accounting=accounting_object)
- with open('/home/derf/var/projects/multipass/src/driver/dummy.cc', 'w') as f:
+ with open('../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:
+ with open('../multipass/include/driver/dummy.h', 'w') as f:
f.write(drv.header)
if '.json' not in modelfile:
diff --git a/bin/generate-dummy-class.py b/bin/generate-dummy-class.py
index 15cc147..d86339b 100755
--- a/bin/generate-dummy-class.py
+++ b/bin/generate-dummy-class.py
@@ -5,10 +5,10 @@ from dfatool.codegen import MultipassDriver
from dfatool.automata import PTA
import yaml
-with open('/home/derf/var/projects/multipass/model/driver/nrf24l01.dfa', 'r') as f:
+with open('../multipass/model/driver/nrf24l01.dfa', 'r') as f:
driver_definition = yaml.safe_load(f)
pta = PTA.from_yaml(driver_definition)
-repo = Repo('/home/derf/var/projects/multipass/build/repo.acp')
+repo = Repo('../multipass/build/repo.acp')
enum = dict()
@@ -17,7 +17,7 @@ if 'dummygen' in driver_definition and 'enum' in driver_definition['dummygen']:
drv = MultipassDriver('Nrf24l01', pta, repo.class_by_name['Nrf24l01'], enum=enum)
-with open('/home/derf/var/projects/multipass/src/driver/dummy.cc', 'w') as f:
+with open('../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:
+with open('../multipass/include/driver/dummy.h', 'w') as f:
f.write(drv.header)