Multicore RTOS implementation using SynthOS

For those who did not notice yet, Moore’s law is not working anymore, at least in the context of single core CPU architectures. Increasing the speed of the CPU is not happening every 18 months. To get better performance for devices, developers need to look for other system-level solutions. The most common way to increase system performance today is to increase the number of CPU cores in a device and do parallel processing.

The move to a multicore architecture holds great promise for improving system performance, but it requires very careful attention to the software architecture. The great challenge for achieving this potential for system performance improvement from a multicore architecture is the correct and efficient scheduling of threads to the different cores and minimizing the serialized processing in the system. Amdahl’s law predicts the relationship between the percentage of serial processing and the speedup in processing. For example, this law shows that with 50% of the code being serialized, the speedup will be limited to a factor of two, independent of the number of cores used.

Amdahls Law

The problem facing the software developers and especially for embedded system, is how to build an efficient software that will take advantage of the multicore architecture. The most common way for developers to generate an efficient system is to write their own kernel and scheduler.  SynthOS and the process of software synthesis can present a new methodology and tool for creating the software architecture to support multicore and multiprocessors systems.  SynthOS is a revolutionary tool, allowing a programmer to synthesize an application-specific real-time operating system (ASOS). The programmer writes code in C and adds simple SynthOS statements to the code to specify inter-task communications and operating system parameters. The output code, after synthesis, is still C code.

SynthOS can be used to develop an ASOS that will run efficiently on each of the cores in a multicore system and help get the system performance needed to take advantage of a multicore architecture.  Using SynthOS you can build an application-specific operating system (“ASOS”) for each of the cores. This is very efficient, especially when dealing with asymmetric core architectures consisting of different types of cores in the same system. This method allows you to build a specific ASOS for each of the cores in a way to support specific capabilities of the core such as a power management or trusted boot loader. Using a separately developed ASOS for each of the cores will require you to define a communication mechanism between the cores. One simple and efficient option is to use a shared memory block with a semaphore. Another way is to use a dedicated communication protocol such as SPI, I2C, or USB to manage the communications, using a SynthOS Call task for synchronized communication or a SynthOS Start task for un-synchronized communication.

The approach of developing an individual custom ASOS for each of the cores can be especially efficient in a multicore environment where every core is expected to do specific tasks, whether in a symmetric or asymmetric architecture. For example, you can have some of the cores run an ASOS created by SynthOS that is built specifically to perform fixed tasks, particularly those that are closely tied to the hardware other cores in the system can run an off-the-shelf OS when the ability to add applications dynamically is required.

In the future, there are plans for SynthOS to support multicore systems more automatically. In a first step toward this goal, Zeidman Technologies is working on a multicore version of SynthOS that allows the user to specify in the SynthOS project file which tasks run on which cores. The user will also be able to specify the shared memory area so that SynthOS can create the semaphore in the code automatically as it does for communication between threads running on a single processor. Eventually, SynthOS will also be able to allocate tasks to different cores depending on parameters set by the user in the SynthOS project file. Also, SynthOS will be able to allocate tasks to cores using a load balancing algorithm that takes into account performance requirements such that each core roughly utilizes the same memory and/or CPU cycles, creating a significantly well-balanced and efficient system without the need for manual experimentation.

Jacob Harel
VP of Product Management
Zeidman Technologies