Using the CASM language for simulator synthesis and model verification

We present the CASM language, an abstract state machine (ASM) based modeling language originally designed for verifying compiler backends. We demonstrate the expressiveness by describing an instruction set simulator (ISS) for MIPS in approximately 700 lines of code. Further we present a refinement of the models to cycle-accurately describe two implementations of the classic 5-stage MIPS pipeline. Utilizing symbolic execution allows us to prove semantic equivalence of the pipeline implementations and the instruction set description. Finally we compile the models to C++ and provide a small runtime to create a system simulator achieving a performance of approx. 1 MHz in MiBench and SPECInt2000 benchmarks.

[1]  David A. Patterson,et al.  Computer Organization and Design, Fourth Edition, Fourth Edition: The Hardware/Software Interface (The Morgan Kaufmann Series in Computer Architecture and Design) , 2008 .

[2]  Gerhard Goos,et al.  Verifying Compilers and ASMs , 2000, Abstract State Machines.

[3]  Rainer Leupers,et al.  A universal technique for fast and flexible instruction-set architecture simulation , 2002, IEEE Transactions on Computer-Aided Design of Integrated Circuits and Systems.

[4]  Rajat Moona,et al.  Processor modeling for hardware software codesign , 1999, Proceedings Twelfth International Conference on VLSI Design. (Cat. No.PR00013).

[5]  James C. King,et al.  Symbolic execution and program testing , 1976, CACM.

[6]  Yuri Gurevich,et al.  Evolving algebras 1993: Lipari guide , 1995, Specification and validation methods.

[7]  David J. Lilja,et al.  Simulation of computer architectures: simulators, benchmarks, methodologies, and recommendations , 2006, IEEE Transactions on Computers.

[8]  G. Braun,et al.  A universal technique for fast and flexible instruction-set architecture simulation , 2002, Proceedings 2002 Design Automation Conference (IEEE Cat. No.02CH37324).

[9]  Andrei Voronkov,et al.  The design and implementation of VAMPIRE , 2002, AI Commun..

[10]  Olivier Temam,et al.  UNISIM: An Open Simulation Environment and Library for Complex Architecture Design and Collaborative Development , 2007, IEEE Computer Architecture Letters.

[11]  Trevor Mudge,et al.  MiBench: A free, commercially representative embedded benchmark suite , 2001 .

[12]  Egon Börger,et al.  Abstract State Machines. A Method for High-Level System Design and Analysis , 2003 .

[13]  Egon Börger,et al.  Composition and Submachine Concepts for Sequential ASMs , 2000, CSL.

[14]  Andreas Krall,et al.  A Unified Processor Model for Compiler Verification and Simulation Using ASM , 2012, ABZ.

[15]  Jürgen Teich,et al.  Description and Simulation of Microprocessor Instruction Sets Using ASMs , 2000, Abstract State Machines.

[16]  Koen Claessen,et al.  Using the TPTP Language for Writing Derivations and Finite Interpretations , 2006, IJCAR.

[17]  Roozbeh Farahbod,et al.  CoreASM: An Extensible ASM Execution Engine , 2007, Fundam. Informaticae.

[18]  David A. Patterson,et al.  Computer Organization and Design - The Hardware / Software Interface (Revised 4th Edition) , 2012, The Morgan Kaufmann Series in Computer Architecture and Design.

[19]  Stuart Greenfield,et al.  Teaching parameter passing by example using thunks in C and C++ , 1993, SIGCSE '93.

[20]  R. Nigel Horspool,et al.  DSP Instruction Set Simulation , 2010, Handbook of Signal Processing Systems.

[21]  Rodolfo Azevedo,et al.  The ArchC Architecture Description Language and Tools , 2005, International Journal of Parallel Programming.

[22]  Jean-François Monin,et al.  Designing a CPU model: from a pseudo-formal document to fast code , 2011, ArXiv.

[23]  Andreas Krall,et al.  Fast and Accurate Simulation using the LLVM Compiler Framework ? , 2008 .