# HG changeset patch
# User Korey Sewell <[email protected]>
# Date 1254427253 14400
# Node ID 5e04e6117c84cd57a60e612020aa0eee462c2006
# Parent b4106897b3d7191734e6c999dff8c980a713021d
inorder: add insts to cpu event
some events are going to need instruction data when they process, so just
include the instruction in the event construction
diff --git a/src/cpu/inorder/cpu.cc b/src/cpu/inorder/cpu.cc
--- a/src/cpu/inorder/cpu.cc
+++ b/src/cpu/inorder/cpu.cc
@@ -83,10 +83,10 @@
}
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);
}
@@ -311,7 +311,7 @@
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(NULL, NULL, 0, 0, 0, 0);
// Reset CPU to reset state.
@@ -556,7 +556,7 @@
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
@@ -567,9 +567,10 @@
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",
@@ -583,7 +584,7 @@
// 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
@@ -685,7 +686,7 @@
"Enabling of concurrent virtual processor execution",
vpe);
- scheduleCpuEvent(EnableVPEs, NoFault, 0/*tid*/, vpe);
+ scheduleCpuEvent(EnableVPEs, NoFault, 0/*tid*/, dummyInst);
}
void
@@ -711,7 +712,7 @@
"Disabling of concurrent virtual processor execution",
vpe);
- scheduleCpuEvent(DisableVPEs, NoFault, 0/*tid*/, vpe);
+ scheduleCpuEvent(DisableVPEs, NoFault, 0/*tid*/, dummyInst);
}
void
@@ -745,7 +746,7 @@
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
@@ -772,7 +773,7 @@
DPRINTF(InOrderCPU, "[tid:%i]: Scheduling Disable Multithreading on "
"virtual processor %i", tid, vpe);
- scheduleCpuEvent(DisableThreads, NoFault, tid, vpe);
+ scheduleCpuEvent(DisableThreads, NoFault, tid, dummyInst);
}
void
@@ -836,7 +837,7 @@
{
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.
@@ -849,7 +850,7 @@
void
InOrderCPU::suspendContext(ThreadID tid, int delay)
{
- scheduleCpuEvent(SuspendThread, NoFault, tid, 0/*vpe*/, delay);
+ scheduleCpuEvent(SuspendThread, NoFault, tid, dummyInst, delay);
//_status = Idle;
}
@@ -863,7 +864,7 @@
void
InOrderCPU::deallocateContext(ThreadID tid, int delay)
{
- scheduleCpuEvent(DeallocateThread, NoFault, tid, 0/*vpe*/, delay);
+ scheduleCpuEvent(DeallocateThread, NoFault, tid, dummyInst, delay);
}
void
diff --git a/src/cpu/inorder/cpu.hh b/src/cpu/inorder/cpu.hh
--- a/src/cpu/inorder/cpu.hh
+++ b/src/cpu/inorder/cpu.hh
@@ -196,22 +196,24 @@
public:
CPUEventType cpuEventType;
ThreadID tid;
+ DynInstPtr inst;
+ Fault fault;
unsigned vpe;
- Fault fault;
-
+
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. */
@@ -229,14 +231,14 @@
/** 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. */
ResourcePool *resPool;
- /** Instruction used to signify that there is no *real* instruction in
buffer slot */
- DynInstPtr dummyBufferInst;
+ /** Inst. used to signify that there is no *real* instruction being used */
+ DynInstPtr dummyInst;
/** Used by resources to signify a denied access to a resource. */
ResourceRequest *dummyReq;
_______________________________________________
m5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/m5-dev