InOrderCPU::CPUEvent::CPUEvent(InOrderCPU *_cpu, CPUEventType e_type,
Fault fault, ThreadID _tid, DynInstPtr inst,
- unsigned event_pri_offset)
- : Event(Event::Priority((unsigned int)CPU_Tick_Pri + event_pri_offset)),
- cpu(_cpu)
+ CPUEventPri event_pri)
+ : Event(event_pri), cpu(_cpu)
{
setEvent(e_type, fault, _tid, inst);
}
void
InOrderCPU::scheduleCpuEvent(CPUEventType c_event, Fault fault,
ThreadID tid, DynInstPtr inst,
- unsigned delay, unsigned event_pri_offset)
+ unsigned delay, CPUEventPri event_pri)
{
CPUEvent *cpu_event = new CPUEvent(this, c_event, fault, tid, inst,
- event_pri_offset);
+ event_pri);
Tick sked_tick = nextCycle(curTick() + ticks(delay));
if (delay >= 0) {
// threads after we've finished deactivating, squashing,etc.
// other threads
scheduleCpuEvent(ActivateNextReadyThread, NoFault, 0/*tid*/, dummyInst[0],
- delay, 5);
+ delay, ActivateNextReadyThread_Pri);
// Be sure to signal that there's some activity so the CPU doesn't
// deschedule itself.
static std::string eventNames[NumCPUEvents];
+ enum CPUEventPri {
+ InOrderCPU_Pri = Event::CPU_Tick_Pri,
+ ActivateNextReadyThread_Pri = Event::CPU_Tick_Pri + 10
+ };
+
/** Define CPU Event */
class CPUEvent : public Event
{
public:
/** Constructs a CPU event. */
CPUEvent(InOrderCPU *_cpu, CPUEventType e_type, Fault fault,
- ThreadID _tid, DynInstPtr inst, unsigned event_pri_offset);
+ ThreadID _tid, DynInstPtr inst, CPUEventPri event_pri);
/** Set Type of Event To Be Scheduled */
void setEvent(CPUEventType e_type, Fault _fault, ThreadID _tid,
/** Schedule a CPU Event */
void scheduleCpuEvent(CPUEventType cpu_event, Fault fault, ThreadID tid,
DynInstPtr inst, unsigned delay = 0,
- unsigned event_pri_offset = 0);
+ CPUEventPri event_pri = InOrderCPU_Pri);
public:
/** Interface between the CPU and CPU resources. */
int stage_num,
InstSeqNum seq_num,
ThreadID _tid)
- : Event(CPU_Tick_Pri), resPool(_resPool),
+ : Event(ResPool_Pri), resPool(_resPool),
eventType(e_type), inst(_inst), seqNum(seq_num),
stageNum(stage_num), tid(_tid)
{ }
Default
};
+ enum ResPoolEventPri {
+ ResPool_Pri = InOrderCPU::InOrderCPU_Pri - 5
+ };
+
class ResPoolEvent : public Event
{
protected:
// A Trap Caused This Fault and will update the pc state
// when done trapping
DPRINTF(InOrderFetchSeq, "[tid:%i] Blocking due to fault @ "
- "[sn:%i].\n", inst->seqNum);
+ "[sn:%i].%s %s \n", inst->seqNum,
+ inst->instName(), inst->pcState());
pcValid[tid] = false;
} else {
TheISA::PCState nextPC;