ExecutionUnit::ExecutionUnit(string res_name, int res_id, int res_width,
int res_latency, InOrderCPU *_cpu,
ThePipeline::Params *params)
- : Resource(res_name, res_id, res_width, res_latency, _cpu)
+ : Resource(res_name, res_id, res_width, res_latency, _cpu),
+ lastExecuteTick(0), lastControlTick(0)
{ }
void
.name(name() + ".predictedNotTakenIncorrect")
.desc("Number of Branches Incorrectly Predicted As Not Taken).");
- lastExecuteCycle = curTick();
-
executions
.name(name() + ".executions")
.desc("Number of Instructions Executed.");
{
case ExecuteInst:
{
- if (curTick() != lastExecuteCycle) {
- lastExecuteCycle = curTick();
+ if (curTick() != lastExecuteTick) {
+ lastExecuteTick = curTick();
}
if (inst->isMemRef()) {
panic("%s not configured to handle memory ops.\n", resName);
} else if (inst->isControl()) {
+ if (lastControlTick == curTick()) {
+ DPRINTF(InOrderExecute, "Can not Execute More than One Control "
+ "Inst Per Cycle. Blocking Request.\n");
+ exec_req->done(false);
+ return;
+ }
+ lastControlTick = curTick();
+
// Evaluate Branch
fault = inst->execute();
executions++;