[Avida-cvs] [Avida2-svn] r327 - trunk/source/cpu

brysonda@myxo.css.msu.edu brysonda at myxo.css.msu.edu
Wed Sep 28 12:08:57 PDT 2005


Author: brysonda
Date: 2005-09-28 15:08:57 -0400 (Wed, 28 Sep 2005)
New Revision: 327

Modified:
   trunk/source/cpu/cHardwareSMT.cc
   trunk/source/cpu/cHardwareSMT.h
Log:
Small fixes to the SMT cpu.

Modified: trunk/source/cpu/cHardwareSMT.cc
===================================================================
--- trunk/source/cpu/cHardwareSMT.cc	2005-09-28 18:51:30 UTC (rev 326)
+++ trunk/source/cpu/cHardwareSMT.cc	2005-09-28 19:08:57 UTC (rev 327)
@@ -752,7 +752,7 @@
   }
   
   if (end_pos < MIN_INJECT_SIZE) {
-    GetMemory(mem_space_used)=cGenome(ConvertToInstruction(mem_space_used)); 
+    GetMemory(mem_space_used) = cGenome(0); 
     Fault(FAULT_LOC_INJECT, FAULT_TYPE_ERROR, "inject: new size too small");
     return false; // (inject fails)
   }
@@ -786,7 +786,7 @@
   //************** CALL ENDS HERE ******************//
 	
   //reset the memory space which was injected
-  GetMemory(mem_space_used)=cGenome(ConvertToInstruction(mem_space_used)); 
+  GetMemory(mem_space_used) = cGenome(0); 
 	
   for(int x=0; x<nHardware::NUM_HEADS; x++) {
 		GetHead(x).Reset(IP().GetMemSpace(), this);
@@ -1600,7 +1600,7 @@
   bool parent_alive = organism->ActivateDivide();
 	
   //reset the memory of the memory space that has been divided off
-  GetMemory(mem_space_used)=cGenome(ConvertToInstruction(mem_space_used)); 
+  GetMemory(mem_space_used) = cGenome(0); 
 	
   // 3 Division Methods:
   // 1) DIVIDE_METHOD_OFFSPRING - Create a child, leave parent state untouched.
@@ -1647,14 +1647,6 @@
   return true;
 }
 
-cString cHardwareSMT::ConvertToInstruction(int mem_space_used)
-{
-  char c = mem_space_used + 97;  // 97 - ASCII for 'a'
-  cString ret;
-  ret += c;
-  return ret;
-}
-
 cString cHardwareSMT::GetActiveStackID(int stackID) const
 {
   if(stackID == nHardwareSMT::STACK_AX)

Modified: trunk/source/cpu/cHardwareSMT.h
===================================================================
--- trunk/source/cpu/cHardwareSMT.h	2005-09-28 18:51:30 UTC (rev 326)
+++ trunk/source/cpu/cHardwareSMT.h	2005-09-28 19:08:57 UTC (rev 327)
@@ -234,11 +234,7 @@
 	
   void SaveState(std::ostream & fp);
   void LoadState(std::istream & fp);
-	
-  //void InitInstSet(const cString & filename, cInstSet & inst_set);
-  cString ConvertToInstruction(int mem_space_used);
-	
-	
+		
 private:
   /////////---------- Instruction Helpers ------------//////////
   int FindModifiedStack(int default_stack);




More information about the Avida-cvs mailing list