Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Rename_unit/Register_translation_unit/Register_Address_Translation_unit/SelfTest/src/test.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Rename_unit/Register_translation_unit/Register_Address_Translation_unit/SelfTest/src/test.cpp	(revision 82)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Rename_unit/Register_translation_unit/Register_Address_Translation_unit/SelfTest/src/test.cpp	(revision 88)
@@ -24,4 +24,14 @@
 #endif
 
+  Tusage_t _usage = USE_ALL;
+
+//   _usage = usage_unset(_usage,USE_SYSTEMC              );
+//   _usage = usage_unset(_usage,USE_VHDL                 );
+//   _usage = usage_unset(_usage,USE_VHDL_TESTBENCH       );
+//   _usage = usage_unset(_usage,USE_VHDL_TESTBENCH_ASSERT);
+//   _usage = usage_unset(_usage,USE_POSITION             );
+//   _usage = usage_unset(_usage,USE_STATISTICS           );
+//   _usage = usage_unset(_usage,USE_INFORMATION          );
+
   Register_Address_Translation_unit * _Register_Address_Translation_unit = new Register_Address_Translation_unit 
     (name.c_str(),
@@ -30,5 +40,5 @@
 #endif
      _param,
-     USE_ALL);
+     _usage);
   
 #ifdef SYSTEMC
@@ -78,4 +88,6 @@
   ALLOC1_SC_SIGNAL( in_RETIRE_NUM_REG_RD_PHY_OLD," in_RETIRE_NUM_REG_RD_PHY_OLD",Tgeneral_address_t,_param->_nb_inst_retire);
   ALLOC1_SC_SIGNAL( in_RETIRE_NUM_REG_RE_PHY_OLD," in_RETIRE_NUM_REG_RE_PHY_OLD",Tspecial_address_t,_param->_nb_inst_retire);
+  ALLOC1_SC_SIGNAL(out_RETIRE_RESTORE_RD_PHY_OLD,"out_RETIRE_RESTORE_RD_PHY_OLD",Tcontrol_t        ,_param->_nb_inst_retire);
+  ALLOC1_SC_SIGNAL(out_RETIRE_RESTORE_RE_PHY_OLD,"out_RETIRE_RESTORE_RE_PHY_OLD",Tcontrol_t        ,_param->_nb_inst_retire);
   
   /********************************************************
@@ -131,4 +143,6 @@
   INSTANCE1_SC_SIGNAL(_Register_Address_Translation_unit, in_RETIRE_NUM_REG_RD_PHY_OLD,_param->_nb_inst_retire);
   INSTANCE1_SC_SIGNAL(_Register_Address_Translation_unit, in_RETIRE_NUM_REG_RE_PHY_OLD,_param->_nb_inst_retire);
+  INSTANCE1_SC_SIGNAL(_Register_Address_Translation_unit,out_RETIRE_RESTORE_RD_PHY_OLD,_param->_nb_inst_retire);
+  INSTANCE1_SC_SIGNAL(_Register_Address_Translation_unit,out_RETIRE_RESTORE_RE_PHY_OLD,_param->_nb_inst_retire);
 
   msg(_("<%s> : Start Simulation ............\n"),name.c_str());
@@ -226,8 +240,14 @@
 	    }
 
+          uint32_t retire_max = _param->_nb_inst_retire;
 	  for (uint32_t i=0; i<_param->_nb_inst_retire; i++)
 	    {
-	      Tcontrol_t val = (rand()%100)<percent_transaction_retire;
+              // in order ...........
+
+	      Tcontrol_t val = (i<retire_max) and ((rand()%100)<percent_transaction_retire);
 	      
+              if (not val)
+                retire_max = i;
+
 	      Tcontext_t front_end_id = rand() % _param->_nb_front_end;
 
@@ -259,4 +279,11 @@
 		}
 	    }
+
+	  for (uint32_t i=0; i<_param->_nb_inst_retire; i++)
+	    {
+              TEST(Tcontrol_t,out_RETIRE_RESTORE_RD_PHY_OLD[i]->read(), 0);
+              TEST(Tcontrol_t,out_RETIRE_RESTORE_RE_PHY_OLD[i]->read(), 0);
+            }
+
 	  for (uint32_t i=0; i<_param->_nb_inst_insert; i++)
 	    {
@@ -320,4 +347,6 @@
       SC_START(1);
 
+      // EVENT !!!!!!!!
+
       nb_request = 32;
       while (nb_request > 1)
@@ -347,7 +376,14 @@
 	    }
 
+          uint32_t retire_max = _param->_nb_inst_retire;
 	  for (uint32_t i=0; i<_param->_nb_inst_retire; i++)
 	    {
-	      Tcontrol_t val = (rand()%100)<percent_transaction_retire;
+              // in order ...........
+
+	      Tcontrol_t val = (i<retire_max) and ((rand()%100)<percent_transaction_retire);
+	      
+              if (not val)
+                retire_max = i;
+
 	      in_RETIRE_VAL                [i]->write(val);
 	      in_RETIRE_FRONT_END_ID       [i]->write(retire_front_end_id [i]);
@@ -362,5 +398,5 @@
 	    }
 
-	  SC_START(1);
+	  SC_START(0);
 	  
 
@@ -380,10 +416,21 @@
 	  for (uint32_t i=0; i<_param->_nb_inst_retire; i++)
 	    {
+              LABEL("RETIRE[%d]",i);
+
 	      Tcontext_t front_end_id = in_RETIRE_FRONT_END_ID [i]->read();
 	      Tcontext_t context_id   = in_RETIRE_CONTEXT_ID   [i]->read();
+
+              LABEL("  * front_end_id : %d",front_end_id);
+              LABEL("  * context_id   : %d",context_id  );
+
 	      if (in_RETIRE_VAL [i]->read() and out_RETIRE_ACK [i]->read())
 		{
 		  if (in_RETIRE_WRITE_RD [i]->read() == 1)
 		    {
+//                       LABEL("  * transaction and write rd");
+//                       LABEL("    * rd_log       : %d",in_RETIRE_NUM_REG_RD_LOG[i]->read());
+//                       LABEL("    * rat_gpr_updt : %d",rat_gpr_updt [front_end_id][context_id][in_RETIRE_NUM_REG_RD_LOG[i]->read()]);
+                      TEST(Tcontrol_t,out_RETIRE_RESTORE_RD_PHY_OLD[i]->read(), (rat_gpr_updt [front_end_id][context_id][in_RETIRE_NUM_REG_RD_LOG[i]->read()] == false));
+
 		      if (rat_gpr_updt [front_end_id][context_id][in_RETIRE_NUM_REG_RD_LOG[i]->read()] == false)
 			rat_gpr[front_end_id][context_id][in_RETIRE_NUM_REG_RD_LOG[i]->read()] = in_RETIRE_NUM_REG_RD_PHY_OLD[i]->read();
@@ -392,4 +439,6 @@
 		  if (in_RETIRE_WRITE_RE [i]->read() == 1)
 		    {
+                      TEST(Tcontrol_t,out_RETIRE_RESTORE_RE_PHY_OLD[i]->read(), (rat_spr_updt [front_end_id][context_id][in_RETIRE_NUM_REG_RE_LOG[i]->read()] == false));
+
 		      if (rat_spr_updt [front_end_id][context_id][in_RETIRE_NUM_REG_RE_LOG[i]->read()] == false)
 			rat_spr[front_end_id][context_id][in_RETIRE_NUM_REG_RE_LOG[i]->read()] = in_RETIRE_NUM_REG_RE_PHY_OLD[i]->read();
@@ -398,4 +447,7 @@
 		}
 	    }
+
+	  SC_START(1);
+
 	  for (uint32_t i=0; i<_param->_nb_inst_insert; i++)
 	    {
@@ -412,6 +464,6 @@
 		  TEST(Tspecial_address_t,out_RENAME_NUM_REG_RE_PHY_OLD[i]->read(), rat_spr[front_end_id][context_id][in_RENAME_NUM_REG_RE_LOG[i]->read()]);
 		}
-
-	    }
+	    }
+
 	}
     }
@@ -472,4 +524,6 @@
   delete []  in_RETIRE_NUM_REG_RD_PHY_OLD;
   delete []  in_RETIRE_NUM_REG_RE_PHY_OLD;
+  delete [] out_RETIRE_RESTORE_RD_PHY_OLD;
+  delete [] out_RETIRE_RESTORE_RE_PHY_OLD;
 
 #endif
