Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Rename_unit/Register_translation_unit/Register_Address_Translation_unit/src/Parameters.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Rename_unit/Register_translation_unit/Register_Address_Translation_unit/src/Parameters.cpp	(revision 132)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Rename_unit/Register_translation_unit/Register_Address_Translation_unit/src/Parameters.cpp	(revision 139)
@@ -20,20 +20,26 @@
 #undef  FUNCTION
 #define FUNCTION "Register_Address_Translation_unit::Parameters"
-  Parameters::Parameters (uint32_t   nb_front_end       ,
-			  uint32_t * nb_context         ,
-			  uint32_t   nb_general_register,
-			  uint32_t   nb_special_register,
-			  uint32_t   nb_inst_insert     ,
-			  uint32_t   nb_inst_retire     ,
-                          bool       is_toplevel)
+  Parameters::Parameters (uint32_t         nb_front_end        ,
+			  uint32_t       * nb_context          ,//[nb_front_end]
+			  uint32_t         nb_general_register ,
+			  uint32_t         nb_special_register ,
+                          Trat_scheme_t    rat_scheme          ,
+			  uint32_t         nb_inst_insert      ,
+			  uint32_t         nb_inst_retire      ,
+                          uint32_t      ** nb_branch_speculated,//[nb_front_end][nb_context]
+                          bool             is_toplevel)
   {
     log_printf(FUNC,Register_Address_Translation_unit,FUNCTION,"Begin");
 
-    _nb_front_end           = nb_front_end       ;
-    _nb_context             = nb_context         ;
-    _nb_general_register    = nb_general_register;
-    _nb_special_register    = nb_special_register;
-    _nb_inst_insert         = nb_inst_insert     ;
-    _nb_inst_retire         = nb_inst_retire     ;
+    _nb_front_end           = nb_front_end        ;
+    _nb_context             = nb_context          ;
+    _nb_general_register    = nb_general_register ;
+    _nb_special_register    = nb_special_register ;
+    _rat_scheme             = rat_scheme          ;
+    _nb_inst_insert         = nb_inst_insert      ;
+    _nb_inst_retire         = nb_inst_retire      ;
+    _nb_branch_speculated   = nb_branch_speculated;
+
+    _max_nb_context         = max<uint32_t>(_nb_context, _nb_front_end);
 
     test();
@@ -41,12 +47,14 @@
     if (is_toplevel)
       {
-        _size_front_end_id      = log2(nb_front_end       );
-        _size_context_id        = log2(max<uint32_t>(nb_context, nb_front_end));
-        _size_general_register  = log2(nb_general_register);
-        _size_special_register  = log2(nb_special_register);
+        _size_front_end_id      = log2(_nb_front_end       );
+        _size_context_id        = log2(_max_nb_context     );
+        _size_general_register  = log2(_nb_general_register);
+        _size_special_register  = log2(_nb_special_register);
+        _size_depth             = log2(max<uint32_t>(_nb_branch_speculated,_nb_front_end,_nb_context));
     
         _have_port_front_end_id = _size_front_end_id>0;
         _have_port_context_id   = _size_context_id  >0;
-        
+        _have_port_depth        = _size_depth       >0;
+
         copy();
       }
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Rename_unit/Register_translation_unit/Register_Address_Translation_unit/src/Parameters_msg_error.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Rename_unit/Register_translation_unit/Register_Address_Translation_unit/src/Parameters_msg_error.cpp	(revision 132)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Rename_unit/Register_translation_unit/Register_Address_Translation_unit/src/Parameters_msg_error.cpp	(revision 139)
@@ -10,5 +10,5 @@
 #include <sstream>
 
-namespace morpheo                    {
+namespace morpheo {
 namespace behavioural {
 namespace core {
@@ -27,4 +27,18 @@
     Parameters_test test ("Register_Address_Translation_unit");
 
+    switch(_rat_scheme)
+      {
+      case RAT_NO_SAVE    :
+        {
+          test.error(toString(_("The Register Address Translation scheme \"%s\" is not yet implemented.\n"),toString(_rat_scheme).c_str()));
+        }
+      default             :
+      // case RAT_ONE_SAVE   :
+      // case RAT_DEPTH_SAVE :
+        {
+          break;
+        }
+      }
+
     return test;
 
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Rename_unit/Register_translation_unit/Register_Address_Translation_unit/src/Parameters_print.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Rename_unit/Register_translation_unit/Register_Address_Translation_unit/src/Parameters_print.cpp	(revision 132)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Rename_unit/Register_translation_unit/Register_Address_Translation_unit/src/Parameters_print.cpp	(revision 139)
@@ -28,9 +28,10 @@
 
     xml.balise_open("register_address_translation_unit");
-    xml.singleton_begin("nb_front_end       "); xml.attribut("value",toString(_nb_front_end       )); xml.singleton_end();
-    xml.singleton_begin("nb_general_register"); xml.attribut("value",toString(_nb_general_register)); xml.singleton_end();
-    xml.singleton_begin("nb_special_register"); xml.attribut("value",toString(_nb_special_register)); xml.singleton_end();
-    xml.singleton_begin("nb_inst_insert     "); xml.attribut("value",toString(_nb_inst_insert     )); xml.singleton_end();
-    xml.singleton_begin("nb_inst_retire     "); xml.attribut("value",toString(_nb_inst_retire     )); xml.singleton_end();
+    xml.singleton_begin("nb_front_end        "); xml.attribut("value",toString(_nb_front_end       )); xml.singleton_end();
+    xml.singleton_begin("rat_scheme          "); xml.attribut("value",toString(_rat_scheme         )); xml.singleton_end();
+    xml.singleton_begin("nb_general_register "); xml.attribut("value",toString(_nb_general_register)); xml.singleton_end();
+    xml.singleton_begin("nb_special_register "); xml.attribut("value",toString(_nb_special_register)); xml.singleton_end();
+    xml.singleton_begin("nb_inst_insert      "); xml.attribut("value",toString(_nb_inst_insert     )); xml.singleton_end();
+    xml.singleton_begin("nb_inst_retire      "); xml.attribut("value",toString(_nb_inst_retire     )); xml.singleton_end();
 
     for (uint32_t i=0;i<_nb_front_end; i++)
@@ -40,5 +41,16 @@
 	xml.  attribut("id"  ,toString(i));
 	xml. balise_open_end();
-	xml.  singleton_begin("nb_context         "); xml.attribut("value",toString(_nb_context [i]     )); xml.singleton_end();
+	xml.  singleton_begin("nb_context          "); xml.attribut("value",toString(_nb_context [i]     )); xml.singleton_end();
+
+        for (uint32_t j=0;j<_nb_context[i]; j++)
+          {
+            xml. balise_open_begin("component");
+            xml.  attribut("type","context");
+            xml.  attribut("id"  ,toString(j));
+            xml. balise_open_end();
+            xml.  singleton_begin("nb_branch_speculated"); xml.attribut("value",toString(_nb_branch_speculated[i][j])); xml.singleton_end();
+            xml. balise_close();
+          }
+
 	xml. balise_close();
       }
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Rename_unit/Register_translation_unit/Register_Address_Translation_unit/src/Register_Address_Translation_unit.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Rename_unit/Register_translation_unit/Register_Address_Translation_unit/src/Register_Address_Translation_unit.cpp	(revision 132)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Rename_unit/Register_translation_unit/Register_Address_Translation_unit/src/Register_Address_Translation_unit.cpp	(revision 139)
@@ -75,4 +75,40 @@
     if (usage_is_set(_usage,USE_SYSTEMC))
       {
+        // Function pointer
+        switch (_param->_rat_scheme)
+          {
+          case RAT_NO_SAVE    :
+            {
+              // function_constant        = &morpheo::behavioural::core::multi_ooo_engine::ooo_engine::rename_unit::register_translation_unit::register_address_translation_unit::Register_Address_Translation_unit::function_no_save_constant       ;
+              // function_transition      = &morpheo::behavioural::core::multi_ooo_engine::ooo_engine::rename_unit::register_translation_unit::register_address_translation_unit::Register_Address_Translation_unit::function_no_save_transition     ;
+              // function_genMealy_rename = &morpheo::behavioural::core::multi_ooo_engine::ooo_engine::rename_unit::register_translation_unit::register_address_translation_unit::Register_Address_Translation_unit::function_no_save_genMealy_rename;
+
+              break;
+            }
+
+          case RAT_ONE_SAVE   :
+            {
+              function_constant        = &morpheo::behavioural::core::multi_ooo_engine::ooo_engine::rename_unit::register_translation_unit::register_address_translation_unit::Register_Address_Translation_unit::function_one_save_constant       ;
+              function_transition      = &morpheo::behavioural::core::multi_ooo_engine::ooo_engine::rename_unit::register_translation_unit::register_address_translation_unit::Register_Address_Translation_unit::function_one_save_transition     ;
+              function_genMealy_rename = &morpheo::behavioural::core::multi_ooo_engine::ooo_engine::rename_unit::register_translation_unit::register_address_translation_unit::Register_Address_Translation_unit::function_one_save_genMealy_rename;
+
+              break;
+            }
+
+          case RAT_DEPTH_SAVE :
+            {
+              function_constant        = &morpheo::behavioural::core::multi_ooo_engine::ooo_engine::rename_unit::register_translation_unit::register_address_translation_unit::Register_Address_Translation_unit::function_depth_save_constant       ;
+              function_transition      = &morpheo::behavioural::core::multi_ooo_engine::ooo_engine::rename_unit::register_translation_unit::register_address_translation_unit::Register_Address_Translation_unit::function_depth_save_transition     ;
+              function_genMealy_rename = &morpheo::behavioural::core::multi_ooo_engine::ooo_engine::rename_unit::register_translation_unit::register_address_translation_unit::Register_Address_Translation_unit::function_depth_save_genMealy_rename;
+
+              break;
+            }
+
+          default             :
+            {
+              break;
+            }
+          }
+
 #ifdef SYSTEMCASS_SPECIFIC
         constant();
@@ -118,4 +154,7 @@
                       << (*(in_RENAME_NUM_REG_RD_LOG [i]))
                       << (*(in_RENAME_NUM_REG_RE_LOG [i]));
+
+            if (_param->_rat_scheme == RAT_DEPTH_SAVE)
+            sensitive << (*(in_RENAME_SAVE_RAT       [i]));
           }
         for (uint32_t i=0; i<_param->_nb_front_end; ++i)
@@ -124,33 +163,4 @@
                       << (*(in_RETIRE_EVENT_STATE [i][j]));
 
-# ifdef SYSTEMCASS_SPECIFIC
-	// List dependency information
-# endif    
-
-	log_printf(INFO,Register_Address_Translation_unit,FUNCTION,"Method - genMealy_retire");
-
-	SC_METHOD (genMealy_retire);
-	dont_initialize ();
-	sensitive << (*(in_CLOCK)).neg() // need internal register
-		  << (*(in_NRESET));
-
-        for (uint32_t i=0; i<_param->_nb_inst_retire; ++i)
-          {
-            if (param->_have_port_front_end_id)
-            sensitive << (*(in_RETIRE_FRONT_END_ID   [i]));
-            if (param->_have_port_context_id)
-            sensitive << (*(in_RETIRE_CONTEXT_ID     [i]));
-            
-            sensitive << (*(in_RETIRE_WRITE_RD       [i]))
-                      << (*(in_RETIRE_WRITE_RE       [i]))
-                      << (*(in_RETIRE_NUM_REG_RD_LOG [i]))
-                      << (*(in_RETIRE_NUM_REG_RE_LOG [i]));
-          }
-
-        for (uint32_t i=0; i<_param->_nb_front_end; ++i)
-          for (uint32_t j=0; j<_param->_nb_context[i]; ++j)
-            sensitive << (*(in_RETIRE_EVENT_VAL   [i][j]))
-                      << (*(in_RETIRE_EVENT_STATE [i][j]));
-	
 # ifdef SYSTEMCASS_SPECIFIC
 	// List dependency information
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Rename_unit/Register_translation_unit/Register_Address_Translation_unit/src/Register_Address_Translation_unit_allocation.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Rename_unit/Register_translation_unit/Register_Address_Translation_unit/src/Register_Address_Translation_unit_allocation.cpp	(revision 132)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Rename_unit/Register_translation_unit/Register_Address_Translation_unit/src/Register_Address_Translation_unit_allocation.cpp	(revision 139)
@@ -61,18 +61,20 @@
       ALLOC1_INTERFACE_BEGIN("rename",IN,EAST,_("Input to rename source logical register"), _param->_nb_inst_insert);
 
-      ALLOC1_VALACK_IN ( in_RENAME_VAL               , VAL);
-      ALLOC1_VALACK_OUT(out_RENAME_ACK               , ACK);
-      ALLOC1_SIGNAL_IN ( in_RENAME_FRONT_END_ID      ,"front_end_id"      ,Tcontext_t        ,_param->_size_front_end_id);
-      ALLOC1_SIGNAL_IN ( in_RENAME_CONTEXT_ID        ,"context_id"        ,Tcontext_t        ,_param->_size_context_id  );
-      ALLOC1_SIGNAL_IN ( in_RENAME_NUM_REG_RA_LOG    ,"num_reg_ra_log"    ,Tgeneral_address_t,_param->_size_general_register_logic);
-      ALLOC1_SIGNAL_IN ( in_RENAME_NUM_REG_RB_LOG    ,"num_reg_rb_log"    ,Tgeneral_address_t,_param->_size_general_register_logic);
-      ALLOC1_SIGNAL_IN ( in_RENAME_NUM_REG_RC_LOG    ,"num_reg_rc_log"    ,Tspecial_address_t,_param->_size_special_register_logic);
-      ALLOC1_SIGNAL_IN ( in_RENAME_NUM_REG_RD_LOG    ,"num_reg_rd_log"    ,Tgeneral_address_t,_param->_size_general_register_logic);
-      ALLOC1_SIGNAL_IN ( in_RENAME_NUM_REG_RE_LOG    ,"num_reg_re_log"    ,Tspecial_address_t,_param->_size_special_register_logic);
-      ALLOC1_SIGNAL_OUT(out_RENAME_NUM_REG_RA_PHY    ,"num_reg_ra_phy"    ,Tgeneral_address_t,_param->_size_general_register);
-      ALLOC1_SIGNAL_OUT(out_RENAME_NUM_REG_RB_PHY    ,"num_reg_rb_phy"    ,Tgeneral_address_t,_param->_size_general_register);
-      ALLOC1_SIGNAL_OUT(out_RENAME_NUM_REG_RC_PHY    ,"num_reg_rc_phy"    ,Tspecial_address_t,_param->_size_special_register);
-      ALLOC1_SIGNAL_OUT(out_RENAME_NUM_REG_RD_PHY_OLD,"num_reg_rd_phy_old",Tgeneral_address_t,_param->_size_general_register);
-      ALLOC1_SIGNAL_OUT(out_RENAME_NUM_REG_RE_PHY_OLD,"num_reg_re_phy_old",Tspecial_address_t,_param->_size_special_register);
+      ALLOC1_VALACK_IN      ( in_RENAME_VAL               , VAL);
+      ALLOC1_VALACK_OUT     (out_RENAME_ACK               , ACK);
+      ALLOC1_SIGNAL_IN      ( in_RENAME_FRONT_END_ID      ,"front_end_id"      ,Tcontext_t        ,_param->_size_front_end_id);
+      ALLOC1_SIGNAL_IN      ( in_RENAME_CONTEXT_ID        ,"context_id"        ,Tcontext_t        ,_param->_size_context_id  );
+      ALLOC1_SIGNAL_IN_COND ( in_RENAME_DEPTH             ,"depth"             ,Tdepth_t          ,_param->_size_depth,_param->_rat_scheme == RAT_DEPTH_SAVE);
+      ALLOC1_SIGNAL_IN      ( in_RENAME_SAVE_RAT          ,"save_rat"          ,Tcontrol_t        ,1);
+      ALLOC1_SIGNAL_IN      ( in_RENAME_NUM_REG_RA_LOG    ,"num_reg_ra_log"    ,Tgeneral_address_t,_param->_size_general_register_logic);
+      ALLOC1_SIGNAL_IN      ( in_RENAME_NUM_REG_RB_LOG    ,"num_reg_rb_log"    ,Tgeneral_address_t,_param->_size_general_register_logic);
+      ALLOC1_SIGNAL_IN      ( in_RENAME_NUM_REG_RC_LOG    ,"num_reg_rc_log"    ,Tspecial_address_t,_param->_size_special_register_logic);
+      ALLOC1_SIGNAL_IN      ( in_RENAME_NUM_REG_RD_LOG    ,"num_reg_rd_log"    ,Tgeneral_address_t,_param->_size_general_register_logic);
+      ALLOC1_SIGNAL_IN      ( in_RENAME_NUM_REG_RE_LOG    ,"num_reg_re_log"    ,Tspecial_address_t,_param->_size_special_register_logic);
+      ALLOC1_SIGNAL_OUT     (out_RENAME_NUM_REG_RA_PHY    ,"num_reg_ra_phy"    ,Tgeneral_address_t,_param->_size_general_register);
+      ALLOC1_SIGNAL_OUT     (out_RENAME_NUM_REG_RB_PHY    ,"num_reg_rb_phy"    ,Tgeneral_address_t,_param->_size_general_register);
+      ALLOC1_SIGNAL_OUT     (out_RENAME_NUM_REG_RC_PHY    ,"num_reg_rc_phy"    ,Tspecial_address_t,_param->_size_special_register);
+      ALLOC1_SIGNAL_OUT     (out_RENAME_NUM_REG_RD_PHY_OLD,"num_reg_rd_phy_old",Tgeneral_address_t,_param->_size_general_register);
+      ALLOC1_SIGNAL_OUT     (out_RENAME_NUM_REG_RE_PHY_OLD,"num_reg_re_phy_old",Tspecial_address_t,_param->_size_special_register);
 
       ALLOC1_INTERFACE_END(_param->_nb_inst_insert);
@@ -111,7 +113,5 @@
       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_NUM_REG_RE_PHY_NEW,"num_reg_re_phy_new",Tspecial_address_t,_param->_size_special_register);
-      ALLOC1_SIGNAL_OUT(out_RETIRE_RESTORE_RD_PHY_OLD,"restore_rd_phy_old",Tcontrol_t        ,1);
-      ALLOC1_SIGNAL_OUT(out_RETIRE_RESTORE_RE_PHY_OLD,"restore_re_phy_old",Tcontrol_t        ,1);
-      ALLOC1_SIGNAL_OUT(out_RETIRE_RESTORE           ,"restore"           ,Tcontrol_t        ,1);
+      ALLOC1_SIGNAL_IN ( in_RETIRE_RESTORE           ,"restore"           ,Tcontrol_t        ,1);
 
       ALLOC1_INTERFACE_END(_param->_nb_inst_retire);
@@ -122,7 +122,9 @@
       ALLOC2_INTERFACE_BEGIN("retire_event", IN,NORTH, _("Retire event"), _param->_nb_front_end, _param->_nb_context[it1]);
 
-      _ALLOC2_VALACK_IN ( in_RETIRE_EVENT_VAL        ,VAL,_param->_nb_front_end, _param->_nb_context[it1]);
-      _ALLOC2_VALACK_OUT(out_RETIRE_EVENT_ACK        ,ACK,_param->_nb_front_end, _param->_nb_context[it1]);
-      _ALLOC2_SIGNAL_IN ( in_RETIRE_EVENT_STATE      ,"state"             ,Tevent_state_t    ,_param->_size_event_state, _param->_nb_front_end, _param->_nb_context[it1]);
+      _ALLOC2_VALACK_IN      ( in_RETIRE_EVENT_VAL        ,VAL,_param->_nb_front_end, _param->_nb_context[it1]);
+      _ALLOC2_VALACK_OUT     (out_RETIRE_EVENT_ACK        ,ACK,_param->_nb_front_end, _param->_nb_context[it1]);
+      _ALLOC2_SIGNAL_IN      ( in_RETIRE_EVENT_STATE      ,"state"             ,Tevent_state_t    ,_param->_size_event_state, _param->_nb_front_end, _param->_nb_context[it1]);
+      _ALLOC2_SIGNAL_IN_COND ( in_RETIRE_EVENT_TYPE       ,"type"              ,Tevent_type_t     ,_param->_size_event_type , _param->_nb_front_end, _param->_nb_context[it1],_param->_rat_scheme == RAT_DEPTH_SAVE);
+      _ALLOC2_SIGNAL_IN_COND ( in_RETIRE_EVENT_DEPTH      ,"depth"             ,Tdepth_t          ,_param->_size_depth      , _param->_nb_front_end, _param->_nb_context[it1],_param->_rat_scheme == RAT_DEPTH_SAVE);
 
       ALLOC2_INTERFACE_END(_param->_nb_front_end, _param->_nb_context[it1]);
@@ -132,24 +134,37 @@
       {
     ALLOC1(internal_RENAME_ACK       ,Tcontrol_t,_param->_nb_inst_insert);
+    ALLOC1(internal_RENAME_SAVE      ,Tcontrol_t,_param->_nb_inst_insert);
     ALLOC1(internal_INSERT_ACK       ,Tcontrol_t,_param->_nb_inst_insert);
     ALLOC1(internal_RETIRE_ACK       ,Tcontrol_t,_param->_nb_inst_retire);
     ALLOC2(internal_RETIRE_EVENT_ACK ,Tcontrol_t,_param->_nb_front_end,_param->_nb_context[it1]);
 
-    ALLOC3(rat_gpr_not_speculative  ,Tgeneral_address_t,_param->_nb_front_end,_param->_nb_context[it1],_param->_nb_general_register_logic);
     ALLOC3(rat_gpr_speculative      ,Tgeneral_address_t,_param->_nb_front_end,_param->_nb_context[it1],_param->_nb_general_register_logic);
-    ALLOC3(rat_gpr_speculative_valid,bool              ,_param->_nb_front_end,_param->_nb_context[it1],_param->_nb_general_register_logic);
-    ALLOC3(rat_gpr_update_table     ,bool              ,_param->_nb_front_end,_param->_nb_context[it1],_param->_nb_general_register_logic);
+    ALLOC3(rat_spr_speculative      ,Tspecial_address_t,_param->_nb_front_end,_param->_nb_context[it1],_param->_nb_special_register_logic);
+
+    switch(_param->_rat_scheme)
+      {
+      case RAT_NO_SAVE    :
+        {
+          break;
+        }
+      case RAT_ONE_SAVE   :
+        {
+          ALLOC3(rat_gpr_not_speculative  ,Tgeneral_address_t,_param->_nb_front_end,_param->_nb_context[it1],_param->_nb_general_register_logic);
+          ALLOC3(rat_gpr_speculative_valid,bool              ,_param->_nb_front_end,_param->_nb_context[it1],_param->_nb_general_register_logic);
+
+          ALLOC3(rat_spr_not_speculative  ,Tspecial_address_t,_param->_nb_front_end,_param->_nb_context[it1],_param->_nb_special_register_logic);
+          ALLOC3(rat_spr_speculative_valid,bool              ,_param->_nb_front_end,_param->_nb_context[it1],_param->_nb_special_register_logic);
+          
+          break;
+        }
+      case RAT_DEPTH_SAVE :
+        {
+          ALLOC4(rat_gpr_save             ,Tgeneral_address_t,_param->_nb_front_end,_param->_nb_context[it1],_param->_nb_branch_speculated[it1][it2],_param->_nb_general_register_logic);
+          ALLOC4(rat_spr_save             ,Tspecial_address_t,_param->_nb_front_end,_param->_nb_context[it1],_param->_nb_branch_speculated[it1][it2],_param->_nb_special_register_logic);
+          ALLOC2(rat_depth                ,Tdepth_t          ,_param->_nb_front_end,_param->_nb_context[it1]);
     
-    ALLOC3(rat_spr_not_speculative  ,Tspecial_address_t,_param->_nb_front_end,_param->_nb_context[it1],_param->_nb_special_register_logic);
-    ALLOC3(rat_spr_speculative      ,Tspecial_address_t,_param->_nb_front_end,_param->_nb_context[it1],_param->_nb_special_register_logic);
-    ALLOC3(rat_spr_speculative_valid,bool              ,_param->_nb_front_end,_param->_nb_context[it1],_param->_nb_special_register_logic);
-    ALLOC3(rat_spr_update_table     ,bool              ,_param->_nb_front_end,_param->_nb_context[it1],_param->_nb_special_register_logic);
-
-    ALLOC3(internal_rat_gpr_update_table,bool, _param->_nb_front_end,_param->_nb_context[it1],_param->_nb_general_register_logic);
-    ALLOC3(internal_rat_spr_update_table,bool, _param->_nb_front_end,_param->_nb_context[it1],_param->_nb_special_register_logic);
-
-    ALLOC1(internal_RETIRE_RESTORE           ,Tcontrol_t,_param->_nb_inst_retire);
-    ALLOC1(internal_RETIRE_RESTORE_RD_PHY_OLD,Tcontrol_t,_param->_nb_inst_retire);
-    ALLOC1(internal_RETIRE_RESTORE_RE_PHY_OLD,Tcontrol_t,_param->_nb_inst_retire);
+          break;
+        }
+      }
       }
 
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Rename_unit/Register_translation_unit/Register_Address_Translation_unit/src/Register_Address_Translation_unit_constant.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Rename_unit/Register_translation_unit/Register_Address_Translation_unit/src/Register_Address_Translation_unit_constant.cpp	(revision 132)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Rename_unit/Register_translation_unit/Register_Address_Translation_unit/src/Register_Address_Translation_unit_constant.cpp	(revision 139)
@@ -26,28 +26,5 @@
     log_function(Register_Address_Translation_unit,FUNCTION,_name.c_str());
 
-	// Constant : accepted already transaction
-	for (uint32_t i=0; i<_param->_nb_inst_insert; i++)
-	  {
-	    internal_RENAME_ACK [i] = 1;
-	    internal_INSERT_ACK [i] = 1;
-
-	    PORT_WRITE(out_RENAME_ACK[i],internal_RENAME_ACK [i]);
-	    PORT_WRITE(out_INSERT_ACK[i],internal_INSERT_ACK [i]);
-	  }
-
-	for (uint32_t i=0; i<_param->_nb_inst_retire; i++)
-	  {
-	    internal_RETIRE_ACK [i] = 1;
-
-	    PORT_WRITE(out_RETIRE_ACK[i],internal_RETIRE_ACK [i]);
-	  }
-
-        for (uint32_t i=0; i<_param->_nb_front_end; ++i)
-          for (uint32_t j=0; j<_param->_nb_context[i]; ++j)
-            {
-              internal_RETIRE_EVENT_ACK [i][j] = 1;
-              
-              PORT_WRITE(out_RETIRE_EVENT_ACK[i][j],internal_RETIRE_EVENT_ACK [i][j]);
-            }
+    (this->*function_constant) ();
 
     log_end(Register_Address_Translation_unit,FUNCTION);
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Rename_unit/Register_translation_unit/Register_Address_Translation_unit/src/Register_Address_Translation_unit_deallocation.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Rename_unit/Register_translation_unit/Register_Address_Translation_unit/src/Register_Address_Translation_unit_deallocation.cpp	(revision 132)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Rename_unit/Register_translation_unit/Register_Address_Translation_unit/src/Register_Address_Translation_unit_deallocation.cpp	(revision 139)
@@ -30,69 +30,84 @@
 	delete     in_NRESET;
 
-        DELETE1_SIGNAL( in_RENAME_VAL               ,_param->_nb_inst_insert,1);
-        DELETE1_SIGNAL(out_RENAME_ACK               ,_param->_nb_inst_insert,1);
-        DELETE1_SIGNAL( in_RENAME_FRONT_END_ID      ,_param->_nb_inst_insert,_param->_size_front_end_id);
-        DELETE1_SIGNAL( in_RENAME_CONTEXT_ID        ,_param->_nb_inst_insert,_param->_size_context_id  );
-        DELETE1_SIGNAL( in_RENAME_NUM_REG_RA_LOG    ,_param->_nb_inst_insert,_param->_size_general_register_logic);
-        DELETE1_SIGNAL( in_RENAME_NUM_REG_RB_LOG    ,_param->_nb_inst_insert,_param->_size_general_register_logic);
-        DELETE1_SIGNAL( in_RENAME_NUM_REG_RC_LOG    ,_param->_nb_inst_insert,_param->_size_special_register_logic);
-        DELETE1_SIGNAL( in_RENAME_NUM_REG_RD_LOG    ,_param->_nb_inst_insert,_param->_size_general_register_logic);
-        DELETE1_SIGNAL( in_RENAME_NUM_REG_RE_LOG    ,_param->_nb_inst_insert,_param->_size_special_register_logic);
-        DELETE1_SIGNAL(out_RENAME_NUM_REG_RA_PHY    ,_param->_nb_inst_insert,_param->_size_general_register);
-        DELETE1_SIGNAL(out_RENAME_NUM_REG_RB_PHY    ,_param->_nb_inst_insert,_param->_size_general_register);
-        DELETE1_SIGNAL(out_RENAME_NUM_REG_RC_PHY    ,_param->_nb_inst_insert,_param->_size_special_register);
-        DELETE1_SIGNAL(out_RENAME_NUM_REG_RD_PHY_OLD,_param->_nb_inst_insert,_param->_size_general_register);
-        DELETE1_SIGNAL(out_RENAME_NUM_REG_RE_PHY_OLD,_param->_nb_inst_insert,_param->_size_special_register);
-
-        DELETE1_SIGNAL( in_INSERT_VAL           ,_param->_nb_inst_insert,1);
-        DELETE1_SIGNAL(out_INSERT_ACK           ,_param->_nb_inst_insert,1);
-//      DELETE1_SIGNAL( in_INSERT_FRONT_END_ID  ,_param->_nb_inst_insert,_param->_size_front_end_id);
-//      DELETE1_SIGNAL( in_INSERT_CONTEXT_ID    ,_param->_nb_inst_insert,_param->_size_context_id  );
-        DELETE1_SIGNAL( in_INSERT_WRITE_RD      ,_param->_nb_inst_insert,1);
-        DELETE1_SIGNAL( in_INSERT_WRITE_RE      ,_param->_nb_inst_insert,1);
-        DELETE1_SIGNAL( in_INSERT_NUM_REG_RD_LOG,_param->_nb_inst_insert,_param->_size_general_register_logic);
-        DELETE1_SIGNAL( in_INSERT_NUM_REG_RE_LOG,_param->_nb_inst_insert,_param->_size_special_register_logic);
-        DELETE1_SIGNAL( in_INSERT_NUM_REG_RD_PHY,_param->_nb_inst_insert,_param->_size_general_register);
-        DELETE1_SIGNAL( in_INSERT_NUM_REG_RE_PHY,_param->_nb_inst_insert,_param->_size_special_register);
-
-        DELETE1_SIGNAL( in_RETIRE_VAL               ,_param->_nb_inst_retire,1);
-        DELETE1_SIGNAL(out_RETIRE_ACK               ,_param->_nb_inst_retire,1);
-        DELETE1_SIGNAL( in_RETIRE_FRONT_END_ID      ,_param->_nb_inst_retire,_param->_size_front_end_id);
-        DELETE1_SIGNAL( in_RETIRE_CONTEXT_ID        ,_param->_nb_inst_retire,_param->_size_context_id  );
-        DELETE1_SIGNAL( in_RETIRE_WRITE_RD          ,_param->_nb_inst_retire,1);
-        DELETE1_SIGNAL( in_RETIRE_WRITE_RE          ,_param->_nb_inst_retire,1);
-        DELETE1_SIGNAL( in_RETIRE_NUM_REG_RD_LOG    ,_param->_nb_inst_retire,_param->_size_general_register_logic);
-        DELETE1_SIGNAL( in_RETIRE_NUM_REG_RE_LOG    ,_param->_nb_inst_retire,_param->_size_special_register_logic);
-        DELETE1_SIGNAL( in_RETIRE_NUM_REG_RD_PHY_NEW,_param->_nb_inst_retire,_param->_size_general_register);
-        DELETE1_SIGNAL( in_RETIRE_NUM_REG_RE_PHY_NEW,_param->_nb_inst_retire,_param->_size_special_register);
-        DELETE1_SIGNAL(out_RETIRE_RESTORE_RD_PHY_OLD,_param->_nb_inst_retire,1);
-        DELETE1_SIGNAL(out_RETIRE_RESTORE_RE_PHY_OLD,_param->_nb_inst_retire,1);
-        DELETE1_SIGNAL(out_RETIRE_RESTORE           ,_param->_nb_inst_retire,1);
-
-        DELETE2_SIGNAL( in_RETIRE_EVENT_VAL            ,_param->_nb_front_end, _param->_nb_context[it1],1);
-        DELETE2_SIGNAL(out_RETIRE_EVENT_ACK            ,_param->_nb_front_end, _param->_nb_context[it1],1);
-        DELETE2_SIGNAL( in_RETIRE_EVENT_STATE          ,_param->_nb_front_end, _param->_nb_context[it1],_param->_size_event_state);
+        DELETE1_SIGNAL     ( in_RENAME_VAL               ,_param->_nb_inst_insert,1);
+        DELETE1_SIGNAL     (out_RENAME_ACK               ,_param->_nb_inst_insert,1);
+        DELETE1_SIGNAL     ( in_RENAME_FRONT_END_ID      ,_param->_nb_inst_insert,_param->_size_front_end_id);
+        DELETE1_SIGNAL     ( in_RENAME_CONTEXT_ID        ,_param->_nb_inst_insert,_param->_size_context_id  );
+        DELETE1_SIGNAL_COND( in_RENAME_DEPTH             ,_param->_nb_inst_insert,_param->_size_depth,_param->_rat_scheme == RAT_DEPTH_SAVE);
+        DELETE1_SIGNAL     ( in_RENAME_SAVE_RAT          ,_param->_nb_inst_insert,1);
+        DELETE1_SIGNAL     ( in_RENAME_NUM_REG_RA_LOG    ,_param->_nb_inst_insert,_param->_size_general_register_logic);
+        DELETE1_SIGNAL     ( in_RENAME_NUM_REG_RB_LOG    ,_param->_nb_inst_insert,_param->_size_general_register_logic);
+        DELETE1_SIGNAL     ( in_RENAME_NUM_REG_RC_LOG    ,_param->_nb_inst_insert,_param->_size_special_register_logic);
+        DELETE1_SIGNAL     ( in_RENAME_NUM_REG_RD_LOG    ,_param->_nb_inst_insert,_param->_size_general_register_logic);
+        DELETE1_SIGNAL     ( in_RENAME_NUM_REG_RE_LOG    ,_param->_nb_inst_insert,_param->_size_special_register_logic);
+        DELETE1_SIGNAL     (out_RENAME_NUM_REG_RA_PHY    ,_param->_nb_inst_insert,_param->_size_general_register);
+        DELETE1_SIGNAL     (out_RENAME_NUM_REG_RB_PHY    ,_param->_nb_inst_insert,_param->_size_general_register);
+        DELETE1_SIGNAL     (out_RENAME_NUM_REG_RC_PHY    ,_param->_nb_inst_insert,_param->_size_special_register);
+        DELETE1_SIGNAL     (out_RENAME_NUM_REG_RD_PHY_OLD,_param->_nb_inst_insert,_param->_size_general_register);
+        DELETE1_SIGNAL     (out_RENAME_NUM_REG_RE_PHY_OLD,_param->_nb_inst_insert,_param->_size_special_register);
+                           
+        DELETE1_SIGNAL     ( in_INSERT_VAL           ,_param->_nb_inst_insert,1);
+        DELETE1_SIGNAL     (out_INSERT_ACK           ,_param->_nb_inst_insert,1);
+//      DELETE1_SIGNAL     ( in_INSERT_FRONT_END_ID  ,_param->_nb_inst_insert,_param->_size_front_end_id);
+//      DELETE1_SIGNAL     ( in_INSERT_CONTEXT_ID    ,_param->_nb_inst_insert,_param->_size_context_id  );
+        DELETE1_SIGNAL     ( in_INSERT_WRITE_RD      ,_param->_nb_inst_insert,1);
+        DELETE1_SIGNAL     ( in_INSERT_WRITE_RE      ,_param->_nb_inst_insert,1);
+        DELETE1_SIGNAL     ( in_INSERT_NUM_REG_RD_LOG,_param->_nb_inst_insert,_param->_size_general_register_logic);
+        DELETE1_SIGNAL     ( in_INSERT_NUM_REG_RE_LOG,_param->_nb_inst_insert,_param->_size_special_register_logic);
+        DELETE1_SIGNAL     ( in_INSERT_NUM_REG_RD_PHY,_param->_nb_inst_insert,_param->_size_general_register);
+        DELETE1_SIGNAL     ( in_INSERT_NUM_REG_RE_PHY,_param->_nb_inst_insert,_param->_size_special_register);
+                           
+        DELETE1_SIGNAL     ( in_RETIRE_VAL               ,_param->_nb_inst_retire,1);
+        DELETE1_SIGNAL     (out_RETIRE_ACK               ,_param->_nb_inst_retire,1);
+        DELETE1_SIGNAL     ( in_RETIRE_FRONT_END_ID      ,_param->_nb_inst_retire,_param->_size_front_end_id);
+        DELETE1_SIGNAL     ( in_RETIRE_CONTEXT_ID        ,_param->_nb_inst_retire,_param->_size_context_id  );
+        DELETE1_SIGNAL     ( in_RETIRE_WRITE_RD          ,_param->_nb_inst_retire,1);
+        DELETE1_SIGNAL     ( in_RETIRE_WRITE_RE          ,_param->_nb_inst_retire,1);
+        DELETE1_SIGNAL     ( in_RETIRE_NUM_REG_RD_LOG    ,_param->_nb_inst_retire,_param->_size_general_register_logic);
+        DELETE1_SIGNAL     ( in_RETIRE_NUM_REG_RE_LOG    ,_param->_nb_inst_retire,_param->_size_special_register_logic);
+        DELETE1_SIGNAL     ( in_RETIRE_NUM_REG_RD_PHY_NEW,_param->_nb_inst_retire,_param->_size_general_register);
+        DELETE1_SIGNAL     ( in_RETIRE_NUM_REG_RE_PHY_NEW,_param->_nb_inst_retire,_param->_size_special_register);
+        DELETE1_SIGNAL     ( in_RETIRE_RESTORE           ,_param->_nb_inst_retire,1);
+                           
+        DELETE2_SIGNAL     ( in_RETIRE_EVENT_VAL            ,_param->_nb_front_end, _param->_nb_context[it1],1);
+        DELETE2_SIGNAL     (out_RETIRE_EVENT_ACK            ,_param->_nb_front_end, _param->_nb_context[it1],1);
+        DELETE2_SIGNAL     ( in_RETIRE_EVENT_STATE          ,_param->_nb_front_end, _param->_nb_context[it1],_param->_size_event_state);
+        DELETE2_SIGNAL_COND( in_RETIRE_EVENT_TYPE           ,_param->_nb_front_end, _param->_nb_context[it1],_param->_size_event_type,_param->_rat_scheme == RAT_DEPTH_SAVE);
+        DELETE2_SIGNAL_COND( in_RETIRE_EVENT_DEPTH          ,_param->_nb_front_end, _param->_nb_context[it1],_param->_size_depth     ,_param->_rat_scheme == RAT_DEPTH_SAVE);
 
         DELETE1(internal_RENAME_ACK                    ,_param->_nb_inst_insert);
+        DELETE1(internal_RENAME_SAVE                   ,_param->_nb_inst_insert);
         DELETE1(internal_INSERT_ACK                    ,_param->_nb_inst_insert);
         DELETE1(internal_RETIRE_ACK                    ,_param->_nb_inst_retire);
         DELETE2(internal_RETIRE_EVENT_ACK              ,_param->_nb_front_end,_param->_nb_context[it1]);
 
-        DELETE3(rat_gpr_not_speculative      ,_param->_nb_front_end,_param->_nb_context[it1],_param->_nb_general_register_logic);
         DELETE3(rat_gpr_speculative          ,_param->_nb_front_end,_param->_nb_context[it1],_param->_nb_general_register_logic);
-        DELETE3(rat_gpr_speculative_valid    ,_param->_nb_front_end,_param->_nb_context[it1],_param->_nb_general_register_logic);
-        DELETE3(rat_gpr_update_table         ,_param->_nb_front_end,_param->_nb_context[it1],_param->_nb_general_register_logic);
+        DELETE3(rat_spr_speculative          ,_param->_nb_front_end,_param->_nb_context[it1],_param->_nb_special_register_logic);
 
-        DELETE3(rat_spr_not_speculative      ,_param->_nb_front_end,_param->_nb_context[it1],_param->_nb_special_register_logic);
-        DELETE3(rat_spr_speculative          ,_param->_nb_front_end,_param->_nb_context[it1],_param->_nb_special_register_logic);
-        DELETE3(rat_spr_speculative_valid    ,_param->_nb_front_end,_param->_nb_context[it1],_param->_nb_special_register_logic);
-        DELETE3(rat_spr_update_table         ,_param->_nb_front_end,_param->_nb_context[it1],_param->_nb_special_register_logic);
+        switch(_param->_rat_scheme)
+          {
+          case RAT_NO_SAVE    :
+            {
+              break;
+            }
+          case RAT_ONE_SAVE   :
+            {
+              DELETE3(rat_gpr_not_speculative      ,_param->_nb_front_end,_param->_nb_context[it1],_param->_nb_general_register_logic);
+              DELETE3(rat_gpr_speculative_valid    ,_param->_nb_front_end,_param->_nb_context[it1],_param->_nb_general_register_logic);
+              
+              DELETE3(rat_spr_not_speculative      ,_param->_nb_front_end,_param->_nb_context[it1],_param->_nb_special_register_logic);
+              DELETE3(rat_spr_speculative_valid    ,_param->_nb_front_end,_param->_nb_context[it1],_param->_nb_special_register_logic);
+              
+              break;
+            }
+          case RAT_DEPTH_SAVE :
+            {
+              DELETE4(rat_gpr_save                 ,_param->_nb_front_end,_param->_nb_context[it1],_param->_nb_branch_speculated[it1][it2],_param->_nb_general_register_logic);
+              DELETE4(rat_spr_save                 ,_param->_nb_front_end,_param->_nb_context[it1],_param->_nb_branch_speculated[it1][it2],_param->_nb_special_register_logic);
+              DELETE2(rat_depth                    ,_param->_nb_front_end,_param->_nb_context[it1]);
 
-        DELETE3(internal_rat_gpr_update_table,_param->_nb_front_end,_param->_nb_context[it1],_param->_nb_general_register_logic);
-        DELETE3(internal_rat_spr_update_table,_param->_nb_front_end,_param->_nb_context[it1],_param->_nb_special_register_logic);
-        
-        DELETE1(internal_RETIRE_RESTORE           ,_param->_nb_inst_retire);
-        DELETE1(internal_RETIRE_RESTORE_RD_PHY_OLD,_param->_nb_inst_retire);
-        DELETE1(internal_RETIRE_RESTORE_RE_PHY_OLD,_param->_nb_inst_retire);
+              break;
+            }
+          }
       }
 
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Rename_unit/Register_translation_unit/Register_Address_Translation_unit/src/Register_Address_Translation_unit_function_depth_save_constant.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Rename_unit/Register_translation_unit/Register_Address_Translation_unit/src/Register_Address_Translation_unit_function_depth_save_constant.cpp	(revision 139)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Rename_unit/Register_translation_unit/Register_Address_Translation_unit/src/Register_Address_Translation_unit_function_depth_save_constant.cpp	(revision 139)
@@ -0,0 +1,63 @@
+#ifdef SYSTEMC
+/*
+ * $Id$
+ *
+ * [ Description ]
+ * 
+ */
+
+#include "Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Rename_unit/Register_translation_unit/Register_Address_Translation_unit/include/Register_Address_Translation_unit.h"
+
+namespace morpheo                    {
+namespace behavioural {
+namespace core {
+namespace multi_ooo_engine {
+namespace ooo_engine {
+namespace rename_unit {
+namespace register_translation_unit {
+namespace register_address_translation_unit {
+
+
+#undef  FUNCTION
+#define FUNCTION "Register_Address_Translation_unit::function_depth_save_constant"
+  void Register_Address_Translation_unit::function_depth_save_constant (void)
+  {
+    log_begin(Register_Address_Translation_unit,FUNCTION);
+    log_function(Register_Address_Translation_unit,FUNCTION,_name.c_str());
+
+    // Constant : accepted already transaction
+    for (uint32_t i=0; i<_param->_nb_inst_insert; i++)
+      {
+        internal_INSERT_ACK [i] = 1;
+        
+        PORT_WRITE(out_INSERT_ACK[i],internal_INSERT_ACK [i]);
+      }
+    
+    for (uint32_t i=0; i<_param->_nb_inst_retire; i++)
+      {
+        internal_RETIRE_ACK [i] = 1;
+        
+        PORT_WRITE(out_RETIRE_ACK[i],internal_RETIRE_ACK [i]);
+      }
+    
+    for (uint32_t i=0; i<_param->_nb_front_end; ++i)
+      for (uint32_t j=0; j<_param->_nb_context[i]; ++j)
+        {
+          internal_RETIRE_EVENT_ACK [i][j] = 1;
+          
+          PORT_WRITE(out_RETIRE_EVENT_ACK[i][j],internal_RETIRE_EVENT_ACK [i][j]);
+        }
+    
+    log_end(Register_Address_Translation_unit,FUNCTION);
+  };
+
+}; // end namespace register_address_translation_unit
+}; // end namespace register_translation_unit
+}; // end namespace rename_unit
+}; // end namespace ooo_engine
+}; // end namespace multi_ooo_engine
+}; // end namespace core
+
+}; // end namespace behavioural
+}; // end namespace morpheo              
+#endif
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Rename_unit/Register_translation_unit/Register_Address_Translation_unit/src/Register_Address_Translation_unit_function_depth_save_genMealy_rename.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Rename_unit/Register_translation_unit/Register_Address_Translation_unit/src/Register_Address_Translation_unit_function_depth_save_genMealy_rename.cpp	(revision 139)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Rename_unit/Register_translation_unit/Register_Address_Translation_unit/src/Register_Address_Translation_unit_function_depth_save_genMealy_rename.cpp	(revision 139)
@@ -0,0 +1,104 @@
+#ifdef SYSTEMC
+/*
+ * $Id$
+ *
+ * [ Description ]
+ * 
+ */
+
+#include "Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Rename_unit/Register_translation_unit/Register_Address_Translation_unit/include/Register_Address_Translation_unit.h"
+
+namespace morpheo                    {
+namespace behavioural {
+namespace core {
+namespace multi_ooo_engine {
+namespace ooo_engine {
+namespace rename_unit {
+namespace register_translation_unit {
+namespace register_address_translation_unit {
+
+
+#undef  FUNCTION
+#define FUNCTION "Register_Address_Translation_unit::function_depth_save_genMealy_rename"
+  void Register_Address_Translation_unit::function_depth_save_genMealy_rename (void)
+  {
+    log_begin(Register_Address_Translation_unit,FUNCTION);
+    log_function(Register_Address_Translation_unit,FUNCTION,_name.c_str());
+
+    if (PORT_READ(in_NRESET) != 0)
+      {
+        bool     have_branch_previous = false;
+        bool     can_continue [_param->_nb_front_end][_param->_max_nb_context];
+
+        for (uint32_t i=0; i<_param->_nb_front_end; ++i)
+          for (uint32_t j=0; j<_param->_nb_context[i]; ++j)
+            can_continue [i][j] = true;
+
+        for (uint32_t i=0; i<_param->_nb_inst_insert; i++)
+          if (PORT_READ(in_RENAME_VAL [i])) // not in sensitive list : it's to have valide value to array access
+            {
+              log_printf(TRACE,Register_Address_Translation_unit,FUNCTION,"  * RENAME [%d]",i);
+              
+              Tcontext_t front_end_id        = (_param->_have_port_front_end_id)?PORT_READ(in_RENAME_FRONT_END_ID [i]):0;
+              Tcontext_t context_id          = (_param->_have_port_context_id  )?PORT_READ(in_RENAME_CONTEXT_ID   [i]):0;
+              // bool       have_event          = (PORT_READ(in_RETIRE_EVENT_VAL [front_end_id][context_id]) and // always ack
+              //                                   (PORT_READ(in_RETIRE_EVENT_STATE [front_end_id][context_id]) == EVENT_STATE_EVENT));
+              
+              bool       have_branch_current = PORT_READ(in_RENAME_SAVE_RAT [i]);
+
+              // one branch per cycle
+              can_continue[front_end_id][context_id] &= not (have_branch_current and have_branch_previous);
+
+              log_printf(TRACE,Register_Address_Translation_unit,FUNCTION,"    * front_end_id         : %d",front_end_id);
+              log_printf(TRACE,Register_Address_Translation_unit,FUNCTION,"    * context_id           : %d",context_id);
+           // log_printf(TRACE,Register_Address_Translation_unit,FUNCTION,"    * have_event           : %d",have_event);
+              log_printf(TRACE,Register_Address_Translation_unit,FUNCTION,"    * have_branch_previous : %d",have_branch_previous);
+              log_printf(TRACE,Register_Address_Translation_unit,FUNCTION,"    * have_branch_current  : %d",have_branch_current );
+              log_printf(TRACE,Register_Address_Translation_unit,FUNCTION,"    * can_continue         : %d",can_continue[front_end_id][context_id]);
+              
+              Tgeneral_address_t num_reg_ra_log    = PORT_READ(in_RENAME_NUM_REG_RA_LOG [i]); //%_param->_nb_general_register;
+              Tgeneral_address_t num_reg_rb_log    = PORT_READ(in_RENAME_NUM_REG_RB_LOG [i]); //%_param->_nb_general_register;
+              Tspecial_address_t num_reg_rc_log    = PORT_READ(in_RENAME_NUM_REG_RC_LOG [i]); //%_param->_nb_special_register;
+              Tgeneral_address_t num_reg_rd_log    = PORT_READ(in_RENAME_NUM_REG_RD_LOG [i]); //%_param->_nb_general_register;
+              Tspecial_address_t num_reg_re_log    = PORT_READ(in_RENAME_NUM_REG_RE_LOG [i]); //%_param->_nb_special_register;
+              
+              Tgeneral_address_t num_reg_ra_phy    = rat_gpr_speculative[front_end_id][context_id][num_reg_ra_log];
+              Tgeneral_address_t num_reg_rb_phy    = rat_gpr_speculative[front_end_id][context_id][num_reg_rb_log];
+              Tspecial_address_t num_reg_rc_phy    = rat_spr_speculative[front_end_id][context_id][num_reg_rc_log];
+              Tgeneral_address_t num_reg_rd_phy_old= rat_gpr_speculative[front_end_id][context_id][num_reg_rd_log];
+              Tspecial_address_t num_reg_re_phy_old= rat_spr_speculative[front_end_id][context_id][num_reg_re_log];
+              
+              log_printf(TRACE,Register_Address_Translation_unit,FUNCTION,"    * num_reg_ra           : %d -> %d",num_reg_ra_log,num_reg_ra_phy    );
+              log_printf(TRACE,Register_Address_Translation_unit,FUNCTION,"    * num_reg_rb           : %d -> %d",num_reg_rb_log,num_reg_rb_phy    );
+              log_printf(TRACE,Register_Address_Translation_unit,FUNCTION,"    * num_reg_rc           : %d -> %d",num_reg_rc_log,num_reg_rc_phy    );
+              log_printf(TRACE,Register_Address_Translation_unit,FUNCTION,"    * num_reg_rd           : %d -> %d",num_reg_rd_log,num_reg_rd_phy_old);
+              log_printf(TRACE,Register_Address_Translation_unit,FUNCTION,"    * num_reg_re           : %d -> %d",num_reg_re_log,num_reg_re_phy_old);
+              
+              internal_RENAME_ACK [i] = can_continue[front_end_id][context_id];
+              PORT_WRITE(out_RENAME_ACK                [i],internal_RENAME_ACK [i]);
+              PORT_WRITE(out_RENAME_NUM_REG_RA_PHY     [i], num_reg_ra_phy    );
+              PORT_WRITE(out_RENAME_NUM_REG_RB_PHY     [i], num_reg_rb_phy    );
+              PORT_WRITE(out_RENAME_NUM_REG_RC_PHY     [i], num_reg_rc_phy    );
+              PORT_WRITE(out_RENAME_NUM_REG_RD_PHY_OLD [i], num_reg_rd_phy_old);
+              PORT_WRITE(out_RENAME_NUM_REG_RE_PHY_OLD [i], num_reg_re_phy_old);
+
+              internal_RENAME_SAVE [i] = have_branch_current;
+
+              // save info to the next instruction
+              have_branch_previous |= have_branch_current;
+            }
+      }
+    
+    log_end(Register_Address_Translation_unit,FUNCTION);
+  };
+
+}; // end namespace register_address_translation_unit
+}; // end namespace register_translation_unit
+}; // end namespace rename_unit
+}; // end namespace ooo_engine
+}; // end namespace multi_ooo_engine
+}; // end namespace core
+
+}; // end namespace behavioural
+}; // end namespace morpheo              
+#endif
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Rename_unit/Register_translation_unit/Register_Address_Translation_unit/src/Register_Address_Translation_unit_function_depth_save_transition.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Rename_unit/Register_translation_unit/Register_Address_Translation_unit/src/Register_Address_Translation_unit_function_depth_save_transition.cpp	(revision 139)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Rename_unit/Register_translation_unit/Register_Address_Translation_unit/src/Register_Address_Translation_unit_function_depth_save_transition.cpp	(revision 139)
@@ -0,0 +1,325 @@
+#ifdef SYSTEMC
+/*
+ * $Id$
+ *
+ * [ Description ]
+ * 
+ */
+
+#include "Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Rename_unit/Register_translation_unit/Register_Address_Translation_unit/include/Register_Address_Translation_unit.h"
+
+namespace morpheo                    {
+namespace behavioural {
+namespace core {
+namespace multi_ooo_engine {
+namespace ooo_engine {
+namespace rename_unit {
+namespace register_translation_unit {
+namespace register_address_translation_unit {
+
+
+#undef  FUNCTION
+#define FUNCTION "Register_Address_Translation_unit::function_depth_save_transition"
+  void Register_Address_Translation_unit::function_depth_save_transition (void)
+  {
+    log_begin(Register_Address_Translation_unit,FUNCTION);
+    log_function(Register_Address_Translation_unit,FUNCTION,_name.c_str());
+
+    if (PORT_READ(in_NRESET) == 0)
+      {
+	uint32_t gpr = 1;
+	uint32_t spr = 0;
+
+	for (uint32_t i=0; i<_param->_nb_front_end; i++)
+	  for (uint32_t j=0; j<_param->_nb_context[i]; j++)
+	    {
+              rat_depth                 [i][j]    = 0;
+              rat_gpr_speculative       [i][j][0] = 0;
+
+	      for (uint32_t k=1; k<_param->_nb_general_register_logic; k++)
+                rat_gpr_speculative        [i][j][k] = gpr++;
+	      for (uint32_t k=0; k<_param->_nb_special_register_logic; k++)
+                rat_spr_speculative        [i][j][k] = spr++; // not necessary
+	    }
+      }
+    else
+      {
+	// Note : GPR[0] is never write (in decod's stage : write_rd = 0 when num_reg_rd_log == 0)
+
+	// =====================================================
+	// ====[ RETIRE_EVENT ]=================================
+	// =====================================================
+        for (uint32_t i=0; i<_param->_nb_front_end; ++i)
+          for (uint32_t j=0; j<_param->_nb_context[i]; ++j)
+            if (PORT_READ(in_RETIRE_EVENT_VAL [i][j]) and internal_RETIRE_EVENT_ACK [i][j])
+              {
+                log_printf(TRACE,Register_Address_Translation_unit,FUNCTION,"  * RETIRE_EVENT [%d][%d]",i,j);
+                
+                // Test if event have just occure
+                if (PORT_READ(in_RETIRE_EVENT_STATE [i][j]) == EVENT_STATE_EVENT)
+                  {
+                    switch (PORT_READ(in_RETIRE_EVENT_TYPE [i][j]))
+                      {
+                      case EVENT_TYPE_BRANCH_MISS_SPECULATION :
+                      case EVENT_TYPE_LOAD_MISS_SPECULATION   :
+                        {
+                          // Miss speculation (branch or load)
+                          // Restore contexte and update depth
+
+                          log_printf(TRACE,Register_Address_Translation_unit,FUNCTION,"    * MISS_SPECULATION : Restore RAT");
+
+                          Tdepth_t depth = (_param->_have_port_depth)?PORT_READ(in_RETIRE_EVENT_DEPTH [i][j]):0;
+
+                          log_printf(TRACE,Register_Address_Translation_unit,FUNCTION,"      * depth : %d",depth);
+                          
+                          // restore GPR
+                          for (uint32_t num_gpr=0; num_gpr<_param->_nb_general_register_logic; num_gpr++)
+                            rat_gpr_speculative [i][j][num_gpr] = rat_gpr_save [i][j][depth][num_gpr];
+                          
+                          // restore SPR
+                          for (uint32_t num_spr=0; num_spr<_param->_nb_special_register_logic; num_spr++)
+                            rat_spr_speculative [i][j][num_spr] = rat_spr_save [i][j][depth][num_spr];
+                          
+                          // update rat_depth
+                          rat_depth[i][j] = depth;
+                          
+                          break;
+                        }
+                        // case EVENT_TYPE_EXCEPTION               :
+                        // case EVENT_TYPE_SPR_ACCESS              :
+                        // case EVENT_TYPE_MSYNC                   :
+                        // case EVENT_TYPE_PSYNC                   :
+                        // case EVENT_TYPE_CSYNC                   :
+                      default :
+                        {
+                          // nothing
+                          break;
+                        }
+                      }
+                  
+                  }
+              }
+
+	// =====================================================
+	// ====[ INSERT ]=======================================
+	// =====================================================
+	// First : interface insert
+        // this instruction is speculative !!!
+	for (uint32_t i=0; i<_param->_nb_inst_insert; i++)
+	  // Test transaction
+	  if (PORT_READ(in_INSERT_VAL [i]) and internal_INSERT_ACK  [i])
+	    {
+              log_printf(TRACE,Register_Address_Translation_unit,FUNCTION,"  * INSERT [%d]",i);
+
+	      Tcontext_t front_end_id = (_param->_have_port_front_end_id)?PORT_READ(in_RENAME_FRONT_END_ID [i]):0;
+	      Tcontext_t context_id   = (_param->_have_port_context_id  )?PORT_READ(in_RENAME_CONTEXT_ID   [i]):0;
+              Tcontrol_t save         = internal_RENAME_SAVE [i];
+
+              log_printf(TRACE,Register_Address_Translation_unit,FUNCTION,"    * front_end          : %d",front_end_id);
+              log_printf(TRACE,Register_Address_Translation_unit,FUNCTION,"    * context            : %d",context_id);
+              log_printf(TRACE,Register_Address_Translation_unit,FUNCTION,"    * save               : %d",save);
+
+	      // Test if write and modifie RAT (RD and RE)
+
+              Tcontrol_t write_rd     = PORT_READ(in_INSERT_WRITE_RD [i]);
+              Tcontrol_t write_re     = PORT_READ(in_INSERT_WRITE_RE [i]);
+
+              log_printf(TRACE,Register_Address_Translation_unit,FUNCTION,"    * write_rd           : %d",write_rd);
+	      if (write_rd == 1)
+                {
+                  Tgeneral_address_t num_reg_rd_log = PORT_READ(in_INSERT_NUM_REG_RD_LOG [i]);
+                  Tgeneral_address_t num_reg_rd_phy = PORT_READ(in_INSERT_NUM_REG_RD_PHY [i]);
+
+                  log_printf(TRACE,Register_Address_Translation_unit,FUNCTION,"    * num_reg_rd_log     : %d",num_reg_rd_log);
+                  log_printf(TRACE,Register_Address_Translation_unit,FUNCTION,"    * num_reg_rd_phy     : %d",num_reg_rd_phy);
+
+                  rat_gpr_speculative [front_end_id][context_id][num_reg_rd_log] = num_reg_rd_phy;
+                }
+
+              log_printf(TRACE,Register_Address_Translation_unit,FUNCTION,"    * write_re           : %d",write_re);
+	      if (write_re == 1)
+                {
+                  Tspecial_address_t num_reg_re_log = PORT_READ(in_INSERT_NUM_REG_RE_LOG [i]);
+                  Tspecial_address_t num_reg_re_phy = PORT_READ(in_INSERT_NUM_REG_RE_PHY [i]);
+
+                  log_printf(TRACE,Register_Address_Translation_unit,FUNCTION,"    * num_reg_re_log     : %d",num_reg_re_log);
+                  log_printf(TRACE,Register_Address_Translation_unit,FUNCTION,"    * num_reg_re_phy     : %d",num_reg_re_phy);
+
+                  rat_spr_speculative [front_end_id][context_id][num_reg_re_log] = num_reg_re_phy;
+                }
+
+              if (save)
+                {
+                  // Need save RAT
+
+                  Tdepth_t depth = (_param->_have_port_depth       )?PORT_READ(in_RENAME_DEPTH        [i]):0;
+
+                  log_printf(TRACE,Register_Address_Translation_unit,FUNCTION,"      * depth old - new  : %d",depth);
+
+// #ifdef DEBUG_TEST
+//                   if (depth != ((depth_old+1)%_param->_nb_branch_speculated[front_end_id][context_id]))
+//                     throw ERRORMORPHEO(FUNCTION,toString(_("Rename : Invalid depth (old : %d, new : %d).\n"),depth_old,depth));
+// #endif
+
+                  // save GPR
+                  for (uint32_t num_gpr=0; num_gpr<_param->_nb_general_register_logic; num_gpr++)
+                    rat_gpr_save [front_end_id][context_id][depth][num_gpr] = rat_gpr_speculative [front_end_id][context_id][num_gpr];
+
+                  // save SPR
+                  for (uint32_t num_spr=0; num_spr<_param->_nb_special_register_logic; num_spr++)
+                    rat_spr_save [front_end_id][context_id][depth][num_spr] = rat_spr_speculative [front_end_id][context_id][num_spr];
+
+                  // update rat_depth with new depth
+                  rat_depth[front_end_id][context_id] = depth;
+                }
+	    }
+
+	// =====================================================
+	// ====[ RETIRE ]=======================================
+	// =====================================================
+	// Second : interface retire
+	//  (because if an event on the same thread : the instruction is already renamed)
+	for (uint32_t i=0; i<_param->_nb_inst_retire; i++)
+	  if (PORT_READ(in_RETIRE_VAL [i]) and internal_RETIRE_ACK [i])
+	    {
+              log_printf(TRACE,Register_Address_Translation_unit,FUNCTION,"  * RETIRE [%d]",i);
+
+	      // if no event : no effect, because the RAT content the most recently register
+	      // but if they have a event (exception or miss speculation), the rat must restore the oldest value
+	      // To restore the oldest valid value, we use the rat_update_table. if the bit is unset, also they have none update on this register
+	      // the retire interface became of the Re Order Buffer, also is in program sequence !
+
+              Tcontext_t front_end_id = (_param->_have_port_front_end_id)?PORT_READ(in_RETIRE_FRONT_END_ID [i]):0;
+              Tcontext_t context_id   = (_param->_have_port_context_id  )?PORT_READ(in_RETIRE_CONTEXT_ID   [i]):0;
+              Tcontrol_t write_rd     = PORT_READ(in_RETIRE_WRITE_RD [i]);
+              Tcontrol_t write_re     = PORT_READ(in_RETIRE_WRITE_RE [i]);
+              Tcontrol_t restore      = PORT_READ(in_RETIRE_RESTORE  [i]);
+
+              log_printf(TRACE,Register_Address_Translation_unit,FUNCTION,"    * front_end_id       : %d",front_end_id);
+              log_printf(TRACE,Register_Address_Translation_unit,FUNCTION,"    * context_id         : %d",context_id  );
+              log_printf(TRACE,Register_Address_Translation_unit,FUNCTION,"    * restore            : %d",restore     );
+
+              // Test if write and have not a previous update
+              log_printf(TRACE,Register_Address_Translation_unit,FUNCTION,"    * write_rd           : %d",write_rd);
+              if (write_rd == 1)
+                {
+                  Tgeneral_address_t num_reg_rd_log     = PORT_READ(in_RETIRE_NUM_REG_RD_LOG     [i]);
+
+                  log_printf(TRACE,Register_Address_Translation_unit,FUNCTION,"    * num_reg_rd_log     : %d",num_reg_rd_log    );
+
+                  if (not restore)
+                    {
+                  Tgeneral_address_t num_reg_rd_phy_new = PORT_READ(in_RETIRE_NUM_REG_RD_PHY_NEW [i]);
+
+                  log_printf(TRACE,Register_Address_Translation_unit,FUNCTION,"    * num_reg_rd_phy_new : %d",num_reg_rd_phy_new);
+
+                  // rat_gpr_speculative [front_end_id][context_id][num_reg_rd_log] = num_reg_rd_phy_new;
+                    }
+                }
+
+              log_printf(TRACE,Register_Address_Translation_unit,FUNCTION,"    * write_re           : %d",write_re);
+              if (write_re == 1)
+                {
+                  Tspecial_address_t num_reg_re_log     = PORT_READ(in_RETIRE_NUM_REG_RE_LOG     [i]);
+
+                  log_printf(TRACE,Register_Address_Translation_unit,FUNCTION,"    * num_reg_re_log     : %d",num_reg_re_log    );
+
+                  if (not restore)
+                    {
+                  Tspecial_address_t num_reg_re_phy_new = PORT_READ(in_RETIRE_NUM_REG_RE_PHY_NEW [i]);
+
+                  log_printf(TRACE,Register_Address_Translation_unit,FUNCTION,"    * num_reg_re_phy_new : %d",num_reg_re_phy_new);
+
+                  // rat_spr_speculative [front_end_id][context_id][num_reg_re_log] = num_reg_re_phy_new;
+                    }
+                }
+
+	    }
+      }
+
+#if (DEBUG >= DEBUG_TRACE) and (DEBUG_Register_Address_Translation_unit == true)
+    {
+      uint32_t limit = 4;
+      
+      log_printf(TRACE,Register_Address_Translation_unit,FUNCTION,"  * Dump RAT (Register_Address_Translation_unit)");
+      for (uint32_t i=0; i<_param->_nb_front_end; ++i)
+        for (uint32_t j=0; j<_param->_nb_context[i]; ++j)
+          {
+            log_printf(TRACE,Register_Address_Translation_unit,FUNCTION,"    * front_end[%d].context[%d] - rat_depth : %d",i,j,rat_depth[i][j]);
+          
+            for (uint32_t k=0; k<_param->_nb_general_register_logic; k+=limit)
+              {
+                std::string str = "";
+                for (uint32_t x=0; x<limit; x++)
+                  {
+                    uint32_t index = k+x;
+                    if (index >= _param->_nb_general_register_logic)
+                      break;
+                    else
+                      str+=toString("GPR[%.4d] - %.5d | ",index,rat_gpr_speculative [i][j][index]);
+                  }
+                log_printf(TRACE,Register_Address_Translation_unit,FUNCTION,"      * %s",str.c_str());
+              }
+
+            for (uint32_t l=0; l<_param->_nb_branch_speculated[i][j]; ++l)
+              for (uint32_t k=0; k<_param->_nb_general_register_logic; k+=limit)
+                {
+                  std::string str = "";
+                  for (uint32_t x=0; x<limit; x++)
+                    {
+                      uint32_t index = k+x;
+                      if (index >= _param->_nb_general_register_logic)
+                        break;
+                      else
+                        str+=toString("GPR_%d[%.4d] - %.5d | ",l,index,rat_gpr_save [i][j][l][index]);
+                    }
+                  log_printf(TRACE,Register_Address_Translation_unit,FUNCTION,"      * %s",str.c_str());
+                }
+            
+            for (uint32_t k=0; k<_param->_nb_special_register_logic; k+=limit)
+              {
+                std::string str = "";
+                
+                for (uint32_t x=0; x<limit; x++)
+                  {
+                    uint32_t index = k+x;
+                    if (index >= _param->_nb_special_register_logic)
+                      break;
+                    else
+                      str+=toString("SPR[%.4d] - %.5d | ",index,rat_spr_speculative [i][j][index]);
+                  }
+                log_printf(TRACE,Register_Address_Translation_unit,FUNCTION,"      * %s",str.c_str());
+              }
+
+            for (uint32_t l=0; l<_param->_nb_branch_speculated[i][j]; ++l)
+              for (uint32_t k=0; k<_param->_nb_special_register_logic; k+=limit)
+                {
+                  std::string str = "";
+                  for (uint32_t x=0; x<limit; x++)
+                    {
+                      uint32_t index = k+x;
+                      if (index >= _param->_nb_special_register_logic)
+                        break;
+                      else
+                        str+=toString("SPR_%d[%.4d] - %.5d | ",l,index,rat_spr_save [i][j][l][index]);
+                    }
+                  log_printf(TRACE,Register_Address_Translation_unit,FUNCTION,"      * %s",str.c_str());
+                }
+
+          }
+    }
+#endif
+
+    log_end(Register_Address_Translation_unit,FUNCTION);
+  };
+
+}; // end namespace register_address_translation_unit
+}; // end namespace register_translation_unit
+}; // end namespace rename_unit
+}; // end namespace ooo_engine
+}; // end namespace multi_ooo_engine
+}; // end namespace core
+
+}; // end namespace behavioural
+}; // end namespace morpheo              
+#endif
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Rename_unit/Register_translation_unit/Register_Address_Translation_unit/src/Register_Address_Translation_unit_function_one_save_constant.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Rename_unit/Register_translation_unit/Register_Address_Translation_unit/src/Register_Address_Translation_unit_function_one_save_constant.cpp	(revision 139)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Rename_unit/Register_translation_unit/Register_Address_Translation_unit/src/Register_Address_Translation_unit_function_one_save_constant.cpp	(revision 139)
@@ -0,0 +1,65 @@
+#ifdef SYSTEMC
+/*
+ * $Id$
+ *
+ * [ Description ]
+ * 
+ */
+
+#include "Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Rename_unit/Register_translation_unit/Register_Address_Translation_unit/include/Register_Address_Translation_unit.h"
+
+namespace morpheo                    {
+namespace behavioural {
+namespace core {
+namespace multi_ooo_engine {
+namespace ooo_engine {
+namespace rename_unit {
+namespace register_translation_unit {
+namespace register_address_translation_unit {
+
+
+#undef  FUNCTION
+#define FUNCTION "Register_Address_Translation_unit::function_one_save_constant"
+  void Register_Address_Translation_unit::function_one_save_constant (void)
+  {
+    log_begin(Register_Address_Translation_unit,FUNCTION);
+    log_function(Register_Address_Translation_unit,FUNCTION,_name.c_str());
+
+    // Constant : accepted already transaction
+    for (uint32_t i=0; i<_param->_nb_inst_insert; i++)
+      {
+        internal_INSERT_ACK [i] = 1;
+        internal_RENAME_ACK [i] = 1;
+        
+        PORT_WRITE(out_INSERT_ACK[i],internal_INSERT_ACK [i]);
+        PORT_WRITE(out_RENAME_ACK[i],internal_RENAME_ACK [i]);
+      }
+    
+    for (uint32_t i=0; i<_param->_nb_inst_retire; i++)
+      {
+        internal_RETIRE_ACK [i] = 1;
+        
+        PORT_WRITE(out_RETIRE_ACK[i],internal_RETIRE_ACK [i]);
+      }
+    
+    for (uint32_t i=0; i<_param->_nb_front_end; ++i)
+      for (uint32_t j=0; j<_param->_nb_context[i]; ++j)
+        {
+          internal_RETIRE_EVENT_ACK [i][j] = 1;
+          
+          PORT_WRITE(out_RETIRE_EVENT_ACK[i][j],internal_RETIRE_EVENT_ACK [i][j]);
+        }
+    
+    log_end(Register_Address_Translation_unit,FUNCTION);
+  };
+
+}; // end namespace register_address_translation_unit
+}; // end namespace register_translation_unit
+}; // end namespace rename_unit
+}; // end namespace ooo_engine
+}; // end namespace multi_ooo_engine
+}; // end namespace core
+
+}; // end namespace behavioural
+}; // end namespace morpheo              
+#endif
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Rename_unit/Register_translation_unit/Register_Address_Translation_unit/src/Register_Address_Translation_unit_function_one_save_genMealy_rename.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Rename_unit/Register_translation_unit/Register_Address_Translation_unit/src/Register_Address_Translation_unit_function_one_save_genMealy_rename.cpp	(revision 139)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Rename_unit/Register_translation_unit/Register_Address_Translation_unit/src/Register_Address_Translation_unit_function_one_save_genMealy_rename.cpp	(revision 139)
@@ -0,0 +1,85 @@
+#ifdef SYSTEMC
+/*
+ * $Id$
+ *
+ * [ Description ]
+ * 
+ */
+
+#include "Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Rename_unit/Register_translation_unit/Register_Address_Translation_unit/include/Register_Address_Translation_unit.h"
+
+namespace morpheo                    {
+namespace behavioural {
+namespace core {
+namespace multi_ooo_engine {
+namespace ooo_engine {
+namespace rename_unit {
+namespace register_translation_unit {
+namespace register_address_translation_unit {
+
+
+#undef  FUNCTION
+#define FUNCTION "Register_Address_Translation_unit::function_one_save_genMealy_rename"
+  void Register_Address_Translation_unit::function_one_save_genMealy_rename (void)
+  {
+    log_begin(Register_Address_Translation_unit,FUNCTION);
+    log_function(Register_Address_Translation_unit,FUNCTION,_name.c_str());
+
+    if (PORT_READ(in_NRESET) != 0)
+    for (uint32_t i=0; i<_param->_nb_inst_insert; i++)
+      if (PORT_READ(in_RENAME_VAL [i])) // not in sensitive list : it's to have valide value to array access
+        {
+        log_printf(TRACE,Register_Address_Translation_unit,FUNCTION,"  * RENAME [%d]",i);
+
+	Tcontext_t front_end_id = (_param->_have_port_front_end_id)?PORT_READ(in_RENAME_FRONT_END_ID [i]):0;
+	Tcontext_t context_id   = (_param->_have_port_context_id  )?PORT_READ(in_RENAME_CONTEXT_ID   [i]):0;
+        bool       have_event   = (PORT_READ(in_RETIRE_EVENT_VAL [front_end_id][context_id]) and // always ack
+                                   (PORT_READ(in_RETIRE_EVENT_STATE [front_end_id][context_id]) == EVENT_STATE_EVENT));
+
+
+        log_printf(TRACE,Register_Address_Translation_unit,FUNCTION,"    * front_end_id       : %d",front_end_id);
+        log_printf(TRACE,Register_Address_Translation_unit,FUNCTION,"    * context_id         : %d",context_id);
+        log_printf(TRACE,Register_Address_Translation_unit,FUNCTION,"    * have_event         : %d",have_event);
+
+        Tgeneral_address_t num_reg_ra_log    = PORT_READ(in_RENAME_NUM_REG_RA_LOG [i]); //%_param->_nb_general_register;
+        Tgeneral_address_t num_reg_rb_log    = PORT_READ(in_RENAME_NUM_REG_RB_LOG [i]); //%_param->_nb_general_register;
+        Tspecial_address_t num_reg_rc_log    = PORT_READ(in_RENAME_NUM_REG_RC_LOG [i]); //%_param->_nb_special_register;
+        Tgeneral_address_t num_reg_rd_log    = PORT_READ(in_RENAME_NUM_REG_RD_LOG [i]); //%_param->_nb_general_register;
+        Tspecial_address_t num_reg_re_log    = PORT_READ(in_RENAME_NUM_REG_RE_LOG [i]); //%_param->_nb_special_register;
+                                            
+        // if rat_speculative is valid, 
+        // then read rat_speculative have the most valid alias register
+        // else, they have an previous event, the rat_not_speculative have the valid register
+
+        Tgeneral_address_t num_reg_ra_phy    = (rat_gpr_speculative_valid[front_end_id][context_id][num_reg_ra_log] and not have_event)?rat_gpr_speculative[front_end_id][context_id][num_reg_ra_log]:rat_gpr_not_speculative[front_end_id][context_id][num_reg_ra_log];
+        Tgeneral_address_t num_reg_rb_phy    = (rat_gpr_speculative_valid[front_end_id][context_id][num_reg_rb_log] and not have_event)?rat_gpr_speculative[front_end_id][context_id][num_reg_rb_log]:rat_gpr_not_speculative[front_end_id][context_id][num_reg_rb_log];
+        Tspecial_address_t num_reg_rc_phy    = (rat_spr_speculative_valid[front_end_id][context_id][num_reg_rc_log] and not have_event)?rat_spr_speculative[front_end_id][context_id][num_reg_rc_log]:rat_spr_not_speculative[front_end_id][context_id][num_reg_rc_log];
+        Tgeneral_address_t num_reg_rd_phy_old= (rat_gpr_speculative_valid[front_end_id][context_id][num_reg_rd_log] and not have_event)?rat_gpr_speculative[front_end_id][context_id][num_reg_rd_log]:rat_gpr_not_speculative[front_end_id][context_id][num_reg_rd_log];
+        Tspecial_address_t num_reg_re_phy_old= (rat_spr_speculative_valid[front_end_id][context_id][num_reg_re_log] and not have_event)?rat_spr_speculative[front_end_id][context_id][num_reg_re_log]:rat_spr_not_speculative[front_end_id][context_id][num_reg_re_log];
+
+        log_printf(TRACE,Register_Address_Translation_unit,FUNCTION,"    * num_reg_ra         : %d -> %d",num_reg_ra_log,num_reg_ra_phy    );
+        log_printf(TRACE,Register_Address_Translation_unit,FUNCTION,"    * num_reg_rb         : %d -> %d",num_reg_rb_log,num_reg_rb_phy    );
+        log_printf(TRACE,Register_Address_Translation_unit,FUNCTION,"    * num_reg_rc         : %d -> %d",num_reg_rc_log,num_reg_rc_phy    );
+        log_printf(TRACE,Register_Address_Translation_unit,FUNCTION,"    * num_reg_rd         : %d -> %d",num_reg_rd_log,num_reg_rd_phy_old);
+        log_printf(TRACE,Register_Address_Translation_unit,FUNCTION,"    * num_reg_re         : %d -> %d",num_reg_re_log,num_reg_re_phy_old);
+
+	PORT_WRITE(out_RENAME_NUM_REG_RA_PHY     [i], num_reg_ra_phy    );
+	PORT_WRITE(out_RENAME_NUM_REG_RB_PHY     [i], num_reg_rb_phy    );
+	PORT_WRITE(out_RENAME_NUM_REG_RC_PHY     [i], num_reg_rc_phy    );
+	PORT_WRITE(out_RENAME_NUM_REG_RD_PHY_OLD [i], num_reg_rd_phy_old);
+	PORT_WRITE(out_RENAME_NUM_REG_RE_PHY_OLD [i], num_reg_re_phy_old);
+      }
+
+    log_end(Register_Address_Translation_unit,FUNCTION);
+  };
+
+}; // end namespace register_address_translation_unit
+}; // end namespace register_translation_unit
+}; // end namespace rename_unit
+}; // end namespace ooo_engine
+}; // end namespace multi_ooo_engine
+}; // end namespace core
+
+}; // end namespace behavioural
+}; // end namespace morpheo              
+#endif
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Rename_unit/Register_translation_unit/Register_Address_Translation_unit/src/Register_Address_Translation_unit_function_one_save_transition.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Rename_unit/Register_translation_unit/Register_Address_Translation_unit/src/Register_Address_Translation_unit_function_one_save_transition.cpp	(revision 139)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Rename_unit/Register_translation_unit/Register_Address_Translation_unit/src/Register_Address_Translation_unit_function_one_save_transition.cpp	(revision 139)
@@ -0,0 +1,274 @@
+#ifdef SYSTEMC
+/*
+ * $Id$
+ *
+ * [ Description ]
+ * 
+ */
+
+#include "Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Rename_unit/Register_translation_unit/Register_Address_Translation_unit/include/Register_Address_Translation_unit.h"
+
+namespace morpheo                    {
+namespace behavioural {
+namespace core {
+namespace multi_ooo_engine {
+namespace ooo_engine {
+namespace rename_unit {
+namespace register_translation_unit {
+namespace register_address_translation_unit {
+
+
+#undef  FUNCTION
+#define FUNCTION "Register_Address_Translation_unit::function_one_save_transition"
+  void Register_Address_Translation_unit::function_one_save_transition (void)
+  {
+    log_begin(Register_Address_Translation_unit,FUNCTION);
+    log_function(Register_Address_Translation_unit,FUNCTION,_name.c_str());
+
+    if (PORT_READ(in_NRESET) == 0)
+      {
+	uint32_t gpr = 1;
+	uint32_t spr = 0;
+
+	for (uint32_t i=0; i<_param->_nb_front_end; i++)
+	  for (uint32_t j=0; j<_param->_nb_context[i]; j++)
+	    {
+	      rat_gpr_not_speculative   [i][j][0] = 0;
+              rat_gpr_speculative_valid [i][j][0] = false;
+              rat_gpr_speculative       [i][j][0] = 0    ; // not necessary
+
+	      for (uint32_t k=1; k<_param->_nb_general_register_logic; k++)
+                {
+                  rat_gpr_not_speculative    [i][j][k] = gpr++;
+                  rat_gpr_speculative_valid  [i][j][k] = false;
+                  rat_gpr_speculative        [i][j][k] = 0    ; // not necessary
+                }
+	      for (uint32_t k=0; k<_param->_nb_special_register_logic; k++)
+                {
+                  rat_spr_not_speculative    [i][j][k] = spr++;
+                  rat_spr_speculative_valid  [i][j][k] = false;
+                  rat_spr_speculative        [i][j][k] = 0    ; // not necessary
+                }
+	    }
+      }
+    else
+      {
+	// Note : GPR[0] is never write (in decod's stage : write_rd = 0 when num_reg_rd_log == 0)
+
+	// =====================================================
+	// ====[ RETIRE_EVENT ]=================================
+	// =====================================================
+        for (uint32_t i=0; i<_param->_nb_front_end; ++i)
+          for (uint32_t j=0; j<_param->_nb_context[i]; ++j)
+            if (PORT_READ(in_RETIRE_EVENT_VAL [i][j]) and internal_RETIRE_EVENT_ACK [i][j])
+              // Test if event have just occure
+              if (PORT_READ(in_RETIRE_EVENT_STATE [i][j]) == EVENT_STATE_EVENT)
+                {
+                  log_printf(TRACE,Register_Address_Translation_unit,FUNCTION,"    * Reset Update Table");
+                  
+                  // Reset validity table
+                  for (uint32_t k=0; k<_param->_nb_general_register_logic; k++)
+                    rat_gpr_speculative_valid [i][j][k] = false;
+                  for (uint32_t k=0; k<_param->_nb_special_register_logic; k++)
+                    rat_spr_speculative_valid [i][j][k] = false;
+                }
+
+	// =====================================================
+	// ====[ INSERT ]=======================================
+	// =====================================================
+	// First : interface insert
+        // this instruction is speculative !!!
+	for (uint32_t i=0; i<_param->_nb_inst_insert; i++)
+	  // Test transaction
+	  if (PORT_READ(in_INSERT_VAL [i]) and internal_INSERT_ACK  [i])
+	    {
+              log_printf(TRACE,Register_Address_Translation_unit,FUNCTION,"  * INSERT [%d]",i);
+
+	      Tcontext_t front_end_id = (_param->_have_port_front_end_id)?PORT_READ(in_RENAME_FRONT_END_ID [i]):0;
+	      Tcontext_t context_id   = (_param->_have_port_context_id  )?PORT_READ(in_RENAME_CONTEXT_ID   [i]):0;
+              Tcontrol_t write_rd     = PORT_READ(in_INSERT_WRITE_RD [i]);
+              Tcontrol_t write_re     = PORT_READ(in_INSERT_WRITE_RE [i]);
+
+              log_printf(TRACE,Register_Address_Translation_unit,FUNCTION,"    * front_end          : %d",front_end_id);
+              log_printf(TRACE,Register_Address_Translation_unit,FUNCTION,"    * context            : %d",context_id);
+	      
+	      // Test if write and modifie RAT
+              log_printf(TRACE,Register_Address_Translation_unit,FUNCTION,"    * write_rd           : %d",write_rd);
+	      if (write_rd == 1)
+                {
+                  Tgeneral_address_t num_reg_rd_log = PORT_READ(in_INSERT_NUM_REG_RD_LOG [i]);
+                  Tgeneral_address_t num_reg_rd_phy = PORT_READ(in_INSERT_NUM_REG_RD_PHY [i]);
+
+                  log_printf(TRACE,Register_Address_Translation_unit,FUNCTION,"    * num_reg_rd_log     : %d",num_reg_rd_log);
+                  log_printf(TRACE,Register_Address_Translation_unit,FUNCTION,"    * num_reg_rd_phy     : %d",num_reg_rd_phy);
+
+                  rat_gpr_speculative       [front_end_id][context_id][num_reg_rd_log] = num_reg_rd_phy;
+                  rat_gpr_speculative_valid [front_end_id][context_id][num_reg_rd_log] = true;
+                }
+
+              log_printf(TRACE,Register_Address_Translation_unit,FUNCTION,"    * write_re           : %d",write_re);
+	      if (write_re == 1)
+                {
+                  Tspecial_address_t num_reg_re_log = PORT_READ(in_INSERT_NUM_REG_RE_LOG [i]);
+                  Tspecial_address_t num_reg_re_phy = PORT_READ(in_INSERT_NUM_REG_RE_PHY [i]);
+
+                  log_printf(TRACE,Register_Address_Translation_unit,FUNCTION,"    * num_reg_re_log     : %d",num_reg_re_log);
+                  log_printf(TRACE,Register_Address_Translation_unit,FUNCTION,"    * num_reg_re_phy     : %d",num_reg_re_phy);
+
+                  rat_spr_speculative       [front_end_id][context_id][num_reg_re_log] = num_reg_re_phy;
+                  rat_spr_speculative_valid [front_end_id][context_id][num_reg_re_log] = true;
+                }
+	    }
+
+	// =====================================================
+	// ====[ RETIRE ]=======================================
+	// =====================================================
+	// Second : interface retire
+	//  (because if an event on the same thread : the instruction is already renamed)
+	for (uint32_t i=0; i<_param->_nb_inst_retire; i++)
+	  if (PORT_READ(in_RETIRE_VAL [i]) and internal_RETIRE_ACK [i])
+	    {
+              log_printf(TRACE,Register_Address_Translation_unit,FUNCTION,"  * RETIRE [%d]",i);
+
+	      // if no event : no effect, because the RAT content the most recently register
+	      // but if they have a event (exception or miss speculation), the rat must restore the oldest value
+	      // To restore the oldest valid value, we use the rat_update_table. if the bit is unset, also they have none update on this register
+	      // the retire interface became of the Re Order Buffer, also is in program sequence !
+
+              Tcontext_t front_end_id = (_param->_have_port_front_end_id)?PORT_READ(in_RETIRE_FRONT_END_ID [i]):0;
+              Tcontext_t context_id   = (_param->_have_port_context_id  )?PORT_READ(in_RETIRE_CONTEXT_ID   [i]):0;
+              Tcontrol_t write_rd     = PORT_READ(in_RETIRE_WRITE_RD [i]);
+              Tcontrol_t write_re     = PORT_READ(in_RETIRE_WRITE_RE [i]);
+              Tcontrol_t restore      = PORT_READ(in_RETIRE_RESTORE  [i]);
+
+              log_printf(TRACE,Register_Address_Translation_unit,FUNCTION,"    * front_end_id       : %d",front_end_id);
+              log_printf(TRACE,Register_Address_Translation_unit,FUNCTION,"    * context_id         : %d",context_id  );
+              log_printf(TRACE,Register_Address_Translation_unit,FUNCTION,"    * restore            : %d",restore     );
+
+              // Test if write and have not a previous update
+              log_printf(TRACE,Register_Address_Translation_unit,FUNCTION,"    * write_rd           : %d",write_rd);
+              if (write_rd == 1)
+                {
+                  Tgeneral_address_t num_reg_rd_log     = PORT_READ(in_RETIRE_NUM_REG_RD_LOG     [i]);
+
+                  log_printf(TRACE,Register_Address_Translation_unit,FUNCTION,"    * num_reg_rd_log     : %d",num_reg_rd_log    );
+
+                  if (not restore)
+                    {
+                  Tgeneral_address_t num_reg_rd_phy_new = PORT_READ(in_RETIRE_NUM_REG_RD_PHY_NEW [i]);
+
+                  log_printf(TRACE,Register_Address_Translation_unit,FUNCTION,"    * num_reg_rd_phy_new : %d",num_reg_rd_phy_new);
+
+                  rat_gpr_not_speculative [front_end_id][context_id][num_reg_rd_log] = num_reg_rd_phy_new;
+                    }
+                }
+
+              log_printf(TRACE,Register_Address_Translation_unit,FUNCTION,"    * write_re           : %d",write_re);
+              if (write_re == 1)
+                {
+                  Tspecial_address_t num_reg_re_log     = PORT_READ(in_RETIRE_NUM_REG_RE_LOG     [i]);
+
+                  log_printf(TRACE,Register_Address_Translation_unit,FUNCTION,"    * num_reg_re_log     : %d",num_reg_re_log    );
+
+                  if (not restore)
+                    {
+                  Tspecial_address_t num_reg_re_phy_new = PORT_READ(in_RETIRE_NUM_REG_RE_PHY_NEW [i]);
+
+                  log_printf(TRACE,Register_Address_Translation_unit,FUNCTION,"    * num_reg_re_phy_new : %d",num_reg_re_phy_new);
+
+                  rat_spr_not_speculative [front_end_id][context_id][num_reg_re_log] = num_reg_re_phy_new;
+                    }
+                }
+
+	    }
+      }
+
+#if (DEBUG >= DEBUG_TRACE) and (DEBUG_Register_Address_Translation_unit == true)
+    {
+      uint32_t limit = 4;
+      
+      log_printf(TRACE,Register_Address_Translation_unit,FUNCTION,"  * Dump RAT (Register_Address_Translation_unit)");
+      for (uint32_t i=0; i<_param->_nb_front_end; ++i)
+        for (uint32_t j=0; j<_param->_nb_context[i]; ++j)
+          {
+            log_printf(TRACE,Register_Address_Translation_unit,FUNCTION,"    * front_end[%d].context[%d]",i,j);
+          
+            for (uint32_t k=0; k<_param->_nb_general_register_logic; k+=limit)
+              {
+                std::string str = "";
+                for (uint32_t x=0; x<limit; x++)
+                  {
+                    uint32_t index = k+x;
+                    if (index >= _param->_nb_general_register_logic)
+                      break;
+                    else
+                      str+=toString("GPR[%.4d] - %.1d %.5d (%.5d) | ",index,rat_gpr_speculative_valid [i][j][index],rat_gpr_speculative [i][j][index],rat_gpr_not_speculative [i][j][index]);
+                  }
+                log_printf(TRACE,Register_Address_Translation_unit,FUNCTION,"      * %s",str.c_str());
+              }
+      
+            for (uint32_t k=0; k<_param->_nb_special_register_logic; k+=limit)
+              {
+                std::string str = "";
+                
+                for (uint32_t x=0; x<limit; x++)
+                  {
+                    uint32_t index = k+x;
+                    if (index >= _param->_nb_special_register_logic)
+                      break;
+                    else
+                      str+=toString("SPR[%.4d] - %.1d %.5d (%.5d) | ",index,rat_spr_speculative_valid [i][j][index],rat_spr_speculative [i][j][index],rat_spr_not_speculative [i][j][index]);
+                  }
+                log_printf(TRACE,Register_Address_Translation_unit,FUNCTION,"      * %s",str.c_str());
+              }
+          }
+    }
+#endif
+
+#ifdef DEBUG_TEST
+# if 1
+    {
+      for (uint32_t i=0; i<_param->_nb_front_end; ++i)
+        for (uint32_t j=0; j<_param->_nb_context[i]; ++j)
+          {
+            for (uint32_t x=0; x<_param->_nb_general_register_logic; ++x)
+              for (uint32_t y=x+1; y<_param->_nb_general_register_logic; ++y)
+                {
+                  if (rat_gpr_speculative_valid [i][j][x] and
+                      rat_gpr_speculative_valid [i][j][y] and
+                      (rat_gpr_speculative[i][j][x] == rat_gpr_speculative[i][j][y]))
+                    throw ERRORMORPHEO (FUNCTION,toString(_("In RAT, rat_gpr_speculative[%d][%d][%d] == rat_gpr_speculative[%d][%d][%d] == %d"),i,j,x,i,j,y,rat_gpr_speculative[i][j][x]));
+                  if (rat_gpr_not_speculative[i][j][x] == rat_gpr_not_speculative[i][j][y])
+                    throw ERRORMORPHEO (FUNCTION,toString(_("In RAT, rat_gpr_not_speculative[%d][%d][%d] == rat_gpr_not_speculative[%d][%d][%d] == %d"),i,j,x,i,j,y,rat_gpr_not_speculative[i][j][x]));
+                  
+                }
+            for (uint32_t x=0; x<_param->_nb_special_register_logic; ++x)
+              for (uint32_t y=x+1; y<_param->_nb_special_register_logic; ++y)
+                {
+                  if(rat_spr_speculative_valid [i][j][x] and
+                     rat_spr_speculative_valid [i][j][y] and
+                     (rat_spr_speculative[i][j][x] == rat_spr_speculative[i][j][y]))
+                    throw ERRORMORPHEO (FUNCTION,toString(_("In RAT, rat_spr_speculative[%d][%d][%d] == rat_spr_speculative[%d][%d][%d] == %d"),i,j,x,i,j,y,rat_spr_speculative[i][j][x]));
+                  if (rat_spr_not_speculative[i][j][x] == rat_spr_not_speculative[i][j][y])
+                    throw ERRORMORPHEO (FUNCTION,toString(_("In RAT, rat_spr_not_speculative[%d][%d][%d] == rat_spr_not_speculative[%d][%d][%d] == %d"),i,j,x,i,j,y,rat_spr_not_speculative[i][j][x]));
+                  
+                }
+          }
+      
+    }
+# endif
+#endif
+
+    log_end(Register_Address_Translation_unit,FUNCTION);
+  };
+
+}; // end namespace register_address_translation_unit
+}; // end namespace register_translation_unit
+}; // end namespace rename_unit
+}; // end namespace ooo_engine
+}; // end namespace multi_ooo_engine
+}; // end namespace core
+
+}; // end namespace behavioural
+}; // end namespace morpheo              
+#endif
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Rename_unit/Register_translation_unit/Register_Address_Translation_unit/src/Register_Address_Translation_unit_genMealy_rename.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Rename_unit/Register_translation_unit/Register_Address_Translation_unit/src/Register_Address_Translation_unit_genMealy_rename.cpp	(revision 132)
+++ 	(revision )
@@ -1,85 +1,0 @@
-#ifdef SYSTEMC
-/*
- * $Id$
- *
- * [ Description ]
- * 
- */
-
-#include "Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Rename_unit/Register_translation_unit/Register_Address_Translation_unit/include/Register_Address_Translation_unit.h"
-
-namespace morpheo                    {
-namespace behavioural {
-namespace core {
-namespace multi_ooo_engine {
-namespace ooo_engine {
-namespace rename_unit {
-namespace register_translation_unit {
-namespace register_address_translation_unit {
-
-
-#undef  FUNCTION
-#define FUNCTION "Register_Address_Translation_unit::genMealy_rename"
-  void Register_Address_Translation_unit::genMealy_rename (void)
-  {
-    log_begin(Register_Address_Translation_unit,FUNCTION);
-    log_function(Register_Address_Translation_unit,FUNCTION,_name.c_str());
-
-    if (PORT_READ(in_NRESET) != 0)
-    for (uint32_t i=0; i<_param->_nb_inst_insert; i++)
-      if (PORT_READ(in_RENAME_VAL [i])) // not in sensitive list : it's to have valide value to array access
-        {
-        log_printf(TRACE,Register_Address_Translation_unit,FUNCTION,"  * RENAME [%d]",i);
-
-	Tcontext_t front_end_id = (_param->_have_port_front_end_id)?PORT_READ(in_RENAME_FRONT_END_ID [i]):0;
-	Tcontext_t context_id   = (_param->_have_port_context_id  )?PORT_READ(in_RENAME_CONTEXT_ID   [i]):0;
-        bool       have_event   = (PORT_READ(in_RETIRE_EVENT_VAL [front_end_id][context_id]) and // always ack
-                                   (PORT_READ(in_RETIRE_EVENT_STATE [front_end_id][context_id]) == EVENT_STATE_EVENT));
-
-
-        log_printf(TRACE,Register_Address_Translation_unit,FUNCTION,"    * front_end_id       : %d",front_end_id);
-        log_printf(TRACE,Register_Address_Translation_unit,FUNCTION,"    * context_id         : %d",context_id);
-        log_printf(TRACE,Register_Address_Translation_unit,FUNCTION,"    * have_event         : %d",have_event);
-
-        Tgeneral_address_t num_reg_ra_log    = PORT_READ(in_RENAME_NUM_REG_RA_LOG [i]); //%_param->_nb_general_register;
-        Tgeneral_address_t num_reg_rb_log    = PORT_READ(in_RENAME_NUM_REG_RB_LOG [i]); //%_param->_nb_general_register;
-        Tspecial_address_t num_reg_rc_log    = PORT_READ(in_RENAME_NUM_REG_RC_LOG [i]); //%_param->_nb_special_register;
-        Tgeneral_address_t num_reg_rd_log    = PORT_READ(in_RENAME_NUM_REG_RD_LOG [i]); //%_param->_nb_general_register;
-        Tspecial_address_t num_reg_re_log    = PORT_READ(in_RENAME_NUM_REG_RE_LOG [i]); //%_param->_nb_special_register;
-                                            
-        // if rat_speculative is valid, 
-        // then read rat_speculative have the most valid alias register
-        // else, they have an previous event, the rat_not_speculative have the valid register
-
-        Tgeneral_address_t num_reg_ra_phy    = (rat_gpr_speculative_valid[front_end_id][context_id][num_reg_ra_log] and not have_event)?rat_gpr_speculative[front_end_id][context_id][num_reg_ra_log]:rat_gpr_not_speculative[front_end_id][context_id][num_reg_ra_log];
-        Tgeneral_address_t num_reg_rb_phy    = (rat_gpr_speculative_valid[front_end_id][context_id][num_reg_rb_log] and not have_event)?rat_gpr_speculative[front_end_id][context_id][num_reg_rb_log]:rat_gpr_not_speculative[front_end_id][context_id][num_reg_rb_log];
-        Tspecial_address_t num_reg_rc_phy    = (rat_spr_speculative_valid[front_end_id][context_id][num_reg_rc_log] and not have_event)?rat_spr_speculative[front_end_id][context_id][num_reg_rc_log]:rat_spr_not_speculative[front_end_id][context_id][num_reg_rc_log];
-        Tgeneral_address_t num_reg_rd_phy_old= (rat_gpr_speculative_valid[front_end_id][context_id][num_reg_rd_log] and not have_event)?rat_gpr_speculative[front_end_id][context_id][num_reg_rd_log]:rat_gpr_not_speculative[front_end_id][context_id][num_reg_rd_log];
-        Tspecial_address_t num_reg_re_phy_old= (rat_spr_speculative_valid[front_end_id][context_id][num_reg_re_log] and not have_event)?rat_spr_speculative[front_end_id][context_id][num_reg_re_log]:rat_spr_not_speculative[front_end_id][context_id][num_reg_re_log];
-
-        log_printf(TRACE,Register_Address_Translation_unit,FUNCTION,"    * num_reg_ra         : %d -> %d",num_reg_ra_log,num_reg_ra_phy    );
-        log_printf(TRACE,Register_Address_Translation_unit,FUNCTION,"    * num_reg_rb         : %d -> %d",num_reg_rb_log,num_reg_rb_phy    );
-        log_printf(TRACE,Register_Address_Translation_unit,FUNCTION,"    * num_reg_rc         : %d -> %d",num_reg_rc_log,num_reg_rc_phy    );
-        log_printf(TRACE,Register_Address_Translation_unit,FUNCTION,"    * num_reg_rd         : %d -> %d",num_reg_rd_log,num_reg_rd_phy_old);
-        log_printf(TRACE,Register_Address_Translation_unit,FUNCTION,"    * num_reg_re         : %d -> %d",num_reg_re_log,num_reg_re_phy_old);
-
-	PORT_WRITE(out_RENAME_NUM_REG_RA_PHY     [i], num_reg_ra_phy    );
-	PORT_WRITE(out_RENAME_NUM_REG_RB_PHY     [i], num_reg_rb_phy    );
-	PORT_WRITE(out_RENAME_NUM_REG_RC_PHY     [i], num_reg_rc_phy    );
-	PORT_WRITE(out_RENAME_NUM_REG_RD_PHY_OLD [i], num_reg_rd_phy_old);
-	PORT_WRITE(out_RENAME_NUM_REG_RE_PHY_OLD [i], num_reg_re_phy_old);
-      }
-
-    log_end(Register_Address_Translation_unit,FUNCTION);
-  };
-
-}; // end namespace register_address_translation_unit
-}; // end namespace register_translation_unit
-}; // end namespace rename_unit
-}; // end namespace ooo_engine
-}; // end namespace multi_ooo_engine
-}; // end namespace core
-
-}; // end namespace behavioural
-}; // end namespace morpheo              
-#endif
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Rename_unit/Register_translation_unit/Register_Address_Translation_unit/src/Register_Address_Translation_unit_genMealy_retire.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Rename_unit/Register_translation_unit/Register_Address_Translation_unit/src/Register_Address_Translation_unit_genMealy_retire.cpp	(revision 132)
+++ 	(revision )
@@ -1,122 +1,0 @@
-#ifdef SYSTEMC
-/*
- * $Id$
- *
- * [ Description ]
- * 
- */
-
-#include "Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Rename_unit/Register_translation_unit/Register_Address_Translation_unit/include/Register_Address_Translation_unit.h"
-
-namespace morpheo                    {
-namespace behavioural {
-namespace core {
-namespace multi_ooo_engine {
-namespace ooo_engine {
-namespace rename_unit {
-namespace register_translation_unit {
-namespace register_address_translation_unit {
-
-
-#undef  FUNCTION
-#define FUNCTION "Register_Address_Translation_unit::genMealy_retire"
-  void Register_Address_Translation_unit::genMealy_retire (void)
-  {
-    log_begin(Register_Address_Translation_unit,FUNCTION);
-    log_function(Register_Address_Translation_unit,FUNCTION,_name.c_str());
-
-    if (PORT_READ(in_NRESET) != 0)
-      {
-    // Init internal update table
-    for (uint32_t i=0; i<_param->_nb_front_end; i++)
-      for (uint32_t j=0; j<_param->_nb_context[i]; j++)
-        {
-          log_printf(TRACE,Register_Address_Translation_unit,FUNCTION,"  * init [%d][%d]",i,j);
-
-          // An event occure
-          // bool event = (PORT_READ(in_RETIRE_EVENT_STATE [i][j]) != EVENT_STATE_NO_EVENT);
-          bool reset_update_table = (PORT_READ(in_RETIRE_EVENT_VAL [i][j]) and // always ack
-                                     (PORT_READ(in_RETIRE_EVENT_STATE [i][j]) == EVENT_STATE_EVENT));
-
-          log_printf(TRACE,Register_Address_Translation_unit,FUNCTION,"    * reset_update_table : %d",reset_update_table);
-
-          // not event -> update_table == 1 -> always update
-          // event     -> update_table and not reset
-          for (uint32_t k=0; k<_param->_nb_general_register_logic; ++k)
-            internal_rat_gpr_update_table [i][j][k] = // not event or 
-                                                      (not reset_update_table and rat_gpr_update_table [i][j][k]);
-          for (uint32_t k=0; k<_param->_nb_special_register_logic; ++k)
-            internal_rat_spr_update_table [i][j][k] = // not event or 
-                                                      (not reset_update_table and rat_spr_update_table [i][j][k]);
-        }
-
-    // RETIRE is in order -> also don't need test if an instruction is valid
-    for (uint32_t i=0; i<_param->_nb_inst_retire; i++)
-      {
-        log_printf(TRACE,Register_Address_Translation_unit,FUNCTION,"  * inst_retire [%d]",i);
-
-        // init -> need't restore old value
-        Tcontrol_t retire_restore_rd_phy_old = false;
-        Tcontrol_t retire_restore_re_phy_old = false;
-
-        Tcontext_t front_end_id   = (_param->_have_port_front_end_id)?PORT_READ(in_RETIRE_FRONT_END_ID [i]):0;
-        Tcontext_t context_id     = (_param->_have_port_context_id  )?PORT_READ(in_RETIRE_CONTEXT_ID   [i]):0;
-        Tcontrol_t retire_restore = (PORT_READ(in_RETIRE_EVENT_STATE [front_end_id][context_id]) != EVENT_STATE_NO_EVENT);
-
-        log_printf(TRACE,Register_Address_Translation_unit,FUNCTION,"    * front_end_id         : %d",front_end_id);
-        log_printf(TRACE,Register_Address_Translation_unit,FUNCTION,"    * context_id           : %d",context_id  );
-        log_printf(TRACE,Register_Address_Translation_unit,FUNCTION,"    * restore              : %d",retire_restore);
-
-        // Test if event -> need restore ?
-        if (retire_restore)
-          {
-            log_printf(TRACE,Register_Address_Translation_unit,FUNCTION,"      * Have event");
-                        
-            // Test and update update table
-            if (PORT_READ(in_RETIRE_WRITE_RD [i]))
-              {
-                Tgeneral_address_t rd_log = PORT_READ(in_RETIRE_NUM_REG_RD_LOG [i]);
-                retire_restore_rd_phy_old = (internal_rat_gpr_update_table[front_end_id][context_id][rd_log] == 0);
-
-//                 log_printf(TRACE,Register_Address_Translation_unit,FUNCTION,"    * write_rd");
-//                 log_printf(TRACE,Register_Address_Translation_unit,FUNCTION,"      * rd_log             : %d",rd_log);
-//                 log_printf(TRACE,Register_Address_Translation_unit,FUNCTION,"      * rat_gpr_update     : %d",internal_rat_gpr_update_table[front_end_id][context_id][rd_log]);
-
-                internal_rat_gpr_update_table[front_end_id][context_id][rd_log] = 1;
-              }
-            if (PORT_READ(in_RETIRE_WRITE_RE [i]))
-              {
-//                 log_printf(TRACE,Register_Address_Translation_unit,FUNCTION,"    * write_re");
-
-                Tgeneral_address_t re_log = PORT_READ(in_RETIRE_NUM_REG_RE_LOG [i]);
-                retire_restore_re_phy_old = (internal_rat_spr_update_table[front_end_id][context_id][re_log] == 0);
-                internal_rat_spr_update_table[front_end_id][context_id][re_log] = 1;
-              }
-
-            log_printf(TRACE,Register_Address_Translation_unit,FUNCTION,"      * restore_rd_phy_old   : %d",retire_restore_rd_phy_old);
-            log_printf(TRACE,Register_Address_Translation_unit,FUNCTION,"      * restore_re_phy_old   : %d",retire_restore_re_phy_old);
-          }
-
-        internal_RETIRE_RESTORE            [i] = retire_restore;
-        internal_RETIRE_RESTORE_RD_PHY_OLD [i] = retire_restore_rd_phy_old;
-        internal_RETIRE_RESTORE_RE_PHY_OLD [i] = retire_restore_re_phy_old;
-              
-        PORT_WRITE(out_RETIRE_RESTORE           [i], internal_RETIRE_RESTORE            [i]);
-        PORT_WRITE(out_RETIRE_RESTORE_RD_PHY_OLD[i], internal_RETIRE_RESTORE_RD_PHY_OLD [i]);
-        PORT_WRITE(out_RETIRE_RESTORE_RE_PHY_OLD[i], internal_RETIRE_RESTORE_RE_PHY_OLD [i]);
-      }
-      }
-
-    log_end(Register_Address_Translation_unit,FUNCTION);
-  };
-
-}; // end namespace register_address_translation_unit
-}; // end namespace register_translation_unit
-}; // end namespace rename_unit
-}; // end namespace ooo_engine
-}; // end namespace multi_ooo_engine
-}; // end namespace core
-
-}; // end namespace behavioural
-}; // end namespace morpheo              
-#endif
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Rename_unit/Register_translation_unit/Register_Address_Translation_unit/src/Register_Address_Translation_unit_transition.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Rename_unit/Register_translation_unit/Register_Address_Translation_unit/src/Register_Address_Translation_unit_transition.cpp	(revision 132)
+++ 	(revision )
@@ -1,299 +1,0 @@
-#ifdef SYSTEMC
-/*
- * $Id$
- *
- * [ Description ]
- * 
- */
-
-#include "Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Rename_unit/Register_translation_unit/Register_Address_Translation_unit/include/Register_Address_Translation_unit.h"
-
-namespace morpheo                    {
-namespace behavioural {
-namespace core {
-namespace multi_ooo_engine {
-namespace ooo_engine {
-namespace rename_unit {
-namespace register_translation_unit {
-namespace register_address_translation_unit {
-
-
-#undef  FUNCTION
-#define FUNCTION "Register_Address_Translation_unit::transition"
-  void Register_Address_Translation_unit::transition (void)
-  {
-    log_begin(Register_Address_Translation_unit,FUNCTION);
-    log_function(Register_Address_Translation_unit,FUNCTION,_name.c_str());
-
-    if (PORT_READ(in_NRESET) == 0)
-      {
-	uint32_t gpr = 1;
-	uint32_t spr = 0;
-
-	for (uint32_t i=0; i<_param->_nb_front_end; i++)
-	  for (uint32_t j=0; j<_param->_nb_context[i]; j++)
-	    {
-	      rat_gpr_not_speculative   [i][j][0] = 0;
-              rat_gpr_speculative_valid [i][j][0] = false;
-              rat_gpr_speculative       [i][j][0] = 0    ; // not necessary
-              rat_gpr_update_table      [i][j][0] = false; // not necessary
-
-	      for (uint32_t k=1; k<_param->_nb_general_register_logic; k++)
-                {
-                  rat_gpr_not_speculative    [i][j][k] = gpr++;
-                  rat_gpr_speculative_valid  [i][j][k] = false;
-                  rat_gpr_speculative        [i][j][k] = 0    ; // not necessary
-                  rat_gpr_update_table       [i][j][k] = false; // not necessary
-                }
-	      for (uint32_t k=0; k<_param->_nb_special_register_logic; k++)
-                {
-                  rat_spr_not_speculative    [i][j][k] = spr++;
-                  rat_spr_speculative_valid  [i][j][k] = false;
-                  rat_spr_speculative        [i][j][k] = 0    ; // not necessary
-                  rat_spr_update_table       [i][j][k] = false; // not necessary
-                }
-	    }
-      }
-    else
-      {
-	// Note : GPR[0] is never write (in decod's stage : write_rd = 0 when num_reg_rd_log == 0)
-
-	// =====================================================
-	// ====[ RETIRE_EVENT ]=================================
-	// =====================================================
-        for (uint32_t i=0; i<_param->_nb_front_end; ++i)
-          for (uint32_t j=0; j<_param->_nb_context[i]; ++j)
-            if (PORT_READ(in_RETIRE_EVENT_VAL [i][j]) and internal_RETIRE_EVENT_ACK [i][j])
-              // Test if event have just occure
-              if (PORT_READ(in_RETIRE_EVENT_STATE [i][j]) == EVENT_STATE_EVENT)
-                {
-                  log_printf(TRACE,Register_Address_Translation_unit,FUNCTION,"    * Reset Update Table");
-                  
-                  // Reset update_table and validity table
-                  for (uint32_t k=0; k<_param->_nb_general_register_logic; k++)
-                    {
-                      rat_gpr_update_table      [i][j][k] = false;
-                      rat_gpr_speculative_valid [i][j][k] = false;
-                    }
-                  for (uint32_t k=0; k<_param->_nb_special_register_logic; k++)
-                    {
-                      rat_spr_update_table      [i][j][k] = false;
-                      rat_spr_speculative_valid [i][j][k] = false;
-                    }
-                }
-
-	// =====================================================
-	// ====[ INSERT ]=======================================
-	// =====================================================
-	// First : interface insert
-        // this instruction is speculative !!!
-	for (uint32_t i=0; i<_param->_nb_inst_insert; i++)
-	  // Test transaction
-	  if (PORT_READ(in_INSERT_VAL [i]) and internal_INSERT_ACK  [i])
-	    {
-              log_printf(TRACE,Register_Address_Translation_unit,FUNCTION,"  * INSERT [%d]",i);
-
-	      Tcontext_t front_end_id = (_param->_have_port_front_end_id)?PORT_READ(in_RENAME_FRONT_END_ID [i]):0;
-	      Tcontext_t context_id   = (_param->_have_port_context_id  )?PORT_READ(in_RENAME_CONTEXT_ID   [i]):0;
-              Tcontrol_t write_rd     = PORT_READ(in_INSERT_WRITE_RD [i]);
-              Tcontrol_t write_re     = PORT_READ(in_INSERT_WRITE_RE [i]);
-
-              log_printf(TRACE,Register_Address_Translation_unit,FUNCTION,"    * front_end          : %d",front_end_id);
-              log_printf(TRACE,Register_Address_Translation_unit,FUNCTION,"    * context            : %d",context_id);
-	      
-	      // Test if write and modifie RAT
-              log_printf(TRACE,Register_Address_Translation_unit,FUNCTION,"    * write_rd           : %d",write_rd);
-	      if (write_rd == 1)
-                {
-                  Tgeneral_address_t num_reg_rd_log = PORT_READ(in_INSERT_NUM_REG_RD_LOG [i]);
-                  Tgeneral_address_t num_reg_rd_phy = PORT_READ(in_INSERT_NUM_REG_RD_PHY [i]);
-
-                  log_printf(TRACE,Register_Address_Translation_unit,FUNCTION,"    * num_reg_rd_log     : %d",num_reg_rd_log);
-                  log_printf(TRACE,Register_Address_Translation_unit,FUNCTION,"    * num_reg_rd_phy     : %d",num_reg_rd_phy);
-
-                  rat_gpr_speculative       [front_end_id][context_id][num_reg_rd_log] = num_reg_rd_phy;
-                  rat_gpr_speculative_valid [front_end_id][context_id][num_reg_rd_log] = true;
-                }
-
-              log_printf(TRACE,Register_Address_Translation_unit,FUNCTION,"    * write_re           : %d",write_re);
-	      if (write_re == 1)
-                {
-                  Tspecial_address_t num_reg_re_log = PORT_READ(in_INSERT_NUM_REG_RE_LOG [i]);
-                  Tspecial_address_t num_reg_re_phy = PORT_READ(in_INSERT_NUM_REG_RE_PHY [i]);
-
-                  log_printf(TRACE,Register_Address_Translation_unit,FUNCTION,"    * num_reg_re_log     : %d",num_reg_re_log);
-                  log_printf(TRACE,Register_Address_Translation_unit,FUNCTION,"    * num_reg_re_phy     : %d",num_reg_re_phy);
-
-                  rat_spr_speculative       [front_end_id][context_id][num_reg_re_log] = num_reg_re_phy;
-                  rat_spr_speculative_valid [front_end_id][context_id][num_reg_re_log] = true;
-                }
-	    }
-
-	// =====================================================
-	// ====[ RETIRE ]=======================================
-	// =====================================================
-	// Second : interface retire
-	//  (because if an event on the same thread : the instruction is already renamed)
-	for (uint32_t i=0; i<_param->_nb_inst_retire; i++)
-	  if (PORT_READ(in_RETIRE_VAL [i]) and internal_RETIRE_ACK [i])
-	    {
-              log_printf(TRACE,Register_Address_Translation_unit,FUNCTION,"  * RETIRE [%d]",i);
-
-	      // if no event : no effect, because the RAT content the most recently register
-	      // but if they have a event (exception or miss speculation), the rat must restore the oldest value
-	      // To restore the oldest valid value, we use the rat_update_table. if the bit is unset, also they have none update on this register
-	      // the retire interface became of the Re Order Buffer, also is in program sequence !
-
-              Tcontext_t front_end_id = (_param->_have_port_front_end_id)?PORT_READ(in_RETIRE_FRONT_END_ID [i]):0;
-              Tcontext_t context_id   = (_param->_have_port_context_id  )?PORT_READ(in_RETIRE_CONTEXT_ID   [i]):0;
-              Tcontrol_t write_rd     = PORT_READ(in_RETIRE_WRITE_RD [i]);
-              Tcontrol_t write_re     = PORT_READ(in_RETIRE_WRITE_RE [i]);
-              Tcontrol_t restore      = internal_RETIRE_RESTORE [i];
-
-              log_printf(TRACE,Register_Address_Translation_unit,FUNCTION,"    * front_end_id       : %d",front_end_id);
-              log_printf(TRACE,Register_Address_Translation_unit,FUNCTION,"    * context_id         : %d",context_id  );
-              log_printf(TRACE,Register_Address_Translation_unit,FUNCTION,"    * restore            : %d",restore     );
-
-              // Test if write and have not a previous update
-              log_printf(TRACE,Register_Address_Translation_unit,FUNCTION,"    * write_rd           : %d",write_rd);
-              if (PORT_READ(in_RETIRE_WRITE_RD [i]) == 1)
-                {
-                  Tgeneral_address_t num_reg_rd_log     = PORT_READ(in_RETIRE_NUM_REG_RD_LOG     [i]);
-
-                  log_printf(TRACE,Register_Address_Translation_unit,FUNCTION,"    * num_reg_rd_log     : %d",num_reg_rd_log    );
-
-                  if (not restore)
-                    {
-                  Tgeneral_address_t num_reg_rd_phy_new = PORT_READ(in_RETIRE_NUM_REG_RD_PHY_NEW [i]);
-
-                  log_printf(TRACE,Register_Address_Translation_unit,FUNCTION,"    * num_reg_rd_phy_new : %d",num_reg_rd_phy_new);
-
-                  rat_gpr_not_speculative [front_end_id][context_id][num_reg_rd_log] = num_reg_rd_phy_new;
-                    }
-
-                  Tcontrol_t         restore_rd         = internal_RETIRE_RESTORE_RD_PHY_OLD [i];
-                  log_printf(TRACE,Register_Address_Translation_unit,FUNCTION,"    * restore_rd         : %d",restore_rd        );
-                      
-                  if (restore_rd)
-                  rat_gpr_update_table    [front_end_id][context_id][num_reg_rd_log] = true;
-                }
-
-              log_printf(TRACE,Register_Address_Translation_unit,FUNCTION,"    * write_re           : %d",write_re);
-              if (PORT_READ(in_RETIRE_WRITE_RE [i]) == 1)
-                {
-                  Tspecial_address_t num_reg_re_log     = PORT_READ(in_RETIRE_NUM_REG_RE_LOG     [i]);
-
-                  log_printf(TRACE,Register_Address_Translation_unit,FUNCTION,"    * num_reg_re_log     : %d",num_reg_re_log    );
-
-                  if (not restore)
-                    {
-                  Tspecial_address_t num_reg_re_phy_new = PORT_READ(in_RETIRE_NUM_REG_RE_PHY_NEW [i]);
-
-                  log_printf(TRACE,Register_Address_Translation_unit,FUNCTION,"    * num_reg_re_phy_new : %d",num_reg_re_phy_new);
-
-                  rat_spr_not_speculative [front_end_id][context_id][num_reg_re_log] = num_reg_re_phy_new;
-                    }
-
-                  Tcontrol_t         restore_re         = internal_RETIRE_RESTORE_RE_PHY_OLD [i];
-                  log_printf(TRACE,Register_Address_Translation_unit,FUNCTION,"    * restore_re         : %d",restore_re        );
-                      
-                  if (restore_re)
-                  rat_spr_update_table    [front_end_id][context_id][num_reg_re_log] = true;
-                }
-
-	    }
-      }
-
-#if (DEBUG >= DEBUG_TRACE) and (DEBUG_Register_Address_Translation_unit == true)
-    {
-      uint32_t limit = 4;
-      
-      log_printf(TRACE,Register_Address_Translation_unit,FUNCTION,"  * Dump RAT (Register_Address_Translation_unit)");
-      for (uint32_t i=0; i<_param->_nb_front_end; ++i)
-        for (uint32_t j=0; j<_param->_nb_context[i]; ++j)
-          {
-            log_printf(TRACE,Register_Address_Translation_unit,FUNCTION,"    * front_end[%d].context[%d]",i,j);
-          
-            for (uint32_t k=0; k<_param->_nb_general_register_logic; k+=limit)
-              {
-                std::string str = "";
-                for (uint32_t x=0; x<limit; x++)
-                  {
-                    uint32_t index = k+x;
-                    if (index >= _param->_nb_general_register_logic)
-                      break;
-                    else
-                      str+=toString("GPR[%.4d] - %.1d %.5d (%.5d) %.1d | ",index,rat_gpr_speculative_valid [i][j][index],rat_gpr_speculative [i][j][index],rat_gpr_not_speculative [i][j][index],rat_gpr_update_table[i][j][index]);
-                  }
-                log_printf(TRACE,Register_Address_Translation_unit,FUNCTION,"      * %s",str.c_str());
-              }
-      
-            for (uint32_t k=0; k<_param->_nb_special_register_logic; k+=limit)
-              {
-                std::string str = "";
-                
-                for (uint32_t x=0; x<limit; x++)
-                  {
-                    uint32_t index = k+x;
-                    if (index >= _param->_nb_special_register_logic)
-                      break;
-                    else
-                      str+=toString("SPR[%.4d] - %.1d %.5d (%.5d) %.1d | ",index,rat_spr_speculative_valid [i][j][index],rat_spr_speculative [i][j][index],rat_spr_not_speculative [i][j][index],rat_spr_update_table[i][j][index]);
-                  }
-                log_printf(TRACE,Register_Address_Translation_unit,FUNCTION,"      * %s",str.c_str());
-              }
-          }
-    }
-#endif
-
-#ifdef DEBUG_TEST
-# if 1
-    {
-      for (uint32_t i=0; i<_param->_nb_front_end; ++i)
-        for (uint32_t j=0; j<_param->_nb_context[i]; ++j)
-          {
-            for (uint32_t x=0; x<_param->_nb_general_register_logic; ++x)
-              for (uint32_t y=x+1; y<_param->_nb_general_register_logic; ++y)
-                {
-                  if (rat_gpr_speculative_valid [i][j][x] and
-                      rat_gpr_speculative_valid [i][j][y] and
-                      (rat_gpr_speculative[i][j][x] == rat_gpr_speculative[i][j][y]))
-                    throw ERRORMORPHEO (FUNCTION,toString(_("In RAT, rat_gpr_speculative[%d][%d][%d] == rat_gpr_speculative[%d][%d][%d] == %d"),i,j,x,i,j,y,rat_gpr_speculative[i][j][x]));
-                  if (rat_gpr_not_speculative[i][j][x] == rat_gpr_not_speculative[i][j][y])
-                    throw ERRORMORPHEO (FUNCTION,toString(_("In RAT, rat_gpr_not_speculative[%d][%d][%d] == rat_gpr_not_speculative[%d][%d][%d] == %d"),i,j,x,i,j,y,rat_gpr_not_speculative[i][j][x]));
-                  
-                }
-            for (uint32_t x=0; x<_param->_nb_special_register_logic; ++x)
-              for (uint32_t y=x+1; y<_param->_nb_special_register_logic; ++y)
-                {
-                  if(rat_spr_speculative_valid [i][j][x] and
-                     rat_spr_speculative_valid [i][j][y] and
-                     (rat_spr_speculative[i][j][x] == rat_spr_speculative[i][j][y]))
-                    throw ERRORMORPHEO (FUNCTION,toString(_("In RAT, rat_spr_speculative[%d][%d][%d] == rat_spr_speculative[%d][%d][%d] == %d"),i,j,x,i,j,y,rat_spr_speculative[i][j][x]));
-                  if (rat_spr_not_speculative[i][j][x] == rat_spr_not_speculative[i][j][y])
-                    throw ERRORMORPHEO (FUNCTION,toString(_("In RAT, rat_spr_not_speculative[%d][%d][%d] == rat_spr_not_speculative[%d][%d][%d] == %d"),i,j,x,i,j,y,rat_spr_not_speculative[i][j][x]));
-                  
-                }
-          }
-      
-    }
-# endif
-#endif
-
-#if defined(STATISTICS) or defined(VHDL_TESTBENCH)
-    end_cycle ();
-#endif
-
-    log_end(Register_Address_Translation_unit,FUNCTION);
-  };
-
-}; // end namespace register_address_translation_unit
-}; // end namespace register_translation_unit
-}; // end namespace rename_unit
-}; // end namespace ooo_engine
-}; // end namespace multi_ooo_engine
-}; // end namespace core
-
-}; // end namespace behavioural
-}; // end namespace morpheo              
-#endif
