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 122)
+++ 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;
+            }
+          }
       }
 
