summaryrefslogtreecommitdiff
path: root/bin/generate-dfa-benchmark.py
diff options
context:
space:
mode:
authorDaniel Friesel <daniel.friesel@uos.de>2019-07-18 15:38:00 +0200
committerDaniel Friesel <daniel.friesel@uos.de>2019-07-18 15:38:00 +0200
commit29acf1f00f52235dce3dc7397cecd0127c90b22a (patch)
tree1d97dcc762121594c04ab2cc080be4c323ac2a85 /bin/generate-dfa-benchmark.py
parentb3a9c59fb4add0606ae3b61c17d3fe07abc51250 (diff)
generate-dfa-benchmark: roll your own loop
Diffstat (limited to 'bin/generate-dfa-benchmark.py')
-rwxr-xr-xbin/generate-dfa-benchmark.py16
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')