Dhrystone and Whetstone Benchmarks for STM32F103

Post here first, or if you can't find a relevant section!
ag123
Posts: 811
Joined: Thu Jul 21, 2016 4:24 pm

Re: Dhrystone and Whetstone Benchmarks for STM32F103

Post by ag123 » Sun Apr 23, 2017 5:28 pm

try Serial instead of SerialUSB (note, i couldn't get Serial to work, hence i basically used SerialUSB :P )
i've read somewhere that USB needs to keep checking the host for messages, i'd guess that may be a lot of *interrupts* and hence slower (with SerialUSB), just a guess :D

User avatar
Pito
Posts: 1628
Joined: Sat Mar 26, 2016 3:26 pm
Location: Rapa Nui

Re: Dhrystone and Whetstone Benchmarks for STM32F103

Post by Pito » Sun Apr 23, 2017 5:37 pm

Splitting the source file into three is ABSOLUTELY ESSENTIAL !!!
I messed yesterday solving following issue:
1. in CMSIS DSP FFT example I generated 3 sinus tones with diff freqs and ampls
2. in a loop I sum up 3 sins to get the signal
3. while I worked with 1 file, it accepted only 1 (one) sinf in the loop, and that with special care on params - adding another sinf/cosf or any other math function crashed
4. I messed with it all day yesterday, debugging crashed almost randomly in rcc (!!!)
5. then I split it in 3 files (ino, h, cpp) and it works without any issue with absolutely everything I put inside.
Last edited by Pito on Mon Apr 24, 2017 3:36 pm, edited 1 time in total.
Pukao Hats Cleaning Services Ltd.

User avatar
Pito
Posts: 1628
Joined: Sat Mar 26, 2016 3:26 pm
Location: Rapa Nui

Re: Dhrystone and Whetstone Benchmarks for STM32F103

Post by Pito » Mon Apr 24, 2017 11:01 am

-O0, -g, eabi-4.8.3-2014q1, new victor's "Generic STM32F4V Series", HardFPU w/ hard calls, 240MHz clock, Black 407ZET, SerialUSB, ag123's Whetstone:

Code: Select all

Beginning Whetstone benchmark at 240 MHz ...

Loops:1000, Iterations:10, Duration:13510.15 millisec
C Converted Single Precision Whetstones:74.02 mflops
-Os, -g, eabi-4.8.3-2014q1, new victor's "Generic STM32F4V Series", HardFPU w/ hard calls, 240MHz clock, Black 407ZET, SerialUSB, ag123's Whetstone:

Code: Select all

Beginning Whetstone benchmark at 240 MHz ...

Loops:1000, Iterations:10, Duration:6010.35 millisec
C Converted Single Precision Whetstones:166.38 mflops
-O3, -g, eabi-4.8.3-2014q1, new victor's "Generic STM32F4V Series", HardFPU w/ hard calls, 240MHz clock, Black 407ZET, SerialUSB, ag123's Whetstone:

Code: Select all

Beginning Whetstone benchmark at 240 MHz ...

Loops:1000, Iterations:10, Duration:2141.57 millisec
C Converted Single Precision Whetstones:466.95 mflops
PS: the Double Precision results were 23 -Os, 38 -O3 ..
Pukao Hats Cleaning Services Ltd.

ag123
Posts: 811
Joined: Thu Jul 21, 2016 4:24 pm

Re: Dhrystone and Whetstone Benchmarks for STM32F103

Post by ag123 » Mon Apr 24, 2017 8:12 pm

my guess is that those 500mflops benchmarks is always an eyebrow raiser, either way this benchmark is basically *fun* and it is the combined 'power' of a too 'smart' gcc -O3 and ART accelerator :lol:

monsonite
Posts: 49
Joined: Tue May 05, 2015 10:34 am

Re: Dhrystone and Whetstone Benchmarks for STM32F103

Post by monsonite » Fri Sep 22, 2017 8:00 pm

Hi All,

A little late to the party, but now testing 80MHz STM32L433 which is now available on the Arduino IDE.

Microseconds for one run through Dhrystone: 9.00
Dhrystones per Second: 111163.81
VAX MIPS rating = 63.27

You can find the board core for this STM32 here and here

https://github.com/GrumpyOldPizza/arduino-STM32L4

https://github.com/millerresearch/arduino-mystorm

We use the STM32L433 as a suport chip for our open source ICE40 FPGA board - BlackIce

mystorm.uk


Cheers


Ken

ChrisMicro
Posts: 308
Joined: Fri Mar 24, 2017 4:51 pm
Location: Germany

Re: Dhrystone and Whetstone Benchmarks for STM32F103

Post by ChrisMicro » Sat Sep 23, 2017 4:10 am

We use the STM32L433 as a suport chip for our open source ICE40 FPGA board - BlackIce
This one?:
https://www.fpgarelated.com/thread/799/ ... -dev-board
Its written: ICE40HX4K and an STM32F103 Cortex M3

dannyf
Posts: 167
Joined: Wed May 11, 2016 4:29 pm

Re: Dhrystone and Whetstone Benchmarks for STM32F103

Post by dannyf » Sat Sep 23, 2017 9:09 pm

A little late to the party, but now testing 80MHz STM32L433 which is now available on the Arduino IDE.

Microseconds for one run through Dhrystone: 9.00
I didn't see your code but in general, the use of arduino timing function millis() for benchmarking can lead to significant errors -> the standard code under-estimates time elapsed.

It is better to use systick, or dwt.

You can borrow the systick / dwt (coreticks()) code here: https://dannyelectronics.wordpress.com/ ... k-on-mcus/

I also wrote extensively about dhrystone / whetstone performance across multitudes of mcus. they are generally in line with what one would expect, with two exceptions:

1. PIC24 is exceptional in integer performance;
2. MSP432 is terrible in integer math with TI's own compiler.

User avatar
Pito
Posts: 1628
Joined: Sat Mar 26, 2016 3:26 pm
Location: Rapa Nui

Re: Dhrystone and Whetstone Benchmarks for STM32F103

Post by Pito » Sat Sep 23, 2017 10:00 pm

I didn't see your code but in general, the use of arduino timing function millis() for benchmarking can lead to significant errors -> the standard code under-estimates time elapsed.
Do you have an evidence of such failing of millis() to support the statement?
Pukao Hats Cleaning Services Ltd.

victor_pv
Posts: 1750
Joined: Mon Apr 27, 2015 12:12 pm

Re: Dhrystone and Whetstone Benchmarks for STM32F103

Post by victor_pv » Sat Sep 23, 2017 11:34 pm

ChrisMicro wrote:
Sat Sep 23, 2017 4:10 am
We use the STM32L433 as a suport chip for our open source ICE40 FPGA board - BlackIce
This one?:
https://www.fpgarelated.com/thread/799/ ... -dev-board
Its written: ICE40HX4K and an STM32F103 Cortex M3
I suspect it may be a new version of the board, since he called it BlackIce, and the one in the link is ICE40.

dannyf
Posts: 167
Joined: Wed May 11, 2016 4:29 pm

Re: Dhrystone and Whetstone Benchmarks for STM32F103

Post by dannyf » Sun Sep 24, 2017 1:05 am

You can borrow the systick / dwt (coreticks()) code here: https://dannyelectronics.wordpress.com/ ... k-on-mcus/
it was pointed out to me that I actually didn't provide the whetstone benchmark code there -> since corrected, :)

The usage is quite simple:

Code: Select all


#include "dhry.h"  //use dhrystone benchmark
#include "whetstone.h" //use whetstone benchmark

...

  time0=time_now(); //time stamp time0. time_now() is whatever timing function you prefer. For short duration execution, don't use the stock millis()
  //put your benchmark here
  dhrystone(); //dhrystone benchmark, or
  whetstone(); //whetstone benchmark
  time1=time_now() - time0; //calcualte time elapsed
  ...
  
The dhrystone() benchmark comes in three pieces, by design, to prevent the loops being optimized away.

Hope it helps.

You may wish to check out an earlier post: https://dannyelectronics.wordpress.com/ ... hry-stone/

if all you want to do is number crunching, even the low end PIC32s will do very well.

Post Reply