skip to main content
10.1145/2093157.2093161acmotherconferencesArticle/Chapter ViewAbstractPublication PagespppjConference Proceedingsconference-collections
research-article

The Java Virtual Machine in retargetable, high-performance instruction set simulation

Published: 24 August 2011 Publication History

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.

References

[1]
The ArchC Architecture Descrition Language. http://archc.sourceforge.net, 2011.
[2]
ASM. http://asm.ow2.org, 2009.
[3]
EEMBC AutoBench 1.1 Benchmark Software. http://www.eembc.org/benchmark/automotive_sl.php, 2011.
[4]
Java DOSBox. http://jdosbox.sourceforge.net, 2011.
[5]
JPC -- The Pure Java x86 PC Emulator. http://jpc.sourceforge.net, 2011.
[6]
Jikes RVM. http://jikesrvm.org, 2011.
[7]
QEMU open source processor emulator. www.qemu.org, 2011.
[8]
T. Austin, E. Larson, and D. Ernst. Simplescalar: an infrastructure for computer system modeling. Computer, 35(2):59--67, Feb. 2002. ISSN 0018--9162.
[9]
M. Baer. Emulating the ARM Architecture Using a Java Dynamic Binary Translator. Master's thesis, University of Manchester, School of Computer Science, 2007.
[10]
V. Bala, E. Duesterwald, and S. Banerjia. Transparent dynamic optimization: The design and implementation of dynamo. Technical report, 1999.
[11]
R. A. Baumann. Z80mu. BYTE, 11:203--216, October 1986. ISSN 0360-5280.
[12]
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.
[13]
F. Bellard. Tiny code generator. http://svn.savannah.gnu.org/svn/qemu/trunk/tcg/README, 2009.
[14]
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.
[15]
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.
[16]
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.
[17]
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.
[18]
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.
[19]
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. URL http://dx.doi.org/10.1109/MICRO.2004.7.
[20]
C. Cifuentes and M. Van Emmerik. Uqbt: adaptable binary translation at low cost. Computer, 33(3):60--66, mar 2000. ISSN 0018-9162.
[21]
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.
[22]
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.
[23]
Freescale Semiconductor. MPC5510 Microcontroller Family Reference Manual, June 2008. Document Number: MPC5510RM.
[24]
Freescale Semiconductor. MPC5604P Microcontroller Reference Manual, December 2010. Document Number: MPC560XPRM.
[25]
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.
[26]
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.
[27]
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.
[28]
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.
[29]
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.
[30]
C. Mills, S. C. Ahalt, and J. Fowler. Compiled Instruction Set Simulation. Software, Practice and Experience, 21(8):877--889, 1991.
[31]
P. Mishra and N. Dutt. Processor Description Languages, volume 1. Morgan Kaufmann, 2008. ISBN 0123742870, 9780123742872.
[32]
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.
[33]
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.
[34]
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.
[35]
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.
[36]
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.
[37]
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.
[38]
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.

Cited By

View all
  • (2021)Domain-specific programming assistance in an embedded DSL for generating processor emulatorsProceedings of the 36th Annual ACM Symposium on Applied Computing10.1145/3412841.3442000(1256-1264)Online publication date: 22-Mar-2021
  • (2013)Superblock compilation and other optimization techniques for a Java-based DBT machine emulatorACM SIGPLAN Notices10.1145/2517326.245152148:7(33-40)Online publication date: 16-Mar-2013
  • (2013)Superblock compilation and other optimization techniques for a Java-based DBT machine emulatorProceedings of the 9th ACM SIGPLAN/SIGOPS international conference on Virtual execution environments10.1145/2451512.2451521(33-40)Online publication date: 16-Mar-2013
  • Show More Cited By

Index Terms

  1. The Java Virtual Machine in retargetable, high-performance instruction set simulation

      Recommendations

      Comments

      Information & Contributors

      Information

      Published In

      cover image ACM Other conferences
      PPPJ '11: Proceedings of the 9th International Conference on Principles and Practice of Programming in Java
      August 2011
      186 pages
      ISBN:9781450309356
      DOI:10.1145/2093157
      Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

      Sponsors

      • DTU: Technical University of Denmark
      • ORACLE: ORACLE

      In-Cooperation

      Publisher

      Association for Computing Machinery

      New York, NY, United States

      Publication History

      Published: 24 August 2011

      Permissions

      Request permissions for this article.

      Check for updates

      Author Tags

      1. Java
      2. dynamic binary translation
      3. instruction set simulation
      4. retargetable
      5. virtualization

      Qualifiers

      • Research-article

      Conference

      PPPJ '11
      Sponsor:
      • DTU
      • ORACLE
      PPPJ '11: Principles and Practice of Programming in Java
      August 24 - 26, 2011
      Kongens Lyngby, Denmark

      Acceptance Rates

      Overall Acceptance Rate 29 of 58 submissions, 50%

      Contributors

      Other Metrics

      Bibliometrics & Citations

      Bibliometrics

      Article Metrics

      • Downloads (Last 12 months)2
      • Downloads (Last 6 weeks)0
      Reflects downloads up to 16 Feb 2025

      Other Metrics

      Citations

      Cited By

      View all
      • (2021)Domain-specific programming assistance in an embedded DSL for generating processor emulatorsProceedings of the 36th Annual ACM Symposium on Applied Computing10.1145/3412841.3442000(1256-1264)Online publication date: 22-Mar-2021
      • (2013)Superblock compilation and other optimization techniques for a Java-based DBT machine emulatorACM SIGPLAN Notices10.1145/2517326.245152148:7(33-40)Online publication date: 16-Mar-2013
      • (2013)Superblock compilation and other optimization techniques for a Java-based DBT machine emulatorProceedings of the 9th ACM SIGPLAN/SIGOPS international conference on Virtual execution environments10.1145/2451512.2451521(33-40)Online publication date: 16-Mar-2013
      • (2012)Dynamic Binary Translation -- A Model-Driven ApproachProceedings of the 2012 31st International Conference of the Chilean Computer Science Society10.1109/SCCC.2012.30(199-206)Online publication date: 12-Nov-2012

      View Options

      Login options

      View options

      PDF

      View or Download as a PDF file.

      PDF

      eReader

      View online with eReader.

      eReader

      Figures

      Tables

      Media

      Share

      Share

      Share this Publication link

      Share on social media