CoreMark: The Performance Benchmark Tool for Embedded Processors, Ideal for Single-Core/Multi-Core Embedded Chips

What is CoreMark? CoreMark is a lightweight benchmark suite launched by EEMBC (Embedded Microprocessor Benchmark Consortium) specifically designed to measure the computational power, instruction scheduling, and memory access efficiency of CPU cores. It runs only four core algorithms—linked list, matrix multiplication, state machine, and CRC check—making it both compact (the source code is less than 2 KB) and realistic (the coding style is close to embedded projects), making it very suitable as a performance reference for single-core/multi-core embedded chips.

Core Objectives: 1️⃣ Simple and portable, can run with just a few lines of C code; 2️⃣ Only measures the processor core, unaffected by peripherals or OS; 3️⃣ Results are comparable and can be submitted, with high industry recognition.

What Pain Points Does It Address?

Traditional Pain Points CoreMark Solutions
Inconsistent Benchmarks Different vendors have vastly different scoring methods, making horizontal comparisons difficult. Unified COREMARK 1.0 specification, fixed report format (iterations/sec, compiler, parameters, etc.).
Score Manipulation Modifying source code or datasets during optimization leads to distorted scores. Only modifications to core_portme series files are allowed, and source integrity is automatically verified through <span>make check</span>.
Embedded Platforms Lack OS Many benchmarks depend on Linux/Windows environments. Supports bare-metal porting, providing <span>barebones_porting.md</span> guidelines.
Results Hard to Interpret Is the score due to computational power or memory bandwidth? The four algorithms cover linked list traversal, matrix multiplication, branch prediction, and CRC, focusing on memory access, arithmetic operations, and branching, making the scores more interpretable.

Installation & Usage Made Easy

⚡ Tip: If you just want to run it quickly, simply execute <span>make</span> in the root directory of the source code, and the generated <span>run1.log</span> and <span>run2.log</span> will contain the performance and validation results.

Step Command Description
1️⃣ Download Source Code <span>git clone https://github.com/eembc/coremark.git</span> Official repository, latest version.
2️⃣ Enter Directory <span>cd coremark</span>
3️⃣ Compile <span>make</span> Default for Linux/Unix environment, generates <span>coremark.exe</span> (or <span>coremark</span>).
4️⃣ Run <span>./coremark.exe > run1.log</span> Generates performance log.
5️⃣ View Results <span>grep "Iterations/Sec" run1.log</span> Directly obtain Iterations/Sec (i.e., score).
6️⃣ Cross-Compile <span>make PORT_DIR=arm</span> (first copy <span>linux/*</span> to <span>arm/</span> and modify <span>core_portme.*</span>). Applicable for MCU, DSP, etc.
7️⃣ Multi-Core Parallel <span>make XCFLAGS="-DMULTITHREAD=4 -DUSE_PTHREAD -pthread"</span> 4-core parallel scoring, the report will include an additional <span>M</span> parameter.

Note: The scoring must last for ≥10 seconds, otherwise it does not comply with official submission rules. You can enforce the number of iterations using <span>ITERATIONS=N</span>, for example, <span>make ITERATIONS=10</span>.

Clear Advantages and Disadvantages

Advantages Description
Small Size Complete source code < 2 KB, hardly takes up storage.
Easy Portability Only need to modify <span>core_portme.*</span>, almost all MCUs, DSPs, and FPGAs can run it.
Cross-Platform Uniformity The same source code can yield comparable scores on ARM, MIPS, PowerPC, x86.
Official Certification EEMBC provides a submission platform, widely adopted in the industry.
Multi-Core Support Multi-core throughput can be measured through macro definitions.
Disadvantages Description
Only Measures Core Does not involve peripherals, system calls, or other real workload.
Fixed Dataset May not be representative for specific applications (e.g., AI inference).
Manual Verification Required After modifying the source code, you need to run <span>make check</span> to prevent violations.
Compiler Dependency Different compilers have significant optimization differences, and the compiler version must be specified in the report.

Practical Example: Running CoreMark on STM32

# 1. Pull code from Git
git clone https://github.com/eembc/coremark.git
cd coremark

# 2. Create porting directory for STM32
mkdir stm32 &amp;&amp; cp -r linux/* stm32/
# 3. Edit stm32/core_portme.c, replace with HAL timing functions (e.g., DWT-&gt;CYCCNT)
# 4. Compile (using arm-none-eabi-gcc)
make PORT_DIR=stm32 XCFLAGS="-O2 -mcpu=cortex-m4 -mthumb"
# 5. Flash the generated coremark.exe to the board and run, UART print will show run1.log content

After running, you will see something like this on the serial port:

CoreMark Size     : 666
Total ticks       : 31245
Total time (secs) : 31.245000
Iterations/Sec    : 3200.12
...
CoreMark 1.0 : 3200.12 / GCC 10.3.1 -O2 / Heap

Post this score on the EEMBC official submission page to compare with thousands of MCUs worldwide.

Conclusion

The reason CoreMark is so popular in the embedded community is fundamentally due to its “compact yet comprehensive” nature: it covers four typical operators—linked lists, matrices, state machines, and CRC—with just a few hundred lines of code, reflecting computational power, memory bandwidth, and branch prediction, without interference from the operating system or peripherals. With slight modifications to <span>core_portme.*</span>, it can run on almost all bare-metal platforms, and the results can be directly submitted to the official platform, forming an industry-recognized benchmark.

If you are preparing to evaluate a new chip, perform performance comparisons, or write a technical blog, CoreMark is almost a standard. Don’t forget to clearly state the compiler, compilation options, and whether multi-core is enabled in your report, so that the score can truly “speak” for itself.

Project Address: https://github.com/eembc/coremark

Leave a Comment