Você está na página 1de 5

Using Multicore Processors in Embedded Systems

Many of the developments in silicon, software and development tools that embedded engineers use today first appeared in disciplines other than embedded computing, and have been adopted and adapted from these other disciplines to meet the requirements of embedded projects. For example, the C-language was developed at Bell Labs for implementing system software on Unix machines, and GUIs found their first applications in gaming machines and PCs. It is natural therefore that the embedded community should look to their colleagues in other disciplines, especially the PC industry, for the Next Big Thing. One requirement that all computer users, whether they be in embedded, desktop, gaming or whatever market segments, have in common is an insatiable demand for more performance. MOOREs LAW In the past, this demand has largely been met by applying Moores Law, which can be roughly summarised as shrink the silicon and increase the clock speed.

Architectural improvements such as caches, pipelining , FPUs, superscalar architectures and hyperthreading have also played their part in increasing system performance. These improvements have combined to provide system designers with a golden age of increasing performance and lower cost, and all without having to make a single change to the software. LAWS OF PHYSICS However, because of immutable physical constants such as the speed of light, the size of electrons, and the operating temperature limits of silicon , Moores Law can no longer be relied on to provide extra performance ad infinitum. In fact we have already arrived at the point where clock speeds are plateauing at around the 3Ghz mark. So has the computer revolution run out of steam? Will the desktop and embedded systems of tomorrow be so weighed-down by bloatware, anti-spyware, anti-malware and search-engines-that-know-the-answer- beforethey-are-even-asked-a-question, that the poor old CPU will either grind to a complete halt, or simply melt? The answer of course is no, and the technological innovation which will propel the computer industry along its ever-upward growth curve is the multicore processor. NEW LAMPS FOR OLD? Computing with several CPUs is not a new idea. PCs have had support for SMP (Symmetrical Multiprocessing) for many years, and companies like Cray, Amdahl and IBM have been making a good living out of building Supercomputers with tens, hundreds or even thousands of computing elements for even longer than that. What is new is the ubiquity, or availability, of such devices, enabled primarily by the chip manufacturers who supply the PC industry. Intels first dual-core processors first appeared around 2004, and AMDs followed soon after. Aimed initially at the desktop market, these processors were quickly taken up by the manufacturers of embedded SBCs, and there is now a wide range of boards in different formats sporting dual and quad-core CPUs. Outside of the PC-world, Sun and IBM have also offered multiprocessor and muticore servers for a number of years. For embedded developers, ARM has announced a multicore roadmap based on the Cortex-A9 MPCore multicore processor, while Freescales PowerPC CPUs have a second processor core dedicated to IO tasks. Once seen as exotic, multicore is now mainstream, and here

to stay. So does this mean the Golden Ageof ever-increasing performance can continue, uninterrupted and unbounded? Can a programmer keep on making his code run faster, just by plugging in a new CPU as before? Not quite, because although previous performance tweaks did not require any changes to the software, multicore does require fundamental changes, in the shape of multithreading, to make best use of the available power.

MULTITHREADING Multithreading is another concept which has been around for some time. It is possible to run multithreaded code on a single CPU or core, but the big advantage that multicore offers is parallelism, and parallelism absolutely requires multithreading. This is true whether the code is legacy code, which is being moved onto a multicore platform to prolong its operating life, or whether it is a new application being built from scratch, with the benefits of multicore in mind.

TOOLS There is a new generation of development tools springing up to meet the demand for editing, simulating and building multithreaded applications. There are even tools which can take a piece of monolithic, single-threaded code and break it down into separate threads, making it suitable for running in parallel on multicore processors. These tools are expected to find application in market segments such as aerospace, defence and finance, where large monolithic applications are re-used over many generations of hardware. But history shows that software tools soon become repackaged and adapted for use in embedded projects.

PARALLELISM So what exactly is parallelism? There are two distinct types: data parallelism and task parallelism. An example of data parallelism would the manipulation of a graphical image, e.g. bitmap, where pieces of the bitmap can be divided up and worked on independently of the others. In a task-parallel situation, a number of different tasks are being carried out simultaneously with the results joined together at the end, e.g. a database query. Each type of parallelism requires different techniques to optimise for multicore, and this is where most programmers could use a little helping hand. It has been noted that Most programmers dont write native threads - so what assistance is available for such mortals?

OPEN MP The OpenMP Application Program Interface (API) supports multi-threaded, multi-platform shared-memory parallel programming in C/C++ and Fortran. OpenMP is a portable, scalable model with a simple and flexible interface for developing parallel applications on platforms from the desktop to the supercomputer. Open MP is supported by a number of commercially- available compilers. For further information about Open MP please see http://openmp.org

EXAMPLES OF COMMERCIALLY AVAILABLE TOOLS For developers on multicore x86 platforms there is a range of software tools, including compilers, thread building blocks, integrated performance primitives and threading analysis tools available from Intel under their Parallel Studio (TM) portfolio. All Intel compilers support Open MP, and supported OS platforms include Windows, Linux, QNX and MAC-OS. Many RTOS vendors are also building support for multicore and multithreading into their products. One such is Interval Zero, whose RTX real-time extension to Windows supports up to 8 cores, with the portioning of the cores between real-time and non-real-time being under full control of the programmer.

CONCLUSION We have seen that the semiconductor industry can no longer rely on Moores Law, as it was originally conceived, to meet the demand for increased performance in computer systems. Device geometry and clock speeds are limited by the laws of Physics, so a new approach is required. Parallel Processing, enabled by multicore processors hitherto found only in exotic supercomputers, seems to offer a solution, but adding extra cores by itself does not guarantee increased performance. Designers must take adapt a system-wide view and optimise the operating systems and applications to take advantage of the

potential benefits of multicore. This requires specialised tools and techniques for the creation of optimised, multithreaded programs which can take full advantage of the new hardware architectures. In the embedded space, specialised processors such as DSPs and communications processors are giving way to GPUs (General Purpose Processors) with additional functionality, bringing big benefits and cost-savings resulting from unified development environments and methodologies. Advances in the desktop world can benefit the developers of embedded systems as they converge on common tools and platforms. The move to parallel processing is a true Paradigm Shift affecting both the enterprise and embedded communities. All trade marks, devices and other IP are recognised as being the property of their respective owners.

Useful weblinks: Open MP: http://openmp.org Intel Parallel Studio: http://software.intel.com/en-us/intel-parallel-studio-home/ Intel Compilers: http://software.intel.com/en-us/intel-compilers/ Interval Zero RTX: http://www.intervalzero.com/rtx.htm

2009 Dale Fittes Technical Specialist Hitex UK Ltd Warwick University Science Park Coventry CV4 7EZ email: dfittes@hitex.co.uk Tel: +44(0) 2476 692066 www.hitex.co.uk

Você também pode gostar