Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Update_Prediction_Table/SelfTest/src/test.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Update_Prediction_Table/SelfTest/src/test.cpp	(revision 111)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Update_Prediction_Table/SelfTest/src/test.cpp	(revision 112)
@@ -126,4 +126,5 @@
   ALLOC1_SC_SIGNAL(out_UPDATE_MISS_PREDICTION         ,"out_UPDATE_MISS_PREDICTION         ",Tcontrol_t         ,_param->_nb_inst_update);
   ALLOC1_SC_SIGNAL(out_UPDATE_DIRECTION_GOOD          ,"out_UPDATE_DIRECTION_GOOD          ",Tcontrol_t         ,_param->_nb_inst_update);
+  ALLOC1_SC_SIGNAL(out_UPDATE_PREDICTION_IFETCH       ,"out_UPDATE_PREDICTION_IFETCH       ",Tcontrol_t         ,_param->_nb_inst_update);
   ALLOC1_SC_SIGNAL(out_UPDATE_BTB_VAL                 ,"out_UPDATE_BTB_VAL                 ",Tcontrol_t         ,_param->_nb_inst_update);
   ALLOC1_SC_SIGNAL(out_UPDATE_BTB_ADDRESS_SRC         ,"out_UPDATE_BTB_ADDRESS_SRC         ",Taddress_t         ,_param->_nb_inst_update);
@@ -137,5 +138,4 @@
   ALLOC1_SC_SIGNAL(out_UPDATE_RAS_ADDRESS             ,"out_UPDATE_RAS_ADDRESS             ",Taddress_t         ,_param->_nb_inst_update);
   ALLOC1_SC_SIGNAL(out_UPDATE_RAS_INDEX               ,"out_UPDATE_RAS_INDEX               ",Tptr_t             ,_param->_nb_inst_update);
-  ALLOC1_SC_SIGNAL(out_UPDATE_RAS_PREDICTION_IFETCH   ,"out_UPDATE_RAS_PREDICTION_IFETCH   ",Tcontrol_t         ,_param->_nb_inst_update);
 
   ALLOC1_SC_SIGNAL( in_EVENT_VAL                      ," in_EVENT_VAL                      ",Tcontrol_t         ,_param->_nb_context);
@@ -223,4 +223,5 @@
   INSTANCE1_SC_SIGNAL(_Update_Prediction_Table,out_UPDATE_MISS_PREDICTION         ,_param->_nb_inst_update);
   INSTANCE1_SC_SIGNAL(_Update_Prediction_Table,out_UPDATE_DIRECTION_GOOD          ,_param->_nb_inst_update);
+  INSTANCE1_SC_SIGNAL(_Update_Prediction_Table,out_UPDATE_PREDICTION_IFETCH       ,_param->_nb_inst_update);
   INSTANCE1_SC_SIGNAL(_Update_Prediction_Table,out_UPDATE_BTB_VAL                 ,_param->_nb_inst_update);
   INSTANCE1_SC_SIGNAL(_Update_Prediction_Table,out_UPDATE_BTB_ADDRESS_SRC         ,_param->_nb_inst_update);
@@ -235,5 +236,4 @@
   INSTANCE1_SC_SIGNAL(_Update_Prediction_Table,out_UPDATE_RAS_ADDRESS             ,_param->_nb_inst_update);
   INSTANCE1_SC_SIGNAL(_Update_Prediction_Table,out_UPDATE_RAS_INDEX               ,_param->_nb_inst_update);
-  INSTANCE1_SC_SIGNAL(_Update_Prediction_Table,out_UPDATE_RAS_PREDICTION_IFETCH   ,_param->_nb_inst_update);
   INSTANCE1_SC_SIGNAL(_Update_Prediction_Table, in_EVENT_VAL                      ,_param->_nb_context);
   INSTANCE1_SC_SIGNAL(_Update_Prediction_Table,out_EVENT_ACK                      ,_param->_nb_context);
@@ -575,4 +575,5 @@
                       TEST(Tcontrol_t         ,out_UPDATE_MISS_PREDICTION       [port]->read(),it_upt->miss_commit);
                       TEST(Tcontrol_t         ,out_UPDATE_DIRECTION_GOOD        [port]->read(),it_upt->take_good);
+                      TEST(Tcontrol_t         ,out_UPDATE_PREDICTION_IFETCH     [port]->read(),not it_upt->miss_ifetch);
                       TEST(Tcontrol_t         ,out_UPDATE_BTB_VAL               [port]->read(),update_btb(it_upt->condition));
                       if (update_btb(it_upt->condition))
@@ -593,5 +594,4 @@
                       TEST(Taddress_t         ,out_UPDATE_RAS_ADDRESS           [port]->read(),it_upt->ras_address);
                       TEST(Tptr_t             ,out_UPDATE_RAS_INDEX             [port]->read(),it_upt->ras_index);
-                      TEST(Tcontrol_t         ,out_UPDATE_RAS_PREDICTION_IFETCH [port]->read(),not it_upt->miss_ifetch);
                         }
                       ++ it_upt;
@@ -906,5 +906,5 @@
                       TEST(Taddress_t         ,out_UPDATE_RAS_ADDRESS           [port]->read(),it_upt->ras_address);
                       TEST(Tptr_t             ,out_UPDATE_RAS_INDEX             [port]->read(),it_upt->ras_index);
-                      TEST(Tcontrol_t         ,out_UPDATE_RAS_PREDICTION_IFETCH [port]->read(),not it_upt->miss_ifetch);
+                      TEST(Tcontrol_t         ,out_UPDATE_PREDICTION_IFETCH     [port]->read(),not it_upt->miss_ifetch);
                         }
                       ++ it_upt;
@@ -1281,5 +1281,5 @@
                       TEST(Taddress_t         ,out_UPDATE_RAS_ADDRESS           [port]->read(),it_ufpt->ras_address);
                       TEST(Tptr_t             ,out_UPDATE_RAS_INDEX             [port]->read(),it_ufpt->ras_index);
-                      TEST(Tcontrol_t         ,out_UPDATE_RAS_PREDICTION_IFETCH [port]->read(),not it_ufpt->miss_ifetch);
+                      TEST(Tcontrol_t         ,out_UPDATE_PREDICTION_IFETCH     [port]->read(),not it_ufpt->miss_ifetch);
                         }
 		    }
@@ -1353,5 +1353,5 @@
                       TEST(Taddress_t         ,out_UPDATE_RAS_ADDRESS           [port]->read(),it_upt->ras_address);
                       TEST(Tptr_t             ,out_UPDATE_RAS_INDEX             [port]->read(),it_upt->ras_index);
-                      TEST(Tcontrol_t         ,out_UPDATE_RAS_PREDICTION_IFETCH [port]->read(),not it_upt->miss_ifetch);
+                      TEST(Tcontrol_t         ,out_UPDATE_PREDICTION_IFETCH     [port]->read(),not it_upt->miss_ifetch);
                         }
                       ++ it_upt;
@@ -1888,5 +1888,5 @@
                               TEST(Taddress_t         ,out_UPDATE_RAS_ADDRESS           [port]->read(),it_ufpt->ras_address);
                               TEST(Tptr_t             ,out_UPDATE_RAS_INDEX             [port]->read(),it_ufpt->ras_index);
-                              TEST(Tcontrol_t         ,out_UPDATE_RAS_PREDICTION_IFETCH [port]->read(),not it_ufpt->miss_ifetch);
+                              TEST(Tcontrol_t         ,out_UPDATE_PREDICTION_IFETCH     [port]->read(),not it_ufpt->miss_ifetch);
                             }
                         }
@@ -1976,5 +1976,5 @@
                         TEST(Taddress_t         ,out_UPDATE_RAS_ADDRESS           [port]->read(),it_upt->ras_address);
                         TEST(Tptr_t             ,out_UPDATE_RAS_INDEX             [port]->read(),it_upt->ras_index);
-                        TEST(Tcontrol_t         ,out_UPDATE_RAS_PREDICTION_IFETCH [port]->read(),not it_upt->miss_ifetch);
+                        TEST(Tcontrol_t         ,out_UPDATE_PREDICTION_IFETCH     [port]->read(),not it_upt->miss_ifetch);
                           }
 
@@ -2103,5 +2103,5 @@
                         TEST(Taddress_t         ,out_UPDATE_RAS_ADDRESS           [port]->read(),it_upt->ras_address);
                         TEST(Tptr_t             ,out_UPDATE_RAS_INDEX             [port]->read(),it_upt->ras_index);
-                        TEST(Tcontrol_t         ,out_UPDATE_RAS_PREDICTION_IFETCH [port]->read(),not it_upt->miss_ifetch);
+                        TEST(Tcontrol_t         ,out_UPDATE_PREDICTION_IFETCH     [port]->read(),not it_upt->miss_ifetch);
                           }
 
@@ -2544,5 +2544,5 @@
                               TEST(Taddress_t         ,out_UPDATE_RAS_ADDRESS           [port]->read(),it_ufpt->ras_address);
                               TEST(Tptr_t             ,out_UPDATE_RAS_INDEX             [port]->read(),it_ufpt->ras_index);
-                              TEST(Tcontrol_t         ,out_UPDATE_RAS_PREDICTION_IFETCH [port]->read(),not it_ufpt->miss_ifetch);
+                              TEST(Tcontrol_t         ,out_UPDATE_PREDICTION_IFETCH     [port]->read(),not it_ufpt->miss_ifetch);
                             }
                         }
@@ -2637,5 +2637,5 @@
                         TEST(Taddress_t         ,out_UPDATE_RAS_ADDRESS           [port]->read(),it_upt->ras_address);
                         TEST(Tptr_t             ,out_UPDATE_RAS_INDEX             [port]->read(),it_upt->ras_index);
-                        TEST(Tcontrol_t         ,out_UPDATE_RAS_PREDICTION_IFETCH [port]->read(),not it_upt->miss_ifetch);
+                        TEST(Tcontrol_t         ,out_UPDATE_PREDICTION_IFETCH     [port]->read(),not it_upt->miss_ifetch);
                           }
 //                         -- it_upt;
@@ -2763,5 +2763,5 @@
                         TEST(Taddress_t         ,out_UPDATE_RAS_ADDRESS           [port]->read(),it_upt->ras_address);
                         TEST(Tptr_t             ,out_UPDATE_RAS_INDEX             [port]->read(),it_upt->ras_index);
-                        TEST(Tcontrol_t         ,out_UPDATE_RAS_PREDICTION_IFETCH [port]->read(),not it_upt->miss_ifetch);
+                        TEST(Tcontrol_t         ,out_UPDATE_PREDICTION_IFETCH     [port]->read(),not it_upt->miss_ifetch);
                           }
 
@@ -2870,4 +2870,5 @@
   delete [] out_UPDATE_MISS_PREDICTION      ;
   delete [] out_UPDATE_DIRECTION_GOOD       ;
+  delete [] out_UPDATE_PREDICTION_IFETCH    ;
   delete [] out_UPDATE_BTB_VAL              ;
   delete [] out_UPDATE_BTB_ADDRESS_SRC      ;
@@ -2881,5 +2882,4 @@
   delete [] out_UPDATE_RAS_ADDRESS          ;
   delete [] out_UPDATE_RAS_INDEX            ;
-  delete [] out_UPDATE_RAS_PREDICTION_IFETCH;
 
   DELETE1_SC_SIGNAL( in_EVENT_VAL                      ,_param->_nb_context);
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Update_Prediction_Table/include/Types.h
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Update_Prediction_Table/include/Types.h	(revision 111)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Update_Prediction_Table/include/Types.h	(revision 112)
@@ -88,5 +88,7 @@
   public : Tcontrol_t          _ifetch_prediction; // not in ufpt
 
+    // to branchement_log_file
   public : bool                _retire_ok        ;
+  public : bool                _miss_prediction  ;
   };
 
@@ -115,5 +117,5 @@
 #define pop_ras(cond)     ((cond == BRANCH_CONDITION_READ_STACK                    ))
 
-#define need_update(cond) update_ras(cond)
+#define need_update(cond) (update_ras(cond) or update_dir(cond))
 
 }; // end namespace update_prediction_table
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Update_Prediction_Table/include/Update_Prediction_Table.h
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Update_Prediction_Table/include/Update_Prediction_Table.h	(revision 111)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Update_Prediction_Table/include/Update_Prediction_Table.h	(revision 112)
@@ -130,4 +130,5 @@
   public    : SC_OUT(Tcontrol_t         )  ** out_UPDATE_MISS_PREDICTION         ; //[nb_inst_update]
   public    : SC_OUT(Tcontrol_t         )  ** out_UPDATE_DIRECTION_GOOD          ; //[nb_inst_update]
+  public    : SC_OUT(Tcontrol_t         )  ** out_UPDATE_PREDICTION_IFETCH       ; //[nb_inst_update]
   public    : SC_OUT(Tcontrol_t         )  ** out_UPDATE_BTB_VAL                 ; //[nb_inst_update]
   public    : SC_OUT(Taddress_t         )  ** out_UPDATE_BTB_ADDRESS_SRC         ; //[nb_inst_update]
@@ -141,5 +142,4 @@
   public    : SC_OUT(Taddress_t         )  ** out_UPDATE_RAS_ADDRESS             ; //[nb_inst_update]
   public    : SC_OUT(Tptr_t             )  ** out_UPDATE_RAS_INDEX               ; //[nb_inst_update]
-  public    : SC_OUT(Tcontrol_t         )  ** out_UPDATE_RAS_PREDICTION_IFETCH   ; //[nb_inst_update]
 
     // ~~~~~[ Interface : "event" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -183,7 +183,8 @@
   private   : bool                          * reg_EVENT_VAL                      ; //[nb_context]
   private   : uint32_t                      * reg_EVENT_UPT_PTR                  ; //[nb_context]
+  private   : bool                          * reg_EVENT_UPT_FULL                 ; //[nb_context]
 
   private   : event_state_t                 * reg_EVENT_STATE                    ; //[nb_context]
-  private   : event_source_t                * reg_EVENT_SOURCE                   ; //[nb_context]
+  private   : bool                          * reg_EVENT_IS_BRANCH                ; //[nb_context]
   private   : Tdepth_t                      * reg_EVENT_DEPTH                    ; //[nb_context]
   private   : Taddress_t                    * reg_EVENT_ADDRESS_SRC              ; //[nb_context] // Address branch
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Update_Prediction_Table/src/Update_Prediction_Table_allocation.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Update_Prediction_Table/src/Update_Prediction_Table_allocation.cpp	(revision 111)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Update_Prediction_Table/src/Update_Prediction_Table_allocation.cpp	(revision 112)
@@ -48,5 +48,5 @@
 							 ,IN
 							 ,SOUTH,
-							 "Generalist interface"
+							 _("Generalist interface")
 #endif
 							 );
@@ -58,5 +58,5 @@
     // ~~~~~[ Interface : "predict" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     {
-      ALLOC1_INTERFACE("predict", IN,SOUTH, "predict", _param->_nb_inst_predict);
+      ALLOC1_INTERFACE_BEGIN("predict", IN,SOUTH, _("predict"), _param->_nb_inst_predict);
       
       ALLOC1_VALACK_IN ( in_PREDICT_VAL                 ,VAL);
@@ -72,9 +72,11 @@
       ALLOC1_SIGNAL_IN ( in_PREDICT_RAS_ADDRESS         ,"ras_address"         ,Taddress_t         ,_param->_size_instruction_address);
       ALLOC1_SIGNAL_IN ( in_PREDICT_RAS_INDEX           ,"ras_index"           ,Tptr_t             ,_param->_max_size_ras_index);
+
+      ALLOC1_INTERFACE_END(_param->_nb_inst_predict);
     }
 
     // ~~~~~[ Interface : "decod" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     {
-      ALLOC1_INTERFACE("decod", IN,SOUTH, "decod", _param->_nb_inst_decod);
+      ALLOC1_INTERFACE_BEGIN("decod", IN,SOUTH, _("decod"), _param->_nb_inst_decod);
 
       ALLOC1_VALACK_IN ( in_DECOD_VAL                 ,VAL);
@@ -93,9 +95,11 @@
       ALLOC1_SIGNAL_IN ( in_DECOD_IS_ACCURATE         ,"is_accurate"         ,Tcontrol_t         ,1);
       ALLOC1_SIGNAL_OUT(out_DECOD_CAN_CONTINUE        ,"can_continue"        ,Tcontrol_t         ,1);
+
+      ALLOC1_INTERFACE_END(_param->_nb_inst_decod);
     }
 
     // ~~~~~[ Interface : "branch_complete" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     {
-      ALLOC1_INTERFACE("branch_complete", IN,SOUTH, "branch_complete", _param->_nb_inst_branch_complete);
+      ALLOC1_INTERFACE_BEGIN("branch_complete", IN,SOUTH, _("branch_complete"), _param->_nb_inst_branch_complete);
       
       ALLOC1_VALACK_IN ( in_BRANCH_COMPLETE_VAL            ,VAL);
@@ -109,9 +113,11 @@
 //       ALLOC1_SIGNAL_OUT(out_BRANCH_COMPLETE_ADDRESS_SRC    ,"address_src"    ,Taddress_t,_param->_size_instruction_address);
 //       ALLOC1_SIGNAL_OUT(out_BRANCH_COMPLETE_ADDRESS_DEST   ,"address_dest"   ,Taddress_t,_param->_size_instruction_address);
+
+      ALLOC1_INTERFACE_END(_param->_nb_inst_branch_complete);
     }
 
     // ~~~~~[ Interface : "branch_event" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     {
-      ALLOC1_INTERFACE("branch_event", IN,SOUTH, "branch_event", _param->_nb_context);
+      ALLOC1_INTERFACE_BEGIN("branch_event", IN,SOUTH, _("branch_event"), _param->_nb_context);
       
       ALLOC1_VALACK_OUT(out_BRANCH_EVENT_VAL              ,VAL);
@@ -123,9 +129,11 @@
       ALLOC1_SIGNAL_OUT(out_BRANCH_EVENT_ADDRESS_DEST_VAL ,"address_dest_val",Tcontrol_t,1);
       ALLOC1_SIGNAL_OUT(out_BRANCH_EVENT_ADDRESS_DEST     ,"address_dest"    ,Taddress_t,_param->_size_instruction_address);
+
+      ALLOC1_INTERFACE_END(_param->_nb_context);
     }
 
     // ~~~~~[ Interface : "update" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     {
-      ALLOC1_INTERFACE("update",OUT,SOUTH, "update", _param->_nb_inst_update);
+      ALLOC1_INTERFACE_BEGIN("update",OUT,SOUTH, "update", _param->_nb_inst_update);
 
       ALLOC1_VALACK_OUT(out_UPDATE_VAL                  ,VAL);
@@ -134,4 +142,5 @@
       ALLOC1_SIGNAL_OUT(out_UPDATE_MISS_PREDICTION      ,"miss_prediction"      ,Tcontrol_t         ,1);
       ALLOC1_SIGNAL_OUT(out_UPDATE_DIRECTION_GOOD       ,"direction_good"       ,Tcontrol_t         ,1);
+      ALLOC1_SIGNAL_OUT(out_UPDATE_PREDICTION_IFETCH    ,"prediction_ifetch"    ,Tcontrol_t         ,1);
       ALLOC1_SIGNAL_OUT(out_UPDATE_BTB_VAL              ,"btb_val"              ,Tcontrol_t         ,1);
       ALLOC1_SIGNAL_OUT(out_UPDATE_BTB_ADDRESS_SRC      ,"btb_address_src"      ,Taddress_t         ,_param->_size_instruction_address);
@@ -145,10 +154,11 @@
       ALLOC1_SIGNAL_OUT(out_UPDATE_RAS_ADDRESS          ,"ras_address"          ,Taddress_t         ,_param->_size_instruction_address);
       ALLOC1_SIGNAL_OUT(out_UPDATE_RAS_INDEX            ,"ras_index"            ,Tptr_t             ,_param->_max_size_ras_index);
-      ALLOC1_SIGNAL_OUT(out_UPDATE_RAS_PREDICTION_IFETCH,"ras_prediction_ifetch",Tcontrol_t         ,1);
+      
+      ALLOC1_INTERFACE_END(_param->_nb_inst_update);
     }
 
     // ~~~~~[ Interface : "event" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     {
-      ALLOC1_INTERFACE("event", IN,SOUTH,"event", _param->_nb_context);
+      ALLOC1_INTERFACE_BEGIN("event", IN,SOUTH,_("event"), _param->_nb_context);
 
       ALLOC1_VALACK_IN ( in_EVENT_VAL    ,VAL);
@@ -156,9 +166,12 @@
       ALLOC1_SIGNAL_IN ( in_EVENT_TYPE   ,"type" ,Tevent_type_t ,_param->_size_event_type );
       ALLOC1_SIGNAL_IN ( in_EVENT_DEPTH  ,"depth",Tdepth_t      ,_param->_size_depth      );
+
+      ALLOC1_INTERFACE_END(_param->_nb_context);
     }
 
     // ~~~~~[ Interface : "depth" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     {
-      ALLOC1_INTERFACE("depth",OUT,SOUTH, "depth", _param->_nb_context);
+      ALLOC1_INTERFACE_BEGIN("depth",OUT,SOUTH, _("depth"), _param->_nb_context);
+
       ALLOC1_SIGNAL_OUT(out_DEPTH_VAL    ,"VAL"    ,Tcontrol_t,1);
       ALLOC1_SIGNAL_OUT(out_DEPTH_CURRENT,"CURRENT",Tdepth_t  ,_param->_size_depth);
@@ -166,4 +179,6 @@
       ALLOC1_SIGNAL_OUT(out_DEPTH_MAX    ,"MAX"    ,Tdepth_t  ,_param->_size_depth);
       ALLOC1_SIGNAL_OUT(out_DEPTH_FULL   ,"FULL"   ,Tcontrol_t,1);
+
+      ALLOC1_INTERFACE_END(_param->_nb_context);
     }
 
@@ -209,7 +224,8 @@
     ALLOC1(reg_EVENT_VAL                    ,bool         ,_param->_nb_context);
     ALLOC1(reg_EVENT_UPT_PTR                ,uint32_t     ,_param->_nb_context);
+    ALLOC1(reg_EVENT_UPT_FULL               ,bool         ,_param->_nb_context);
 
     ALLOC1(reg_EVENT_STATE                  ,event_state_t ,_param->_nb_context);
-    ALLOC1(reg_EVENT_SOURCE                 ,event_source_t,_param->_nb_context);
+    ALLOC1(reg_EVENT_IS_BRANCH              ,bool          ,_param->_nb_context);
     ALLOC1(reg_EVENT_DEPTH                  ,Tdepth_t      ,_param->_nb_context);
     ALLOC1(reg_EVENT_ADDRESS_SRC            ,Taddress_t    ,_param->_nb_context);
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Update_Prediction_Table/src/Update_Prediction_Table_deallocation.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Update_Prediction_Table/src/Update_Prediction_Table_deallocation.cpp	(revision 111)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Update_Prediction_Table/src/Update_Prediction_Table_deallocation.cpp	(revision 112)
@@ -29,54 +29,46 @@
 	delete    in_NRESET;
 
-	// ~~~~~[ Interface : "predict" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-	delete []  in_PREDICT_VAL                 ;
-	delete [] out_PREDICT_ACK                 ;
-	if (_param->_have_port_context_id)
-	delete []  in_PREDICT_CONTEXT_ID          ;
-	delete []  in_PREDICT_BTB_ADDRESS_SRC     ;
-	delete []  in_PREDICT_BTB_ADDRESS_DEST    ;
-	delete []  in_PREDICT_BTB_CONDITION       ;
-	delete []  in_PREDICT_BTB_LAST_TAKE       ;
-	delete []  in_PREDICT_BTB_IS_ACCURATE     ;
-	if (_param->_have_port_history)
-	delete []  in_PREDICT_DIR_HISTORY         ;
-	delete []  in_PREDICT_RAS_ADDRESS         ;
-	delete []  in_PREDICT_RAS_INDEX           ;
- 	if (_param->_have_port_depth)
- 	delete [] out_PREDICT_UPDATE_PREDICTION_ID;
-	
-	// ~~~~~[ Interface : "decod" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-	delete []  in_DECOD_VAL                   ;
-	delete [] out_DECOD_ACK                   ;
-	if (_param->_have_port_context_id)
-	delete []  in_DECOD_CONTEXT_ID            ;
-	delete []  in_DECOD_BTB_ADDRESS_SRC       ;
-	delete []  in_DECOD_BTB_ADDRESS_DEST      ;
-	delete []  in_DECOD_BTB_CONDITION         ;
-	delete []  in_DECOD_BTB_LAST_TAKE         ;
-	delete []  in_DECOD_RAS_ADDRESS           ;
-	delete []  in_DECOD_RAS_INDEX             ;
-	delete []  in_DECOD_MISS_IFETCH           ;
-	delete []  in_DECOD_MISS_DECOD            ;
-	if (_param->_have_port_depth)
-	delete []  in_DECOD_UPDATE_PREDICTION_ID  ;
-// 	if (_param->_have_port_depth)
-// 	delete [] out_DECOD_DEPTH                 ;
-	delete []  in_DECOD_IS_ACCURATE           ;
-	delete [] out_DECOD_CAN_CONTINUE          ;
-	
-	// ~~~~~[ Interface : "branch_complete" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-	delete []  in_BRANCH_COMPLETE_VAL            ;
-	delete [] out_BRANCH_COMPLETE_ACK            ;
-	if (_param->_have_port_context_id)
-	delete []  in_BRANCH_COMPLETE_CONTEXT_ID     ;
-	if (_param->_have_port_depth)
-	delete []  in_BRANCH_COMPLETE_DEPTH          ;
-	delete []  in_BRANCH_COMPLETE_ADDRESS        ;
-	delete []  in_BRANCH_COMPLETE_NO_SEQUENCE    ;
-	delete [] out_BRANCH_COMPLETE_MISS_PREDICTION;
-// 	delete [] out_BRANCH_COMPLETE_TAKE           ;
-// 	delete [] out_BRANCH_COMPLETE_ADDRESS_SRC    ;
-// 	delete [] out_BRANCH_COMPLETE_ADDRESS_DEST   ;
+        // ~~~~~[ Interface : "predict" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+        DELETE1_SIGNAL( in_PREDICT_VAL                 ,_param->_nb_inst_predict,1);
+        DELETE1_SIGNAL(out_PREDICT_ACK                 ,_param->_nb_inst_predict,1);
+        DELETE1_SIGNAL( in_PREDICT_CONTEXT_ID          ,_param->_nb_inst_predict,_param->_size_context_id);
+        DELETE1_SIGNAL(out_PREDICT_UPDATE_PREDICTION_ID,_param->_nb_inst_predict,_param->_size_depth);
+        DELETE1_SIGNAL( in_PREDICT_BTB_ADDRESS_SRC     ,_param->_nb_inst_predict,_param->_size_instruction_address);
+        DELETE1_SIGNAL( in_PREDICT_BTB_ADDRESS_DEST    ,_param->_nb_inst_predict,_param->_size_instruction_address);
+        DELETE1_SIGNAL( in_PREDICT_BTB_CONDITION       ,_param->_nb_inst_predict,_param->_size_branch_condition);
+        DELETE1_SIGNAL( in_PREDICT_BTB_LAST_TAKE       ,_param->_nb_inst_predict,1);
+        DELETE1_SIGNAL( in_PREDICT_BTB_IS_ACCURATE     ,_param->_nb_inst_predict,1);
+        DELETE1_SIGNAL( in_PREDICT_DIR_HISTORY         ,_param->_nb_inst_predict,_param->_size_history);
+        DELETE1_SIGNAL( in_PREDICT_RAS_ADDRESS         ,_param->_nb_inst_predict,_param->_size_instruction_address);
+        DELETE1_SIGNAL( in_PREDICT_RAS_INDEX           ,_param->_nb_inst_predict,_param->_max_size_ras_index);
+
+        // ~~~~~[ Interface : "decod" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+        DELETE1_SIGNAL( in_DECOD_VAL                 ,_param->_nb_inst_decod,1);
+        DELETE1_SIGNAL(out_DECOD_ACK                 ,_param->_nb_inst_decod,1);
+        DELETE1_SIGNAL( in_DECOD_CONTEXT_ID          ,_param->_nb_inst_decod,_param->_size_context_id);
+        DELETE1_SIGNAL( in_DECOD_BTB_ADDRESS_SRC     ,_param->_nb_inst_decod,_param->_size_instruction_address);
+        DELETE1_SIGNAL( in_DECOD_BTB_ADDRESS_DEST    ,_param->_nb_inst_decod,_param->_size_instruction_address);
+        DELETE1_SIGNAL( in_DECOD_BTB_CONDITION       ,_param->_nb_inst_decod,_param->_size_branch_condition);
+        DELETE1_SIGNAL( in_DECOD_BTB_LAST_TAKE       ,_param->_nb_inst_decod,1);
+        DELETE1_SIGNAL( in_DECOD_RAS_ADDRESS         ,_param->_nb_inst_decod,_param->_size_instruction_address);
+        DELETE1_SIGNAL( in_DECOD_RAS_INDEX           ,_param->_nb_inst_decod,_param->_max_size_ras_index);
+        DELETE1_SIGNAL( in_DECOD_MISS_IFETCH         ,_param->_nb_inst_decod,1);
+        DELETE1_SIGNAL( in_DECOD_MISS_DECOD          ,_param->_nb_inst_decod,1);
+        DELETE1_SIGNAL( in_DECOD_UPDATE_PREDICTION_ID,_param->_nb_inst_decod,_param->_size_depth);
+//      DELETE1_SIGNAL(out_DECOD_DEPTH               ,_param->_nb_inst_decod,_param->_size_depth);
+        DELETE1_SIGNAL( in_DECOD_IS_ACCURATE         ,_param->_nb_inst_decod,1);
+        DELETE1_SIGNAL(out_DECOD_CAN_CONTINUE        ,_param->_nb_inst_decod,1);
+
+        // ~~~~~[ Interface : "branch_complete" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+        DELETE1_SIGNAL( in_BRANCH_COMPLETE_VAL            ,_param->_nb_inst_branch_complete,1);
+        DELETE1_SIGNAL(out_BRANCH_COMPLETE_ACK            ,_param->_nb_inst_branch_complete,1);
+        DELETE1_SIGNAL( in_BRANCH_COMPLETE_CONTEXT_ID     ,_param->_nb_inst_branch_complete,_param->_size_context_id);
+        DELETE1_SIGNAL( in_BRANCH_COMPLETE_DEPTH          ,_param->_nb_inst_branch_complete,_param->_size_depth);
+        DELETE1_SIGNAL( in_BRANCH_COMPLETE_ADDRESS        ,_param->_nb_inst_branch_complete,_param->_size_instruction_address);
+        DELETE1_SIGNAL( in_BRANCH_COMPLETE_NO_SEQUENCE    ,_param->_nb_inst_branch_complete,1);
+        DELETE1_SIGNAL(out_BRANCH_COMPLETE_MISS_PREDICTION,_param->_nb_inst_branch_complete,1);
+//      DELETE1_SIGNAL(out_BRANCH_COMPLETE_TAKE           ,_param->_nb_inst_branch_complete,1);
+//      DELETE1_SIGNAL(out_BRANCH_COMPLETE_ADDRESS_SRC    ,_param->_nb_inst_branch_complete,_param->_size_instruction_address);
+//      DELETE1_SIGNAL(out_BRANCH_COMPLETE_ADDRESS_DEST   ,_param->_nb_inst_branch_complete,_param->_size_instruction_address);
 
 	// ~~~~~[ Interface : "branch_event" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -90,24 +82,22 @@
         DELETE1_SIGNAL(out_BRANCH_EVENT_ADDRESS_DEST     ,_param->_nb_context,_param->_size_instruction_address);
 
-	// ~~~~~[ Interface : "update" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-	delete [] out_UPDATE_VAL                  ;
-	delete []  in_UPDATE_ACK                  ;
-	if (_param->_have_port_context_id)
-	delete [] out_UPDATE_CONTEXT_ID           ;
-	delete [] out_UPDATE_MISS_PREDICTION      ;
-	delete [] out_UPDATE_DIRECTION_GOOD       ;
-	delete [] out_UPDATE_BTB_VAL              ;
-	delete [] out_UPDATE_BTB_ADDRESS_SRC      ;
-	delete [] out_UPDATE_BTB_ADDRESS_DEST     ;
-	delete [] out_UPDATE_BTB_CONDITION        ;
-	delete [] out_UPDATE_DIR_VAL              ;
-	if (_param->_have_port_history)
-	delete [] out_UPDATE_DIR_HISTORY          ;
-	delete [] out_UPDATE_RAS_VAL              ;
-	delete [] out_UPDATE_RAS_FLUSH            ;
-	delete [] out_UPDATE_RAS_PUSH             ;
-	delete [] out_UPDATE_RAS_ADDRESS          ;
-	delete [] out_UPDATE_RAS_INDEX            ;
-	delete [] out_UPDATE_RAS_PREDICTION_IFETCH;
+        // ~~~~~[ Interface : "update" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+        DELETE1_SIGNAL(out_UPDATE_VAL                  ,_param->_nb_inst_update,1);
+        DELETE1_SIGNAL( in_UPDATE_ACK                  ,_param->_nb_inst_update,1);
+        DELETE1_SIGNAL(out_UPDATE_CONTEXT_ID           ,_param->_nb_inst_update,_param->_size_context_id);
+        DELETE1_SIGNAL(out_UPDATE_MISS_PREDICTION      ,_param->_nb_inst_update,1);
+        DELETE1_SIGNAL(out_UPDATE_DIRECTION_GOOD       ,_param->_nb_inst_update,1);
+        DELETE1_SIGNAL(out_UPDATE_PREDICTION_IFETCH    ,_param->_nb_inst_update,1);
+        DELETE1_SIGNAL(out_UPDATE_BTB_VAL              ,_param->_nb_inst_update,1);
+        DELETE1_SIGNAL(out_UPDATE_BTB_ADDRESS_SRC      ,_param->_nb_inst_update,_param->_size_instruction_address);
+        DELETE1_SIGNAL(out_UPDATE_BTB_ADDRESS_DEST     ,_param->_nb_inst_update,_param->_size_instruction_address);
+        DELETE1_SIGNAL(out_UPDATE_BTB_CONDITION        ,_param->_nb_inst_update,_param->_size_branch_condition);
+        DELETE1_SIGNAL(out_UPDATE_DIR_VAL              ,_param->_nb_inst_update,1);
+        DELETE1_SIGNAL(out_UPDATE_DIR_HISTORY          ,_param->_nb_inst_update,_param->_size_history);
+        DELETE1_SIGNAL(out_UPDATE_RAS_VAL              ,_param->_nb_inst_update,1);
+        DELETE1_SIGNAL(out_UPDATE_RAS_FLUSH            ,_param->_nb_inst_update,1);
+        DELETE1_SIGNAL(out_UPDATE_RAS_PUSH             ,_param->_nb_inst_update,1);
+        DELETE1_SIGNAL(out_UPDATE_RAS_ADDRESS          ,_param->_nb_inst_update,_param->_size_instruction_address);
+        DELETE1_SIGNAL(out_UPDATE_RAS_INDEX            ,_param->_nb_inst_update,_param->_max_size_ras_index);
 
         // ~~~~~[ Interface : "event" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -162,7 +152,8 @@
         DELETE1(reg_EVENT_VAL                    ,_param->_nb_context);
         DELETE1(reg_EVENT_UPT_PTR                ,_param->_nb_context);
+        DELETE1(reg_EVENT_UPT_FULL               ,_param->_nb_context);
 
         DELETE1(reg_EVENT_STATE                  ,_param->_nb_context);
-        DELETE1(reg_EVENT_SOURCE                 ,_param->_nb_context);
+        DELETE1(reg_EVENT_IS_BRANCH              ,_param->_nb_context);
         DELETE1(reg_EVENT_DEPTH                  ,_param->_nb_context);
         DELETE1(reg_EVENT_ADDRESS_SRC            ,_param->_nb_context);
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Update_Prediction_Table/src/Update_Prediction_Table_genMoore.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Update_Prediction_Table/src/Update_Prediction_Table_genMoore.cpp	(revision 111)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Update_Prediction_Table/src/Update_Prediction_Table_genMoore.cpp	(revision 112)
@@ -98,4 +98,5 @@
         Tcontrol_t          miss_prediction      ;
         Tcontrol_t          direction_good       ;
+        Tcontrol_t          prediction_ifetch    ;
         Tcontrol_t          btb_val              ;
         Taddress_t          btb_address_src      ;
@@ -109,5 +110,4 @@
         Taddress_t          ras_address          ;
         Tptr_t              ras_index            ;
-        Tcontrol_t          ras_prediction_ifetch;
 
         // Test if update fetch prediction table need update port
@@ -133,10 +133,11 @@
                 miss_prediction       = 1;
 //              direction_good        = ;
+                prediction_ifetch     = 1;
                 btb_val               = 0; // don't update btb (is update by the event branch)
-//              btb_address_src       = ;
-//              btb_address_dest      = ;
-//              btb_condition         = ;
-                dir_val               = 0; // don't update btb (is update by the event branch (if conditionnal branch))
-//              dir_history           = ;
+//              btb_address_src       = reg_UPDATE_PREDICTION_TABLE [context][depth]._address_src ;
+//              btb_address_dest      = reg_UPDATE_PREDICTION_TABLE [context][depth]._address_dest;
+//              btb_condition         = condition;
+                dir_val               = update_ras(condition);
+                dir_history           = reg_UPDATE_PREDICTION_TABLE [context][depth]._history;
                 // repop/ repush data -> don't corrupt ras
                 ras_val               = update_ras(condition); 
@@ -145,5 +146,4 @@
                 ras_address           = reg_UPDATE_FETCH_PREDICTION_TABLE [context][depth]._address_ras;
                 ras_index             = reg_UPDATE_FETCH_PREDICTION_TABLE [context][depth]._index_ras;
-                ras_prediction_ifetch = 1;
                 
                 internal_UPDATE_FROM_UFPT [i] = true;
@@ -200,9 +200,11 @@
                 miss_prediction       = (state != UPDATE_PREDICTION_STATE_OK);
                 direction_good        = reg_UPDATE_PREDICTION_TABLE [context][depth]._good_take   ;
+                prediction_ifetch     = ifetch;
                 btb_val               = state_is_ok_ko and update_btb(condition);
                 btb_address_src       = reg_UPDATE_PREDICTION_TABLE [context][depth]._address_src ;
                 btb_address_dest      = reg_UPDATE_PREDICTION_TABLE [context][depth]._address_dest;
                 btb_condition         = condition;
-                dir_val               = state_is_ok_ko and update_dir(condition) and ifetch; // if not ifetch, then static prediction
+                dir_val               = // state_is_ok_ko and 
+                                        update_dir(condition); // if not ifetch, then static prediction
                 dir_history           = reg_UPDATE_PREDICTION_TABLE [context][depth]._history     ;
                 ras_val               = update_ras(condition); // repop/ repush data -> don't corrupt ras
@@ -213,5 +215,4 @@
                 ras_address           = (ras_flush)?(reg_UPDATE_PREDICTION_TABLE [context][depth]._address_src+2):reg_UPDATE_PREDICTION_TABLE [context][depth]._address_ras;
                 ras_index             = reg_UPDATE_PREDICTION_TABLE [context][depth]._index_ras;
-                ras_prediction_ifetch = ifetch;
 
                 internal_UPDATE_FROM_UFPT [i] = false;
@@ -257,4 +258,5 @@
         PORT_WRITE(out_UPDATE_MISS_PREDICTION       [i],miss_prediction      );
         PORT_WRITE(out_UPDATE_DIRECTION_GOOD        [i],direction_good       );
+        PORT_WRITE(out_UPDATE_PREDICTION_IFETCH     [i],prediction_ifetch    );
         PORT_WRITE(out_UPDATE_BTB_VAL               [i],btb_val              );
         PORT_WRITE(out_UPDATE_BTB_ADDRESS_SRC       [i],btb_address_src      );
@@ -269,5 +271,4 @@
         PORT_WRITE(out_UPDATE_RAS_ADDRESS           [i],ras_address          );
         PORT_WRITE(out_UPDATE_RAS_INDEX             [i],ras_index            );
-        PORT_WRITE(out_UPDATE_RAS_PREDICTION_IFETCH [i],ras_prediction_ifetch);
           }
       }
@@ -290,4 +291,17 @@
       }
       }
+    else
+      {
+        for (uint32_t i=0; i<_param->_nb_inst_update; i++)
+          {
+            internal_UPDATE_VAL             [i] = 0;
+            internal_UPDATE_VAL_WITHOUT_ACK [i] = 0;
+          }
+        for (uint32_t i=0; i<_param->_nb_context; i++)
+          {
+            internal_BRANCH_EVENT_VAL       [i] = 0;
+          }
+      }
+
 
     log_end(Update_Prediction_Table,FUNCTION);
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Update_Prediction_Table/src/Update_Prediction_Table_transition.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Update_Prediction_Table/src/Update_Prediction_Table_transition.cpp	(revision 111)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Update_Prediction_Table/src/Update_Prediction_Table_transition.cpp	(revision 112)
@@ -53,4 +53,5 @@
             reg_EVENT_VAL            [i] = false;
             reg_EVENT_STATE          [i] = EVENT_STATE_OK;
+            reg_EVENT_IS_BRANCH      [i] = true;
           }
       }
@@ -100,4 +101,8 @@
               // Test if state is end
 //               if (end_ok or end_ko)
+              
+              log_printf(TRACE,Update_Prediction_Table,FUNCTION,"      * state is STATE_END      : %d",end);
+              log_printf(TRACE,Update_Prediction_Table,FUNCTION,"      * reg_UPT_BOTTOM (before) : %d",reg_UPT_BOTTOM         [i]);
+
               if (end)
                 {
@@ -108,8 +113,12 @@
                       branchement_log_file [num_thread] 
                         << std::hex
-                        << "0x" << reg_UPDATE_PREDICTION_TABLE [i][bottom]._address_src  << " "
-                        << "0x" << reg_UPDATE_PREDICTION_TABLE [i][bottom]._address_dest << " "
+                        << "0x" << reg_UPDATE_PREDICTION_TABLE [i][bottom]._address_src       << " "
+                        << "0x" << reg_UPDATE_PREDICTION_TABLE [i][bottom]._address_dest      << " "
                         << std::dec
-                        <<         reg_UPDATE_PREDICTION_TABLE [i][bottom]._good_take    << " "
+                        <<         reg_UPDATE_PREDICTION_TABLE [i][bottom]._good_take         << " - "
+                        << "["  << sc_simulation_time() << "] " << " "
+                        <<         reg_UPDATE_PREDICTION_TABLE [i][bottom]._miss_prediction   << " "
+                        <<         reg_UPDATE_PREDICTION_TABLE [i][bottom]._ifetch_prediction << " "
+                        << "("  << (uint32_t)reg_UPDATE_PREDICTION_TABLE [i][bottom]._condition         << ")"
                         << std::endl;
                     }
@@ -128,23 +137,38 @@
 //                   if (bottom = reg_UPT_UPDATE [i])
 //                     reg_UPT_UPDATE [i] = reg_UPT_BOTTOM [i];
-
-                  if (reg_EVENT_VAL [i] and (reg_EVENT_UPT_PTR [i] == bottom))
+                }// @@@
+              
+              log_printf(TRACE,Update_Prediction_Table,FUNCTION,"      * reg_UPT_BOTTOM (after ) : %d",reg_UPT_BOTTOM         [i]);
+              log_printf(TRACE,Update_Prediction_Table,FUNCTION,"      * reg_EVENT_VAL           : %d",reg_EVENT_VAL     [i]);
+              log_printf(TRACE,Update_Prediction_Table,FUNCTION,"      * reg_EVENT_UPT_PTR       : %d",reg_EVENT_UPT_PTR [i]);
+              log_printf(TRACE,Update_Prediction_Table,FUNCTION,"      * reg_EVENT_UPT_FULL      : %d",reg_EVENT_UPT_FULL[i]);
+
+              if (reg_EVENT_VAL [i] and (reg_EVENT_UPT_PTR [i] == bottom))
+                {
+                  log_printf(TRACE,Update_Prediction_Table,FUNCTION,"  * END EVENT");
+
+                  if ((reg_EVENT_IS_BRANCH [i] == false) and (reg_EVENT_UPT_FULL [i] == false))
+                    reg_EVENT_STATE[i] = EVENT_STATE_OK;
+
+                  if ((reg_EVENT_IS_BRANCH [i] == true) or (reg_EVENT_UPT_FULL [i] == false))
                     {
-                      log_printf(TRACE,Update_Prediction_Table,FUNCTION,"  * END EVENT");
-                      
-                      reg_EVENT_VAL  [i] = false;
-                      reg_UPT_TOP    [i] = reg_UPT_TOP_EVENT [i];
-                      reg_UPT_UPDATE [i] = reg_UPT_TOP_EVENT [i];
-                      
-                      if (reg_UPT_BOTTOM [i] != reg_UPT_TOP [i])
-                        reg_UPT_EMPTY [i] = false;
-
-                      log_printf(TRACE,Update_Prediction_Table,FUNCTION,"      * reg_UPT_TOP             : %d",reg_UPT_TOP            [i]);
-                      log_printf(TRACE,Update_Prediction_Table,FUNCTION,"      * reg_UPT_TOP_EVENT       : %d",reg_UPT_TOP_EVENT      [i]);
-                      log_printf(TRACE,Update_Prediction_Table,FUNCTION,"      * reg_UPT_UPDATE          : %d",reg_UPT_UPDATE         [i]);
-                      log_printf(TRACE,Update_Prediction_Table,FUNCTION,"      * reg_UPT_EMPTY           : %d",reg_UPT_EMPTY          [i]);
+                  reg_EVENT_VAL       [i] = false;
+//                reg_EVENT_IS_BRANCH [i] = true;
+                  reg_UPT_TOP         [i] = reg_UPT_TOP_EVENT [i];
+                  reg_UPT_UPDATE      [i] = reg_UPT_TOP_EVENT [i];
+                  
+                  if (reg_UPT_BOTTOM [i] != reg_UPT_TOP [i])
+                    reg_UPT_EMPTY [i] = false;
                     }
 
+                  log_printf(TRACE,Update_Prediction_Table,FUNCTION,"      * reg_UPT_TOP             : %d",reg_UPT_TOP            [i]);
+                  log_printf(TRACE,Update_Prediction_Table,FUNCTION,"      * reg_UPT_TOP_EVENT       : %d",reg_UPT_TOP_EVENT      [i]);
+                  log_printf(TRACE,Update_Prediction_Table,FUNCTION,"      * reg_UPT_UPDATE          : %d",reg_UPT_UPDATE         [i]);
+                  log_printf(TRACE,Update_Prediction_Table,FUNCTION,"      * reg_UPT_EMPTY           : %d",reg_UPT_EMPTY          [i]);
+                
                 }
+              
+              if (end)
+                reg_EVENT_UPT_FULL [i] = false;
             }
 	  }
@@ -245,4 +269,5 @@
                       log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * EVENT [%d] <- EVENT_STATE_UPDATE_CONTEXT (decod - miss - no flush ufpt)",context);
                       reg_EVENT_STATE [context] = EVENT_STATE_UPDATE_CONTEXT;
+//                       reg_EVENT_SOURCE[context] = EVENT_SOURCE_UFPT;
                     }
                   else
@@ -251,9 +276,9 @@
                       reg_EVENT_STATE [context] = EVENT_STATE_MISS_FLUSH_UFPT;
                     }
-                  reg_EVENT_SOURCE          [context] = EVENT_SOURCE_UFPT;
 
                   // Flush UPFT
                   flush_UFPT [context] = true;
 
+                  reg_EVENT_IS_BRANCH       [context] = true;
                   reg_EVENT_DEPTH           [context] = upt_ptr_write;
                   reg_EVENT_ADDRESS_SRC     [context] = address_src; // delay_slot is compute in Context_State
@@ -357,5 +382,5 @@
                   (internal_UPDATE_VAL_WITHOUT_ACK [i] and can_continue [context]))
                 {
-                  Tdepth_t   depth     = internal_UPDATE_DEPTH      [i];
+                  Tdepth_t   depth     = internal_UPDATE_DEPTH [i];
                   
                   log_printf(TRACE,Update_Prediction_Table,FUNCTION,"  * UPDATE[%d] - Accepted",i);
@@ -369,13 +394,21 @@
 //                       if (reg_UFPT_UPDATE [context] == reg_UFPT_BOTTOM [context])
                       if ((--reg_UFPT_NB_UPDATE [context])==0)
-                        switch (reg_EVENT_STATE [context])
-                          {
-                          case EVENT_STATE_MISS_FLUSH_UFPT         : reg_EVENT_STATE [context] = EVENT_STATE_UPDATE_CONTEXT; break;
-                            // impossible to have an update on ufpt and reg_upt_update>reg_upt_top
-                          case EVENT_STATE_MISS_FLUSH_UFPT_AND_UPT : reg_EVENT_STATE [context] = EVENT_STATE_MISS_FLUSH_UPT ; break;
-                          case EVENT_STATE_EVENT_FLUSH_UFPT        : reg_EVENT_STATE [context] = EVENT_STATE_OK             ; break;
-                          case EVENT_STATE_EVENT_FLUSH_UFPT_AND_UPT: reg_EVENT_STATE [context] = EVENT_STATE_EVENT_FLUSH_UPT; break;
-                          default : break;
-                          }
+                        {
+                          switch (reg_EVENT_STATE [context])
+                            {
+                            case EVENT_STATE_MISS_FLUSH_UFPT         : 
+                              {
+                                reg_EVENT_STATE [context] = EVENT_STATE_UPDATE_CONTEXT; 
+//                                 reg_EVENT_SOURCE[context] = EVENT_SOURCE_UFPT;
+
+                                break;
+                              }
+                              // impossible to have an update on ufpt and reg_upt_update>reg_upt_top
+                            case EVENT_STATE_MISS_FLUSH_UFPT_AND_UPT : reg_EVENT_STATE [context] = EVENT_STATE_MISS_FLUSH_UPT ; break;
+                            case EVENT_STATE_EVENT_FLUSH_UFPT        : reg_EVENT_STATE [context] = EVENT_STATE_OK             ; break;
+                            case EVENT_STATE_EVENT_FLUSH_UFPT_AND_UPT: reg_EVENT_STATE [context] = EVENT_STATE_EVENT_FLUSH_UPT; break;
+                            default : break;
+                            }
+                        }
                       
                       log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * Update Fetch Prediction Table");
@@ -405,5 +438,7 @@
                     {
                       log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * Update Prediction Table");
-                      
+                      log_printf(TRACE,Update_Prediction_Table,FUNCTION,"      * reg_UPT_UPDATE (before) : %d",reg_UPT_UPDATE [context]);
+                      log_printf(TRACE,Update_Prediction_Table,FUNCTION,"      * reg_EVENT_STATE         : %s",toString(reg_EVENT_STATE [context]).c_str());
+ 
                       // Change state
 #ifdef DEBUG_TEST 
@@ -430,5 +465,8 @@
 
                       if (ok or ko)
-                        reg_UPDATE_PREDICTION_TABLE [context][depth]._retire_ok = true;
+                        {
+                          reg_UPDATE_PREDICTION_TABLE [context][depth]._retire_ok       = true;
+                          reg_UPDATE_PREDICTION_TABLE [context][depth]._miss_prediction = ko;
+                        }
 
                       // Have an update, test the state to transiste to the good state
@@ -444,6 +482,9 @@
                           reg_UPDATE_PREDICTION_TABLE [context][depth]._state = UPDATE_PREDICTION_STATE_END_KO;
 
-                          reg_EVENT_VAL     [context] = true;
-                          reg_EVENT_UPT_PTR [context] = depth;
+                          reg_EVENT_VAL      [context] = true;
+                          reg_EVENT_UPT_PTR  [context] = depth;
+//                        reg_EVENT_UPT_FULL [context] = 0;
+//                        reg_EVENT_UPT_FULL        [i] = (not reg_UPT_EMPTY [i] and (bottom == reg_UPT_TOP [i]));
+
 
 #ifdef STATISTICS
@@ -473,13 +514,18 @@
                       // Update pointer
                       //  * if update RAS : update pointer is decreaste until it equal at top pointer
+                      log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * internal_UPDATE_RAS [%d] : %d",i,internal_UPDATE_RAS [i]);
+                      
                       if (internal_UPDATE_RAS [i])
                         {
                           // if end_event, restart too bottom, else decrease pointer
                           bool end_event  = (reg_UPT_UPDATE [context] == reg_UPT_TOP [context]);
+
+                          log_printf(TRACE,Update_Prediction_Table,FUNCTION,"      * end_event               : %d",end_event);
+                          log_printf(TRACE,Update_Prediction_Table,FUNCTION,"      * bottom                  : %d",reg_UPT_BOTTOM[context]);
                           
-                          reg_UPT_UPDATE [context] = (end_event)?reg_UPT_BOTTOM[context]:(((depth==0)?_param->_size_upt_queue[context]:depth)-1);
                           if (end_event)
                             {
-//                               reg_UPT_UPDATE [context] = reg_UPT_BOTTOM[context];
+                              reg_UPT_UPDATE [context] = (end_event)?reg_UPT_BOTTOM[context]:(((depth==0)?_param->_size_upt_queue[context]:depth)-1);
+//                            reg_UPT_UPDATE [context] = reg_UPT_BOTTOM[context];
 
                               if (reg_EVENT_STATE [context] == EVENT_STATE_EVENT_FLUSH_UPT)
@@ -488,5 +534,8 @@
                                 }
                               else
-                                reg_EVENT_STATE [context] = EVENT_STATE_UPDATE_CONTEXT;
+                                {
+                                  reg_EVENT_STATE [context] = EVENT_STATE_UPDATE_CONTEXT;
+//                                   reg_EVENT_SOURCE[context] = EVENT_SOURCE_UPT;
+                                }
                             }
                           else
@@ -497,4 +546,6 @@
                       else
                         {
+                          log_printf(TRACE,Update_Prediction_Table,FUNCTION,"      * next update");
+                          
                           // increase pointer
                           reg_UPT_UPDATE [context] = (depth+1)%_param->_size_upt_queue[context];
@@ -502,6 +553,9 @@
                       
                       // Free the branch with no accurate ?
-                      if ( (reg_UPDATE_PREDICTION_TABLE [context][depth]._is_accurate == false) and not ko)
+                      if ((reg_UPDATE_PREDICTION_TABLE [context][depth]._is_accurate == false) and not ko)
                         reg_IS_ACCURATE [context] = true;
+
+                      log_printf(TRACE,Update_Prediction_Table,FUNCTION,"      * reg_UPT_UPDATE (after ) : %d",reg_UPT_UPDATE[context]);
+                      log_printf(TRACE,Update_Prediction_Table,FUNCTION,"      * reg_EVENT_STATE         : %s",toString(reg_EVENT_STATE [context]).c_str());
                     }
                 }
@@ -513,5 +567,4 @@
           reg_UPDATE_PRIORITY = (reg_UPDATE_PRIORITY+1)%_param->_nb_context;
         }
-
 
 	// ===================================================================
@@ -533,7 +586,8 @@
 
 	      log_printf(TRACE,Update_Prediction_Table,FUNCTION,"  * BRANCH_COMPLETE[%d] - Accepted",i);
-	      log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * context        : %d",context);
-	      log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * depth          : %d",depth);
-	      log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * miss           : %d",miss);
+	      log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * context             : %d",context);
+	      log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * depth               : %d",depth);
+	      log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * miss                : %d",miss);
+              log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * reg_EVENT_STATE     : %s",toString(reg_EVENT_STATE [context]).c_str());
 	      
               if (miss)
@@ -546,4 +600,7 @@
                   event_state_t event_state         = reg_EVENT_STATE [context];
                   upt_state_t   event_top           = reg_UPDATE_PREDICTION_TABLE [context][top]._state;
+
+                  log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * event_top           : %s",toString(event_top).c_str());
+
                   bool          previous_ufpt_event = ((event_state == EVENT_STATE_MISS_FLUSH_UFPT_AND_UPT ) or
                                                        (event_state == EVENT_STATE_MISS_FLUSH_UFPT         ) or
@@ -551,14 +608,15 @@
                                                        (event_state == EVENT_STATE_EVENT_FLUSH_UFPT        ));
 
-                  bool          previous_upt_event  = ((event_state == EVENT_STATE_MISS_FLUSH_UFPT_AND_UPT ) or
-                                                       (event_state == EVENT_STATE_MISS_FLUSH_UPT          ) or
-                                                       (event_state == EVENT_STATE_EVENT_FLUSH_UFPT_AND_UPT) or
-                                                       (event_state == EVENT_STATE_EVENT_FLUSH_UPT         ) or
-                                                       (event_top   == UPDATE_PREDICTION_STATE_END_KO      ) or
-                                                       (event_top   == UPDATE_PREDICTION_STATE_KO          )
-//                                                   (event_state == EVENT_STATE_WAIT_END_EVENT          ) or
-//                                                   ((event_state == EVENT_STATE_UPDATE_CONTEXT         ) and
-//                                                    (reg_EVENT_SOURCE [context] == EVENT_SOURCE_UPT))
-                                                  );
+                  bool          previous_upt_event  = (false
+                                                       or  (event_state == EVENT_STATE_MISS_FLUSH_UFPT_AND_UPT )
+                                                       or  (event_state == EVENT_STATE_MISS_FLUSH_UPT          )
+                                                       or  (event_state == EVENT_STATE_EVENT_FLUSH_UFPT_AND_UPT)
+                                                       or  (event_state == EVENT_STATE_EVENT_FLUSH_UPT         )
+                                                       or  (event_top   == UPDATE_PREDICTION_STATE_END_KO      )
+                                                       or  (event_top   == UPDATE_PREDICTION_STATE_KO          )
+//                                                     or  (event_state == EVENT_STATE_WAIT_END_EVENT          )
+//                                                        or ((event_state == EVENT_STATE_UPDATE_CONTEXT          )
+//                                                            and (reg_EVENT_SOURCE [context] == EVENT_SOURCE_UPT))
+                                                       );
 //                bool          update_ras     = (new_update != depth);
 
@@ -568,8 +626,9 @@
                   log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * previous_upt_event  : %d",previous_upt_event);
                   log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * previous_ufpt_event : %d",previous_ufpt_event);
-
+                  log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * reg_UPT_UPDATE      : %d",reg_UPT_UPDATE [context]);
+                          
                   // Have a miss !!!
                   // Flush UPFT
-                  flush_UFPT [context] = not previous_ufpt_event;
+                  flush_UFPT [context] |= not previous_ufpt_event;
                   
                   if (reg_UPDATE_PREDICTION_TABLE [context][depth]._state == UPDATE_PREDICTION_STATE_WAIT_END)
@@ -587,5 +646,5 @@
                       reg_UPT_TOP       [context] = depth;
 //                    reg_UPT_TOP_EVENT [context] = top;
-
+                      
                       if (not previous_upt_event)
                         {
@@ -604,4 +663,5 @@
                                 // Have already update predictor
                                 reg_UPDATE_PREDICTION_TABLE [context][top]._state = UPDATE_PREDICTION_STATE_END;
+                                reg_UPT_UPDATE              [context] = new_update;
                                 break;
                               }
@@ -649,8 +709,9 @@
                           }
                         }
-                      reg_EVENT_SOURCE          [context] = EVENT_SOURCE_UPT;
+//                       reg_EVENT_SOURCE          [context] = EVENT_SOURCE_UPT;
                       
                       // else no update
                       
+                      reg_EVENT_IS_BRANCH       [context] = true;
                       reg_EVENT_DEPTH           [context] = depth;
                       reg_EVENT_ADDRESS_SRC     [context] = address_src; // delay_slot is compute in Context_State
@@ -675,4 +736,6 @@
 		}
 
+              log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * reg_EVENT_STATE     : %s",toString(reg_EVENT_STATE [context]).c_str());
+
 	      // In all case : update good_take
 	      reg_UPDATE_PREDICTION_TABLE [context][depth]._good_take    = good_take;
@@ -686,4 +749,5 @@
                 reg_UPDATE_PREDICTION_TABLE [context][depth]._address_dest = good_addr;
             }
+
 
  	// ===================================================================
@@ -779,67 +843,47 @@
                     
                     // Flush UPT
-                    Tdepth_t depth      = (_param->_have_port_depth)?PORT_READ(in_EVENT_DEPTH [i]):0;
-                    uint32_t top        = reg_UPT_TOP    [i];
-                    uint32_t bottom     = reg_UPT_BOTTOM [i];
-                    uint32_t new_update = ((top==0)?_param->_size_upt_queue[i]:top)-1; 
-//                     bool     empty      = reg_UPT_EMPTY [i];
-
+                    uint32_t bottom = reg_UPT_BOTTOM [i];
+
+                    log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * bottom     : %d",bottom);
+
+//                     event_state_t event_state         = reg_EVENT_STATE [i];
+//                     bool          previous_update_ras = ((event_state == EVENT_STATE_MISS_FLUSH_UFPT_AND_UPT ) or
+//                                                          (event_state == EVENT_STATE_MISS_FLUSH_UPT          ) or
+//                                                          (event_state == EVENT_STATE_EVENT_FLUSH_UFPT_AND_UPT) or
+//                                                          (event_state == EVENT_STATE_EVENT_FLUSH_UPT));
+
+                    bool     find   = false; // have slot to update ???
+                    Tdepth_t top    = bottom;
+                    Tdepth_t update = bottom;
+                    bool     empty  = reg_UPT_EMPTY [i];
+
+                    // flush all slot, because this event is in head of rob
+                    for (uint32_t j=0; j<_param->_size_upt_queue[i]; ++j)
+                      {
+                        Tdepth_t x = (bottom+j)%_param->_size_upt_queue[i];
+                        
+                        if ((reg_UPDATE_PREDICTION_TABLE [i][x]._state != UPDATE_PREDICTION_STATE_END) and
+                            (reg_UPDATE_PREDICTION_TABLE [i][x]._state != UPDATE_PREDICTION_STATE_EMPTY))
+                          {
+                            find = true; // find a not empty slot
+                            reg_UPDATE_PREDICTION_TABLE [i][x]._state = UPDATE_PREDICTION_STATE_EVENT;
+                            reg_UPDATE_PREDICTION_TABLE [i][x]._retire_ok = false;
+                            update = x;
+                          }
+
+                        if (reg_UPDATE_PREDICTION_TABLE [i][x]._state != UPDATE_PREDICTION_STATE_EMPTY)
+                          top = x+1;
+                      }
+
+                    top = top%_param->_size_upt_queue[i];
+
+                    log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * find       : %d",find);
                     log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * top        : %d",top);
-                    log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * depth      : %d",depth);
-                    log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * new_update : %d",new_update);
-
-                    event_state_t event_state         = reg_EVENT_STATE [i];
-                    bool          previous_update_ras = ((event_state == EVENT_STATE_MISS_FLUSH_UFPT_AND_UPT ) or
-                                                         (event_state == EVENT_STATE_MISS_FLUSH_UPT          ) or
-                                                         (event_state == EVENT_STATE_EVENT_FLUSH_UFPT_AND_UPT) or
-                                                         (event_state == EVENT_STATE_EVENT_FLUSH_UPT));
-
-                    bool     find = false; // have slot to update ???
-                    Tdepth_t depth_new = depth;
-
-                    // flush all slot after the event
-                    for (uint32_t j=(depth+1)%_param->_size_upt_queue[i];
-                         j!=top; 
-                         j=(j+1)%_param->_size_upt_queue[i])
-                      if ((reg_UPDATE_PREDICTION_TABLE [i][j]._state != UPDATE_PREDICTION_STATE_END) and
-                          (reg_UPDATE_PREDICTION_TABLE [i][j]._state != UPDATE_PREDICTION_STATE_EMPTY))
-                        {
-                          find = true;
-                          reg_UPDATE_PREDICTION_TABLE [i][j]._state = UPDATE_PREDICTION_STATE_EVENT;
-                          reg_UPDATE_PREDICTION_TABLE [i][j]._retire_ok = false;
-                        }
-                      else
-                        if (not find) // while state == end or empty
-                          depth_new ++;
-                    
-                    if ((reg_UPDATE_PREDICTION_TABLE [i][depth]._state != UPDATE_PREDICTION_STATE_END) and
-                        (reg_UPDATE_PREDICTION_TABLE [i][depth]._state != UPDATE_PREDICTION_STATE_EMPTY))
-                      {
-                        find = true;
-                        reg_UPDATE_PREDICTION_TABLE [i][depth]._state = UPDATE_PREDICTION_STATE_EVENT;
-                        reg_UPDATE_PREDICTION_TABLE [i][depth]._retire_ok = false;
-
-                      }
-                    else
-                      // while state == end or empty
-                      depth = (depth_new+1)%_param->_size_upt_queue[i];
-
-                    log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * find       : %d",find);
-                    log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * depth_new  : %d",depth_new);
                     
                     // Test if have update slot
                     if (find)
                       {
-//                         // flush all slot after the event
-//                         for (uint32_t j=(depth+1)%_param->_size_upt_queue[i];
-//                              j!=top; 
-//                              j=(j+1)%_param->_size_upt_queue[i])
-//                           reg_UPDATE_PREDICTION_TABLE [i][j]._state = UPDATE_PREDICTION_STATE_EVENT;
-
-//                         reg_UPDATE_PREDICTION_TABLE [i][depth]._state = UPDATE_PREDICTION_STATE_EVENT;
-                        
-                        // reg_UPT_BOTTOM    [i];
                         // TODO : special case : event is an exception on branch, also depth is not valid
-                        reg_UPT_TOP       [i] = depth; // depth is again valid
+                        reg_UPT_TOP       [i] = top; // depth is again valid
                         reg_UPT_TOP_EVENT [i] = top;
                         
@@ -847,12 +891,5 @@
                           reg_UPT_EMPTY [i] = true;
                       }
-
-                    bool     full       = ((depth == top) and (top == bottom) and not reg_UPT_EMPTY [i]);
-                    bool     update_ras = find and ((top != depth) or full);
-                    
-                    log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * update_ras : %d",update_ras);
-                    
-                    if (not previous_update_ras and update_ras)
-                      reg_UPT_UPDATE [i]  = new_update;
+                    reg_UPT_UPDATE [i]  = update;
               
                     // new state :
@@ -862,20 +899,36 @@
                     //            * ok : nothing
                     //            * ko : flush upt
-                    reg_EVENT_VAL     [i] = true;
-                    reg_EVENT_UPT_PTR [i] = depth;
-
+                    reg_EVENT_VAL             [i] = find;
+                    reg_EVENT_IS_BRANCH       [i] = false;
+                    reg_EVENT_UPT_PTR         [i] = top;
+                    reg_EVENT_UPT_FULL        [i] = (not empty and (bottom == reg_UPT_TOP [i]));
+                    reg_EVENT_DEPTH           [i] = top;
+//                  reg_EVENT_ADDRESS_SRC     [i] = address_src; // delay_slot is compute in I_State
+//                  reg_EVENT_ADDRESS_DEST_VAL[i] = good_take;
+//                  reg_EVENT_ADDRESS_DEST    [i] = good_addr;
+
+                    log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * reg_UPT_BOTTOM                   : %d",reg_UPT_BOTTOM          [i]);
+                    log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * reg_UPT_TOP                      : %d",reg_UPT_TOP             [i]);
+                    log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * reg_UPT_EMPTY                    : %d",reg_UPT_EMPTY           [i]);
+
+                    log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * reg_EVENT_VAL                    : %d",reg_EVENT_VAL           [i]);
+                    log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * reg_EVENT_UPT_PTR                : %d",reg_EVENT_UPT_PTR       [i]);
+                    log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * reg_EVENT_UPT_FULL               : %d",reg_EVENT_UPT_FULL      [i]);
                     log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * reg_UFPT_NB_NEED_UPDATE          : %d",reg_UFPT_NB_NEED_UPDATE [i]);
-//                     if (reg_UFPT_NB_NEED_UPDATE [i] > 0)
+                    log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * reg_UFPT_NB_UPDATE               : %d",reg_UFPT_NB_UPDATE      [i]);
+
                     if ( (reg_UFPT_NB_NEED_UPDATE [i] > 0) or
                          (reg_UFPT_NB_UPDATE      [i] > 0))
                       {
-                        if (update_ras)
+                        if (find)
                           {
-                            log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * EVENT [%d] <- EVENT_STATE_EVENT_FLUSH_UFPT_AND_UPT (branch_complete - miss)",i);
+                            log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * EVENT [%d] <- EVENT_STATE_EVENT_FLUSH_UFPT_AND_UPT (event - find)",i);
                             reg_EVENT_STATE [i] = EVENT_STATE_EVENT_FLUSH_UFPT_AND_UPT;
                           }
                         else
                           {
-                            log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * EVENT [%d] <- EVENT_STATE_EVENT_FLUSH_UFPT (branch_complete - miss)",i);
+                            log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * EVENT [%d] <- EVENT_STATE_EVENT_FLUSH_UFPT (event - not find)",i);
+//                          reg_EVENT_VAL   [i] = false;
+
                             reg_EVENT_STATE [i] = EVENT_STATE_EVENT_FLUSH_UFPT;
                           }                          
@@ -883,9 +936,8 @@
                     else
                       {
-//                         if (not previous_update_ras)
-                        if (update_ras)
+                        if (find)
                           {
                             // have ras prediction ?
-                            log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * EVENT [%d] <- EVENT_STATE_EVENT_FLUSH_UPT (branch_complete - miss)",i);
+                            log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * EVENT [%d] <- EVENT_STATE_EVENT_FLUSH_UPT (event - find)",i);
                             
                             reg_EVENT_STATE [i] = EVENT_STATE_EVENT_FLUSH_UPT;
@@ -894,5 +946,7 @@
                           {
                             // special case : nothing
-                            reg_EVENT_VAL     [i] = false;
+                            log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * EVENT [%d] <- EVENT_STATE_EVENT_FLUSH_UPT (event - not find)",i);
+
+//                          reg_EVENT_VAL     [i] = false;
 
                             reg_EVENT_STATE [i] = EVENT_STATE_OK;
@@ -902,8 +956,134 @@
                     // else no update
                     
-                    reg_EVENT_DEPTH           [i] = depth;
-//                  reg_EVENT_ADDRESS_SRC     [i] = address_src; // delay_slot is compute in I_State
-//                  reg_EVENT_ADDRESS_DEST_VAL[i] = good_take;
-//                  reg_EVENT_ADDRESS_DEST    [i] = good_addr;
+//                     Tdepth_t depth      = (_param->_have_port_depth)?PORT_READ(in_EVENT_DEPTH [i]):0;
+//                     uint32_t top        = reg_UPT_TOP    [i];
+//                     uint32_t bottom     = reg_UPT_BOTTOM [i];
+//                     uint32_t new_update = ((top==0)?_param->_size_upt_queue[i]:top)-1; 
+// //                     bool     empty      = reg_UPT_EMPTY [i];
+
+//                     log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * top        : %d",top);
+//                     log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * depth      : %d",depth);
+//                     log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * new_update : %d",new_update);
+
+//                     event_state_t event_state         = reg_EVENT_STATE [i];
+//                     bool          previous_update_ras = ((event_state == EVENT_STATE_MISS_FLUSH_UFPT_AND_UPT ) or
+//                                                          (event_state == EVENT_STATE_MISS_FLUSH_UPT          ) or
+//                                                          (event_state == EVENT_STATE_EVENT_FLUSH_UFPT_AND_UPT) or
+//                                                          (event_state == EVENT_STATE_EVENT_FLUSH_UPT));
+
+//                     bool     find = false; // have slot to update ???
+//                     Tdepth_t depth_new = depth;
+
+//                     // flush all slot, because this event is in head of rob
+//                     for (uint32_t j=(depth+1)%_param->_size_upt_queue[i];
+//                          //uint32_t j=bottom;
+//                          j!=top; 
+//                          j=(j+1)%_param->_size_upt_queue[i])
+//                       if ((reg_UPDATE_PREDICTION_TABLE [i][j]._state != UPDATE_PREDICTION_STATE_END) and
+//                           (reg_UPDATE_PREDICTION_TABLE [i][j]._state != UPDATE_PREDICTION_STATE_EMPTY))
+//                         {
+//                           find = true;
+//                           reg_UPDATE_PREDICTION_TABLE [i][j]._state = UPDATE_PREDICTION_STATE_EVENT;
+//                           reg_UPDATE_PREDICTION_TABLE [i][j]._retire_ok = false;
+//                         }
+//                       else
+//                         if (not find) // while state == end or empty
+//                           depth_new ++;
+                    
+//                     if ((reg_UPDATE_PREDICTION_TABLE [i][depth]._state != UPDATE_PREDICTION_STATE_END) and
+//                         (reg_UPDATE_PREDICTION_TABLE [i][depth]._state != UPDATE_PREDICTION_STATE_EMPTY))
+//                       {
+//                         find = true;
+//                         reg_UPDATE_PREDICTION_TABLE [i][depth]._state = UPDATE_PREDICTION_STATE_EVENT;
+//                         reg_UPDATE_PREDICTION_TABLE [i][depth]._retire_ok = false;
+
+//                       }
+//                     else
+//                       // while state == end or empty
+//                       depth = (depth_new+1)%_param->_size_upt_queue[i];
+
+//                     log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * find       : %d",find);
+//                     log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * depth_new  : %d",depth_new);
+                    
+//                     // Test if have update slot
+//                     if (find)
+//                       {
+// //                         // flush all slot after the event
+// //                         for (uint32_t j=(depth+1)%_param->_size_upt_queue[i];
+// //                              j!=top; 
+// //                              j=(j+1)%_param->_size_upt_queue[i])
+// //                           reg_UPDATE_PREDICTION_TABLE [i][j]._state = UPDATE_PREDICTION_STATE_EVENT;
+
+// //                         reg_UPDATE_PREDICTION_TABLE [i][depth]._state = UPDATE_PREDICTION_STATE_EVENT;
+                        
+//                         // reg_UPT_BOTTOM    [i];
+//                         // TODO : special case : event is an exception on branch, also depth is not valid
+//                         reg_UPT_TOP       [i] = depth; // depth is again valid
+//                         reg_UPT_TOP_EVENT [i] = top;
+                        
+//                         if (bottom == reg_UPT_TOP [i])
+//                           reg_UPT_EMPTY [i] = true;
+//                       }
+
+//                     bool     full       = ((depth == top) and (top == bottom) and not reg_UPT_EMPTY [i]);
+//                     bool     update_ras = find and ((top != depth) or full);
+                    
+//                     log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * update_ras : %d",update_ras);
+                    
+//                     if (not previous_update_ras and update_ras)
+//                       reg_UPT_UPDATE [i]  = new_update;
+              
+//                     // new state :
+//                     //   * test if ufpt is empty
+//                     //     * ok : flush upft and upt
+//                     //     * ko : test if have previous flush upt
+//                     //            * ok : nothing
+//                     //            * ko : flush upt
+//                     reg_EVENT_VAL     [i] = update_ras;
+//                     reg_EVENT_UPT_PTR [i] = depth;
+
+//                     log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * reg_UFPT_NB_NEED_UPDATE          : %d",reg_UFPT_NB_NEED_UPDATE [i]);
+// //                     if (reg_UFPT_NB_NEED_UPDATE [i] > 0)
+//                     if ( (reg_UFPT_NB_NEED_UPDATE [i] > 0) or
+//                          (reg_UFPT_NB_UPDATE      [i] > 0))
+//                       {
+//                         if (update_ras)
+//                           {
+//                             log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * EVENT [%d] <- EVENT_STATE_EVENT_FLUSH_UFPT_AND_UPT (branch_complete - miss)",i);
+//                             reg_EVENT_STATE [i] = EVENT_STATE_EVENT_FLUSH_UFPT_AND_UPT;
+//                           }
+//                         else
+//                           {
+//                             log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * EVENT [%d] <- EVENT_STATE_EVENT_FLUSH_UFPT (branch_complete - miss)",i);
+// //                          reg_EVENT_VAL   [i] = false;
+
+//                             reg_EVENT_STATE [i] = EVENT_STATE_EVENT_FLUSH_UFPT;
+//                           }                          
+//                       }
+//                     else
+//                       {
+// //                         if (not previous_update_ras)
+//                         if (update_ras)
+//                           {
+//                             // have ras prediction ?
+//                             log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * EVENT [%d] <- EVENT_STATE_EVENT_FLUSH_UPT (branch_complete - miss)",i);
+                            
+//                             reg_EVENT_STATE [i] = EVENT_STATE_EVENT_FLUSH_UPT;
+//                           }
+//                         else
+//                           {
+//                             // special case : nothing
+// //                          reg_EVENT_VAL     [i] = false;
+
+//                             reg_EVENT_STATE [i] = EVENT_STATE_OK;
+//                           }
+//                       }
+
+//                     // else no update
+                    
+//                     reg_EVENT_DEPTH           [i] = depth;
+// //                  reg_EVENT_ADDRESS_SRC     [i] = address_src; // delay_slot is compute in I_State
+// //                  reg_EVENT_ADDRESS_DEST_VAL[i] = good_take;
+// //                  reg_EVENT_ADDRESS_DEST    [i] = good_addr;
 
                     break;
@@ -994,6 +1174,7 @@
         log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * reg_EVENT_VAL             : %d"  ,reg_EVENT_VAL             [i]);
         log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * reg_EVENT_UPT_PTR         : %d"  ,reg_EVENT_UPT_PTR         [i]);
+        log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * reg_EVENT_UPT_FULL        : %d"  ,reg_EVENT_UPT_FULL        [i]);
         log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * reg_EVENT_STATE           : %s"  ,toString(reg_EVENT_STATE [i]).c_str());
-        log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * reg_EVENT_SOURCE          : %s"  ,toString(reg_EVENT_SOURCE[i]).c_str());
+        log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * reg_EVENT_IS_BRANCH       : %d"  ,reg_EVENT_IS_BRANCH       [i]);
         log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * reg_EVENT_DEPTH           : %d"  ,reg_EVENT_DEPTH           [i]);
         log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * reg_EVENT_ADDRESS_SRC     : %.8x (%.8x)",reg_EVENT_ADDRESS_SRC     [i],reg_EVENT_ADDRESS_SRC     [i]<<2);
