Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Commit_unit/src/Commit_unit_allocation.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Commit_unit/src/Commit_unit_allocation.cpp	(revision 138)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Commit_unit/src/Commit_unit_allocation.cpp	(revision 139)
@@ -120,10 +120,10 @@
       _ALLOC2_SIGNAL_OUT(out_RETIRE_STORE_QUEUE_PTR_WRITE   ,"store_queue_ptr_write",Tlsq_ptr_t        ,_param->_size_store_queue_ptr       ,_param->_nb_rename_unit,_param->_nb_inst_retire[it1]);
       _ALLOC2_SIGNAL_OUT(out_RETIRE_LOAD_QUEUE_PTR_WRITE    ,"load_queue_ptr_write" ,Tlsq_ptr_t        ,_param->_size_load_queue_ptr        ,_param->_nb_rename_unit,_param->_nb_inst_retire[it1]);
-//       _ALLOC2_SIGNAL_OUT(out_RETIRE_READ_RA                 ,"read_ra"              ,Tcontrol_t        ,1                                   ,_param->_nb_rename_unit,_param->_nb_inst_retire[it1]);
-//       _ALLOC2_SIGNAL_OUT(out_RETIRE_NUM_REG_RA_PHY          ,"num_reg_ra_phy"       ,Tgeneral_address_t,_param->_size_general_register      ,_param->_nb_rename_unit,_param->_nb_inst_retire[it1]);
-//       _ALLOC2_SIGNAL_OUT(out_RETIRE_READ_RB                 ,"read_rb"              ,Tcontrol_t        ,1                                   ,_param->_nb_rename_unit,_param->_nb_inst_retire[it1]);
-//       _ALLOC2_SIGNAL_OUT(out_RETIRE_NUM_REG_RB_PHY          ,"num_reg_rb_phy"       ,Tgeneral_address_t,_param->_size_general_register      ,_param->_nb_rename_unit,_param->_nb_inst_retire[it1]);
-//       _ALLOC2_SIGNAL_OUT(out_RETIRE_READ_RC                 ,"read_rc"              ,Tcontrol_t        ,1                                   ,_param->_nb_rename_unit,_param->_nb_inst_retire[it1]);
-//       _ALLOC2_SIGNAL_OUT(out_RETIRE_NUM_REG_RC_PHY          ,"num_reg_rc_phy"       ,Tspecial_address_t,_param->_size_special_register      ,_param->_nb_rename_unit,_param->_nb_inst_retire[it1]);
+//    _ALLOC2_SIGNAL_OUT(out_RETIRE_READ_RA                 ,"read_ra"              ,Tcontrol_t        ,1                                   ,_param->_nb_rename_unit,_param->_nb_inst_retire[it1]);
+//    _ALLOC2_SIGNAL_OUT(out_RETIRE_NUM_REG_RA_PHY          ,"num_reg_ra_phy"       ,Tgeneral_address_t,_param->_size_general_register      ,_param->_nb_rename_unit,_param->_nb_inst_retire[it1]);
+//    _ALLOC2_SIGNAL_OUT(out_RETIRE_READ_RB                 ,"read_rb"              ,Tcontrol_t        ,1                                   ,_param->_nb_rename_unit,_param->_nb_inst_retire[it1]);
+//    _ALLOC2_SIGNAL_OUT(out_RETIRE_NUM_REG_RB_PHY          ,"num_reg_rb_phy"       ,Tgeneral_address_t,_param->_size_general_register      ,_param->_nb_rename_unit,_param->_nb_inst_retire[it1]);
+//    _ALLOC2_SIGNAL_OUT(out_RETIRE_READ_RC                 ,"read_rc"              ,Tcontrol_t        ,1                                   ,_param->_nb_rename_unit,_param->_nb_inst_retire[it1]);
+//    _ALLOC2_SIGNAL_OUT(out_RETIRE_NUM_REG_RC_PHY          ,"num_reg_rc_phy"       ,Tspecial_address_t,_param->_size_special_register      ,_param->_nb_rename_unit,_param->_nb_inst_retire[it1]);
       _ALLOC2_SIGNAL_OUT(out_RETIRE_WRITE_RD                ,"write_rd"             ,Tcontrol_t        ,1                                   ,_param->_nb_rename_unit,_param->_nb_inst_retire[it1]);
       _ALLOC2_SIGNAL_OUT(out_RETIRE_NUM_REG_RD_LOG          ,"num_reg_rd_log"       ,Tgeneral_address_t,_param->_size_general_register_logic,_param->_nb_rename_unit,_param->_nb_inst_retire[it1]);
@@ -134,4 +134,7 @@
       _ALLOC2_SIGNAL_OUT(out_RETIRE_NUM_REG_RE_PHY_OLD      ,"num_reg_re_phy_old"   ,Tspecial_address_t,_param->_size_special_register      ,_param->_nb_rename_unit,_param->_nb_inst_retire[it1]);
       _ALLOC2_SIGNAL_OUT(out_RETIRE_NUM_REG_RE_PHY_NEW      ,"num_reg_re_phy_new"   ,Tspecial_address_t,_param->_size_special_register      ,_param->_nb_rename_unit,_param->_nb_inst_retire[it1]);
+      _ALLOC2_SIGNAL_OUT(out_RETIRE_RESTORE                 ,"RESTORE"              ,Tcontrol_t        ,1                                   ,_param->_nb_rename_unit,_param->_nb_inst_retire[it1]);
+      _ALLOC2_SIGNAL_OUT(out_RETIRE_RESTORE_RD_PHY_OLD      ,"RESTORE_RD_PHY_OLD"   ,Tcontrol_t        ,1                                   ,_param->_nb_rename_unit,_param->_nb_inst_retire[it1]);
+      _ALLOC2_SIGNAL_OUT(out_RETIRE_RESTORE_RE_PHY_OLD      ,"RESTORE_RE_PHY_OLD"   ,Tcontrol_t        ,1                                   ,_param->_nb_rename_unit,_param->_nb_inst_retire[it1]);
 
       ALLOC2_INTERFACE_END(_param->_nb_rename_unit,_param->_nb_inst_retire[it1]);
@@ -142,9 +145,11 @@
       ALLOC2_INTERFACE_BEGIN("retire_event",OUT,SOUTH, _("Interface to update rename_unit."),_param->_nb_front_end,_param->_nb_context[it1]);
     
-      _ALLOC2_VALACK_OUT(out_RETIRE_EVENT_VAL               ,VAL,_param->_nb_front_end,_param->_nb_context[it1]);
-      _ALLOC2_VALACK_IN ( in_RETIRE_EVENT_ACK               ,ACK,_param->_nb_front_end,_param->_nb_context[it1]);
-      _ALLOC2_SIGNAL_OUT(out_RETIRE_EVENT_STATE             ,"state"                ,Tevent_state_t    ,_param->_size_event_state           ,_param->_nb_front_end,_param->_nb_context[it1]);
-//    _ALLOC2_SIGNAL_OUT(out_RETIRE_EVENT_FLUSH             ,"flush"                ,Tcontrol_t        ,1                                   ,_param->_nb_front_end,_param->_nb_context[it1]);
-      _ALLOC2_SIGNAL_OUT(out_RETIRE_EVENT_STOP              ,"stop"                 ,Tcontrol_t        ,1                                   ,_param->_nb_front_end,_param->_nb_context[it1]);
+      _ALLOC2_VALACK_OUT     (out_RETIRE_EVENT_VAL   ,VAL,_param->_nb_front_end,_param->_nb_context[it1]);
+      _ALLOC2_VALACK_IN      ( in_RETIRE_EVENT_ACK   ,ACK,_param->_nb_front_end,_param->_nb_context[it1]);
+      _ALLOC2_SIGNAL_OUT     (out_RETIRE_EVENT_STATE ,"state"      ,Tevent_state_t    ,_param->_size_event_state,_param->_nb_front_end,_param->_nb_context[it1]);
+//    _ALLOC2_SIGNAL_OUT     (out_RETIRE_EVENT_FLUSH ,"flush"      ,Tcontrol_t        ,1                        ,_param->_nb_front_end,_param->_nb_context[it1]);
+      _ALLOC2_SIGNAL_OUT     (out_RETIRE_EVENT_STOP  ,"stop"       ,Tcontrol_t        ,1                        ,_param->_nb_front_end,_param->_nb_context[it1]);
+      _ALLOC2_SIGNAL_OUT_COND(out_RETIRE_EVENT_TYPE  ,"type"       ,Tevent_type_t     ,_param->_size_event_type ,_param->_nb_front_end,_param->_nb_context[it1],_param->_rat_scheme[it1] == RAT_DEPTH_SAVE);
+      _ALLOC2_SIGNAL_OUT_COND(out_RETIRE_EVENT_DEPTH ,"depth"      ,Tdepth_t          ,_param->_size_depth      ,_param->_nb_front_end,_param->_nb_context[it1],_param->_rat_scheme[it1] == RAT_DEPTH_SAVE);
 
       ALLOC2_INTERFACE_END(_param->_nb_front_end,_param->_nb_context[it1]);
@@ -306,7 +311,10 @@
     ALLOC2(internal_BANK_COMMIT_ENTRY           ,entry_t * ,_param->_nb_bank,_param->_nb_bank_access_commit);
 
-    ALLOC1(internal_BANK_RETIRE_VAL             ,Tcontrol_t,_param->_nb_bank);
-    ALLOC1(internal_BANK_RETIRE_NUM_RENAME_UNIT ,uint32_t  ,_param->_nb_bank);
-    ALLOC1(internal_BANK_RETIRE_NUM_INST        ,uint32_t  ,_param->_nb_bank);
+    ALLOC1(internal_BANK_RETIRE_VAL               ,Tcontrol_t,_param->_nb_bank);
+    ALLOC1(internal_BANK_RETIRE_NUM_RENAME_UNIT   ,uint32_t  ,_param->_nb_bank);
+    ALLOC1(internal_BANK_RETIRE_NUM_INST          ,uint32_t  ,_param->_nb_bank);
+//  ALLOC1(internal_BANK_RETIRE_RESTORE           ,Tcontrol_t,_param->_nb_bank);
+    ALLOC1(internal_BANK_RETIRE_RESTORE_RD_PHY_OLD,Tcontrol_t,_param->_nb_bank);
+    ALLOC1(internal_BANK_RETIRE_RESTORE_RE_PHY_OLD,Tcontrol_t,_param->_nb_bank);
 
     ALLOC1(internal_REEXECUTE_VAL               ,Tcontrol_t,_param->_nb_inst_reexecute);
@@ -318,4 +326,8 @@
     ALLOC2(internal_EVENT_ACK                   ,Tcontrol_t,_param->_nb_front_end,_param->_nb_context[it1]);
     ALLOC2(internal_RETIRE_EVENT_VAL            ,Tcontrol_t,_param->_nb_front_end,_param->_nb_context[it1]);
+
+    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);
+
 
     // ~~~~~[ Register ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~    
@@ -329,10 +341,12 @@
     
     ALLOC2(reg_EVENT_STATE          ,Tcommit_event_state_t,_param->_nb_front_end,_param->_nb_context [it1]);
+    ALLOC2(reg_EVENT_TYPE           ,Tevent_type_t        ,_param->_nb_front_end,_param->_nb_context [it1]);
 //  ALLOC2(reg_EVENT_FLUSH          ,bool                 ,_param->_nb_front_end,_param->_nb_context [it1]);
 //  ALLOC2(reg_EVENT_STOP           ,bool                 ,_param->_nb_front_end,_param->_nb_context [it1]);
-    ALLOC2(reg_EVENT_NUM_BANK       ,uint32_t             ,_param->_nb_front_end,_param->_nb_context [it1]);
-    ALLOC2(reg_EVENT_NUM_PTR        ,uint32_t             ,_param->_nb_front_end,_param->_nb_context [it1]);
+//  ALLOC2(reg_EVENT_NUM_BANK       ,uint32_t             ,_param->_nb_front_end,_param->_nb_context [it1]);
+//  ALLOC2(reg_EVENT_NUM_PTR        ,uint32_t             ,_param->_nb_front_end,_param->_nb_context [it1]);
 //  ALLOC2(reg_EVENT_CAN_RESTART    ,bool                 ,_param->_nb_front_end,_param->_nb_context [it1]);
     ALLOC2(reg_EVENT_PACKET         ,uint32_t             ,_param->_nb_front_end,_param->_nb_context [it1]);
+    ALLOC2(reg_EVENT_DEPTH          ,Tdepth_t             ,_param->_nb_front_end,_param->_nb_context [it1]);
     ALLOC2(reg_EVENT_NB_INST        ,uint32_t             ,_param->_nb_front_end,_param->_nb_context [it1]);
     ALLOC2(reg_EVENT_LAST           ,bool                 ,_param->_nb_front_end,_param->_nb_context [it1]);
@@ -348,4 +362,7 @@
     ALLOC2(reg_PC_CURRENT_IS_DS_TAKE,Taddress_t           ,_param->_nb_front_end,_param->_nb_context [it1]);
     ALLOC2(reg_PC_NEXT              ,Taddress_t           ,_param->_nb_front_end,_param->_nb_context [it1]);
+
+    ALLOC3(rat_gpr_update_table     ,bool                 ,_param->_nb_front_end,_param->_nb_context [it1],_param->_nb_general_register_logic);
+    ALLOC3(rat_spr_update_table     ,bool                 ,_param->_nb_front_end,_param->_nb_context [it1],_param->_nb_special_register_logic);
       }
 
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Commit_unit/src/Commit_unit_deallocation.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Commit_unit/src/Commit_unit_deallocation.cpp	(revision 138)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Commit_unit/src/Commit_unit_deallocation.cpp	(revision 139)
@@ -96,10 +96,15 @@
         DELETE2_SIGNAL(out_RETIRE_NUM_REG_RE_PHY_OLD      ,_param->_nb_rename_unit,_param->_nb_inst_retire[it1],_param->_size_special_register      );
         DELETE2_SIGNAL(out_RETIRE_NUM_REG_RE_PHY_NEW      ,_param->_nb_rename_unit,_param->_nb_inst_retire[it1],_param->_size_special_register      );
-
-        DELETE2_SIGNAL(out_RETIRE_EVENT_VAL               ,_param->_nb_front_end,_param->_nb_context[it1],1);
-        DELETE2_SIGNAL( in_RETIRE_EVENT_ACK               ,_param->_nb_front_end,_param->_nb_context[it1],1);
-        DELETE2_SIGNAL(out_RETIRE_EVENT_STATE             ,_param->_nb_front_end,_param->_nb_context[it1],_param->_size_event_state);
-//      DELETE2_SIGNAL(out_RETIRE_EVENT_FLUSH             ,_param->_nb_front_end,_param->_nb_context[it1],1);
-        DELETE2_SIGNAL(out_RETIRE_EVENT_STOP              ,_param->_nb_front_end,_param->_nb_context[it1],1);
+        DELETE2_SIGNAL(out_RETIRE_RESTORE                 ,_param->_nb_rename_unit,_param->_nb_inst_retire[it1],1);
+        DELETE2_SIGNAL(out_RETIRE_RESTORE_RD_PHY_OLD      ,_param->_nb_rename_unit,_param->_nb_inst_retire[it1],1);
+        DELETE2_SIGNAL(out_RETIRE_RESTORE_RE_PHY_OLD      ,_param->_nb_rename_unit,_param->_nb_inst_retire[it1],1);
+
+        DELETE2_SIGNAL     (out_RETIRE_EVENT_VAL               ,_param->_nb_front_end,_param->_nb_context[it1],1);
+        DELETE2_SIGNAL     ( in_RETIRE_EVENT_ACK               ,_param->_nb_front_end,_param->_nb_context[it1],1);
+        DELETE2_SIGNAL     (out_RETIRE_EVENT_STATE             ,_param->_nb_front_end,_param->_nb_context[it1],_param->_size_event_state);
+//      DELETE2_SIGNAL     (out_RETIRE_EVENT_FLUSH             ,_param->_nb_front_end,_param->_nb_context[it1],1);
+        DELETE2_SIGNAL     (out_RETIRE_EVENT_STOP              ,_param->_nb_front_end,_param->_nb_context[it1],1);
+        DELETE2_SIGNAL_COND(out_RETIRE_EVENT_TYPE              ,_param->_nb_front_end,_param->_nb_context[it1],_param->_size_event_type,_param->_rat_scheme[it1] == RAT_DEPTH_SAVE);
+        DELETE2_SIGNAL_COND(out_RETIRE_EVENT_DEPTH             ,_param->_nb_front_end,_param->_nb_context[it1],_param->_size_depth     ,_param->_rat_scheme[it1] == RAT_DEPTH_SAVE);
 
         DELETE1_SIGNAL( in_COMMIT_VAL               ,_param->_nb_inst_commit,1                             );
@@ -187,7 +192,10 @@
         DELETE2(internal_BANK_COMMIT_ENTRY           ,_param->_nb_bank,_param->_nb_bank_access_commit);
         
-        DELETE1(internal_BANK_RETIRE_VAL             ,_param->_nb_bank);
-        DELETE1(internal_BANK_RETIRE_NUM_RENAME_UNIT ,_param->_nb_bank);
-        DELETE1(internal_BANK_RETIRE_NUM_INST        ,_param->_nb_bank);
+        DELETE1(internal_BANK_RETIRE_VAL               ,_param->_nb_bank);
+        DELETE1(internal_BANK_RETIRE_NUM_RENAME_UNIT   ,_param->_nb_bank);
+        DELETE1(internal_BANK_RETIRE_NUM_INST          ,_param->_nb_bank);
+//      DELETE1(internal_BANK_RETIRE_RESTORE           ,_param->_nb_bank);
+        DELETE1(internal_BANK_RETIRE_RESTORE_RD_PHY_OLD,_param->_nb_bank);
+        DELETE1(internal_BANK_RETIRE_RESTORE_RE_PHY_OLD,_param->_nb_bank);
         
         DELETE1(internal_REEXECUTE_VAL               ,_param->_nb_inst_reexecute);
@@ -200,4 +208,7 @@
         
         DELETE2(internal_RETIRE_EVENT_VAL            ,_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);
         
         // ~~~~~[ Register ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~    
@@ -217,10 +228,12 @@
 
         DELETE2(reg_EVENT_STATE          ,_param->_nb_front_end,_param->_nb_context [it1]);
+        DELETE2(reg_EVENT_TYPE           ,_param->_nb_front_end,_param->_nb_context [it1]);
 //      DELETE2(reg_EVENT_FLUSH          ,_param->_nb_front_end,_param->_nb_context [it1]);
 //      DELETE2(reg_EVENT_STOP           ,_param->_nb_front_end,_param->_nb_context [it1]);
-        DELETE2(reg_EVENT_NUM_BANK       ,_param->_nb_front_end,_param->_nb_context [it1]);
-        DELETE2(reg_EVENT_NUM_PTR        ,_param->_nb_front_end,_param->_nb_context [it1]);
+//      DELETE2(reg_EVENT_NUM_BANK       ,_param->_nb_front_end,_param->_nb_context [it1]);
+//      DELETE2(reg_EVENT_NUM_PTR        ,_param->_nb_front_end,_param->_nb_context [it1]);
 //      DELETE2(reg_EVENT_CAN_RESTART    ,_param->_nb_front_end,_param->_nb_context [it1]);
         DELETE2(reg_EVENT_PACKET         ,_param->_nb_front_end,_param->_nb_context [it1]);
+        DELETE2(reg_EVENT_DEPTH          ,_param->_nb_front_end,_param->_nb_context [it1]);
         DELETE2(reg_EVENT_NB_INST        ,_param->_nb_front_end,_param->_nb_context [it1]);
         DELETE2(reg_EVENT_LAST           ,_param->_nb_front_end,_param->_nb_context [it1]);
@@ -236,4 +249,7 @@
         DELETE2(reg_PC_CURRENT_IS_DS_TAKE,_param->_nb_front_end,_param->_nb_context [it1]);
         DELETE2(reg_PC_NEXT              ,_param->_nb_front_end,_param->_nb_context [it1]);
+
+        DELETE3(rat_gpr_update_table     ,_param->_nb_front_end,_param->_nb_context [it1],_param->_nb_general_register_logic);
+        DELETE3(rat_spr_update_table     ,_param->_nb_front_end,_param->_nb_context [it1],_param->_nb_special_register_logic);
       }
 
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Commit_unit/src/Commit_unit_genMealy_retire.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Commit_unit/src/Commit_unit_genMealy_retire.cpp	(revision 138)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Commit_unit/src/Commit_unit_genMealy_retire.cpp	(revision 139)
@@ -60,4 +60,21 @@
           spr_write_sr_cy     [i][j] = 0; // not necessary
           spr_write_sr_ov     [i][j] = 0; // not necessary
+
+          // Init internal update table
+          
+          // Test if an event occure
+          // bool event = (PORT_READ(in_RETIRE_EVENT_STATE [i][j]) != EVENT_STATE_NO_EVENT);
+          bool reset_update_table = (commit_event_state_to_event_state(reg_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]);
         }
 
@@ -116,5 +133,7 @@
                         )
                       {
+                        Tcontrol_t         write_rd       = entry->write_rd;
                         Tcontrol_t         write_re       = entry->write_re;
+                        Tgeneral_address_t num_reg_rd_log = entry->num_reg_rd_log;
                         Tspecial_address_t num_reg_re_log = entry->num_reg_re_log;
                         
@@ -172,6 +191,32 @@
                           }
                         
-                        internal_BANK_RETIRE_NUM_RENAME_UNIT [num_bank] = x;
-                        internal_BANK_RETIRE_NUM_INST        [num_bank] = y;
+                        // Restore Old Register
+                        Tcontrol_t retire_restore = (commit_event_state_to_event_state(reg_EVENT_STATE[front_end_id][context_id]) != EVENT_STATE_NO_EVENT);
+
+                        // Test if event -> need restore ?
+                        if (retire_restore)
+                          {
+                            log_printf(TRACE,Commit_unit,FUNCTION,"      * Restore");
+                            
+                            // Test and update update table
+                            if (write_rd)
+                              {
+                                internal_BANK_RETIRE_RESTORE_RD_PHY_OLD [num_bank] = (internal_rat_gpr_update_table[front_end_id][context_id][num_reg_rd_log] == 0);
+
+                                internal_rat_gpr_update_table[front_end_id][context_id][num_reg_rd_log] = 1;
+                              }
+                            if (write_re)
+                              {
+                                internal_BANK_RETIRE_RESTORE_RE_PHY_OLD [num_bank] = (internal_rat_spr_update_table[front_end_id][context_id][num_reg_re_log] == 0);
+                                
+                                internal_rat_spr_update_table[front_end_id][context_id][num_reg_re_log] = 1;
+                              }
+
+                            log_printf(TRACE,Commit_unit,FUNCTION,"      * restore_rd_phy_old   : %d",internal_BANK_RETIRE_RESTORE_RD_PHY_OLD [num_bank]);
+                            log_printf(TRACE,Commit_unit,FUNCTION,"      * restore_re_phy_old   : %d",internal_BANK_RETIRE_RESTORE_RE_PHY_OLD [num_bank]);
+                          }
+
+                        internal_BANK_RETIRE_NUM_RENAME_UNIT    [num_bank] = x;
+                        internal_BANK_RETIRE_NUM_INST           [num_bank] = y;
                         
                         if (_param->_have_port_front_end_id)
@@ -199,4 +244,7 @@
                         PORT_WRITE(out_RETIRE_NUM_REG_RE_PHY_OLD    [x][y], entry->num_reg_re_phy_old   );
                         PORT_WRITE(out_RETIRE_NUM_REG_RE_PHY_NEW    [x][y], entry->num_reg_re_phy_new   );
+                        PORT_WRITE(out_RETIRE_RESTORE               [x][y],retire_restore);
+                        PORT_WRITE(out_RETIRE_RESTORE_RD_PHY_OLD    [x][y],internal_BANK_RETIRE_RESTORE_RD_PHY_OLD [num_bank]);
+                        PORT_WRITE(out_RETIRE_RESTORE_RE_PHY_OLD    [x][y],internal_BANK_RETIRE_RESTORE_RE_PHY_OLD [num_bank]);
                         
                         // Event -> rob must be manage this event
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Commit_unit/src/Commit_unit_genMoore.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Commit_unit/src/Commit_unit_genMoore.cpp	(revision 138)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Commit_unit/src/Commit_unit_genMoore.cpp	(revision 139)
@@ -331,4 +331,10 @@
           PORT_WRITE(out_RETIRE_EVENT_STOP  [i][j], ((reg_EVENT_STATE [i][j] == COMMIT_EVENT_STATE_NOT_YET_EVENT) or
                                                      reg_EVENT_NEXT_STOP [i][j]));
+          if (_param->_rat_scheme[i] == RAT_DEPTH_SAVE)
+            {
+          PORT_WRITE(out_RETIRE_EVENT_TYPE  [i][j], reg_EVENT_TYPE  [i][j]);
+          if (_param->_have_port_depth)
+          PORT_WRITE(out_RETIRE_EVENT_DEPTH [i][j], reg_EVENT_DEPTH [i][j]);
+            }
         }
       }
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Commit_unit/src/Commit_unit_transition.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Commit_unit/src/Commit_unit_transition.cpp	(revision 138)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Commit_unit/src/Commit_unit_transition.cpp	(revision 139)
@@ -54,8 +54,9 @@
 //            reg_EVENT_FLUSH           [i][j] = false;
 //            reg_EVENT_STOP            [i][j] = false;
-              reg_EVENT_NUM_BANK        [i][j] = 0; // not necessary
-              reg_EVENT_NUM_PTR         [i][j] = 0; // not necessary
-            //reg_EVENT_CAN_RESTART     [i][j] = 0; // not necessary
+//            reg_EVENT_NUM_BANK        [i][j] = 0; // not necessary
+//            reg_EVENT_NUM_PTR         [i][j] = 0; // not necessary
+//            reg_EVENT_CAN_RESTART     [i][j] = 0; // not necessary
               reg_EVENT_PACKET          [i][j] = 0; // not necessary
+              reg_EVENT_DEPTH           [i][j] = 0; // not necessary
               reg_EVENT_NB_INST         [i][j] = 0;
               reg_EVENT_LAST            [i][j] = false;
@@ -72,4 +73,14 @@
               reg_PC_NEXT               [i][j] = (0x100+4)>>2;
 	    }
+
+        // Resert RAT_UPDATE_TABLE
+	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 k=0; k<_param->_nb_general_register_logic; k++)
+                rat_gpr_update_table       [i][j][k] = false; // not necessary
+	      for (uint32_t k=0; k<_param->_nb_special_register_logic; k++)
+                rat_spr_update_table       [i][j][k] = false; // not necessary
+            }
 
         // Reset priority algorithm
@@ -114,4 +125,10 @@
 //                         else
                           reg_EVENT_STATE [i][j] = COMMIT_EVENT_STATE_WAIT_END; 
+                          
+                          // Reset update_table
+                          for (uint32_t k=0; k<_param->_nb_general_register_logic; k++)
+                            rat_gpr_update_table      [i][j][k] = false;
+                          for (uint32_t k=0; k<_param->_nb_special_register_logic; k++)
+                            rat_spr_update_table      [i][j][k] = false;
                       }
                     
@@ -180,8 +197,11 @@
                         else
                           {
+                            uint32_t next_packet = reg_EVENT_NEXT_PACKET [i][j];
+
                             reg_EVENT_STATE         [i][j] = COMMIT_EVENT_STATE_NOT_YET_EVENT;
 
                             reg_EVENT_NEXT_STOP     [i][j] = false;
-                            reg_EVENT_PACKET        [i][j] = reg_EVENT_NEXT_PACKET [i][j];
+                            reg_EVENT_PACKET        [i][j] = next_packet;
+//                          reg_EVENT_DEPTH         [i][j] = _rob[next_packet].depth;
                             reg_EVENT_NB_INST       [i][j] = reg_NB_INST_COMMIT_ALL [i][j];
                           //reg_EVENT_STOP          [i][j] = true;
@@ -596,4 +616,5 @@
                                 reg_EVENT_STATE         [front_end_id][context_id] = COMMIT_EVENT_STATE_NOT_YET_EVENT;
 
+//                              reg_EVENT_DEPTH         [front_end_id][context_id] = _rob[packet].depth;
                                 reg_EVENT_NB_INST       [front_end_id][context_id] = reg_NB_INST_COMMIT_ALL [front_end_id][context_id];
 
@@ -697,9 +718,7 @@
 #endif
 
-
 #ifdef STATISTICS
-	    if (usage_is_set(_usage,USE_STATISTICS))
-	      (*_stat_nb_inst_retire [x]) ++;
-                
+                if (usage_is_set(_usage,USE_STATISTICS))
+                  (*_stat_nb_inst_retire [x]) ++;
 #endif
                 
@@ -709,4 +728,14 @@
                 entry->state_old = entry->state;
                 entry->state     = ROB_END;
+
+
+                // Update RAT_UPDATE_TABLE
+                Tcontext_t front_end_id = entry->front_end_id;
+                Tcontext_t context_id   = entry->context_id  ;
+
+                if (entry->write_rd and internal_BANK_RETIRE_RESTORE_RD_PHY_OLD [num_bank])
+                  rat_gpr_update_table [front_end_id][context_id][entry->num_reg_rd_log] = true;
+                if (entry->write_re and internal_BANK_RETIRE_RESTORE_RE_PHY_OLD [num_bank])
+                  rat_spr_update_table [front_end_id][context_id][entry->num_reg_re_log] = true;
               }
           }
@@ -771,9 +800,11 @@
 	              {
                           reg_EVENT_STATE         [front_end_id][context_id] = COMMIT_EVENT_STATE_EVENT;
+                          reg_EVENT_TYPE          [front_end_id][context_id] = rob_state_to_event_type(state);
 //                        reg_EVENT_STOP          [front_end_id][context_id] = false; // instruction flow can continue
                           reg_EVENT_LAST          [front_end_id][context_id] = false;
                           // it the head !
                           reg_EVENT_PACKET        [front_end_id][context_id] = packet_id;
-	            
+                          reg_EVENT_DEPTH         [front_end_id][context_id] = entry->depth;
+
 //                           // If event is an load_miss, many instruction can be inserted. 
 //                           // -> new last instruction
@@ -947,6 +978,6 @@
                       // In all case, stop instruction flow
                       reg_EVENT_STATE         [entry->front_end_id][entry->context_id] = COMMIT_EVENT_STATE_NOT_YET_EVENT;
+//                    reg_EVENT_DEPTH         [entry->front_end_id][entry->context_id] = _rob[packet]._depth;
                       reg_EVENT_NB_INST       [entry->front_end_id][entry->context_id] = reg_NB_INST_COMMIT_ALL [entry->front_end_id][entry->context_id];
-                                
 //                    reg_EVENT_STOP          [entry->front_end_id][entry->context_id] = true;
 
@@ -1283,4 +1314,5 @@
 //          log_printf(TRACE,Commit_unit,FUNCTION,"      * EVENT             : %d (bank %d, ptr %d)",((reg_EVENT_NUM_PTR [i][j] << _param->_shift_num_slot) | reg_EVENT_NUM_BANK [i][j]), reg_EVENT_NUM_BANK [i][j],reg_EVENT_NUM_PTR [i][j]);
 //          log_printf(TRACE,Commit_unit,FUNCTION,"      * EVENT_CAN_RESTART : %d",reg_EVENT_CAN_RESTART [i][j]);
+            log_printf(TRACE,Commit_unit,FUNCTION,"      * EVENT_DEPTH       : %d - type %s",reg_EVENT_DEPTH [i][j],toString(reg_EVENT_TYPE [i][j]).c_str());
             log_printf(TRACE,Commit_unit,FUNCTION,"      * EVENT_LAST        : %d - packet %d - ptr %d (bank %d, ptr %d)",reg_EVENT_LAST [i][j],reg_EVENT_PACKET[i][j],((reg_EVENT_LAST_NUM_PTR [i][j] << _param->_shift_num_slot) | reg_EVENT_LAST_NUM_BANK [i][j]), reg_EVENT_LAST_NUM_BANK [i][j],reg_EVENT_LAST_NUM_PTR [i][j]);
             log_printf(TRACE,Commit_unit,FUNCTION,"      * EVENT_NEXT        : stop : %d - packet : %d",reg_EVENT_NEXT_STOP  [i][j],reg_EVENT_NEXT_PACKET[i][j]);
@@ -1370,4 +1402,25 @@
         }
 
+      log_printf(TRACE,Commit_unit,FUNCTION,"  * Dump RAT Update Table");
+      for (uint32_t i=0; i<_param->_nb_front_end; ++i)
+        for (uint32_t j=0; j<_param->_nb_context[i]; ++j)
+          {
+            {
+              std::string str = "";
+              for (uint32_t k=0; k<_param->_nb_general_register_logic; k++)
+                str+=toString("%.1d ",rat_gpr_update_table[i][j][k]);
+              
+              log_printf(TRACE,Commit_unit,FUNCTION,"    * GPR [%d][%d] %s",i,j,str.c_str());
+            }
+
+            {
+              std::string str = "";
+              for (uint32_t k=0; k<_param->_nb_special_register_logic; k++)
+                str+=toString("%.1d ",rat_spr_update_table[i][j][k]);
+              
+              log_printf(TRACE,Commit_unit,FUNCTION,"    * GPR [%d][%d] %s",i,j,str.c_str());
+            }
+          }
+
       log_printf(TRACE,Commit_unit,FUNCTION,"    * nb_write_rd   : %d",nb_write_rd);
       log_printf(TRACE,Commit_unit,FUNCTION,"    * nb_write_re   : %d",nb_write_re);
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Commit_unit/src/Parameters.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Commit_unit/src/Parameters.cpp	(revision 138)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Commit_unit/src/Parameters.cpp	(revision 139)
@@ -22,15 +22,15 @@
 #define FUNCTION "Commit_unit::Parameters"
   Parameters::Parameters (uint32_t             nb_front_end                       ,
-			  uint32_t           * nb_context                         ,
-			  uint32_t             nb_rename_unit                     ,
-			  uint32_t             size_queue                         ,
-			  uint32_t             nb_bank                            ,
-                          Tretire_ooo_scheme_t retire_ooo_scheme                  ,
-			  uint32_t           * nb_inst_insert                     ,
-			  uint32_t           * nb_inst_retire                     ,
-			  uint32_t             nb_inst_commit                     ,
-			  uint32_t             nb_inst_reexecute                  ,
-			  uint32_t             nb_inst_branch_complete            ,
-			  uint32_t          ** nb_branch_speculated               ,
+			  uint32_t           * nb_context                         ,//[nb_front_end]            
+			  uint32_t             nb_rename_unit                     ,                            
+			  uint32_t             size_queue                         ,                            
+			  uint32_t             nb_bank                            ,                            
+                          Tretire_ooo_scheme_t retire_ooo_scheme                  ,                            
+			  uint32_t           * nb_inst_insert                     ,//[nb_rename_unit]          
+			  uint32_t           * nb_inst_retire                     ,//[nb_rename_unit]
+			  uint32_t             nb_inst_commit                     ,                            
+			  uint32_t             nb_inst_reexecute                  ,                            
+			  uint32_t             nb_inst_branch_complete            ,                            
+			  uint32_t          ** nb_branch_speculated               ,//[nb_front_end][nb_context]
                           uint32_t             size_nb_inst_decod                 ,
 			  uint32_t             size_general_data                  ,
@@ -39,9 +39,10 @@
 			  uint32_t             size_general_register              ,
 			  uint32_t             size_special_register              ,
+			  Trat_scheme_t      * rat_scheme                         ,//[nb_front_end]
 			  Tpriority_t          priority                           ,
 			  Tload_balancing_t    load_balancing                     ,
 			  uint32_t             nb_rename_unit_select              ,
                           uint32_t             nb_thread                          ,
-                          uint32_t          ** translate_num_context_to_num_thread,
+                          uint32_t          ** translate_num_context_to_num_thread,//[nb_front_end][nb_context]
                           bool                 is_toplevel):
     _nb_bank_access_commit (1              )
@@ -61,4 +62,5 @@
     _nb_inst_branch_complete             = nb_inst_branch_complete            ;
     _nb_branch_speculated                = nb_branch_speculated               ;
+    _rat_scheme                          = rat_scheme                         ;
     _priority                            = priority                           ;
     _load_balancing                      = load_balancing                     ;
