------------------------------------------------------------------- More...
#include <McOpteron.h>
Public Member Functions | |
McOpteron () | |
Constructor. | |
~McOpteron () | |
Destructor. | |
void | setOutputFiles (const char *outFilename, const char *debugFilename) |
redirect output to specific files | |
int | init (const char *definitionFilename, const char *mixFilename, const char *cpuIniFilename, const char *appIniFilename, OffCpuIF *extif, const char *traceFilename=0) |
Initialize model. | |
int | finish (bool printInstMix) |
Finalize simulation and report statistics. | |
int | simCycle () |
Simulate one cycle. | |
CycleCount | currentCycles () |
Get current cycle count. | |
double | currentCPI () |
Get current CPI. |
-------------------------------------------------------------------
Main Monte Carlo Opteron Simulation Class This class drives the entire simulation. It instantiates the CPU model, reads instruction definition and mix information from files, and then runs the simulation cycle by cycle. The simulation is generally composed of working backwards up the architectural pipeline each cycle, from retiring instructions out of the reorder buffer and load-store queue, to updating the progress of the functional units, to allowing the reservation queues to send new instructions to the functional units, to fetching and dispatching new instructions to the reservation queues. Instruction fetch can also be done from a trace file.
Each instruction is represented by a token object. This object has a pointer to an InstructionInfo record that holds the data about the type of instruction it is. The token moves to the reservation queues, and the reorder buffer and possibly the load-store queue also hold a reference to it. Once the token recognizes it is completed, the reorder buffer will tell it it is retired, and then the reservation queue can delete it. Token objects are always deleted by the reservation queue that holds it. -------------------------------------------------------------------
int McOpteron::simCycle | ( | ) |
Simulate one cycle.
This function works backwards up the pipeline since we need to open things up to move things forward, and software doesn't all happen at once.
References LoadStoreUnit::updateStatus(), and ReorderBuffer::updateStatus().