ABSTRACT
Two main demands on instruction set simulation are portability and high simulation performance. For the testing and benchmarking of ISA prototypes such as in an ASIP design process, simulators are additionally required to offer retargetability for the rapid modeling and revisal of their simulation targets.
In this paper, we present the techniques applied in a full-system instruction set simulation framework that combines these three conflicting demands. Our framework is retargetable, portable and provides high simulation performance. It is entirely implemented in Java and features a two-stage dynamic binary translation (DBT) targeting Java Bytecode in the first stage and employing the Java Virtual Machine as an external code generation back end in the second stage. While the use of state-of-the-art techniques such as DBT generates high simulation performance, the framework is also platform independent and can run on any J2SE-compliant Java Runtime Environment. In spite of this platform independence, the native code generated in the second stage will even profit from the platform-specific optimizations performed by modern JVM implementations. Our second contribution is HPADL, the instruction set description language that provides the retargetability of our framework. HPADL is tailored for the specific needs of dynamically compiling full-system IS simulation. Due to its clean separation of concerns between the instruction decoding and instruction execution, it easily enables DBT. Also, it is not restricted to a specific range of target architectures such as RISC. In this paper, we will compare the modeling effort in HPADL to that of QEMU. For our experiments and in order to show the practicability and flexibility of our approach, we implemented HPADL models of the DLX, 8086, ARMv4 and PowerPC/PowerPC VLE ISA as well as some IO device models in Java. A comparison with the simulation performance of QEMU by reference of the EEMBC AutoBench 1.1 shows that we achieve 78% of the QEMU performance on average.
- The ArchC Architecture Descrition Language. http://archc.sourceforge.net, 2011.Google Scholar
- ASM. http://asm.ow2.org, 2009.Google Scholar
- EEMBC AutoBench 1.1 Benchmark Software. http://www.eembc.org/benchmark/automotive_sl.php, 2011.Google Scholar
- Java DOSBox. http://jdosbox.sourceforge.net, 2011.Google Scholar
- JPC -- The Pure Java x86 PC Emulator. http://jpc.sourceforge.net, 2011.Google Scholar
- Jikes RVM. http://jikesrvm.org, 2011.Google Scholar
- QEMU open source processor emulator. www.qemu.org, 2011.Google Scholar
- T. Austin, E. Larson, and D. Ernst. Simplescalar: an infrastructure for computer system modeling. Computer, 35(2):59--67, Feb. 2002. ISSN 0018--9162. Google ScholarDigital Library
- M. Baer. Emulating the ARM Architecture Using a Java Dynamic Binary Translator. Master's thesis, University of Manchester, School of Computer Science, 2007.Google Scholar
- V. Bala, E. Duesterwald, and S. Banerjia. Transparent dynamic optimization: The design and implementation of dynamo. Technical report, 1999.Google Scholar
- R. A. Baumann. Z80mu. BYTE, 11:203--216, October 1986. ISSN 0360-5280. Google ScholarDigital Library
- F. Bellard. Qemu, a fast and portable dynamic translator. In Proceedings of the annual conference on USENIX Annual Technical Conference, ATEC '05, pages 41--41, Berkeley, CA, USA, 2005. USENIX Association. Google ScholarDigital Library
- F. Bellard. Tiny code generator. http://svn.savannah.gnu.org/svn/qemu/trunk/tcg/README, 2009.Google Scholar
- F. Brandner. Precise simulation of interrupts using a rollback mechanism. In SCOPES '09: Proceedings of the International Workshop on Software and Compilers for Embedded Systems, pages 71--80, 2009. ISBN 978-1-60558-696-0. Google ScholarCross Ref
- F. Brandner, N. Horspool, and A. Krall. Dsp instruction set simulation. In S. S. Bhattacharyya, E. Deprettere, R. Leupers, and J. Takala, editors, Handbook of Signal Processing Systems, pages 679--705. Springer, August 2010. ISBN 978-1-4419-6344-4.Google Scholar
- D. Brooks, V. Tiwari, and M. Martonosi. Wattch: a framework for architectural-level power analysis and optimizations. In Computer Architecture, 2000. Proceedings of the 27th International Symposium on, pages 83--94, 2000. Google ScholarDigital Library
- D. Bruening, T. Garnett, and S. Amarasinghe. An infrastructure for adaptive dynamic optimization. In Proceedings of the international symposium on Code generation and optimization: feedback-directed and runtime optimization, CGO '03, pages 265--275, Washington, DC, USA, 2003. IEEE Computer Society. ISBN 0-7695-1913-X. Google ScholarDigital Library
- D. Burger and T. M. Austin. The simplescalar tool set, version 2.0. SIGARCH Comput. Archit. News, 25:13--25, June 1997. ISSN 0163-5964. Google ScholarDigital Library
- M. Burtscher and I. Ganusov. Automatic synthesis of high-speed processor simulators. In Proceedings of the 37th annual IEEE/ACM International Symposium on Microarchitecture, MICRO 37, pages 55--66, Washington, DC, USA, 2004. IEEE Computer Society. ISBN 0-7695-2126-6. doi: http://dx.doi.org/10.1109/MICRO.2004.7. URL http://dx.doi.org/10.1109/MICRO.2004.7. Google ScholarDigital Library
- C. Cifuentes and M. Van Emmerik. Uqbt: adaptable binary translation at low cost. Computer, 33(3):60--66, mar 2000. ISSN 0018-9162. Google ScholarDigital Library
- B. Cmelik and D. Keppel. Shade: a fast instruction-set simulator for execution profiling. In Proceedings of the 1994 ACM SIGMETRICS conference on Measurement and modeling of computer systems, SIG-METRICS '94, pages 128--137, New York, NY, USA, 1994. ACM. ISBN 0-89791-659-X. Google ScholarDigital Library
- J. Emer, P. Ahuja, E. Borch, A. Klauser, C.-K. Luk, S. Manne, S. Mukherjee, H. Patil, S. Wallace, N. Binkert, R. Espasa, and T. Juan. Asim: a performance model framework. Computer, 35(2):68--76, Feb. 2002. ISSN 0018-9162. Google ScholarDigital Library
- Freescale Semiconductor. MPC5510 Microcontroller Family Reference Manual, June 2008. Document Number: MPC5510RM.Google Scholar
- Freescale Semiconductor. MPC5604P Microcontroller Reference Manual, December 2010. Document Number: MPC560XPRM.Google Scholar
- A. Halambi, P. Grun, V. Ganesh, and A. Khare. Expression: A language for architecture exploration through compiler/simulator retargetability. In In Proceedings of the European Conference on Design, Automation and Test, pages 485--490, 1999. Google ScholarDigital Library
- D. Jones and N. Topham. High Speed CPU Simulation Using LTU Dynamic Binary Translation. In HiPEAC '09: Proceedings of the 4th International Conference on High Performance Embedded Architectures and Compilers, pages 50--64, Berlin, Heidelberg, 2009. Springer-Verlag. ISBN 978-3-540-92989-5. Google ScholarDigital Library
- M. Kaufmann. Erschließung von Just-in-Time-Compilierungstechniken in der Realisierung eines retargierbaren Architektursimulators. Thesis, Technische Universitat Dresden, Faculty of Computer Science, December 2009.Google Scholar
- C. keung Luk, R. Cohn, R. Muth, H. Patil, A. Klauser, G. Lowney, S. Wallace, V. Janapa, and R. K. Hazelwood. Pin: Building customized program analysis tools with dynamic instrumentation. In In Programming Language Design and Implementation, pages 190--200. ACM Press, 2005. Google ScholarDigital Library
- P. Magnusson, M. Christensson, J. Eskilson, D. Forsgren, G. Hallberg, J. Hogberg, F. Larsson, A. Moestedt, and B. Werner. Simics: A full system simulation platform. Computer, 35(2):50--58, Feb. 2002. ISSN 0018-9162. Google ScholarDigital Library
- C. Mills, S. C. Ahalt, and J. Fowler. Compiled Instruction Set Simulation. Software, Practice and Experience, 21(8):877--889, 1991.Google ScholarCross Ref
- P. Mishra and N. Dutt. Processor Description Languages, volume 1. Morgan Kaufmann, 2008. ISBN 0123742870, 9780123742872. Google ScholarDigital Library
- N. Nethercote and J. Seward. Valgrind: a framework for heavyweight dynamic binary instrumentation. In Proceedings of the 2007 ACM SIGPLAN conference on Programming language design and implementation, PLDI '07, pages 89--100, New York, NY, USA, 2007. ACM. ISBN 978-1-59593-633-2. Google ScholarDigital Library
- V. S. Pai, P. Ranganathan, and S. V. Adve. Rsim: Rice simulator for ilp multiprocessors. SIGARCH Comput. Archit. News, 25:1--, December 1997. ISSN 0163-5964. Google ScholarDigital Library
- S. Pees, A. Hoffmann, V. Zivojnovic, and H. Meyr. Lisa -- machine description language for cycle-accurate models of programmable dsp architectures. In Proceedings of the 36th annual ACM/IEEE Design Automation Conference, DAC '99, pages 933--938, New York, NY, USA, 1999. ACM. ISBN 1-58113-109-7. Google ScholarDigital Library
- M. Reshadi, P. Mishra, and N. Dutt. Instruction set compiled simulation: a technique for fast and flexible instruction set simulation. In DAC '03: Proceedings of the 40th annual Design Automation Conference, pages 758--763, New York, NY, USA, 2003. ACM. ISBN 1-58113-688-9. Google ScholarDigital Library
- I. Rogers and C. Kirkham. JikesNODE and PearColator: A Jikes RVM Operating System and Legacy Code Execution Environment. In 2nd ECOOP Workshop on Programm Languages and Operating Systems (ECOOP-PLOS'05), 2005.Google Scholar
- M. Vachharajani, N. Vachharajani, D. A. Penry, B. J. A., S. Malik, and D. I. August. The liberty simulation environment: A deliberate approach to high-level system modeling. ACM Trans. Comput. Syst., 24:211--249, August 2006. ISSN 0734-2071. Google ScholarDigital Library
- A. Yermolovich, A. Gal, and M. Franz. Portable execution of legacy binaries on the java virtual machine. In Proceedings of the 6th international symposium on Principles and practice of programming in Java, PPPJ '08, pages 63--72, New York, NY, USA, 2008. ACM. ISBN 978-1-60558-223-8. Google ScholarDigital Library
Index Terms
- The Java Virtual Machine in retargetable, high-performance instruction set simulation
Recommendations
A multiprocessing approach to accelerate retargetable and portable dynamic-compiled instruction-set simulation
CODES+ISSS '06: Proceedings of the 4th international conference on Hardware/software codesign and system synthesisTraditionally, instruction-set simulators (ISS's) are sequential programs running on individual processors. Besides the advances of simulation techniques, ISS's have been mainly driven by the continuously improving performance of single processors. ...
A Retargetable MATLAB-to-C Compiler Exploiting Custom Instructions and Data Parallelism
Special Issue on LCETES, Part 2, Learning, Distributed, and Optimizing CompilersThis article presents a MATLAB-to-C compiler that exploits custom instructions present in state-of-the-art processor architectures and supports semi-automatic vectorization. A parameterized processor model is used to describe the target instruction set ...
Embedded processor validation environment using a cycle-accurate retargetable instruction-set simulator
AbstractIn the advent of System-on-Chip (SoC) technology, validation scope is further expanded from a single core to the system. Modules are also substituted by application specific instruction-set processors (ASIP) in order to raise abstraction level of ...
Comments