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 133)
+++ 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
