Version 2 of FastSim addresses the primary weakness of the original FastSim simulator -- flexibility. Version 2 is not an individual simulator, but a framework for generating architecture and micro-architecture simulators. In addition to simplifying the task of simulator specification, it also optimizes your simulation code to use fast-forwarding, a variation on the well known technique of memoization.
A simulator specification is written in Facile, FastSim's architecture simulation language. Specifications can include descriptions of binary instruction encodings, instruction semantics, architectural and micro-architectural registers, and additional simulator behavior. FastSim then analyses the simulator specification and produces a fast-forwarding simulator that implements that specification.
A fast-forwarding simulator works by repeatedly calling your simulator's main function. The arguments to main are cached along with a list of all actions performed by main that are not completely determined by the value of main's arguments or by constant values in its code. If main is called again with the same arguments, then the cached action list is replayed instead of executing the entire main function. Assuming that most of main's functionality is determined by its arguments, replaying the cached (i.e., memoized) actions will be much faster then re-evaluating main.
Below are three examples of simulators written for the FastSim v.2 simulation system:
A snapshot of the FastSim v.2 source code is available for download here.