原创 Using Coremark for benchmarking

2013-1-30 09:57 2093 19 20 分类: 消费电子

Here's a rather meaningless question:


How fast is your CPU?


The amount of work a processor can get done in a period of time is dependent on many factors, including the compiler (and its optimisation level), wait states, background activity such as direct memory access that can steal cycles, and much more. Yet plenty of folks have tried to establish benchmarks to make some level of comparison possible. Principle among these is Dhrystone.


But Dhrystone has problems. Compiler writers target the benchmark with optimisations that may not help developers much, but give better scores. Much of the execution time is spent in libraries, which can vary wildly between compilers. And both the source code and reporting methods are not standardised.


A few years ago the EEMBC people addressed these and other issues with their CoreMark benchmark which is targeted at evaluating just the processor core. It's small—about 16k of code, with little I/O. All of the computations are made at run time so the compiler can't cleverly solve parts of the problem. CoreMark is focused primarily on integer operations—the control problems addressed by embedded systems.


The four bits of workload tested are matrix manipulation, linked lists, state machines, and CRCs. The output of each stage is input to the next to thwart over-eager compiler writers.


One rule is that each benchmark must include the name and version of the compiler used, as well as the compiler flags. Full disclosure, no hiding behind games.


The result has been good news for us. Some of the compiler vendors have taken on CoreMark as the new battleground, publishing their scores and improving their tools to ace the competition. IAR and Green Hills are examples.


Jack's addiction
Scores (www.coremark.org/benchmark/index.php?pg=benchmark) are expressed as raw CoreMark, CoreMark/MHz (more interesting to me), and CoreMark/Core (for multi-core devices). There are two types of results—those submitted from vendors, and those certified by EEMBC's staff (for a charge).


Results range from 0.03 CoreMark/MHz for a PIC18F97J60 to 168 for a Tilera TILEPro64 running 64 threads. The single-threaded max is 5.1 for a Fujitsu SPARK64V(8).


But away from speed demons like Pentium-class or SPARC machines, the highest score is for Atmel's SAM4S16CAU—a Cortex M4 device—which notches in at 3.38 CoreMark/MHz. That beats out a lot of high-end devices.


Clock rates do matter, and while the Intel Core i5 gets a score of 5.09 CoreMark/MHz, its raw result, at 2,500MHz, is 12,715, or 6,458 CoreMark/core. That thrashes the Atmel device, which was tested to 21MHz, where it netted 71 CoreMark.


There are some caveats. Some processors can load the entire test in cache. For those, it makes sense to use some of EEMBC's more comprehensive benchmarks. Wait states are a problem, so tests report where the code runs: if it's from flash it'll generally be slower than from RAM. The nearly-shocking news that the Core i5 is less than two times the score/MHz for a Cortex M4 neglects nifty features like floating point (the i5 has an insanely-fast FPU, which the benchmark's integer tests ignore).


Some companies couple CoreMark with EEMBC's EnergyBench to compute performance per mA, a number of increasing importance.


Best of all, the code is freely available at www.coremark.org.


I've turned into a crack-head, and my drug of choice is the CoreMark scores. It's fascinating to compare various processors and compilers. The results can be pretty surprising.


Thanks to Marcus Levy of EEMBC for answers to my questions.


 

PARTNER CONTENT

文章评论1条评论)

登录后参与讨论

用户1406868 2013-3-30 19:20

Your comments are huefpll. I tried to use an AVR ISP MK2 with Arduino IDE. Didn't work and I'm getting flashing orange on the programmer. I think I'll try to program something using something other than Arduino IDE with the AVR ISP MK2. When I get all that to work successfully then I'll try the JY board again. The advantage of Arduino is all the libary files make make the programming processes very easy. I've played around with the MSP430 and there is an Arduino clone Energia that makes that board easy to program. I got their MATRIX Booster pack to work. I'm trying to find a cheap way to get an LED matrix. MSP430 Launch pad is $5 while an Arduino is $30. JY is $12 with everything.
相关推荐阅读
用户3671694 2016-04-18 17:49
What would you change about C?
If you’re an old-timer you’ve most likely written code in a large number of languages that have ma...
用户3671694 2016-04-18 17:33
A look at a new embedded heap manager
Many of us don’t give much thought about the math our compilers do. Toss off a call to a sine func...
用户3671694 2016-04-15 17:12
Why names are critical
The Linux printk function has various logging levels, which include KERN_EMERG, KERN_ERR and other...
用户3671694 2016-03-14 19:02
What do you think of ultra-low power watchdogs?
I have written extensively about designing ultra-low power systems that operate from coin cells. U...
用户3671694 2016-02-26 21:58
Comment headers: The best and the worst
I read a great deal of code. The vast majority is in C with some C++ and a bit of assembly sprinkl...
用户3671694 2016-02-12 17:58
What's your take on knobs?
In a recent Embedded Muse Richard Wall reviews the latest version of Digilent’s Analog Discovery U...
EE直播间
更多
我要评论
1
19
关闭 站长推荐上一条 /3 下一条