In this thesis we argued the benefits of using program transformation to reduce the burden of developing applications for embedded systems. We have investigated research areas on program transformation and compiler techniques, with a focus on embedded software development. We showed that the design space to be explored is extremely large for a generator to generate suitable programs, and existing techniques often tackle only the design space partially. We proposed a transformation framework aiming at equipping engineers with flexible and extensible means to explore the design space more efficiently. We focus on transforming Java programs into a mixture of Java and platform-specific C programs, and develop associated tools to streamline the process. A near-term goal is to add profiling capability into JGene so that profiling information gathered from actual program execution can be used by JGene again to aid the user in exploring the design space. Despite the requirement of using Java as the base language, we believe our framework is already powerful for many practical scenarios. We hope the framework’s extensible design can lend itself into a more powerful and comprehensive system that matches the need of embedded systems development in the future.
References
[Aarts] B. Aarts, M. Barreteau, F. Bodin, P. Brinkhaus, Z. Chamski, H.-P. Charles, C.
Eisenbeis, J. Gurd, J. Hoogerbrugge, P.Hu,W. Jalby, P.Knijnenburg, M. O’Boyle, E.
Rohou, R. Sakellariou, H. Schepers, A. Seznec, E. A. Sthr,M. Verhoeven, and H.Wijshoff, “OCEANS: Optimizing compilers for embedded HPC applications,” Lecture Notes in Computer Science, August 1997.
[Ali] Ayaz Ali and Lennart Johnsson, Dragan Mirkovic, “Empirical Auto-tuning Code Generator for FFT and Trigonometric Transforms”, Workshop on Optimizations for DSP and Embedded Systems, March 11, 2007.
[Alur] Rajeev Alur, Franjo Ivancic, Jesung Kim, Insup Lee, Oleg Sokolsky, “Generating Embedded Software from Hierarchical Hybrid Models”, ACM SIGPLAN Notices, Proceedings of the 2003 ACM SIGPLAN conference on Language, compiler, and tool for embedded systems LCTES '03, Volume 38 Issue 7. pp. 171-182
[Barat] F. Barat, T. Vander Aa, M. Jayapala, G. Deconinck, R. Lauwereins, and H. Corporaal,
“Methodology for building processor design space exploration frameworks”, 3th Workshop on Optimizations for DSP and Embedded Systems, March 20, 2005.
[Bennett] Richard Vincent Bennett Alastair Colin Murray Bjorn Franke Nigel Topham,
“Combining Source-to-Source Transformations and Processor Instruction Set Extensions for the Automated Design-Space Exploration of Embedded Systems”, LCTES’07 June 13–15, 2007. pp. 83-93
[Bravenboer] Martin Bravenboer, Karl Trygve Kalleberg, and Rob Vermaas, “Stratego/XT 0.16: Components for Transformation Systems”, ACM/SIGPLAN Workshop Partial Evaluation and Semantics-Based Program Manipulation Proceedings of the 2006 ACM SIGPLAN symposium on Partial evaluation and semantics-based program manipulation, 2006. pp. 95-99.
[Burgaard] Kim Burgaard, Flemming Gram Christensen, Jørgen Lindskov Knudsen, Ulrik Pagh Schultz, “Compiling Java for Low-end Embedded Systems”, ACM SIGPLAN Notices , Proceedings of the 2003 ACM SIGPLAN conference on Language, compiler, and tool for embedded systems LCTES '03, Volume 38, Issue 7. pp. 42-50
[Cavazos] John Cavazos, Grigori Fursin, Felix Agakov, Edwin Bonilla, Michael F. P.
O'Boyle, and Olivier Temam, “Rapidly Selecting Good Compiler Optimizations Using Performance Counters”, International Symposium on Code Generation and Optimization (CGO), 2007. pp. 185-197
[Chen] C. Chen, J. Chame, and M. Hall, “Combining Models and Guided Empirical Search to Optimize for Multiple Levels of the Memory Hierarchy”, 2005 International Symposium on Code Generation and Optimization (CGO), 2005. pp. 111-122
[Cheng] Allen Cheng, Gary Tyson, and Trevor Mudge, “FITS: Increasing Code Density for Embedded Systems with a Cost-Effective 16-bit Synthesis Technique”, Workshop on Optimizations for DSP and Embedded Systems, March 21, 2004. pp. 920-923
[Cordy] James R. Cordy, “Source Transformation, Analysis and Generation in TXL”, ACM/SIGPLAN Workshop Partial Evaluation and Semantics-Based Program Manipulation Proceedings of the 2006 ACM SIGPLAN symposium on Partial evaluation and semantics-based program manipulation, 2006. pp. 1-11
[Dupre] Michael Dupre, Nathalie Drach, Olivier Temam, “VHC: Quickly Building an Optimizer for Complex Embedded Architectures”, International Symposium on Code Generation and Optimization (CGO), 2004. pp. 53-64
[Ernst] Ernst, R., “Codesign of embedded systems: status and trends”, Design & Test of Computers, Apr-Jun 1998, Vol. 15, No. 2. pp. 45-54
[Ertl] M.A. Ertl, “Stack caching for interpreters,” Proc. ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI), pp.315–327, 1995.
[Franke] Björn Franke, Michael F. P. O'Boyle, John Thomson, Grigori Fursin, “Probabilistic source-level optimisation of embedded programs”, Proceedings of the 2005 ACM SIGPLAN/SIGBED Conference on Languages, Compilers, and Tools for Embedded Systems (LCTES'05). pp. 78-86
[Fulton] Mike Fulton and Mark Stoodley, “Compilation Techniques for Real-Time Java Programs”, International Symposium on Code Generation and Optimization (CGO), 2007.
pp. 221-231
[Grewal] Gary Grewal, S. Coros, “A Novel Scatter Search Procedure for Effective Memory Assignment for Dual-Bank DSPs”, Workshop on Optimizations for DSP and Embedded Systems, March 11, 2007.
[Hong] SungHyun Hong, et al, “Java Client Ahead-of-Time Compiler for Embedded Systems”, ACM SIGPLAN Notices , Proceedings of the 2007 ACM SIGPLAN/SIGBED conference on Languages, compilers, and tools LCTES '07, Volume 42, Issue 7. pp. 63-72 [JNI] Sun Microsystems Inc. Java Native Interface Specification.
http://java.sun.com/products/jdk/1.2/docs/guide/jni/index.html
[Kim] Dngkeun Kim and Donald Yeung, “A Study of Source-Level Compiler Algorithms for Automatic Construction of Pre-Execution Code”, ACM Transactions on Computer Systems, Vol. 22, No. 3, August 2004, Pages 326–379
[Lambrechts] Andy Lambrechts, Praveen Raghavan, David Novo and Estela Rey Ramos,
“Enabling WordWidth Aware Energy and Performance Optimizations for Embedded Processors”, 5th Workshop on Optimizations for DSP and Embedded Systems, March 11, 2007.
[Lee] Sheayun Lee, Jaejin Lee, Chang Yun Par, and Sang Lyul Min, “Selective Code Transformation for Dual Instruction Set Processors”, ACM Transactions on Embedded Computing Systems, Vol. 6, No. 2, Article 10, May 2007.
[Nacul] André C. Nácul and Tony Givargis, “Synthesis of time-constrained multitasking embedded software”, ACM Transactions on Design Automation of Electronic Systems, Vol.
11, No. 4, October 2006, pp. 822–847
[Ozturk] O. Ozturk, M. Kandemir, and S. W. Son, “ILP-based management of multi-level memory hierarchies”, Workshop on Optimizations for DSP and Embedded Systems, March 26, 2006.
[Pan] Zhelong Pan, Rudolf Eigenmann, “Fast and Effective Orchestration of Compiler Optimizations for Automatic Performance Tuning”, International Symposium on Code Generation and Optimization (CGO), 2006. pp. 319-332
[Panda] Panda et al, “Data and Memory Optimization Techniques for Embedded Systems”, ACM Transactions on Design Automation of Electronic Systems, Vol. 6, No. 2, April 2001, pp. 149–206
[Peri] Ramesh V Peri, Zino Benaissa, and Sri Doddapaneni, “A Binary Rewriting Tool for DSPs to Optimize Programs Based on Profile Information”, Workshop on Optimizations for DSP and Embedded Systems, March 21, 2004.
[Perkins] Michael Perkins, Graeme Roy, and Andrew Higham, “Profile-guided Optimization in the Cross-core Production C/C++ DSP Compilers”, Workshop on Optimizations for DSP and Embedded Systems, March 23, 2003.
[Sanghai05] K. Sanghai, D. Kaeli, and R. Gentile, Code and data partitioning on the Blackfin 561 dual-core platform, Workshop on Optimizations for DSP and Embedded Systems, March 20, 2005.
[Sanghai07] Kaushal Sanghai and David Kaeli, Alex Raikman and Ken Butler, “A Code Layout Framework for Embedded Processors with Configurable Memory Hierarchy”, Workshop on Optimizations for DSP and Embedded Systems, March 11, 2007.
[Shudo] Kazuyuki Shudo, Satoshi Sekiguchi, Yoichi Muraoka, “Cost-effective compilation techniques for Java Just-in-Time compilers”, Systems and Computers in Japan, Volume 35, Issue 12, pp. 10-24
[Suresh] Dinesh C. Suresh, Walid A. Najjar, Frank Vahid, “Profiling Tools for Hardware/Software Partitioning of Embedded Applications”, ACM SIGPLAN Notices, Proceedings of the 2003 ACM SIGPLAN conference on Language, compiler, and tool for embedded systems LCTES '03, Volume 38 Issue 7. pp. 189-198
[Tabatabai] Ali-Reza Ad-Tabataba, Michal Cierniak, Guei-Yuan Lueh, Vishesh M. Parikh, James M. Stichnoth, “Fast, Effective Code Generation in a Just-In-Time Java Compiler”, SIGPLAN '98, pp. 280-290.[Vachharajani] Manish Vachharajani, Neil Vachharajani, and David August, Compiler Optimization-Space Exploration, Spyridon Triantafyllis, International Symposium on Code Generation and Optimization (CGO), 2003. pp. 204- 215.
[VanderAa03] Tom Vander Aa, Murali Jayapala, Francisco Barat, Geert Deconinck, Henk Corporaal, and Francky Catthoor, “Software Transformations to Reduce Instruction Memory Power Consumption using a Loop Buffer”, Workshop on Optimizations for DSP and Embedded Systems, March 23, 2003.
[VanderAa05] T. Vander Aa, M. Jayapala, F. Barat, H. Corporaal, F. Catthoor, and G.
Deconinck, “A high-level memory energy estimator based on reuse distance”, Workshop on Optimizations for DSP and Embedded Systems, March 20, 2005.
[Zhao03] Min Zhao, Bruce Childers, Mary Lou Soffa, “Predicting the Impact of Optimizations for Embedded Systems”, ACM SIGPLAN Notices , Proceedings of the 2003 ACM SIGPLAN conference on Language, compiler, and tool for embedded systems LCTES '03, Volume 38 Issue 7. pp. 1-11
[Zhao05] M. Zhao, B. Childers, and M. L. Soffa, “A Model-based Framework: an Approach for Profit-driven Optimization”, 2005 International Symposium on Code Generation and Optimization (CGO), 2005. pp. 317-327
Appendix: Benchmarks used in Section 4.1
Prime Search:
public int primeSerach(long max) { int no = 0;
private boolean isPrime(long i) {
for (long test = 2; test < i; test++) {
public long fib(long i) { long res = calcFib(i);
return res;
}
public long calcFib(long n) { if (n <= 1)
public long accumulator(long n) { if (n == 0)
return 1;
return acc(n, 1);
}
private long acc(long n, long sum) { if (n == 1)
return sum;
else
return acc(n-1, sum + n);
}
Matrix Multiplication test:
public void matrixMulti(int N) { Random R = new Random();
double dotProduct(double[] ai, double[] bj, int N) { double s = 0;