Download the PDF of this article.
C and C++ compilers tend not to be sexy, but they’re used to build the embedded infrastructure from the cloud down to motor control systems. They compile the code for self-driving cars and medical devices, which tend to require a bit more oversight than the code for the latest remote light switch or voice-activated cloud portals. Then again, those Internet-of-things (IoT) devices could be a little safer and more secure.
LLVM’s Clang and GNU Project’s gcc compilers make up the bulk of C and C++ compilers in the open-source space, and they are also bundled with many integrated development environments (IDE) available from chip and system vendors. These are useful for a wide range of applications, but things get a bit more difficult when systems need to meet the highest levels of functional safety levels like ISO 26262 ASIL D (automotive), IEC 61508 SIL 4 (industrial) and EN 50128 SWSIL 4 (railway) standards.
Image courtesy of Thinkstock
One compiler toolchain that meets these strict requirements is Green Hills Software’s latest Optimizing Compiler 2017. It also incorporates single-pass MISRA-C adherence checker. Static analysis features like this should not be overlooked by developers in general: It’s not just for automotive applications. Less than half of the developers in our 2017 Embedded Revolution survey employed tools like this.
Having a fast, efficient feature like this in the compiler makes adoption more likely. The argument type checking available with Green Hills compilers can catch mismatches across modules.
The compiler supports 32-bit and 64-bit embedded processor architectures, including ARM, Intel, and Power Architecture. It has C++11 support and takes advantage of hardware acceleration like ARM’s 28-bit SIMD (Single Instruction, Multiple Data) NEON vector unit with autovectorization support. On Intel platforms, the compiler supports the latest Intel Streaming SIMD Extensions (SSE4) instructions. It handles the Power Architecture e200 processor, including new DSP and SPE2 instructions.
The Optimizing Compiler 2017 support is integrated with Green Hill’s MULTI IDE, which also supports its INTEGRITY RTOS. In addition, INTEGRITY addresses safety and security applications meeting the following standards: DO-178B, Level A (INTEGRITY-178 RTOS); EAL 6+ High Robustness Common Criteria; SKPP; FDA: Class II and Class III medical device approval; 50128 SWISL 4 railway control; IEC: 61508 SIL 3-certified industrial control systems; and ISO 26262.
Making sure the compiler generates object code based on the source code is part of the critical aspect of Green Hills’ solution, but performance is also a prime reason for choosing its tools. That is one reason why many vendors choose it for benchmarking using EEMBC’s embedded benchmarks like CoreMark and ULP Bench. The latter tests power efficiency.
Memory efficiency is another area that embedded developers place high on their checklist for compilers. Green Hills’ Optimizing Compiler 2017 does well in this area. Some customers have seen as much as a 30%improvement in memory requirements. This can allow an application to fit into a smaller, less costly platform.