You are on page 1of 3

An eye on design: Effective embedded system software

ood software design is as impors tant in the development of a product as a strong foundation in the construction of an edifice. This is particularly important in the development of an embedded system where resources like memory, power, and processing capabilities are limited. Continuous innovation, fast-changing consumer needs, and the drive to remain ahead of competitors in terms of market share and product profile has drastically reduced the time to market a product and its development life cycle. The cost of defect correction increases with the development lifecycle stage. Post-release defect fixing is the most costly. Thus, it is important to have good software design and a process in place so that stringent deadlines can be met and rework activities minimized. Good software design should effectively utilize all the hardware capabilities provided by the system-on-chip (SOC). Present day SOCs can contain over 30 different intellectual properties with singleor multicore processors and several hardware accelerators for multimedia and graphics data processing. Some SOCs also contain a dedicated digital signal processor (DSP) for performing specialized tasks. A system-level block diagram of a typical SOC used for general application purposes in consumer and entertainment electronic products like personal digital assistants (PDA), smart phones, portable media players, gaming consoles, car navigation systems, and DVD players is shown in Fig. 1. An engineer entrusted with the development of a specific module or a subsystem should start by studying and analyzing the SOC architecture as a whole and then move toward the analysis of the particular module under consideration. A top-down design approach helps in taking into consideration the interdependencies between various modules, and thus resource sharing and interface design can be done in an effective manner. A post-processor, for example, is one

Sachin P. Kamat

Digital Object Identifier 10.1109/MPOT.2010.937052

INGRAM PUBLISHING & COMSTOCK

SEPTEMBER/OCTOBER 2010

0278-6648/10/$26.00 2010 IEEE

33

Memory is an important and sparse resource in any embedded system, and Multimedia System Peripherals Acceleration it should be used very conservatively. Timers Camera I/F Only the required size of memory should be allocated at the required PLL Video Engine time, and it should be freed immediCPU DMA Image Engine ately upon completion of the operation. Keypad 2D/3D Graphics The holding up of memory unnecessarily when it is not required deprives TV Out Touch Screen other applications from utilizing it, and hence, they might fail to load. High Speed Bus Wherever possible, memory should be shared between modules that operate Connectivity on the same data. This conserves Audio I/F Memory Interfaces memory and improves the performance Serial I/F of the system by reducing the number of memory transfer operations. A Infrared I/F shared memory system requires wellModem I/F LCD designed memory protection and a Controller USB I/F synchronization mechanism to avoid simultaneous read and write operations and to avoid overflow and underflow Fig. 1 Block diagram of a typical general purpose application processor SOC. conditions. Care should also be taken to avoid possible race conditions. Engineers involved in the developsible without architectural redesign. such module present in a multimedia ment of device drivers should give SOCs designed for multimedia applicadevice that is utilized by many other special consideration to the usage of tions generally have multiformat codecs modules like the camera and video and cache memory, direct memory access (MFC) implemented in hardware. MFC image decoders for doing color space (DMA), and interrupt handling mechacan support simultaneous encoding and conversion (YUV to RGB and vice nism. Making a memory cacheable decoding of multiple streams of multiversa), image scaling, and cropping or improves the performance of the sysmedia data of different formats like rotating operations. It is essential to tem. At the same time, it also adds a lot MPEG-4, H.263, and H.264. The design design this module in such a way that of overhead if there are too many should take into consideration the use multiple modules can access it in an cache misses. Direct memory access optimal and nonconflicting way. Fig. 2 helps in faster transfer of bulk data illustrates the use of a post processor without the intervention of the proby multiple peripherals in a multimedia cessing unit. Similarly, interrupt driven embedded system. mechanism is more efficient than pollHardware architecture analysis ing as it frees the processing unit from should immediately be followed by constant monitoring. It also improves software requirement analysis to underthe responsiveness of the system. Interstand the software requirements and rupt handling mechanism should be map it to hardware capabilities. The designed in such a way that it does not hardware might provide several adhamper the real-time performance of case scenarios where these features vanced features that may not be possithe system. may be used and other advanced ble to implement in software all at once An SOC contains several clock sources. software application features that may for various reasons. However, the The main clock, or processor clock, become essential in the near future. design should be accommodative which runs at the highest frequency enough for possible feature addiis primarily responsible for the tion and expansion at a later date. overall system performance and For example, the SOC might supVideo Image power consumption. The periphport dual external camera interCamera Decoder Decoder erals are connected by a peripheral faces. But it may be required to YUV YUV YUV clock and the bus may be clocked attach only one camera for a parPost by the hardware clock. All three ticular model of a product built Processor clocks are in some definite proporusing this SOC. The software RGB tion with the main clock (e.g., 4:2:1 design should be such that it proor 2:1:1). These clocks can further vides provision for connecting be gated or subdivided using clock and using a second external LCD Display TV Out dividers to lower the frequency as camera for a different model of per the requirements. Care should the product using the same SOC. be taken not to affect the operation Similarly, upgrading to multiple Fig. 2 A block diagram, which illustrates the usage of a memory cards or a higher resolu- post-processor module by multiple peripherals for color of other peripherals during the clock alteration. tion of LCD should also be pos- space conversion.
34 IEEE POTENTIALS

Sometimes it is not possible for a particular peripheral or a piece of software code to handle and process all possible cases of input data. A stable software design should have a mechanism to handle unsupported and corrupted data gracefully. Wherever possible, a software workaround and fallback mechanism should be provided to handle these kind of invalid data. Power is another important and scarce resource in battery powered devices. The design should take into account power management aspects to enhance the battery life and reduce the heat dissipation of the chip. Power management features are provided by the hardware chip as well as by the operating system running on it. Dynamic voltage and frequency scaling (DVFS) is a popular power management technique employed in embedded systems. The software design should encompass these features and utilize the hooks provided by the hardware and software platforms.

good software design is one that is a balanced tradeoff between high performance, low memory usage, and low power consumption.

Read more about it


T. A. Henzinger and J. Sifakis, The discipline of embedded systems design, Computer, vol. 40, no. 10, pp. 3240, Oct. 2007. V. Narayanan and Y. Xie, Reliability concerns in embedded system designs, Computer, vol. 39, no. 1, pp. 118120, Jan. 2006.

Wherever there is a possibility of implementing a design in multiple ways, the engineer should analyze and assess each method and choose the one that is most optimal. Good software design should exploit all the features provided by the hardware and give provisions for developing scalable, portable, modular, and highly efficient software in terms of power consumption, memory usage, and performance. Since a high performance output generally requires more memory and consumes more power,

About the author


Sachin P. Kamat (sachin.kamat@ieee. org) received his bachelors degree in electrical and electronics engineering from the National Institute of Technology, Karnataka, India, in 2003. Currently he is working as development lead with Samsung India Software Operations, Bangalore, India, handling the software design of high-end multimedia phones.

YO U K N O W YO U R S T U D E N T S N E E D I E E E I N F O R M AT I O N . N O W T H E Y C A N H AV E I T . A N D Y O U C A N A F F O R D I T .
IEEE RECOGNIZES THE SPECIAL NEEDS OF SMALLER COLLEGES,

and wants students to have access to the information that will put them on the path to career success. Now, smaller colleges can subscribe to the same IEEE collections that large universities receive, but at a lower price, based on your full-time enrollment and degree programs. Find out morevisit www.ieee.org/learning

SEPTEMBER/OCTOBER 2010

35

You might also like