struct / union in initializer, RFE #901.
[sdcc.git] / sdcc-extra / historygraphs / execute_benchmark-z80
blobd21188e37fc4fd1c3fa228bd1b6852ce9fa86f26
1 #!/bin/bash
2 # Takes a few seconds to execute
3 # Z80-MBC2 board must be attached.
4 # Needs read/write access to the serial device
6 STM8FLASH=/home/philipp/stm8flash/stm8flash
8 if [ $# != 2 ]; then
9 echo "execute_benchmark-z80: Execute a benchmark on an Z80-MBC2 board and report the results line"
10 echo "Wrong number of parameters. Usage: execute_benchmark-z80 <serial device> <benchmark file>"
11 exit 1
14 # Setup serial device
15 stty --file $1 115200 cooked
16 sleep 2
18 # Load benchmark onto the board
19 if ! $STM8FLASH -c stlinkv2 -p stm8af5288 -w "$2" &> /dev/null; then
20 echo "FAILED to write benchmark to device!"
21 exit 1
23 while read -r line; do
24 # Whetstone result
25 if [[ "$line" == "Loops:"* ]]; then
26 break
28 # Dhrystone result
29 if [[ "$line" == "Dhrystones per Second"* ]]; then
30 break
32 # Coremark result
33 if [[ "$line" == "Total ticks"* ]]; then
34 break
36 # stdcbench result
37 if [[ "$line" == "stdcbench final score"* ]]; then
38 break
40 done < "$1"
41 echo $line