summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorKorey Sewell <ksewell@umich.edu>2011-02-04 00:08:17 -0500
committerKorey Sewell <ksewell@umich.edu>2011-02-04 00:08:17 -0500
commit8ac717ef4c22580516d54046f9c0c1048eb4da62 (patch)
tree0862f5c7bf4163630703ceb8b360bf468377076e /src
parentbe17617990ea2b95e0f08324570b2bbf93dee1f0 (diff)
downloadgem5-8ac717ef4c22580516d54046f9c0c1048eb4da62.tar.xz
inorder: multi-issue branch resolution
Only execute (resolve) one branch per cycle because handling more than one is a little more complicated
Diffstat (limited to 'src')
-rw-r--r--src/cpu/inorder/resources/execution_unit.cc17
-rw-r--r--src/cpu/inorder/resources/execution_unit.hh3
2 files changed, 14 insertions, 6 deletions
diff --git a/src/cpu/inorder/resources/execution_unit.cc b/src/cpu/inorder/resources/execution_unit.cc
index 9ba7a64c7..cae007deb 100644
--- a/src/cpu/inorder/resources/execution_unit.cc
+++ b/src/cpu/inorder/resources/execution_unit.cc
@@ -41,7 +41,8 @@ using namespace ThePipeline;
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
@@ -55,8 +56,6 @@ ExecutionUnit::regStats()
.name(name() + ".predictedNotTakenIncorrect")
.desc("Number of Branches Incorrectly Predicted As Not Taken).");
- lastExecuteCycle = curTick();
-
executions
.name(name() + ".executions")
.desc("Number of Instructions Executed.");
@@ -98,14 +97,22 @@ ExecutionUnit::execute(int slot_num)
{
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++;
diff --git a/src/cpu/inorder/resources/execution_unit.hh b/src/cpu/inorder/resources/execution_unit.hh
index 8be339f4a..a6694ddb5 100644
--- a/src/cpu/inorder/resources/execution_unit.hh
+++ b/src/cpu/inorder/resources/execution_unit.hh
@@ -74,7 +74,8 @@ class ExecutionUnit : public Resource {
Stats::Scalar predictedCorrect;
Stats::Formula mispredictPct;
Stats::Scalar executions;
- Tick lastExecuteCycle;
+ Tick lastExecuteTick;
+ Tick lastControlTick;
};