}
InOrderCPU::CPUEvent::CPUEvent(InOrderCPU *_cpu, CPUEventType e_type,
- Fault fault, ThreadID _tid, unsigned _vpe)
+ Fault fault, ThreadID _tid, DynInstPtr inst)
: Event(CPU_Tick_Pri), cpu(_cpu)
{
- setEvent(e_type, fault, _tid, _vpe);
+ setEvent(e_type, fault, _tid, inst);
}
contextSwitch = false;
// Define dummy instructions and resource requests to be used.
- DynInstPtr dummyBufferInst = new InOrderDynInst(this, NULL, 0, 0);
+ dummyInst = new InOrderDynInst(this, NULL, 0, 0);
dummyReq = new ResourceRequest(resPool->getResource(0), NULL, 0, 0, 0, 0);
// Reset CPU to reset state.
InOrderCPU::trap(Fault fault, ThreadID tid, int delay)
{
//@ Squash Pipeline during TRAP
- scheduleCpuEvent(Trap, fault, tid, 0/*vpe*/, delay);
+ scheduleCpuEvent(Trap, fault, tid, dummyInst, delay);
}
void
void
InOrderCPU::scheduleCpuEvent(CPUEventType c_event, Fault fault,
- ThreadID tid, unsigned vpe, unsigned delay)
+ ThreadID tid, DynInstPtr inst,
+ unsigned delay)
{
- CPUEvent *cpu_event = new CPUEvent(this, c_event, fault, tid, vpe);
+ CPUEvent *cpu_event = new CPUEvent(this, c_event, fault, tid, inst);
if (delay >= 0) {
DPRINTF(InOrderCPU, "Scheduling CPU Event (%s) for cycle %i.\n",
// Broadcast event to the Resource Pool
DynInstPtr dummy_inst =
new InOrderDynInst(this, NULL, getNextEventNum(), tid);
- resPool->scheduleEvent(c_event, dummy_inst, 0, 0, tid);
+ resPool->scheduleEvent(c_event, inst, 0, 0, tid);
}
inline bool
"Enabling of concurrent virtual processor execution",
vpe);
- scheduleCpuEvent(EnableVPEs, NoFault, 0/*tid*/, vpe);
+ scheduleCpuEvent(EnableVPEs, NoFault, 0/*tid*/, dummyInst);
}
void
"Disabling of concurrent virtual processor execution",
vpe);
- scheduleCpuEvent(DisableVPEs, NoFault, 0/*tid*/, vpe);
+ scheduleCpuEvent(DisableVPEs, NoFault, 0/*tid*/, dummyInst);
}
void
DPRINTF(InOrderCPU, "[vpe:%i]: Scheduling Enable Multithreading on "
"virtual processor %i", vpe);
- scheduleCpuEvent(EnableThreads, NoFault, 0/*tid*/, vpe);
+ scheduleCpuEvent(EnableThreads, NoFault, 0/*tid*/, dummyInst);
}
void
DPRINTF(InOrderCPU, "[tid:%i]: Scheduling Disable Multithreading on "
"virtual processor %i", tid, vpe);
- scheduleCpuEvent(DisableThreads, NoFault, tid, vpe);
+ scheduleCpuEvent(DisableThreads, NoFault, tid, dummyInst);
}
void
{
DPRINTF(InOrderCPU,"[tid:%i]: Activating ...\n", tid);
- scheduleCpuEvent(ActivateThread, NoFault, tid, 0/*vpe*/, delay);
+ scheduleCpuEvent(ActivateThread, NoFault, tid, dummyInst, delay);
// Be sure to signal that there's some activity so the CPU doesn't
// deschedule itself.
void
InOrderCPU::suspendContext(ThreadID tid, int delay)
{
- scheduleCpuEvent(SuspendThread, NoFault, tid, 0/*vpe*/, delay);
+ scheduleCpuEvent(SuspendThread, NoFault, tid, dummyInst, delay);
//_status = Idle;
}
void
InOrderCPU::deallocateContext(ThreadID tid, int delay)
{
- scheduleCpuEvent(DeallocateThread, NoFault, tid, 0/*vpe*/, delay);
+ scheduleCpuEvent(DeallocateThread, NoFault, tid, dummyInst, delay);
}
void
public:
CPUEventType cpuEventType;
ThreadID tid;
- unsigned vpe;
+ DynInstPtr inst;
Fault fault;
-
+ unsigned vpe;
+
public:
/** Constructs a CPU event. */
CPUEvent(InOrderCPU *_cpu, CPUEventType e_type, Fault fault,
- ThreadID _tid, unsigned _vpe);
+ ThreadID _tid, DynInstPtr inst);
/** Set Type of Event To Be Scheduled */
void setEvent(CPUEventType e_type, Fault _fault, ThreadID _tid,
- unsigned _vpe)
+ DynInstPtr _inst)
{
fault = _fault;
cpuEventType = e_type;
tid = _tid;
- vpe = _vpe;
+ inst = _inst;
+ vpe = 0;
}
/** Processes a resource event. */
/** Schedule a CPU Event */
void scheduleCpuEvent(CPUEventType cpu_event, Fault fault, ThreadID tid,
- unsigned vpe, unsigned delay = 0);
+ DynInstPtr inst, unsigned delay = 0);
public:
/** Interface between the CPU and CPU resources. */
/** Instruction used to signify that there is no *real* instruction in
buffer slot */
- DynInstPtr dummyBufferInst;
+ DynInstPtr dummyInst;
/** Used by resources to signify a denied access to a resource. */
ResourceRequest *dummyReq;