<<

Engineer-to-Engineer Note EE-389

Technical notes on using products and development tools Visit our Web resources http://www.analog.com/ee-notes and http://www.analog.com/processors or e-mail [email protected] or [email protected] for technical support.

CoreMark® User's Guide for ADuCM3027/ADuCM3029 Processors Contributed by Monica Redon Rev 1 – May 12, 2016

Introduction requirement. Several benchmarking options are available. is the most widely used This document describes how to obtain the benchmarking option. However, it has few inherit Embedded problems such as having library calls within the Consortium (EEMBC) CoreMark® for the timed portion, being susceptible to a ’s ADuCM3027/ADuCM3029 . It ability to optimize work, and so on. To address also explains how to install the and setup these problems and provide a simple, open source the hardware to measure the EEMBC CoreMark benchmark, EEMBC created the CoreMark. score and reproduce it in the EZ-KIT® board. ADuCM3027/ADuCM3029 About EEMBC General Description EEMBC is a non-profit industry association that The ADuCM3027/ADuCM3029 processor is an detected the need for a joint, democratic effort ultra-low power, integrated mixed-signal involving the leading suppliers in the embedded system used for processing, industry to make new benchmarks a reality. control, and connectivity. The MCU subsystem is EEMBC members represent more than 40 of the based on an ARM® Cortex® -M3 processor, a world’s leading semiconductor, intellectual collection of digital , embedded property, compiler, RTOS, and system SRAM and flash memory, and an analog companies. EEMBC is licensed by more than 80 subsystem which provides clocking, reset and companies and more than 100 universities power management capabilities along with an worldwide. Through the combined efforts of its ADC subsystem. members, EEMBC benchmarks have become an The ADuCM3027/ADuCM3029 processor industry standard for evaluating the capabilities of provides a collection of power modes and features embedded processors and systems according to such as dynamic and software controlled clock objective, clearly-defined, application-based gating and power gating to support extremely low criteria. dynamic and hibernate power management. About CoreMark Overview CoreMark is a benchmark that aims to measure To select a Microcontroller Unit (MCU) for a the performance of central processing units (CPU) particular application, the user need to know if the used in embedded systems. It was developed in MCU has enough processing power to meet the 2009 at EEMBC and is intended to become an

Copyright 2016, Analog Devices, Inc. All rights reserved. Analog Devices assumes no responsibility for customer product design or the use or application of customers’ products or for any infringements of patents or rights of others which may result from Analog Devices assistance. All trademarks and logos are property of their respective holders. Information furnished by Analog Devices applications and development tools engineers is believed to be accurate and reliable, however no responsibility is assumed by Analog Devices regarding technical accuracy and topicality of the content provided in Analog Devices Engineer-to-Engineer Notes. industry standard, replacing the antiquated Dhrystone benchmark. The code is written in and contains implementations of the following :

 List processing (find and sort)  Matrix manipulation (common matrix operations  State machine (determine if an input stream contains valid numbers)  CRC Downloading and Installing IAR Download the IAR software available at: Figure 1. Adding an Existing Project https://www.iar.com/iar-embedded- workbench/#!?architecture=ARM 4. Browse through the project obtained and open the extension file. For more information about how to install the IAR .ewp and add the license (if any), refer to the The files available in the Workspace are shown in Figure 2. Installation and Licensing Guide for IAR Embedded Workbench. Adding CoreMark Project on IAR Project with the CoreMark source files and core_portme.* files are tuned to our platform. The following steps describe how to add the CoreMark project on IAR: 1. Open the IAR workbench. 2. Open the project in IAR. 3. Go to Project > Add Existing Project…, as shown in Figure 1.

Figure 2. Files in the Project

The BSP files are the board support files for the power configurations, UART printing, startup, and so on. The CoreMark sources have the source files given by the EEMBC. The Platform sources contain the core_portme.c file given by the EEMBC, but tuned to support our platform.

CoreMark® User's Guide for ADuCM3027/ADuCM3029 Processors (EE-389) Page 2 of 9

EEMBC does not restrict on changing the Options core_portme.* files to suit our platform. Few options have been changed to support the The following are the differences between the ADuCM3027/ADuCM3029 device. core_portme.c file and the one given by the The following steps show the options that needs EEMBC: to be changed to support the ADuCM3027  Code for UART printing. /ADuCM3029 device:  Code for calculating the ticks of execution 1. Right-click on the name of the Project and using oscillator/crystal. select Options…, as shown in Figure 3.

 Code to configure the microcontroller properly.

 Header files to support these codes. Note:

 The HP Buck is enabled to reduce the power consumption. This is useful during power measurement when CoreMark is running (See Power Measurement on page 8).

 core_portme.h file has two defines:

UART_PRINT define is used to print the result through the UART. If this is commented, the Figure 3. Options result is printed only on the terminal I/O. 2. Go to General Options and select Analog XTAL define is used to measure the ticks using an external oscillator. If this is commented, Devices ADUCM3029, as shown in Figure 4. internal oscillator is used.

Figure 4. Target

CoreMark® User's Guide for ADuCM3027/ADuCM3029 Processors (EE-389) Page 3 of 9

3. Go to Debugger and select J-Link/J-trace as 5. Go to J-Link/J-Trace and select Halt after Driver, as shown in Figure 5. bootloader, as shown in Figure 7.

Figure 7. J-Link/J-Trace-Setup Figure 5. Debugger-Setup 6. Click Connection. Select SWD as Interface 4. Click Download and select Verify download and USB as Communication, as shown in and Use flash loader(s), as shown in Figure 6. Figure 8.

Figure 6. Debugger-Download Figure 8. J-Link/J-Trace-Connection

CoreMark® User's Guide for ADuCM3027/ADuCM3029 Processors (EE-389) Page 4 of 9

7. Go to Linker. Click Checksum and select the options shown in Figure 9.

Figure 10. Linker-Extra Options

For better benchmark results, optimizations Figure 9. Linker-Checksum must be turned ON. 8. Click Extra Options. 9. Go to C/C++ Compiler Category.

Add --keep __checksum in the Command Click Optimizations and select the options line options, as shown in Figure 10. shown in Figure 11.

CoreMark® User's Guide for ADuCM3027/ADuCM3029 Processors (EE-389) Page 5 of 9

Running the Project The following steps describe how to run the project: 1. Right-click on the project name and select Rebuild All, as shown in Figure 13.

Figure 11. C/C++ Compiler-Optimizations

Figure 13. Building Project 10. To add the header files paths, click Preprocessor. Ensure that the directories It prompts to save the Workspace in .eww shown in Figure 12 are included. extension. The project must build without any errors. 2. To load the code onto the EZ-KIT, click Download and Debug, as shown in Figure 14.

Figure 14. Download and Debug

The code is loaded onto the microcontroller. 3. To run the code, click Go, as shown in Figure 15.

Figure 12. C/C++ Compiler-Preprocessor Figure 15. Running the Project

CoreMark® User's Guide for ADuCM3027/ADuCM3029 Processors (EE-389) Page 6 of 9

Figure 16. Results on Terminal I/O

CoreMark Results on The following steps describe how to print the ADuCM3027/ADuCM3029 results through UART:

The CoreMark code runs for specified iterations 1. Uncomment UART_PRINT define. (Number of iterations is set to 10000. Takes about 2. Connect the UART port of the EZ-KIT to the 2 minutes to complete the execution. Minimum computer using a USB cable. run time is 10 seconds), and the results are printed 3. Go to Control Panel > Device Manager. as shown in Figure 16. 4. Check the COM Port number to which the By default, UART_PRINT define in the UART is connected. core_portme.h file is commented. To print the 5. Open a terminal that can connect to the UART results through UART, uncomment UART_PRINT port (Putty is used here). define. 6. Select the Connection Type to Serial, and put the corresponding COM Port number. 7. The other settings are as shown in Figure 18.

Figure 18. UART Configuration

8. Rebuild the project as per the instructions given in Running the Project section. The results are printed through UART.

Figure 17. USB Connection

CoreMark® User's Guide for ADuCM3027/ADuCM3029 Processors (EE-389) Page 7 of 9

Figure 19. Results on UART

The CoreMark number shows the raw horsepower Power Measurement and CoreMark/MHz number shows the efficiency The following steps describe how to monitor the of the core. current consumption of the ADuCM3027/ To calculate the CoreMark/MHz number, the ADuCM3029 processor when it executes the CoreMark number must be divided by the clock CoreMark code: speed used when the benchmark is performed. 1. Ensure that UART_PRINT define in the CoreMark Score file is commented so that the CoreMark/MHz = core_portme.h Clock Frequency UART pins are not floating. In this example, the ADuCM3027/ADuCM3029 2. Load the code onto the microcontroller. processors runs at 26MHz. 3. Connect the positive terminal of the source to the JP6 connector. 85.337589 / = 26 4. Connect GND of the source to the GND of the board. 𝐶𝐶𝐶𝐶𝐶𝐶𝐶𝐶𝐶𝐶𝐶𝐶𝐶𝐶𝐶𝐶 𝑀𝑀𝑀𝑀𝑀𝑀 𝑀𝑀𝑀𝑀𝑀𝑀 5. Remove all the jumpers. The CoreMark/MHz score is 3.2822. 6. Press Reset. This score is almost equal to the CoreMark/MHz 7. Monitor the current consumption on the score of the ARM Cortex-M3 processor whose meter. score is 3.32. It must be around 1165 µA when it executes To report the score, CoreMark recommends using the code at 26 MHz. the following format: 8. For dynamic current consumption, repeat the procedure with a different frequency. Change CoreMark/MHz 1.0: 3.2822 / IAR EWARM the CLKDIV definition variable to 4 so that 7.50.2.10505 --no_size_constraints -- the frequency is divided by 4 giving a value of cpu=Cortex-M3 -D __ADUCM3029__ -- 26 MHz/4=6.5 MHz. no_code_motion -Ohs -e --fpu=None -- endian=little / FLASH 9. Monitor the current consumption on the meter. It must be around 425 µA.

CoreMark® User's Guide for ADuCM3027/ADuCM3029 Processors (EE-389) Page 8 of 9 10. To get the dynamic current consumption The Slope is: value, calculate the slope of the line formed by 1165 425 the two points (Frequency and Current). = 38 A/MHz 26 6.5 − The dynamic current µconsumption is 38 µA/MHz. −

References [1] ADuCM302x Mixed-Signal Control Processor with ARM Cortex-M3 and Low-Power Management Hardware Reference Manual. Revision 0.3, November 2015. Analog Devices, Inc. [2] ADuCM3027/ADuCM3029 Ultra Low-Power ARM Cortex-M3 MCU with Integrated Power Management Datasheet. Rev PrF, February 2016. Analog Devices, Inc.

Document History

Revision Description

Rev 1 – May 12, 2016 Initial Release by Monica Redon

CoreMark® User's Guide for ADuCM3027/ADuCM3029 Processors (EE-389) Page 9 of 9