18
Compilers for Embedded Systems Ram, Vasanth, and VJ Instructor : Dr. Edwin Sha Synthesis and Optimization of High-Performance Systems

Compilers for Embedded Systems Ram, Vasanth, and VJ Instructor : Dr. Edwin Sha Synthesis and Optimization of High-Performance Systems

Embed Size (px)

Citation preview

Page 1: Compilers for Embedded Systems Ram, Vasanth, and VJ Instructor : Dr. Edwin Sha Synthesis and Optimization of High-Performance Systems

Compilers for Embedded Systems

Ram, Vasanth, and VJInstructor : Dr. Edwin Sha

Synthesis and Optimization of High-Performance Systems

Page 2: Compilers for Embedded Systems Ram, Vasanth, and VJ Instructor : Dr. Edwin Sha Synthesis and Optimization of High-Performance Systems

Outline

• Compiler – the bottleneck

• Memory Optimization Techniques

• Re-targetability

Page 3: Compilers for Embedded Systems Ram, Vasanth, and VJ Instructor : Dr. Edwin Sha Synthesis and Optimization of High-Performance Systems

Embedded System Development

• Software Development• Hardware Development• Integration

Page 4: Compilers for Embedded Systems Ram, Vasanth, and VJ Instructor : Dr. Edwin Sha Synthesis and Optimization of High-Performance Systems

Requirements of Good Software

Complexity

Perf

Page 5: Compilers for Embedded Systems Ram, Vasanth, and VJ Instructor : Dr. Edwin Sha Synthesis and Optimization of High-Performance Systems

Requirements of Good Hardware

Complexity

Perf

Page 6: Compilers for Embedded Systems Ram, Vasanth, and VJ Instructor : Dr. Edwin Sha Synthesis and Optimization of High-Performance Systems

Compilers

Software

Hardware

Bad Compiler

Complexity

Perf

Software

Hardware

Good Compiler

Complexity

Perf

Page 7: Compilers for Embedded Systems Ram, Vasanth, and VJ Instructor : Dr. Edwin Sha Synthesis and Optimization of High-Performance Systems

Next…

• Compiler – the bottleneck

• Memory Optimization Techniques

• Re-targetability

Page 8: Compilers for Embedded Systems Ram, Vasanth, and VJ Instructor : Dr. Edwin Sha Synthesis and Optimization of High-Performance Systems

Optimization Techniques

• Platform independent• Architecture specific• Memory address generation

Page 9: Compilers for Embedded Systems Ram, Vasanth, and VJ Instructor : Dr. Edwin Sha Synthesis and Optimization of High-Performance Systems

Platform Independent Techniques

• Loop transformation• Data reuse• Processor partitioning

Page 10: Compilers for Embedded Systems Ram, Vasanth, and VJ Instructor : Dr. Edwin Sha Synthesis and Optimization of High-Performance Systems

Architecture Specific Techniques

• Memory modeling optimization• Register allocation – graph coloring• Custom memory architecture

Page 11: Compilers for Embedded Systems Ram, Vasanth, and VJ Instructor : Dr. Edwin Sha Synthesis and Optimization of High-Performance Systems

Memory Address Generation

• General compilers – generated addresses are periodic

• Embedded systems – address sequence might not be periodic

Page 12: Compilers for Embedded Systems Ram, Vasanth, and VJ Instructor : Dr. Edwin Sha Synthesis and Optimization of High-Performance Systems

Next…

• Compiler – the bottleneck

• Memory Optimization Techniques

• Re-targetability

Page 13: Compilers for Embedded Systems Ram, Vasanth, and VJ Instructor : Dr. Edwin Sha Synthesis and Optimization of High-Performance Systems

Retargetable Code Generation• Code must be applicable to a

range of different targets

• Two Levels• Portability• Target Independence

Page 14: Compilers for Embedded Systems Ram, Vasanth, and VJ Instructor : Dr. Edwin Sha Synthesis and Optimization of High-Performance Systems

Why Retargetability?

• Processor architectures differ from application to application

• Designing compilers quickly and economically.

Page 15: Compilers for Embedded Systems Ram, Vasanth, and VJ Instructor : Dr. Edwin Sha Synthesis and Optimization of High-Performance Systems

Approaches

• Interpretive Code Generation

• Pattern Matched Code Generation

Page 16: Compilers for Embedded Systems Ram, Vasanth, and VJ Instructor : Dr. Edwin Sha Synthesis and Optimization of High-Performance Systems

Interpretive Code Generation

• Generate code for virtual machine and expand it to real target

• Disadvantage• Design a lot of virtual machines!• Not fully portable

Page 17: Compilers for Embedded Systems Ram, Vasanth, and VJ Instructor : Dr. Edwin Sha Synthesis and Optimization of High-Performance Systems

Pattern Matched Code Generation

• Pattern matching (tree) replaces interpretation.

• Disadvantage• Creating pattern tree structures is

hard• No instructions may match pattern

tree!

Page 18: Compilers for Embedded Systems Ram, Vasanth, and VJ Instructor : Dr. Edwin Sha Synthesis and Optimization of High-Performance Systems

Conclusion

• Efficient compilers – hard job.• Assembly code – increased time to

market• Lot of research in the field of code

generation for embedded systems.