Compiler Integrated Multiprocessor Simulation (original) (raw)

The Prism simulation system models the interaction of application, system and architectural structures for shared memory multiprocessors and distributed memory multicomputers. The simulation is achieved using two major components, a compiler and a library of processor and architecture modeling routines. The compiler processes application and system code written in a high level language and links the result to the modeling routines to produce a purpose built simulator. The compiler converts the program into a large number of small fragments, called slices, and then compiles the sequence of slices twice. The first compilation targets an abstract model processor and annotates each slice with a list of code and data accesses that would be emitted by the modeled CPU when executing that slice. The second compilation emits a C program from the annotated slices which interacts with a model machine to represent the program's execution on the modeled architecture. The output from compiling an application program is combined with libraries containing similarly compiled run-time and operating systems. The result is a special purpose simulator for the test application running under a particular kernel and executing on a specific architecture. Architectural features such as the number of processors or memory modules, cache algorithms and cache sizes, and network topology and speed can be selected. The use of simulation allows any amount of performance data to be gathered and analyzed on the fly, without disturbing the history of the execution. It also allows for rapid prototyping of architectural features and implementation techniques. This paper discusses the fundamental operation of the simulator and its integration with the associated compiler.