[Avida-cvs] [avida-svn] r940 - development/source/cpu

brysonda at myxo.css.msu.edu brysonda at myxo.css.msu.edu
Sun Sep 10 17:19:17 PDT 2006


Author: brysonda
Date: 2006-09-10 20:19:17 -0400 (Sun, 10 Sep 2006)
New Revision: 940

Modified:
   development/source/cpu/cHardwareCPU.cc
   development/source/cpu/cHardwareSMT.cc
Log:
Adjust cHardwareCPU MoveHead and cHardwareSMT (not the transitional version) Head-Move instructions to support fully associative behavior.   Can now specify both the head to move and the target of the move.

Modified: development/source/cpu/cHardwareCPU.cc
===================================================================
--- development/source/cpu/cHardwareCPU.cc	2006-09-10 23:57:58 UTC (rev 939)
+++ development/source/cpu/cHardwareCPU.cc	2006-09-11 00:19:17 UTC (rev 940)
@@ -2851,7 +2851,12 @@
 bool cHardwareCPU::Inst_MoveHead(cAvidaContext& ctx)
 {
   const int head_used = FindModifiedHead(nHardware::HEAD_IP);
-  GetHead(head_used).Set(GetHead(nHardware::HEAD_FLOW));
+#if CLASSIC_FULLY_ASSOCIATIVE
+  const int target = FindModifiedHead(nHardware::HEAD_FLOW);
+#else
+  const int target = nHardware::HEAD_FLOW;
+#endif
+  GetHead(head_used).Set(GetHead(target));
   if (head_used == nHardware::HEAD_IP) m_advance_ip = false;
   return true;
 }

Modified: development/source/cpu/cHardwareSMT.cc
===================================================================
--- development/source/cpu/cHardwareSMT.cc	2006-09-10 23:57:58 UTC (rev 939)
+++ development/source/cpu/cHardwareSMT.cc	2006-09-11 00:19:17 UTC (rev 940)
@@ -1433,15 +1433,18 @@
 bool cHardwareSMT::Inst_HeadMove(cAvidaContext& ctx)
 {
   const int head_used = FindModifiedHead(nHardware::HEAD_IP);
-  if(head_used != nHardware::HEAD_FLOW)
-	{
-		GetHead(head_used).Set(GetHead(nHardware::HEAD_FLOW));
+#if SMT_FULLY_ASSOCIATIVE
+  const int target = FindModifiedHead(nHardware::HEAD_FLOW);
+#else
+  const int target = nHardware::HEAD_FLOW;
+#endif
+
+  if (head_used != target) {
+		GetHead(head_used).Set(GetHead(target));
 		if (head_used == nHardware::HEAD_IP) AdvanceIP() = false;
+	} else {
+		m_threads[m_cur_thread].heads[head_used]++;
 	}
-  else
-	{
-		m_threads[m_cur_thread].heads[nHardware::HEAD_FLOW]++;
-	}
   return true;
 }
 




More information about the Avida-cvs mailing list