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
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>"
15 if ! command -v $EC2WRITEFLASH &> /dev
/null
; then
16 echo "$EC2WRITEFLASH not found!";
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!"
29 while read -r line
; do
30 if [ "$line" == "Hello, World!" ]; then
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!"
41 while read -r line
; do
43 if [[ "$line" == "Loops:"* ]]; then
47 if [[ "$line" == "Dhrystones per Second"* ]]; then
51 if [[ "$line" == "Total ticks"* ]]; then
55 if [[ "$line" == "stdcbench final score"* ]]; then