Constructing Fast and Cycle-Accurate Simulators for Configurable Accelerators Using C++ Templates

To quickly prototype accelerator/compiler co-designs, fast and highly accurate architectural simulators are indispensable. They must be fast to keep design iteration times low; they must be highly accurate to make simulation results meaningful. In this paper, we describe how to construct such fast, cycle-accurate simulators from an architectural model by using C++ templates. Not only are templates fully resolved at compile time, thus offering ample opportunity for optimization, they also aptly mirror synthesis-time parameterization of accelerators. For each hardware component, we encode these architecture parameters in a C++ type and construct a class templated on this type. Hierarchically composing the component classes then yields the overall simulator. To demonstrate our constructed simulators' speedup, we construct two simulators for a lightweight VLIW processor, one with, one without templates, and measured their performance: the templated simulator is about 4.85 times faster. Their execution speed makes our simulators well-suited for compiler validation and prototyping accelerator features.

[1]  Frank Hannig,et al.  Invasive Tightly-Coupled Processor Arrays , 2014, ACM Trans. Embed. Comput. Syst..

[2]  Todd Austin A user's and hacker's guide to the simplescalar architectural research tool set , 1997 .

[3]  Heinrich Meyr,et al.  Architecture implementation using the machine description language LISA , 2002, Proceedings of ASP-DAC/VLSI Design 2002. 7th Asia and South Pacific Design Automation Conference and 15h International Conference on VLSI Design.

[4]  Nikil Dutt,et al.  Processor Description Languages , 2008 .

[5]  Todd L. Veldhuizen,et al.  C++ Templates are Turing Complete , 2003 .

[6]  Nigel P. Topham,et al.  High Speed CPU Simulation Using LTU Dynamic Binary Translation , 2009, HiPEAC.

[7]  Bjarne Stroustrup,et al.  C++ Programming Language , 1986, IEEE Softw..

[8]  Bjarne Stroustrup,et al.  The C++ Programming Language, 4th Edition , 2013 .

[9]  Jürgen Teich,et al.  High-Speed Event-Driven RTL Compiled Simulation , 2004, SAMOS.