Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Rename_unit/Register_translation_unit/Stat_List_unit/src/Parameters.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Rename_unit/Register_translation_unit/Stat_List_unit/src/Parameters.cpp	(revision 82)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Rename_unit/Register_translation_unit/Stat_List_unit/src/Parameters.cpp	(revision 88)
@@ -29,5 +29,6 @@
 			  uint32_t   nb_reg_free           ,
 			  uint32_t   nb_bank               ,
-			  uint32_t   size_counter          )
+			  uint32_t   size_counter          ,
+                          bool       is_toplevel)
   {
     log_printf(FUNC,Stat_List_unit,FUNCTION,"Begin");
@@ -43,7 +44,4 @@
     _size_counter           = size_counter       ;
 
-    _size_general_register  = log2(nb_general_register);
-    _size_special_register  = log2(nb_special_register);
-    
     _max_reader             = 1<<size_counter;
 
@@ -68,4 +66,13 @@
 
     test();
+    
+    if (is_toplevel)
+      {
+        _size_general_register  = log2(nb_general_register);
+        _size_special_register  = log2(nb_special_register);
+        
+        copy ();
+      }
+
     log_printf(FUNC,Stat_List_unit,FUNCTION,"End");
   };
@@ -82,9 +89,18 @@
 #undef  FUNCTION
 #define FUNCTION "Stat_List_unit::~Parameters"
-  Parameters::~Parameters () 
+  Parameters::~Parameters (void) 
   {
     log_printf(FUNC,Stat_List_unit,FUNCTION,"Begin");
     log_printf(FUNC,Stat_List_unit,FUNCTION,"End");
   };
+
+#undef  FUNCTION
+#define FUNCTION "Stat_List_unit::copy"
+  void Parameters::copy (void) 
+  {
+    log_printf(FUNC,Stat_List_unit,FUNCTION,"Begin");
+    log_printf(FUNC,Stat_List_unit,FUNCTION,"End");
+  };
+
 
 }; // end namespace stat_list_unit
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Rename_unit/Register_translation_unit/Stat_List_unit/src/Stat_List_unit.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Rename_unit/Register_translation_unit/Stat_List_unit/src/Stat_List_unit.cpp	(revision 82)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Rename_unit/Register_translation_unit/Stat_List_unit/src/Stat_List_unit.cpp	(revision 88)
@@ -16,5 +16,4 @@
 namespace register_translation_unit {
 namespace stat_list_unit {
-
 
 #undef  FUNCTION
@@ -39,4 +38,10 @@
     log_printf(FUNC,Stat_List_unit,FUNCTION,"Begin");
 
+#if DEBUG_Stat_List_unit == true
+    log_printf(INFO,Stat_List_unit,FUNCTION,_("<%s> Parameters"),_name.c_str());
+
+    std::cout << *param << std::endl;
+#endif    
+
     log_printf(INFO,Stat_List_unit,FUNCTION,"Allocation");
 
@@ -48,5 +53,5 @@
 
 #ifdef STATISTICS
-    if (_usage & USE_STATISTICS)
+    if (usage_is_set(_usage,USE_STATISTICS))
       {	
 	log_printf(INFO,Stat_List_unit,FUNCTION,"Allocation of statistics");
@@ -57,5 +62,5 @@
 
 #ifdef VHDL
-    if (_usage & USE_VHDL)
+    if (usage_is_set(_usage,USE_VHDL))
       {
 	// generate the vhdl
@@ -67,5 +72,5 @@
 
 #ifdef SYSTEMC
-    if (_usage & USE_SYSTEMC)
+    if (usage_is_set(_usage,USE_SYSTEMC))
       {
 	// Constant
@@ -90,5 +95,5 @@
 	SC_METHOD (genMoore);
 	dont_initialize ();
-	sensitive << (*(in_CLOCK)).neg();
+	sensitive << (*(in_CLOCK)).neg(); // need internal register
 	
 # ifdef SYSTEMCASS_SPECIFIC
@@ -100,5 +105,5 @@
 	SC_METHOD (genMealy);
 	dont_initialize ();
-	sensitive << (*(in_CLOCK)).neg();
+	sensitive << (*(in_CLOCK)).neg(); // need internal register
 	for (uint32_t i=0; i<_param->_nb_inst_insert; i++)
 	  sensitive << (*(in_INSERT_READ_RA        [i]))
@@ -135,5 +140,5 @@
 
 #ifdef STATISTICS
-    if (_usage & USE_STATISTICS)
+    if (usage_is_set(_usage,USE_STATISTICS))
       {
 	log_printf(INFO,Stat_List_unit,FUNCTION,"Generate Statistics file");
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Rename_unit/Register_translation_unit/Stat_List_unit/src/Stat_List_unit_allocation.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Rename_unit/Register_translation_unit/Stat_List_unit/src/Stat_List_unit_allocation.cpp	(revision 82)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Rename_unit/Register_translation_unit/Stat_List_unit/src/Stat_List_unit_allocation.cpp	(revision 88)
@@ -87,7 +87,9 @@
        ALLOC1_SIGNAL_IN ( in_RETIRE_NUM_REG_RC_PHY    ,"num_reg_rc_phy"    ,Tspecial_address_t,_param->_size_special_register);
        ALLOC1_SIGNAL_IN ( in_RETIRE_WRITE_RD          ,"write_rd"          ,Tcontrol_t        ,1                             );
+       ALLOC1_SIGNAL_IN ( in_RETIRE_RESTORE_RD_PHY_OLD,"restore_rd_phy_old",Tcontrol_t        ,1                             );
        ALLOC1_SIGNAL_IN ( in_RETIRE_NUM_REG_RD_PHY_OLD,"num_reg_rd_phy_old",Tgeneral_address_t,_param->_size_general_register);
        ALLOC1_SIGNAL_IN ( in_RETIRE_NUM_REG_RD_PHY_NEW,"num_reg_rd_phy_new",Tgeneral_address_t,_param->_size_general_register);
        ALLOC1_SIGNAL_IN ( in_RETIRE_WRITE_RE          ,"write_re"          ,Tcontrol_t        ,1                             );
+       ALLOC1_SIGNAL_IN ( in_RETIRE_RESTORE_RE_PHY_OLD,"restore_re_phy_old",Tcontrol_t        ,1                             );
        ALLOC1_SIGNAL_IN ( in_RETIRE_NUM_REG_RE_PHY_OLD,"num_reg_re_phy_old",Tspecial_address_t,_param->_size_special_register);
        ALLOC1_SIGNAL_IN ( in_RETIRE_NUM_REG_RE_PHY_NEW,"num_reg_re_phy_new",Tspecial_address_t,_param->_size_special_register);
@@ -112,5 +114,7 @@
      }
 
-    // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~    
+    // ~~~~~[ Internal ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~    
+    if (usage_is_set(_usage,USE_SYSTEMC))
+      {
      gpr_stat_list = new stat_list_entry_t * [_param->_nb_bank];
      spr_stat_list = new stat_list_entry_t * [_param->_nb_bank];
@@ -128,7 +132,11 @@
      internal_PUSH_SPR_VAL      = new Tcontrol_t [_param->_nb_reg_free];
      internal_PUSH_SPR_NUM_BANK = new uint32_t   [_param->_nb_reg_free];
+      }
+
+    // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~    
 
 #ifdef POSITION
-    _component->generate_file();
+    if (usage_is_set(_usage,USE_POSITION))
+      _component->generate_file();
 #endif
 
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Rename_unit/Register_translation_unit/Stat_List_unit/src/Stat_List_unit_deallocation.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Rename_unit/Register_translation_unit/Stat_List_unit/src/Stat_List_unit_deallocation.cpp	(revision 82)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Rename_unit/Register_translation_unit/Stat_List_unit/src/Stat_List_unit_deallocation.cpp	(revision 88)
@@ -24,5 +24,5 @@
     log_printf(FUNC,Stat_List_unit,FUNCTION,"Begin");
 
-    if (_usage & USE_SYSTEMC)
+    if (usage_is_set(_usage,USE_SYSTEMC))
       {
 	delete     in_CLOCK ;
@@ -51,7 +51,9 @@
 	delete []  in_RETIRE_NUM_REG_RC_PHY    ;
 	delete []  in_RETIRE_WRITE_RD          ;
+	delete []  in_RETIRE_RESTORE_RD_PHY_OLD;
 	delete []  in_RETIRE_NUM_REG_RD_PHY_OLD;
 	delete []  in_RETIRE_NUM_REG_RD_PHY_NEW;
 	delete []  in_RETIRE_WRITE_RE          ;
+	delete []  in_RETIRE_RESTORE_RE_PHY_OLD;
 	delete []  in_RETIRE_NUM_REG_RE_PHY_OLD;
 	delete []  in_RETIRE_NUM_REG_RE_PHY_NEW;
@@ -64,15 +66,20 @@
 	delete []  in_PUSH_SPR_ACK             ;
 	delete [] out_PUSH_SPR_NUM_REG         ;
+    
+        // ~~~~~[ Internal ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+    
+        delete [] gpr_stat_list;
+        delete [] spr_stat_list;
+        
+        delete [] internal_INSERT_ACK       ;
+        delete [] internal_RETIRE_ACK       ;
+        delete [] internal_PUSH_GPR_VAL     ;
+        delete [] internal_PUSH_GPR_NUM_BANK;
+        delete [] internal_PUSH_SPR_VAL     ;
+        delete [] internal_PUSH_SPR_NUM_BANK;
       }
+
+
     // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~    
-    delete [] gpr_stat_list;
-    delete [] spr_stat_list;
-
-    delete [] internal_INSERT_ACK       ;
-    delete [] internal_RETIRE_ACK       ;
-    delete [] internal_PUSH_GPR_VAL     ;
-    delete [] internal_PUSH_GPR_NUM_BANK;
-    delete [] internal_PUSH_SPR_VAL     ;
-    delete [] internal_PUSH_SPR_NUM_BANK;
 
     delete _component;
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Rename_unit/Register_translation_unit/Stat_List_unit/src/Stat_List_unit_end_cycle.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Rename_unit/Register_translation_unit/Stat_List_unit/src/Stat_List_unit_end_cycle.cpp	(revision 82)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Rename_unit/Register_translation_unit/Stat_List_unit/src/Stat_List_unit_end_cycle.cpp	(revision 88)
@@ -26,5 +26,6 @@
 
 #ifdef STATISTICS
-    _stat->end_cycle();
+    if (usage_is_set(_usage,USE_STATISTICS))
+      _stat->end_cycle();
 #endif    
 
@@ -32,5 +33,6 @@
     // Evaluation before read the ouput signal
 //  sc_start(0);
-    _interfaces->testbench();
+    if (usage_is_set(_usage,USE_VHDL_TESTBENCH))
+      _interfaces->testbench();
 #endif
 
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Rename_unit/Register_translation_unit/Stat_List_unit/src/Stat_List_unit_genMealy.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Rename_unit/Register_translation_unit/Stat_List_unit/src/Stat_List_unit_genMealy.cpp	(revision 82)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Rename_unit/Register_translation_unit/Stat_List_unit/src/Stat_List_unit_genMealy.cpp	(revision 88)
@@ -23,5 +23,6 @@
   void Stat_List_unit::genMealy (void)
   {
-    log_printf(FUNC,Stat_List_unit,FUNCTION,"Begin");
+    log_begin(Stat_List_unit,FUNCTION);
+    log_function(Stat_List_unit,FUNCTION,_name.c_str());
 
     for (uint32_t i=0; i<_param->_nb_inst_insert; i++)
@@ -57,5 +58,5 @@
       }
     
-    log_printf(FUNC,Stat_List_unit,FUNCTION,"End");
+    log_end(Stat_List_unit,FUNCTION);
   };
 
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Rename_unit/Register_translation_unit/Stat_List_unit/src/Stat_List_unit_genMoore.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Rename_unit/Register_translation_unit/Stat_List_unit/src/Stat_List_unit_genMoore.cpp	(revision 82)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Rename_unit/Register_translation_unit/Stat_List_unit/src/Stat_List_unit_genMoore.cpp	(revision 88)
@@ -23,5 +23,6 @@
   void Stat_List_unit::genMoore (void)
   {
-    log_printf(FUNC,Stat_List_unit,FUNCTION,"Begin");
+    log_begin(Stat_List_unit,FUNCTION);
+    log_function(Stat_List_unit,FUNCTION,_name.c_str());
 
     uint32_t gpr_ptr = internal_GPR_PTR_FREE;
@@ -69,5 +70,5 @@
       }
     
-    log_printf(FUNC,Stat_List_unit,FUNCTION,"End");
+    log_end(Stat_List_unit,FUNCTION);
   };
 
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Rename_unit/Register_translation_unit/Stat_List_unit/src/Stat_List_unit_transition.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Rename_unit/Register_translation_unit/Stat_List_unit/src/Stat_List_unit_transition.cpp	(revision 82)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Rename_unit/Register_translation_unit/Stat_List_unit/src/Stat_List_unit_transition.cpp	(revision 88)
@@ -23,5 +23,6 @@
   void Stat_List_unit::transition (void)
   {
-    log_printf(FUNC,Stat_List_unit,FUNCTION,"Begin");
+    log_begin(Stat_List_unit,FUNCTION);
+    log_function(Stat_List_unit,FUNCTION,_name.c_str());
 
     if (PORT_READ(in_NRESET) == 0)
@@ -121,9 +122,10 @@
 	      if (PORT_READ(in_RETIRE_WRITE_RD [i]))
 		{
+                  Tcontrol_t restore_old = PORT_READ(in_RETIRE_RESTORE_RD_PHY_OLD [i]);
 		  {
 		    Tgeneral_address_t num_reg = PORT_READ(in_RETIRE_NUM_REG_RD_PHY_OLD [i]);
 		    uint32_t bank = num_reg >> _param->_shift_gpr;
 		    uint32_t reg  = num_reg  & _param->_mask_gpr ;
-		    gpr_stat_list [bank][reg].retire_write_old();
+		    gpr_stat_list [bank][reg].retire_write_old(restore_old);
 		  }
 		  {
@@ -131,5 +133,5 @@
 		    uint32_t bank = num_reg >> _param->_shift_gpr;
 		    uint32_t reg  = num_reg  & _param->_mask_gpr ;
-		    gpr_stat_list [bank][reg].retire_write_new();
+		    gpr_stat_list [bank][reg].retire_write_new(restore_old);
 		  }
 		}
@@ -137,9 +139,10 @@
 	      if (PORT_READ(in_RETIRE_WRITE_RE [i]))
 		{
+                  Tcontrol_t restore_old = PORT_READ(in_RETIRE_RESTORE_RE_PHY_OLD [i]);
 		  {
 		    Tgeneral_address_t num_reg = PORT_READ(in_RETIRE_NUM_REG_RE_PHY_OLD [i]);
 		    uint32_t bank = num_reg >> _param->_shift_spr;
 		    uint32_t reg  = num_reg  & _param->_mask_spr ;
-		    spr_stat_list [bank][reg].retire_write_old();
+		    spr_stat_list [bank][reg].retire_write_old(restore_old);
 		  }
 		  {
@@ -147,5 +150,5 @@
 		    uint32_t bank = num_reg >> _param->_shift_spr;
 		    uint32_t reg  = num_reg  & _param->_mask_spr ;
-		    spr_stat_list [bank][reg].retire_write_new();
+		    spr_stat_list [bank][reg].retire_write_new(restore_old);
 		  }
 		}
@@ -171,28 +174,29 @@
 	internal_SPR_PTR_FREE = ((internal_SPR_PTR_FREE==0)?_param->_nb_special_register_by_bank:internal_SPR_PTR_FREE)-1;
       }
-    
-//     log_printf(TRACE,Stat_List_unit,FUNCTION,"Print gpr_stat_list :");
-//     for (uint32_t i=0; i<_param->_nb_bank; i++)
-//       {
-// 	log_printf(TRACE,Stat_List_unit,FUNCTION," * Bank : %d",i);
-// 	for (uint32_t j=0; j<_param->_nb_general_register_by_bank; j++)
-// 	  {
-// 	    std::ostringstream str;
-// 	    str << gpr_stat_list [i][j];
-// 	    log_printf(TRACE,Stat_List_unit,FUNCTION,"   [%d] %s",j,str.str().c_str());
-
-// 	  }
-//       }
-//     log_printf(TRACE,Stat_List_unit,FUNCTION,"Print spr_stat_list :");
-//     for (uint32_t i=0; i<_param->_nb_bank; i++)
-//       {
-// 	log_printf(TRACE,Stat_List_unit,FUNCTION," * Bank : %d",i);
-// 	for (uint32_t j=0; j<_param->_nb_special_register_by_bank; j++)
-// 	  {
-// 	    std::ostringstream str;
-// 	    str << spr_stat_list [i][j];
-// 	    log_printf(TRACE,Stat_List_unit,FUNCTION,"   [%d] %s",j,str.str().c_str());
-// 	  }
-//       }
+
+
+#if (DEBUG >= DEBUG_TRACE)
+    log_printf(TRACE,Stat_List_unit,FUNCTION,"  * Dump Stat List");
+    for (uint32_t i=0; i<_param->_nb_bank; i++)
+      for (uint32_t j=0; j<_param->_nb_general_register_by_bank; j++)
+        log_printf(TRACE,Stat_List_unit,FUNCTION,"    * GPR[%.4d][%.5d] (%.5d) - free %.1d, link %.1d, valid %.1d, counter %.4d",
+                   i,
+                   j,
+                   (i<<_param->_shift_gpr)|j,
+                   gpr_stat_list[i][j]._is_free,
+                   gpr_stat_list[i][j]._is_link,
+                   gpr_stat_list[i][j]._is_valid,
+                   gpr_stat_list[i][j]._counter);
+    for (uint32_t i=0; i<_param->_nb_bank; i++)
+      for (uint32_t j=0; j<_param->_nb_special_register_by_bank; j++)
+        log_printf(TRACE,Stat_List_unit,FUNCTION,"    * SPR[%.4d][%.5d] (%.5d) - free %.1d, link %.1d, valid %.1d, counter %.4d",
+                   i,
+                   j,
+                   (i<<_param->_shift_spr)|j,
+                   spr_stat_list[i][j]._is_free,
+                   spr_stat_list[i][j]._is_link,
+                   spr_stat_list[i][j]._is_valid,
+                   spr_stat_list[i][j]._counter);
+#endif
 
 #if defined(STATISTICS) or defined(VHDL_TESTBENCH)
@@ -200,5 +204,5 @@
 #endif
 
-    log_printf(FUNC,Stat_List_unit,FUNCTION,"End");
+    log_end(Stat_List_unit,FUNCTION);
   };
 
