Hackfix and re-enable strtoull and wcstoull, see bug #3798.
[sdcc.git] / sdcc-extra / historygraphs / execute_benchmark-mcs51
blobd483855ded3456cbd8481f0f1391754549f8c130
1 #!/bin/bash
2 # Takes a few seconds to execute
3 # C8051F120 variant of C8051 V2.1 board must be attached.
4 # Needs read access to a serial device
5 # Must be able to access the U-EC6.
7 EC2WRITEFLASH=/home/philipp/ec2-new/src/ec2tools/ec2writeflash
9 if [ $# != 2 ]; then
10 echo "execute_benchmark-mcs51: Execute a benchmark on a C8051 V2.1 C8051F120 and report the results line"
11 echo "Wrong number of parameters. Usage: execute_benchmark-mcs51 <serial device> <benchmark file>"
12 exit 1
15 if ! command -v $EC2WRITEFLASH &> /dev/null; then
16 echo "$EC2WRITEFLASH not found!";
17 exit 1
20 # Setup serial device
21 stty --file $1 4800 cooked
23 # Ensure that we don't get any leftover results from an old benchmark still running on the device
24 if ! $EC2WRITEFLASH --port USB --hex hello-mcs51/hello.ihx --run &> /dev/null; then
25 echo "FAILED to write hello.ihx to device!"
26 exit 1
29 while read -r line; do
30 if [ "$line" == "Hello, World!" ]; then
31 break
33 done < "$1"
35 # Load benchmark onto the board
36 if ! $EC2WRITEFLASH --port USB --hex "$2" --run &> /dev/null; then
37 echo "FAILED to write benchmark to device!"
38 exit 1
41 while read -r line; do
42 # Whetstone result
43 if [[ "$line" == "Loops:"* ]]; then
44 break
46 # Dhrystone result
47 if [[ "$line" == "Dhrystones per Second"* ]]; then
48 break
50 # Coremark result
51 if [[ "$line" == "Total ticks"* ]]; then
52 break
54 # stdcbench result
55 if [[ "$line" == "stdcbench final score"* ]]; then
56 break
58 done < "$1"
59 echo $line