13
OPTIMISATION OF EMBEDDED COMPLIERS Submitted By N. Sai Mani Bharath 14481D5521

optimisation of embeded compilers

Embed Size (px)

DESCRIPTION

requirements of compilers in embedded system and their optimisation

Citation preview

Page 1: optimisation of embeded compilers

OPTIMISATION OF EMBEDDED COMPLIERS

Submitted ByN. Sai Mani Bharath

14481D5521

Page 2: optimisation of embeded compilers

Contents

• Introduction• Designing Compilers• Compilers Optimization Techniques for Embedded Systems • Source level optimization – Platform independent• Assembly level optimization – Platform dependent• Conclusion

Page 3: optimisation of embeded compilers

Introduction• A Compiler is a piece of software that performs translation

from the source language to the target language • In most cases, the source language is the high-level language

like C and the target language is the machine dependent executable binaries.

• An Embedded System is a specialized computer system which is dedicated to a specific task

• An embedded system is often subject to real-time constraints including timing, size, weight, power consumption, reliability, and cost.

• Most software for embedded systems is written in C.

Page 4: optimisation of embeded compilers

Contd…• Compilers help programmers use high level constructs without

performance loss.• Compilers also help applications fully utilize architectural

features. • Since most embedded processors and architectures support

features like pipelining and instruction level parallelism , it is the task of the compiler to fully use the architectural features to generate efficient code.

• This presentation will discuss the importance of good compilers for embedded systems, the various high level and low level optimizations that are performed by compilers,.

Page 5: optimisation of embeded compilers

Designing Compilers

 

• Hand-coded assembly code will probably have better performance than any assembly code generated by a compiler from a high level specification.

• To boost designer productivity and reduce time to market for new embedded systems, a transition from assembly to C must take place in the development of embedded software.

• This also means that the problems of compiler unavailability for new architectures and also poor code quality must be solved. Architecture-Compiler co-design is essential for high performance systems

• The design of compilers can be divided into two parts namely the design of front end and design of the back end .

Page 6: optimisation of embeded compilers

Contd…• The front end of the compiler includes the lexical, syntactic

and semantic analyzer. The front end of the compiler generates machine independent intermediate code (like three-address code).

• The back end of the compiler takes the machine independent intermediate code generated by the compiler and converts it into machine dependent assembly code or executable code

• The problem that most compilers for embedded systems face is efficient code generation. If the design of compiler back end for embedded system uses the traditional code generation techniques, the resulting code quality may be unacceptable

Page 7: optimisation of embeded compilers

Compilers Optimization Techniques for Embedded Systems

 • Unlike traditional compilers, compilers for embedded systems have a lot

more constraints that make it challenging to develop them. • Constraints on embedded system applications like low power, low

memory availability make optimization techniques all the more important. • Embedded systems have the flexibility of having custom defined memory

architectures. Embedded system applications are special purpose and highly specific to a specific architecture. This is advantageous from compiler viewpoint because a high degree of memory optimizations can be obtained for specific memory architecture and specific application.

• Optimization techniques for compilers can be broadly classified into two categories. Source level optimizations are those that can be done at a higher level without bothering about the hardware

Page 8: optimisation of embeded compilers

Source level optimization – Platform independent

• Optimization at this level can be easily visualized and they can be relatively easily exploited than at a platform dependent level.

• Also, optimization techniques at this level hold good for all possible embedded system architectures.

• The concept of code generation for embedded system is that by using time-intensive optimization techniques, it is possible to create very well optimized code than what traditional compilers create. This is made possible because the applications are special purpose and it is possible to exploit the uniqueness of the application

Page 9: optimisation of embeded compilers

Contd..Listed below are some optimization strategies at source level• Loop transformations• Code rewriting technique for data reuse• Code size minimization techniques• Dynamic Memory Allocation• Coarse grain transformations• Function inlining

Page 10: optimisation of embeded compilers

Assembly level optimization – Platform dependent

• Memory Allocation Strategies• Memory access optimization• Address code optimization• Instruction scheduling• Task and Data Parallelism

Page 11: optimisation of embeded compilers

Conclusion

• Compliers for embedded systems is a very active area of research and conferences like LCTES and CASES are especially dedicated to research ideas in this field. Most of the research is focused in the area of code generation for the various types of target architectures for embedded systems which are subject to a variety of real time constraints. In this paper, we have briefly described the importance of efficient compilers and why generating efficient compilers is hard for embedded systems. We also discussed about some optimization techniques used in compilers, the characteristics of a good compiler, and the development of retargetable compilers.

Page 12: optimisation of embeded compilers

References

• [1]. Alfred V. Aho, Ravi Sethi and Jefferey D. Ullman. Compilers – Principles, Techniques and Tools. Addison-Wesley Publishing Company.

• [2]. Embedded Systems - http://www.bbdsoft.com/glossary.html

• [3]. Rainer Leupers, Compiler Design Issues for Embedded Processors. IEEE Magazine 2002

• [4]. M. Ganapathi, C. Fischer, J. Hennessy. Retargetable Compiler Code Generation, 1982 ACM Computing surveys.

Page 13: optimisation of embeded compilers

Thank You