In MCU development and application, engineers need to test the capability of MCU, and the common practice is to use Benchmark program to test. However, when benchmarking, the compiler's optimization capability also has a significant impact on the test results. The same hardware platform with different compilers and different optimization options may yield significantly different results.
In order to maximize the performance of the MCU and achieve the best results in benchmark tests, engineers need to understand not only their own hardware, but also the optimization principles of the compiler and apply them flexibly in order to bring out the full performance of the MCU in benchmark tests. IAR's compilers are often able to produce good benchmarking results for MCUs.
This article takes the IAR Embedded Workbench development tool suite, which has been widely used in the MCU field, as an example to share the items and the following tips that should be noted for MCU software benchmarking to help readers generate the most efficient and complete code in the industry. With the following items and settings, engineers can precisely adjust optimization levels to maximize testing and performance of the developed and applied code.
With development tool suites such as IAR Embedded Workbench, engineers can set optimization levels and types for the entire project scope or for individual files. This can even be done in the source code using the #pragma optimize command for individual functions.
The goal of optimization is to reduce code size and increase execution speed. If only one of these goals can be met, the compiler will prioritize based on the settings specified by the user. Therefore, in real-world software benchmarking, engineers can try various settings to get the best results. For example, since function inlining is more focused on execution speed optimization, using function inlining with generic code execution speed optimization settings will result in smaller program code compared to using generic code size optimization settings.
In order to fully exploit the performance of MCU devices and reduce problems in applications, software development must take into account the memory and other resource constraints of MCU devices, so it is necessary to choose the smallest possible memory model for the target device and project. The advantages of a small memory model include.
Sophisticated development tool suites such as IAR Embedded Workbench also have integrated evaluation capabilities that can evaluate multiple aspects of the memory model, helping engineers to size and optimize their software designs.
By default, runtime libraries are compiled with the highest code size optimization level. If you want to optimize for speed, consider recompiling to generate these libraries. Configuration options are available to set the most appropriate level for certain standard library features such as language environment, file descriptors, and multi-byte.
Select the format of scanf input and printf in the library options, depending on the specific requirements. The default option is not the minimum format.
Data types are closely related to code size or execution speed, so you need to use development tools to observe and analyze data types in order to find the right type for your hardware resources. In the IAR Embedded Workbench development tool suite, developers can start testing and optimizing in the following ways.
All MCU development tools should provide benchmarking-related code, but the code base of established general-purpose development tools is a distillation of these providers' experience in the relevant areas and is therefore more comprehensive and efficient. Some of the key lessons learned include.
By using a proven suite of development tools such as IAR Embedded Workbench and leveraging the knowledge gathered and iterated over decades of global applications, MCU design and application development engineers can quickly complete these essential performance tests and further target the performance of the MCU to achieve optimized, hardware-software integration of the target device.
Manufacturer: Texas Instruments
IC DSP FIXED-POINT 737FCBGA
Product Categories: DSP
Lifecycle:
RoHS:
Manufacturer: Texas Instruments
IC DSP FIXED/FLOATING PNT 256BGA
Product Categories: DSP
Lifecycle:
RoHS:
Manufacturer: Texas Instruments
IC DIGITAL MEDIA SOC 337-NFBGA
Product Categories: SOC
Lifecycle:
RoHS:
Manufacturer: Analog Devices
IC DSP CTLR 32BIT 136CSBGA
Product Categories: 32bit DSP
Lifecycle:
RoHS:
Looking forward to your comment
Comment