Global Sources
EE Times-Asia
Stay in touch with EE Times Asia
EE Times-Asia > Embedded

Use multi-core with multi-OS software architecture

Posted: 14 Oct 2013 ?? ?Print Version ?Bookmark and Share

Keywords:embedded systems? Multicore? multiple OS? SoC? Symmetric and Asymmetric Multiprocessing?

The objective of engineering is to do things as efficiently as possible, and this is especially true in embedded systems. As engineers, we are tasked to make the impossible, possible. Do things with less power, in less time, or a higher bandwidth, or greater security. These are the driving forces in our industry that keep us moving forward.

Multicore as an architecture that is disruptive yet a logical extension to the single-core systems is no different.

There are some key benefits moving to multi-core where we can take advantage of several cores to parallelise the application. But there are cases where multi-core, if done improperly, can actually slow down the processing and make the move to multi-core worthless.

Here we will get into the architectural choices from the hardware capabilities, to the software choices including multiple OS's, and how to make them efficient for your design. We will get into working both in software and hardware that can make the challenges understood. We will look virtualisation technologies and necessary OS choices for both Symmetric and Asymmetric operating environments. Lastly, we will get into tuning of a multi-core system so we can assess just how well the system is performing under a load.

Figure 1: Freescale i.MX6 Quad Core SoC.

What's in the hardware?
The System on a Chip (SoC) has been growing in complexity because of two main factors. First, the cost of the logic to put more transistors in an SoC is decreased. SoC's balance the needs to size, weight, power, and speed to become the modern workhorse in embedded systems. No longer is it customary to integrate discrete components for the most common of interfaces.

The SoC's have encapsulated many different peripherals into themselves. Additionally modern SoC's are overloading the pins and putting in many more peripherals than there are pins, and the system must initialise all the interconnects to bring out the right peripherals to the right pins, and route the interrupts to the right place. This means by necessity that that the software is more complex.

There are two main trends in multi-core systems and they are Symmetric and Asymmetric Multiprocessing or SMP and AMP for short. SMP has the advantage that with all the cores the same, you can write the code to run on one core and the code will run on all the SMP capable cores.

AMP being a much older technology C yet still relevant today, allows for dedicated processors like a Digital Signal Processor (DSP) core for signal processing alongside, a general processor for the more nominal features of an SoC. Both are valid, and coexist quite nicely. We will look at how to take advantage of both even on SMP hardware.

Shown in figure 1 below is an SoC with a quad core Cortex-A9 SoC. As you can see the complexity in SoC is more than just the multiple CPU's. There are many IP blocks for dedicated purposes like connectivity, System control and graphics acceleration, power management and security.

SMP scheduling
We will focus on how to use the CPUs in the multi-core/multi-OS paradigm. With 4 cores at our disposal, we can think of using them as a single OS domain. One scheduler will prioritise the tasks and interrupts onto all 4 cores.

The OS will take care of the details adding just a bit of complexity to handle multiple threads to be scheduled simultaneously by adding a spinlock. The OS itself will initiate the system on core 0 and bring the system up.

Once the system is fully operational, the scheduler will engage each core to start processing. Each core will run the schedule and pick out a thread to run. The OS itself can execute on all cores scheduling from the same free thread list, but adding the concept of a spinlock.

A spinlock, like a semaphore from the single CPU scenario, is used to protect critical regions for multiple tasks from accessing the same block of data at the same time. Where a semaphore will allow a task to access a critical region, and block all the other threads from accessing it, a spinlock keeps the threads executing on the blocked CPU core in a tight loop waiting for the resource to be free.

1???2???3?Next Page?Last Page

Article Comments - Use multi-core with multi-OS softwar...
*? You can enter [0] more charecters.
*Verify code:


Visit Asia Webinars to learn about the latest in technology and get practical design tips.

Back to Top