diff options
author | Daniel Friesel <daniel.friesel@uos.de> | 2019-07-18 15:38:00 +0200 |
---|---|---|
committer | Daniel Friesel <daniel.friesel@uos.de> | 2019-07-18 15:38:00 +0200 |
commit | 29acf1f00f52235dce3dc7397cecd0127c90b22a (patch) | |
tree | 1d97dcc762121594c04ab2cc080be4c323ac2a85 /bin | |
parent | b3a9c59fb4add0606ae3b61c17d3fe07abc51250 (diff) |
generate-dfa-benchmark: roll your own loop
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/generate-dfa-benchmark.py | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/bin/generate-dfa-benchmark.py b/bin/generate-dfa-benchmark.py index 95fbbb3..2503097 100755 --- a/bin/generate-dfa-benchmark.py +++ b/bin/generate-dfa-benchmark.py @@ -88,9 +88,15 @@ if __name__ == '__main__': outbuf.write('#include "{}"\n'.format(include)) outbuf.write(harness.global_code()) - outbuf.write('void loop(void)\n') + outbuf.write('int main(void)\n') outbuf.write('{\n') + for driver in ('arch', 'gpio', 'kout'): + outbuf.write('{}.setup();\n'.format(driver)) + if 'setup' in pta.codegen: + for call in pta.codegen['setup']: + outbuf.write(call) + outbuf.write('while (1) {\n') outbuf.write(harness.start_benchmark()) class_prefix = '' @@ -127,14 +133,6 @@ if __name__ == '__main__': outbuf.write(harness.stop_benchmark()) print(harness.traces) outbuf.write('}\n') - outbuf.write('int main(void)\n') - outbuf.write('{\n') - for driver in ('arch', 'gpio', 'kout'): - outbuf.write('{}.setup();\n'.format(driver)) - if 'setup' in pta.codegen: - for call in pta.codegen['setup']: - outbuf.write(call) - outbuf.write('arch.idle_loop();\n') outbuf.write('return 0;\n') outbuf.write('}\n') |