numCtxtSwitches
.name(name() + ".contextSwitches")
.desc("Number of context switches");
+
+ comLoads
+ .name(name() + ".comLoads")
+ .desc("Number of Load instructions committed");
+
+ comStores
+ .name(name() + ".comStores")
+ .desc("Number of Store instructions committed");
+
+ comBranches
+ .name(name() + ".comBranches")
+ .desc("Number of Branches instructions committed");
+
+ comNops
+ .name(name() + ".comNops")
+ .desc("Number of Nop instructions committed");
+
+ comNonSpec
+ .name(name() + ".comNonSpec")
+ .desc("Number of Non-Speculative instructions committed");
+
+ comInts
+ .name(name() + ".comInts")
+ .desc("Number of Integer instructions committed");
+
+ comFloats
+ .name(name() + ".comFloats")
+ .desc("Number of Floating Point instructions committed");
timesIdled
.name(name() + ".timesIdled")
.name(name() + ".cpi")
.desc("CPI: Cycles Per Instruction (Per-Thread)")
.precision(6);
- cpi = threadCycles / committedInsts;
+ cpi = numCycles / committedInsts;
smtCpi
.name(name() + ".smt_cpi")
.name(name() + ".ipc")
.desc("IPC: Instructions Per Cycle (Per-Thread)")
.precision(6);
- ipc = committedInsts / threadCycles;
+ ipc = committedInsts / numCycles;
smtIpc
.name(name() + ".smt_ipc")
smtCommittedInsts[tid]++;
}
+ // Instruction-Mix Stats
+ if (inst->isLoad()) {
+ comLoads++;
+ } else if (inst->isStore()) {
+ comStores++;
+ } else if (inst->isControl()) {
+ comBranches++;
+ } else if (inst->isNop()) {
+ comNops++;
+ } else if (inst->isNonSpeculative()) {
+ comNonSpec++;
+ } else if (inst->isInteger()) {
+ comInts++;
+ } else if (inst->isFloating()) {
+ comFloats++;
+ }
+
// Check for instruction-count-based events.
comInstEventQueue[tid]->serviceEvents(thread[tid]->numInst);
/** Percentage of cycles a stage was active */
Stats::Formula activity;
+ /** Instruction Mix Stats */
+ Stats::Scalar comLoads;
+ Stats::Scalar comStores;
+ Stats::Scalar comBranches;
+ Stats::Scalar comNops;
+ Stats::Scalar comNonSpec;
+ Stats::Scalar comInts;
+ Stats::Scalar comFloats;
+
/** Stat for the number of committed instructions per thread. */
Stats::Vector committedInsts;
void
Resource::regStats()
{
+#ifdef DEBUG
instReqsProcessed
.name(name() + ".instReqsProcessed")
.desc("Number of Instructions Requests that completed in "
"this resource.")
.prereq(instReqsProcessed);
+#endif
}
int
// change slot # to -1, since we check slotNum to see if request is still valid
slotNum = -1;
-
+
+#ifdef DEBUG
res->instReqsProcessed++;
+#endif
}
ResourceEvent::ResourceEvent()
// DEFAULT RESOURCE STATISTICS
//
/////////////////////////////////////////////////////////////////
+#ifdef DEBUG
/** Number of Instruction Requests the Resource Processes */
Stats::Scalar instReqsProcessed;
+#endif
};
class ResourceEvent : public Event
: Resource(res_name, res_id, res_width, res_latency, _cpu)
{ }
+void
+AGENUnit::regStats()
+{
+ agens
+ .name(name() + ".agens")
+ .desc("Number of Address Generations");
+
+ Resource::regStats();
+}
+
void
AGENUnit::execute(int slot_num)
{
fatal("%s encountered while calculating address [sn:%i]",
fault->name(), seq_num);
}
+
+ agens++;
} else {
DPRINTF(InOrderAGEN,
"[tid:] Ignoring non-memory instruction [sn:%i]\n",
};
virtual void execute(int slot_num);
+ void regStats();
protected:
- /** @todo: Add Resource Stats Here */
+ Stats::Scalar agens;
};
#endif //__CPU_INORDER_DECODE_UNIT_HH__
lastExecuteCycle = curTick;
- cyclesExecuted
- .name(name() + ".cyclesExecuted")
- .desc("Number of Cycles Execution Unit was used.");
-
- utilization
- .name(name() + ".utilization")
- .desc("Utilization of Execution Unit (cycles / totalCycles).");
- utilization = cyclesExecuted / cpu->numCycles;
+ executions
+ .name(name() + ".executions")
+ .desc("Number of Instructions Executed.");
Resource::regStats();
}
{
if (curTick != lastExecuteCycle) {
lastExecuteCycle = curTick;
- cyclesExecuted++;
}
} else if (inst->isControl()) {
// Evaluate Branch
fault = inst->execute();
+ executions++;
inst->setExecuted();
} else {
// Regular ALU instruction
fault = inst->execute();
+ executions++;
if (fault == NoFault) {
inst->setExecuted();
Stats::Scalar predictedTakenIncorrect;
Stats::Scalar predictedNotTakenIncorrect;
- Stats::Scalar cyclesExecuted;
+ Stats::Scalar executions;
Tick lastExecuteCycle;
-
- Stats::Formula utilization;
};
void
MultDivUnit::regStats()
{
- multInstReqsProcessed
- .name(name() + ".multInstReqsProcessed")
- .desc("Number of Multiply Requests Processed.");
+ multiplies
+ .name(name() + ".multiplies")
+ .desc("Number of Multipy Operations Executed");
- divInstReqsProcessed
- .name(name() + ".divInstReqsProcessed")
- .desc("Number of Divide Requests Processed.");
+ divides
+ .name(name() + ".divides")
+ .desc("Number of Divide Operations Executed");
Resource::regStats();
}
if (inst->opClass() == IntMultOp) {
scheduleEvent(slot_num, multLatency);
- multInstReqsProcessed++;
} else if (inst->opClass() == IntDivOp) {
int op_size = getDivOpSize(inst);
}
lastDivSize = op_size;
-
- divInstReqsProcessed++;
}
// Allow to pass through to next stage while
fault = inst->execute();
+ if (inst->opClass() == IntMultOp) {
+ multiplies++;
+ } else if (inst->opClass() == IntDivOp) {
+ divides++;
+ }
+
if (fault == NoFault) {
inst->setExecuted();
mult_div_req->setCompleted();
/** Last instruction name the MDU used */
std::string lastInstName;
- /** Number of Instruction Requests the Resource Processes */
- Stats::Scalar multInstReqsProcessed;
+ /** Number of Multiplies */
+ Stats::Scalar multiplies;
- /** Number of Instruction Requests the Resource Processes */
- Stats::Scalar divInstReqsProcessed;
+ /** Number of Divides */
+ Stats::Scalar divides;
MDUEvent *mduEvent;
};
.name(name() + ".uniqueRegsPerSwitch")
.desc("Number of Unique Registers Needed Per Context Switch")
.prereq(uniqueRegsPerSwitch);
+
+ regFileReads
+ .name(name() + ".regFileReads")
+ .desc("Number of Reads from Register File");
+
+ regForwards
+ .name(name() + ".regForwards")
+ .desc("Number of Registers Read Through Forwarding Logic");
+
+ regFileWrites
+ .name(name() + ".regFileWrites")
+ .desc("Number of Writes to Register File");
+
+ regFileAccs
+ .name(name() + ".regFileAccesses")
+ .desc("Number of Total Accesses (Read+Write) to the Register File");
+ regFileAccs = regFileReads + regFileWrites;
Resource::regStats();
}
}
outReadSeqNum[tid] = maxSeqNum;
-
+ regFileReads++;
ud_req->done();
} else {
DPRINTF(InOrderUseDef, "[tid:%i]: Unable to read because "
}
outReadSeqNum[tid] = maxSeqNum;
-
+ regForwards++;
ud_req->done();
} else {
DPRINTF(InOrderUseDef, "[tid:%i]: Unable to read "
}
outWriteSeqNum[tid] = maxSeqNum;
-
+ regFileWrites++;
ud_req->done();
} else {
DPRINTF(InOrderUseDef, "[tid:%i]: Unable to write because "
int useDefIdx;
};
+
+ protected:
+ /** Register File Reads */
+ Stats::Scalar regFileReads;
+
+ /** Register File Writes */
+ Stats::Scalar regFileWrites;
+
+ /** Source Register Forwarding */
+ Stats::Scalar regForwards;
+
+ /** Register File Total Accesses (Read+Write) */
+ Stats::Formula regFileAccs;
};
#endif //__CPU_INORDER_USE_DEF_UNIT_HH__