Microarchitecture simulation is an important technique in
computer architecture
In computer engineering, computer architecture is a description of the structure of a computer system made from component parts. It can sometimes be a high-level description that ignores details of the implementation. At a more detailed level, the ...
research and
computer science
Computer science is the study of computation, automation, and information. Computer science spans theoretical disciplines (such as algorithms, theory of computation, information theory, and automation) to practical disciplines (includi ...
education. It is a tool for modeling the design and behavior of a
microprocessor
A microprocessor is a computer processor where the data processing logic and control is included on a single integrated circuit, or a small number of integrated circuits. The microprocessor contains the arithmetic, logic, and control circ ...
and its components, such as the
ALU,
cache memory
In computing, a cache ( ) is a hardware or software component that stores data so that future requests for that data can be served faster; the data stored in a cache might be the result of an earlier computation or a copy of data stored elsewher ...
,
control unit
The control unit (CU) is a component of a computer's central processing unit (CPU) that directs the operation of the processor. A CU typically uses a binary decoder to convert coded instructions into timing and control signals that direct the op ...
, and data path, among others. The simulation allows researchers to explore the design space as well as to evaluate the performance and efficiency of novel microarchitecture features. For example, several microarchitecture components, such as
branch predictors,
re-order buffer, and
trace cache
In computer architecture, a trace cache or execution trace cache is a specialized instruction cache which stores the dynamic stream of instructions known as trace. It helps in increasing the instruction fetch bandwidth and decreasing power consump ...
, went through numerous simulation cycles before they become common components in contemporary microprocessors of today. In addition, the simulation also enables educators to teach computer organization and architecture courses with hand-on experiences.
For system-level simulation of computer hardware, please refer to the
full system simulation.
Classification
Microarchitecture simulation can be classified into multiple categories according to input types and level of details. Specifically, the input can be a trace collected from an execution of program on a real microprocessor (so called trace-driven simulation) or a program itself (so called execution-driven simulation).
A trace-driven simulation reads a fixed sequence of trace records from a file as an input. These trace records usually represent memory references, branch outcomes, or specific machine instructions, among others. While a trace-driven simulation is known to be comparatively fast and its results are highly reproducible, it also requires a very large storage space. On the other hand, an execution-driven simulation reads a program and simulates the execution of machine instructions on the fly. A program file is typically several magnitudes smaller than a trace file. However, the execution-driven simulation is much slower than the trace-driven simulation because it has to process each instruction one-by-one and update all statuses of the microarchitecture components involved. Thus, the selection of input types for simulation is a trade-off between space and time. In particular, a very detailed trace for a highly accurate simulation requires a very large storage space, whereas a very accurate execution-driven simulation takes a very long time to execute all instructions in the program.
Apart from input types, the level of details can also be used to classify the simulation. In particular, a piece of software that simulates a microprocessor executing a program on a cycle-by-cycle basis is known as
cycle-accurate simulator, whereas
instruction set simulator
An instruction set simulator (ISS) is a simulation model, usually coded in a high-level programming language, which mimics the behavior of a mainframe or microprocessor by "reading" instructions and maintaining internal variables which represent t ...
only models the execution of a program on a microprocessor through the eyes of an instruction scheduler along with a coarse timing of instruction execution. Most computer science classes in computer architecture with hand-on experiences adopt the instruction set simulators as tools for teaching, whereas the cycle-accurate simulators are deployed mostly for research projects due to both complexities and resource consumption.
Usages
Microarchitecture simulators are deployed for a variety of purposes. It allows researchers to evaluate their ideas without the need to fabricate a real microprocessor chip, which is both expensive and time consuming. For instance, simulating a microprocessor with thousand of cores along with multiple levels of cache memory incurs very little cost when comparing with the fabrication of a prototyping chip. The researchers can also play with several configurations of the cache hierarchy using different cache models in the simulator instead of having to fabricate a new chip every time they want to test something different.
Another usage of the microarchitecture simulator is in education. Given that a course in computer architecture teaches students many different microprocessor's features and its architectures, the microarchitecture simulator is ideal for modeling and experimenting with different features and architectures over the course of a semester. For example, students may start with a microarchitecture simulator that models a simple microprocessor design at the beginning of a semester. As the semester progresses, additional features, such as
instruction pipelining
In computer engineering, instruction pipelining or ILP is a technique for implementing instruction-level parallelism within a single processor. Pipelining attempts to keep every part of the processor busy with some instruction by dividing incom ...
,
register renaming
In computer architecture, register renaming is a technique that abstracts logical registers from physical registers.
Every logical register has a set of physical registers associated with it.
When a machine language instruction refers to a partic ...
,
reservation station
A unified reservation station, also known as unified scheduler, is a decentralized feature of the microarchitecture of a CPU that allows for register renaming, and is used by the Tomasulo algorithm for dynamic instruction scheduling.
Reservat ...
s,
out-of-order execution, and
scoreboarding Scoreboarding is a centralized method, first used in the CDC 6600 computer, for dynamically scheduling instructions so that they can execute out of order when there are no conflicts and the hardware is available.
In a scoreboard, the data depende ...
, can be modeled and added to the simulator as they are introduced in the classroom. Microarchitecture simulator provides the flexibility of reconfiguration and testing with minimal costs.
Examples
* Shade (trace-driven, instruction set simulator)
* SimpleScalar (execution-driven, cycle-accurate simulator)
*
SPIM
SPIM is a MIPS processor simulator, designed to run assembly language code for this architecture. The program simulates R2000 and R3000 processors, and was written by James R. Larus while a professor at the University of Wisconsin–Madison. ...
(execution-driven, instruction set simulator)
* SMTSIM
[Tullsen, D. M. (1996). Simulation and Modeling of a Simultaneous Multithreading Processor. In Proceedings of the 22nd Annual Computer Measurement Group Conference.] (execution-driven, cycle-accurate simulator)
*
Multi2Sim (2007)
* (2007), derived from SimpleScalar
References
{{reflist
External links
The Official SimpleScalar WebsiteThe Official SPIM Website
Computer architecture
Simulation software