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 101)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Update_Prediction_Table/src/Update_Prediction_Table_allocation.cpp	(revision 105)
@@ -205,4 +205,7 @@
     ALLOC1(reg_UPT_EMPTY                    ,bool         ,_param->_nb_context);
 
+    ALLOC1(reg_EVENT_VAL                    ,bool         ,_param->_nb_context);
+    ALLOC1(reg_EVENT_UPT_PTR                ,uint32_t     ,_param->_nb_context);
+
     ALLOC1(reg_EVENT_STATE                  ,event_state_t,_param->_nb_context);
     ALLOC1(reg_EVENT_DEPTH                  ,Tdepth_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 101)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Update_Prediction_Table/src/Update_Prediction_Table_deallocation.cpp	(revision 105)
@@ -158,4 +158,7 @@
         DELETE1(reg_UPT_EMPTY                    ,_param->_nb_context);
         
+        DELETE1(reg_EVENT_VAL                    ,_param->_nb_context);
+        DELETE1(reg_EVENT_UPT_PTR                ,_param->_nb_context);
+
         DELETE1(reg_EVENT_STATE                  ,_param->_nb_context);
         DELETE1(reg_EVENT_DEPTH                  ,_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_genMealy_decod.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Update_Prediction_Table/src/Update_Prediction_Table_genMealy_decod.cpp	(revision 101)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Update_Prediction_Table/src/Update_Prediction_Table_genMealy_decod.cpp	(revision 105)
@@ -50,6 +50,6 @@
                                             is_accurate and
 //                                             (
-                                             (event_state == EVENT_STATE_OK            )//  or
-//                                              (event_state == EVENT_STATE_FLUSH_UFPT    ) or
+                                             (event_state == EVENT_STATE_OK)//  or
+//                                              (event_state == EVENT_STATE_MISS_FLUSH_UFPT    ) or
 //                                              (event_state == EVENT_STATE_UPDATE_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 101)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Update_Prediction_Table/src/Update_Prediction_Table_genMoore.cpp	(revision 105)
@@ -40,5 +40,7 @@
         //     include ]DEPTH_MIN:DEPTH_MAX] -> speculative
 
-        PORT_WRITE(out_DEPTH_VAL     [i],(reg_UPDATE_PREDICTION_TABLE [i][reg_UPT_TOP [i]]._state == UPDATE_PREDICTION_STATE_EMPTY));
+        PORT_WRITE(out_DEPTH_VAL     [i],((reg_UPDATE_PREDICTION_TABLE [i][reg_UPT_TOP [i]]._state == UPDATE_PREDICTION_STATE_EMPTY) 
+                                          and (reg_EVENT_STATE [i] == EVENT_STATE_OK)
+                                          ));
 	if (_param->_have_port_depth)
           {
@@ -59,4 +61,5 @@
     bool     retire_ras_from_ufpt [_param->_nb_context]; // event ufpt -> restore RAS, else update upt
     bool     retire_ras_from_upt  [_param->_nb_context]; // event upt  -> restore RAS, else restore others structure
+//     bool     have_event           [_param->_nb_context];
     bool     ufpt_update          [_param->_nb_context];
     bool     upt_update           [_param->_nb_context];
@@ -68,7 +71,12 @@
         event_state_t event_state = reg_EVENT_STATE [i];
 
-        retire_ras_from_ufpt [i] = ((event_state == EVENT_STATE_FLUSH_UFPT            ) or
-                                    (event_state == EVENT_STATE_FLUSH_UFPT_AND_UPT));
-        retire_ras_from_upt  [i] = (event_state == EVENT_STATE_FLUSH_UPT);
+        retire_ras_from_ufpt [i] = ((event_state == EVENT_STATE_MISS_FLUSH_UFPT         ) or
+                                    (event_state == EVENT_STATE_MISS_FLUSH_UFPT_AND_UPT ) or
+                                    (event_state == EVENT_STATE_EVENT_FLUSH_UFPT        ) or
+                                    (event_state == EVENT_STATE_EVENT_FLUSH_UFPT_AND_UPT));
+        retire_ras_from_upt  [i] = ((event_state == EVENT_STATE_MISS_FLUSH_UPT) or
+                                    (event_state == EVENT_STATE_EVENT_FLUSH_UPT));
+
+//         have_event           [i] = (event_state == EVENT_STATE_EVENT_FLUSH_UPT);
 
         ufpt_update          [i] = true;
@@ -168,5 +176,8 @@
                                                                 (state == UPDATE_PREDICTION_STATE_KO   ));
                 Tcontrol_t          state_is_event           = ((state == UPDATE_PREDICTION_STATE_KO   ) or
-                                                                (state == UPDATE_PREDICTION_STATE_EVENT));
+                                                                (state == UPDATE_PREDICTION_STATE_EVENT)//  or
+//                                                                 ((have_event[context])?(state == UPDATE_PREDICTION_STATE_OK):false)
+                                                                );
+                
                 Tcontrol_t          state_is_event_update    = state_is_event and     need_update(condition);
                 Tcontrol_t          state_is_event_no_update = state_is_event and not need_update(condition);
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 101)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Update_Prediction_Table/src/Update_Prediction_Table_transition.cpp	(revision 105)
@@ -50,4 +50,5 @@
             reg_IS_ACCURATE          [i] = true;
             
+            reg_EVENT_VAL            [i] = false;
             reg_EVENT_STATE          [i] = EVENT_STATE_OK;
           }
@@ -55,7 +56,9 @@
     else
       {
-        bool flush_UFPT [_param->_nb_context];
+        bool flush_UFPT    [_param->_nb_context];
 	for (uint32_t i=0; i<_param->_nb_context; i++)
-          flush_UFPT [i] = false;
+          {
+            flush_UFPT    [i] = false;
+          }
 
 	// ===================================================================
@@ -66,5 +69,5 @@
         //   * Update state -> new status is "empty"
         //   * Update pointer (bottom and accurate)
-        log_printf(TRACE,Update_Prediction_Table,FUNCTION,"  * GARBAGE COLLECTOR");
+        log_printf(TRACE,Update_Prediction_Table,FUNCTION,"  * GARBAGE COLLECTOR (BEGIN)");
 	for (uint32_t i=0; i<_param->_nb_context; i++)
 	  {
@@ -113,9 +116,14 @@
 //                   if (bottom = reg_UPT_UPDATE [i])
 //                     reg_UPT_UPDATE [i] = reg_UPT_BOTTOM [i];
-                  if (end_ko) // free
+
+                  if (reg_EVENT_VAL [i] and (reg_EVENT_UPT_PTR [i] == bottom))
+//                   if (end_ko) // free
                     {
+                      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;
@@ -124,4 +132,5 @@
             }
 	  }
+        log_printf(TRACE,Update_Prediction_Table,FUNCTION,"  * GARBAGE COLLECTOR (END)");
 
 	// ===================================================================
@@ -218,6 +227,6 @@
                   else
                     {
-                      log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * EVENT [%d] <- EVENT_STATE_FLUSH_UFPT (decod - miss - flush ufpt)",context);
-                      reg_EVENT_STATE [context] = EVENT_STATE_FLUSH_UFPT;
+                      log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * EVENT [%d] <- EVENT_STATE_MISS_FLUSH_UFPT (decod - miss - flush ufpt)",context);
+                      reg_EVENT_STATE [context] = EVENT_STATE_MISS_FLUSH_UFPT;
                     }
 
@@ -273,5 +282,5 @@
                   reg_UPDATE_PREDICTION_TABLE [context][upt_ptr_write]._address_ras       = reg_UPDATE_FETCH_PREDICTION_TABLE [context][ufpt_ptr_read]._address_ras ;
                   reg_UPDATE_PREDICTION_TABLE [context][upt_ptr_write]._index_ras         = reg_UPDATE_FETCH_PREDICTION_TABLE [context][ufpt_ptr_read]._index_ras   ;
-                  reg_UPDATE_PREDICTION_TABLE [context][upt_ptr_write]._ifetch_prediction = true; // prediction from ifetch
+                  reg_UPDATE_PREDICTION_TABLE [context][upt_ptr_write]._ifetch_prediction = true ; // prediction from ifetch
 
                   // Update pointer
@@ -283,5 +292,4 @@
 
               // All case !!!
-
 #ifdef DEBUG_TEST
               if (reg_UPDATE_PREDICTION_TABLE [context][upt_ptr_write]._state != UPDATE_PREDICTION_STATE_EMPTY)
@@ -352,5 +360,5 @@
 
                   if (reg_UPT_BOTTOM [context] == reg_UPT_TOP [context])
-                    reg_UPT_EMPTY [i] = true;
+                    reg_UPT_EMPTY [context] = true;
 
 #ifdef DEBUG_TEST
@@ -364,22 +372,25 @@
                   Taddress_t    address_src         = reg_UPDATE_PREDICTION_TABLE [context][depth]._address_src;
                   event_state_t event_state         = reg_EVENT_STATE [context];
-                  bool          previous_update_ras = (event_state == EVENT_STATE_FLUSH_UPT);
-                  bool          update_ras          = (new_update != depth);
-
-                  log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * update_ras : %d",update_ras);
+                  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          update_ras          = (new_update != depth);
+
+//                   log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * update_ras : %d",update_ras);
 
                   if (reg_UFPT_NB_NEED_UPDATE [context] > 0)
                     {
-                      log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * EVENT [%d] <- EVENT_STATE_FLUSH_UFPT_AND_UPT (branch_complete - miss)",context);
-                      reg_EVENT_STATE [context] = EVENT_STATE_FLUSH_UFPT_AND_UPT;
+                      log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * EVENT [%d] <- EVENT_STATE_MISS_FLUSH_UFPT_AND_UPT (branch_complete - miss)",context);
+                      reg_EVENT_STATE [context] = EVENT_STATE_MISS_FLUSH_UFPT_AND_UPT;
                     }
                   else
                     {
-                      if (not previous_update_ras)
+//                       if (not previous_update_ras)
                         {
                           // have ras prediction ?
-                          log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * EVENT [%d] <- EVENT_STATE_FLUSH_UPT (branch_complete - miss)",context);
-
-                          reg_EVENT_STATE [context] = EVENT_STATE_FLUSH_UPT;
+                          log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * EVENT [%d] <- EVENT_STATE_MISS_FLUSH_UPT (branch_complete - miss)",context);
+
+                          reg_EVENT_STATE [context] = EVENT_STATE_MISS_FLUSH_UPT;
              
                         }
@@ -442,7 +453,9 @@
                         switch (reg_EVENT_STATE [context])
                           {
-                          case EVENT_STATE_FLUSH_UFPT             : reg_EVENT_STATE [context] = EVENT_STATE_UPDATE_CONTEXT; break;
+                          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_FLUSH_UFPT_AND_UPT : reg_EVENT_STATE [context] = EVENT_STATE_FLUSH_UPT ; break;
+                          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;
                           }
@@ -478,5 +491,5 @@
                         {
                           if ((reg_UPDATE_PREDICTION_TABLE [context][depth]._state != UPDATE_PREDICTION_STATE_EVENT) and
-                              (reg_UPDATE_PREDICTION_TABLE [context][depth]._state != UPDATE_PREDICTION_STATE_KO   ))
+                              (reg_UPDATE_PREDICTION_TABLE [context][depth]._state != UPDATE_PREDICTION_STATE_KO   ) )
                             throw ERRORMORPHEO(FUNCTION,_("Update : invalid upt state."));
                         }
@@ -507,4 +520,7 @@
                           
                           reg_UPDATE_PREDICTION_TABLE [context][depth]._state = UPDATE_PREDICTION_STATE_END_KO;
+
+                          reg_EVENT_VAL     [context] = true;
+                          reg_EVENT_UPT_PTR [context] = depth;
 
 #ifdef STATISTICS
@@ -541,6 +557,12 @@
                           if (end_event)
                             {
-                              reg_UPT_UPDATE [context] = reg_UPT_BOTTOM[context];
-                              reg_EVENT_STATE [context] = EVENT_STATE_UPDATE_CONTEXT;
+//                               reg_UPT_UPDATE [context] = reg_UPT_BOTTOM[context];
+
+                              if (reg_EVENT_STATE [context] == EVENT_STATE_EVENT_FLUSH_UPT)
+                                {
+                                  reg_EVENT_STATE [context] = EVENT_STATE_OK;
+                                }
+                              else
+                                reg_EVENT_STATE [context] = EVENT_STATE_UPDATE_CONTEXT;
                             }
                           else
@@ -593,4 +615,6 @@
           if (PORT_READ(in_EVENT_VAL [i]) and internal_EVENT_ACK [i])
             {
+              log_printf(TRACE,Update_Prediction_Table,FUNCTION,"  * EVENT");
+
               //----------------------------------------------------------------
               // Cases
@@ -606,37 +630,147 @@
               
               Tevent_type_t  event_type  = PORT_READ(in_EVENT_TYPE  [i]);
-//            Tdepth_t       depth       = PORT_READ(in_EVENT_DEPTH [i]);
-            
+
               // Test if end of miss -> all previous branch is complete
               //                     -> all next     branch is finish
-              if (event_type  == EVENT_TYPE_MISS_SPECULATION)
+
+              switch (event_type)
                 {
-                  log_printf(TRACE,Update_Prediction_Table,FUNCTION,"  * EVENT");
-                  log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * type  : EVENT_TYPE_MISS_SPECULATION");
-                  
-#ifdef DEBUG_TEST
-                  if (reg_EVENT_STATE [i] != EVENT_STATE_WAIT_END_EVENT)
-                    throw ERRORMORPHEO(FUNCTION,_("Event : invalid event state."));
-#endif
-                  
-                  // Change state
-                  log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * EVENT [%d] <- EVENT_STATE_OK (event)",i);
-                  
-                  reg_EVENT_STATE [i] = EVENT_STATE_OK;
-                  reg_IS_ACCURATE [i] = true;
-
-//                   Tdepth_t depth = reg_UPT_TOP [i];
-
-#ifdef DEBUG_TEST
-//                   if (reg_UPDATE_PREDICTION_TABLE [i][depth]._state != UPDATE_PREDICTION_STATE_END_KO_WAIT_END)
-//                     throw ERRORMORPHEO(FUNCTION,_("Event : invalid upt event state."));
-//                   if (reg_UPDATE_PREDICTION_TABLE [i][depth]._state != UPDATE_PREDICTION_STATE_END_KO)
-//                     throw ERRORMORPHEO(FUNCTION,_("Event : invalid upt event state."));
-#endif
-                  
-//                   log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * UPT  [%d][%d].state <- UPDATE_PREDICTION_STATE_END_KO (update)",i,depth);
+                case EVENT_TYPE_BRANCH_MISS_SPECULATION :
+                  {
+                    log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * type  : EVENT_TYPE_BRANCH_MISS_SPECULATION");
+                    
+#ifdef DEBUG_TEST
+                    if (reg_EVENT_STATE [i] != EVENT_STATE_WAIT_END_EVENT)
+                      throw ERRORMORPHEO(FUNCTION,_("Event : invalid event state."));
+#endif
+                    
+                    // Change state
+                    log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * EVENT [%d] <- EVENT_STATE_OK (event)",i);
+                    
+                    reg_EVENT_STATE [i] = EVENT_STATE_OK;
+                    reg_IS_ACCURATE [i] = true;
+                    
+//                  Tdepth_t depth = reg_UPT_TOP [i];
+
+#ifdef DEBUG_TEST
+//                  if (reg_UPDATE_PREDICTION_TABLE [i][depth]._state != UPDATE_PREDICTION_STATE_END_KO_WAIT_END)
+//                    throw ERRORMORPHEO(FUNCTION,_("Event : invalid upt event state."));
+//                  if (reg_UPDATE_PREDICTION_TABLE [i][depth]._state != UPDATE_PREDICTION_STATE_END_KO)
+//                    throw ERRORMORPHEO(FUNCTION,_("Event : invalid upt event state."));
+#endif
+                  
+//                  log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * UPT  [%d][%d].state <- UPDATE_PREDICTION_STATE_END_KO (update)",i,depth);
                           
-//                   reg_UPDATE_PREDICTION_TABLE [i][depth]._state = UPDATE_PREDICTION_STATE_END_KO;
-
+//                  reg_UPDATE_PREDICTION_TABLE [i][depth]._state = UPDATE_PREDICTION_STATE_END_KO;
+
+                    break;
+                  }
+                case EVENT_TYPE_LOAD_MISS_SPECULATION :
+                case EVENT_TYPE_EXCEPTION             :
+                  {
+                    log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * type  : EVENT_TYPE_LOAD_MISS_SPECULATION");
+
+                    // Have a miss !!!
+                    // Flush UPFT
+                    flush_UFPT [i] = true;
+                    
+                    // 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; 
+                    uint32_t full       = ((depth == top) and (top == bottom) and not 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);
+
+                    
+#ifdef DEBUG_TEST
+                    if (reg_UPDATE_PREDICTION_TABLE [i][depth]._state != UPDATE_PREDICTION_STATE_WAIT_END)
+                      throw ERRORMORPHEO(FUNCTION,_("Branch complete : invalid upt state."));
+#endif
+
+                    // flush all slot after the event
+                    for (uint32_t j=depth;
+                         j!=top; 
+                         j=(j+1)%_param->_size_upt_queue[i])
+                      reg_UPDATE_PREDICTION_TABLE [i][j]._state = UPDATE_PREDICTION_STATE_EVENT;
+                      
+                    // test full :
+                    if (full)
+                      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;
+
+                    reg_EVENT_VAL     [i] = true;
+                    reg_EVENT_UPT_PTR [i] = depth;
+                    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          update_ras          = (top != depth) or full;
+
+                    log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * update_ras : %d",update_ras);
+                    
+                    // new state :
+                    //   * test if ufpt is empty
+                    //     * ok : flush upft and upt
+                    //     * ko : test if have previous flush upt
+                    //            * ok : nothing
+                    //            * ko : flush upt
+                    if (reg_UFPT_NB_NEED_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_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
+                          {
+                            reg_EVENT_STATE [i] = EVENT_STATE_OK;
+                          }
+                      }
+                    
+                    if (not previous_update_ras and update_ras)
+                      {
+                        reg_UPT_UPDATE [i]  = new_update;
+                      }
+                    // 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;
+                  }
+                default :
+                  {
+                    // nothing
+                    break;
+                  }
                 }
             }
@@ -706,4 +840,6 @@
       {
         log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * reg_IS_ACCURATE           : %d",reg_IS_ACCURATE        [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_STATE           : %s"  ,toString(reg_EVENT_STATE [i]).c_str());
         log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * reg_EVENT_DEPTH           : %d"  ,reg_EVENT_DEPTH           [i]);
