A new API from the Multicore Association eases the job of programming increasingly heterogeneous embedded processors.
Until roughly a decade ago, processors consisted of a single core. Performance increases were largely driven by frequency scaling. Since then, processor architectures have undergone significant changes to lower power consumption and optimize performance.
To satisfy the demand for high performance even in small devices, hardware manufactures increasingly provide specialized accelerators for compute-intensive tasks. Many chips for embedded systems not only have an integrated graphics processing unit beside the main processor, but also contain additional hardware such as digital signal processors or programmable logic devices.
The trend towards heterogeneity is expected to continue. One recent study said heterogeneous systems provide an effective way of responding to the ever-increasing demand for computing power. A separate report published by the IEEE said heterogeneous architectures will remain one of the top challenges in computer science until 2022.
Efficiently leveraging the performance of such processors is an intricate task due to diverse programming models, putting an additional burden on software developers. The Multicore Task Management API (MTAPI) specifies interfaces that abstract the underlying hardware and let developers focus on their applications, enabling flexibility and portability.
MTAPI was created by companies in the embedded domain working under the umbrella of the Multicore Association, a non-profit standards group. Recently, the Multicore Association announced the availability of a significantly enhanced implementation of MTAPI integrated into an open source framework called Embedded Multicore Building Blocks (EMB²).
In addition to MTAPI, which takes care of task scheduling and execution, EMB² provides generic building blocks and algorithms for developing compute-intensive applications. Target applications span a wide range of markets such as industrial automation, energy production and management, health care, smart cities, mobility and consumer electronics.
EMB² can be used for image and signal processing for the Internet of Things, for example, as well as applications that have to analyze large amounts of data in real-time and apps that perform complex calculations for simulations or augmented reality. All these applications share a need for heterogeneous computing to provide optimal performance.
There’s an increasing need for high compute capabilities on devices where data is generated. This way, sensitive information can be kept secure and network traffic is reduced compared to pure cloud-based solutions. In fact, low latency is often essential in industrial applications.
While inspired by existing solutions which mainly target the desktop and server market, EMB² has been specifically designed for resource-constrained embedded systems. This includes fine-grained control over the hardware and predictable memory consumption to avoid unintended behavior, a must in safety-critical applications.
Users can implement task-scheduling strategies tailored to their needs and integrate custom hardware via MTAPI scheduler plugins. EMB² ships with ready-to-use plugins for OpenCL, CUDA and network sockets. The latter allows multiple field devices to work on the same computation.
The latest version of EMB² provides compliance with the MTAPI reference implementation plus C++ wrappers for convenient task management. It supports heterogeneous systems at all levels. It addition it has improved support for timing-critical applications using task priorities and affinities.
The framework is available for download at GitHub under a BSD license. Contributions such as enhancements and ports to other operating systems are welcome. More information on EMB² can be found here, and the MTAPI spec can be downloaded for free here.
--Tobias Schüle is a member of Siemens’ corporate technology group and a primary creator of EMB².