diff options
author | Daniel Friesel <daniel.friesel@uos.de> | 2020-04-30 13:33:17 +0200 |
---|---|---|
committer | Daniel Friesel <daniel.friesel@uos.de> | 2020-04-30 13:33:17 +0200 |
commit | 1d814060715c83e10f4f8541ddb499f8c000ef29 (patch) | |
tree | 423cdc848df93f109647f27b435f86fe5be02fa4 /bin | |
parent | b22f114c3062f25afd5b13cdf8fc8baf4e6cff69 (diff) |
generate-dfa-benchmark: write to ../data by default
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/generate-dfa-benchmark.py | 24 |
1 files changed, 21 insertions, 3 deletions
diff --git a/bin/generate-dfa-benchmark.py b/bin/generate-dfa-benchmark.py index 3b0b4f2..70530ec 100755 --- a/bin/generate-dfa-benchmark.py +++ b/bin/generate-dfa-benchmark.py @@ -3,7 +3,7 @@ Generate a driver/library benchmark based on DFA/PTA traces. Usage: -PYTHONPATH=lib bin/generate-dfa-benchmark.py [options] <pta/dfa definition> [output.cc] +bin/generate-dfa-benchmark.py [options] <pta/dfa definition> [output.cc] generate-dfa-benchmarks reads in a DFA definition and generates runs (i.e., all words accepted by the DFA up to a configurable length). Each symbol @@ -11,6 +11,15 @@ corresponds to a function call. If arguments are specified in the DFA definition, each symbol corresponds to a function call with a specific set of 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 +> git clone .../dfatool +> git clone .../multipass +> cd multipass +> ../dfatool/bin/generate-dfa-benchmark.py ... src/app/aemr/main.cc + Options: --accounting=static_state|static_state_immediate|static_statetransition|static_statetransition_immedate[,opt1=val1,opt2=val2,...] Select accounting method for dummy driver generation. @@ -55,6 +64,12 @@ Options: E.g. --trace-filter='init,foo init,bar' will only consider traces with init as first and foo or bar as second transition, and --trace-filter='init,foo,$ init,bar,$' will only consider the traces init -> foo and init -> bar. +EXAMPLES + +Perform timing measurements of nRF24L01+ function calls: + +../dfatool/bin/generate-dfa-benchmark.py --timer-pin=GPIO::p1_0 --sleep=200 --repeat=3 --depth=10 --arch=msp430fr5994lp --timing --trace-filter='setup,setAutoAck,setDataRate,setPALevel,write,$' model/driver/nrf24l01.dfa src/app/aemr/main.cc + """ import getopt @@ -363,6 +378,9 @@ if __name__ == '__main__': if opt['repeat'] == 0: opt['repeat'] = 1 + if 'data' not in opt: + opt['data'] = '../data' + if 'dummy' in opt: if opt['dummy'] == '': opt['dummy'] = dict() @@ -472,9 +490,9 @@ if __name__ == '__main__': } extra_files = flatten(json_out['files']) if 'instance' in pta.codegen: - output_prefix = time.strftime('/home/derf/var/ess/aemr/data/%Y%m%d-%H%M%S-') + pta.codegen['instance'] + output_prefix = opt['data'] + time.strftime('/%Y%m%d-%H%M%S-') + pta.codegen['instance'] else: - output_prefix = time.strftime('/home/derf/var/ess/aemr/data/%Y%m%d-%H%M%S-ptalog') + output_prefix = opt['data'] + time.strftime('/%Y%m%d-%H%M%S-ptalog') if len(extra_files): with open('ptalog.json', 'w') as f: json.dump(json_out, f) |