Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Update_Prediction_Table/include/Parameters.h
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Update_Prediction_Table/include/Parameters.h	(revision 82)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Update_Prediction_Table/include/Parameters.h	(revision 88)
@@ -24,27 +24,30 @@
   {
     //-----[ fields ]------------------------------------------------------------
-  public : uint32_t   _nb_context             ;
-  public : uint32_t * _size_queue             ; // [nb_context]
-  public : uint32_t   _size_address           ;
-  public : uint32_t   _nb_inst_predict        ;
-  public : uint32_t   _nb_inst_decod          ;
-  public : uint32_t   _nb_inst_branch_complete;
-  public : uint32_t   _nb_inst_update         ;
-  public : uint32_t   _size_history           ;
-  public : uint32_t * _size_ras_index         ; // [nb_context]
+  public : uint32_t   _nb_context                ;
+  public : uint32_t * _size_upt_queue            ; // [nb_context]
+  public : uint32_t * _size_ufpt_queue           ; // [nb_context]
+//public : uint32_t   _size_address              ;
+  public : uint32_t   _nb_inst_predict           ;
+  public : uint32_t   _nb_inst_decod             ;
+  public : uint32_t   _nb_inst_branch_complete   ;
+  public : uint32_t   _nb_inst_update            ;
+  public : uint32_t   _size_history              ;
+  public : uint32_t * _size_ras_index            ; // [nb_context]
+  public : const bool _not_accurate_block_predict;
 
-  public : uint32_t   _size_context_id        ;
-  public : uint32_t * _size_depth             ; // [nb_context]
-  public : uint32_t   _max_size_depth         ;
-  public : uint32_t   _max_size_ras_index     ;
-		      
-  public : bool       _have_port_context_id   ;
-  public : bool     * _have_port_depth        ; // [nb_context]
-  public : bool       _have_port_max_depth    ;
-  public : bool       _have_port_history      ;
+//public : uint32_t   _size_context_id           ;
+//public : uint32_t * _size_depth                ; // [nb_context]
+//public : uint32_t   _max_size_depth            ;
+  public : uint32_t   _max_size_ras_index        ;
+		                                 
+//public : bool       _have_port_context_id      ;
+//public : bool     * _have_port_depth           ; // [nb_context]
+//public : bool       _have_port_max_depth       ;
+  public : bool       _have_port_history         ;
     
     //-----[ methods ]-----------------------------------------------------------
   public : Parameters  (uint32_t   nb_context             ,
-			uint32_t * size_queue             ,
+			uint32_t * size_upt_queue         ,
+			uint32_t * size_ufpt_queue        ,
 			uint32_t   size_address           ,
 			uint32_t   nb_inst_predict        ,
@@ -53,7 +56,10 @@
 			uint32_t   nb_inst_update         ,
 			uint32_t   size_history           ,
-			uint32_t * size_ras_index         );
+			uint32_t * size_ras_index         ,
+                        bool       is_toplevel=false);
 //public : Parameters  (Parameters & param) ;
   public : ~Parameters () ;
+
+  public :        void            copy       (void);
 
   public :        Parameters_test msg_error  (void);
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 82)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Update_Prediction_Table/include/Types.h	(revision 88)
@@ -21,26 +21,85 @@
   typedef enum
     {
-      UPDATE_PREDICTION_STATE_EMPTY      , // Slot is empty
-      UPDATE_PREDICTION_STATE_WAIT_DECOD , // Fetch have access at the predictor
-      UPDATE_PREDICTION_STATE_WAITEND    , // Have make a prediction, wait branch_complete
-      UPDATE_PREDICTION_STATE_EVENT      , // have a event - must signal at the context_unit
-      UPDATE_PREDICTION_STATE_OK         , // branch is complete and can update predictor
-      UPDATE_PREDICTION_STATE_KO         , // have a event - must update predictor unit
-      UPDATE_PREDICTION_STATE_END          // branch is updated 
-    } state_t;
+      EVENT_STATE_OK                 , // Can predict
+      EVENT_STATE_FLUSH_UFPT         , // in decod  stage, detect a miss, continue to execute but flush ufpt
+      EVENT_STATE_FLUSH_UFPT_AND_UPT , // in commit stage, detect a miss, stop context and flush ufpt and upt
+      EVENT_STATE_FLUSH_UPT_RAS      , // in commit stage, detect a miss, context is stop and ufpt is flush, update RAS
+      EVENT_STATE_FLUSH_UPT          , // in commit stage, detect a miss, context is stop and ufpt is flush
+      EVENT_STATE_UPDATE_CONTEXT       // prediction unit is update, send signal to context manager
+    } event_state_t;
 
-  class entry_t
+  typedef enum
+    {
+      UPDATE_FETCH_PREDICTION_STATE_EMPTY       , // Slot is empty
+      UPDATE_FETCH_PREDICTION_STATE_WAIT_DECOD  , // Have make a prediction, wait decod
+      UPDATE_FETCH_PREDICTION_STATE_EVENT       , // previous branch is a miss prediction
+      UPDATE_FETCH_PREDICTION_STATE_END           // branch is updated 
+    } ufpt_state_t;
+
+  typedef enum
+    {
+      UPDATE_PREDICTION_STATE_EMPTY             , // Slot is empty
+      UPDATE_PREDICTION_STATE_WAIT_END          , // Have make a prediction, wait branch_complete
+      UPDATE_PREDICTION_STATE_OK                , // this branch is a hit prediction
+      UPDATE_PREDICTION_STATE_KO                , // this branch is a miss prediction
+      UPDATE_PREDICTION_STATE_EVENT             , // previous branch is a miss prediction
+      UPDATE_PREDICTION_STATE_END                 // branch is updated 
+    } upt_state_t;
+
+  class ufpt_entry_t
   {
-  public : state_t             _state;
-  public : Tcontrol_t          _ifetch_prediction;
-  public : Tbranch_condition_t _condition;
-  public : Taddress_t          _address_src;
-  public : Taddress_t          _address_dest;
-  public : Tcontrol_t          _last_take;
-  public : Tcontrol_t          _good_take;
-  public : Thistory_t          _history;
-  public : Taddress_t          _address_ras;
-  public : Tptr_t              _index_ras;
+  public : ufpt_state_t        _state            ;
+  public : Tbranch_condition_t _condition        ;
+  public : Taddress_t          _address_src      ;
+  public : Taddress_t          _address_dest     ;
+  public : Tcontrol_t          _last_take        ;
+//public : Tcontrol_t          _good_take        ;
+  public : Tcontrol_t          _is_accurate      ;
+  public : Thistory_t          _history          ;
+  public : Taddress_t          _address_ras      ;
+  public : Tptr_t              _index_ras        ;
+//public : Tcontrol_t          _ifetch_prediction;
   };
+
+  class upt_entry_t
+  {
+  public : upt_state_t         _state            ;
+  public : Tbranch_condition_t _condition        ;
+  public : Taddress_t          _address_src      ;
+  public : Taddress_t          _address_dest     ;
+  public : Tcontrol_t          _last_take        ;
+  public : Tcontrol_t          _good_take        ; // not in ufpt
+  public : Tcontrol_t          _is_accurate      ;
+  public : Thistory_t          _history          ;
+  public : Taddress_t          _address_ras      ;
+  public : Tptr_t              _index_ras        ;
+  public : Tcontrol_t          _ifetch_prediction; // not in ufpt
+  };
+
+
+// BRANCH_CONDITION_NONE_WITHOUT_WRITE_STACK          
+// BRANCH_CONDITION_NONE_WITH_WRITE_STACK             
+// BRANCH_CONDITION_FLAG_UNSET                        
+// BRANCH_CONDITION_FLAG_SET                          
+// BRANCH_CONDITION_READ_REGISTER_WITHOUT_WRITE_STACK 
+// BRANCH_CONDITION_READ_REGISTER_WITH_WRITE_STACK    
+// BRANCH_CONDITION_READ_STACK                        
+
+
+#define update_btb(cond)  true
+
+#define update_dir(cond)  ((cond == BRANCH_CONDITION_FLAG_UNSET) or \
+                           (cond == BRANCH_CONDITION_FLAG_SET))
+
+#define update_ras(cond)  ((cond == BRANCH_CONDITION_NONE_WITH_WRITE_STACK         ) or \
+                           (cond == BRANCH_CONDITION_READ_REGISTER_WITH_WRITE_STACK) or \
+                           (cond == BRANCH_CONDITION_READ_STACK                    ))
+
+#define push_ras(cond)    ((cond == BRANCH_CONDITION_NONE_WITH_WRITE_STACK         ) or \
+                           (cond == BRANCH_CONDITION_READ_REGISTER_WITH_WRITE_STACK))
+
+#define pop_ras(cond)     ((cond == BRANCH_CONDITION_READ_STACK                    ))
+
+#define need_update(cond) update_ras(cond)
 
 }; // end namespace update_prediction_table
@@ -51,15 +110,39 @@
 }; // end namespace behavioural
   
+  template<> inline std::string toString<morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::update_prediction_table::event_state_t>(const morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::update_prediction_table::event_state_t& x)
+  {
+    switch (x)
+      {
+      case morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::update_prediction_table::EVENT_STATE_OK                   : return "ok"                  ; break;
+      case morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::update_prediction_table::EVENT_STATE_FLUSH_UFPT           : return "flush_ufpt"          ; break;
+      case morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::update_prediction_table::EVENT_STATE_FLUSH_UFPT_AND_UPT   : return "flush_ufpt_and_upt"  ; break;
+      case morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::update_prediction_table::EVENT_STATE_FLUSH_UPT_RAS        : return "flush_upt_ras"       ; break;
+      case morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::update_prediction_table::EVENT_STATE_FLUSH_UPT            : return "flush_upt"           ; break;
+      case morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::update_prediction_table::EVENT_STATE_UPDATE_CONTEXT       : return "update_context"      ; break;
+      default    : return ""      ; break;
+      }
+  };
 
-  template<> inline std::string toString<morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::update_prediction_table::state_t>(const morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::update_prediction_table::state_t& x)
+  template<> inline std::string toString<morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::update_prediction_table::ufpt_state_t>(const morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::update_prediction_table::ufpt_state_t& x)
+  {
+    switch (x)
+      {
+      case morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::update_prediction_table::UPDATE_FETCH_PREDICTION_STATE_EMPTY      : return "empty"     ; break;
+      case morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::update_prediction_table::UPDATE_FETCH_PREDICTION_STATE_WAIT_DECOD : return "wait_decod"; break;
+      case morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::update_prediction_table::UPDATE_FETCH_PREDICTION_STATE_EVENT      : return "event"     ; break;
+      case morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::update_prediction_table::UPDATE_FETCH_PREDICTION_STATE_END        : return "end"       ; break;
+      default    : return ""      ; break;
+      }
+  };
+
+  template<> inline std::string toString<morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::update_prediction_table::upt_state_t>(const morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::update_prediction_table::upt_state_t& x)
   {
     switch (x)
       {
       case morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::update_prediction_table::UPDATE_PREDICTION_STATE_EMPTY      : return "empty"     ; break;
-      case morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::update_prediction_table::UPDATE_PREDICTION_STATE_WAIT_DECOD : return "wait_decod"; break;
-      case morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::update_prediction_table::UPDATE_PREDICTION_STATE_WAITEND    : return "waitend"   ; break;
-      case morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::update_prediction_table::UPDATE_PREDICTION_STATE_EVENT      : return "event"     ; break;
+      case morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::update_prediction_table::UPDATE_PREDICTION_STATE_WAIT_END   : return "wait_end"  ; break;
       case morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::update_prediction_table::UPDATE_PREDICTION_STATE_OK         : return "ok"        ; break;
       case morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::update_prediction_table::UPDATE_PREDICTION_STATE_KO         : return "ko"        ; break;
+      case morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::update_prediction_table::UPDATE_PREDICTION_STATE_EVENT      : return "event"     ; break;
       case morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::update_prediction_table::UPDATE_PREDICTION_STATE_END        : return "end"       ; break;
       default    : return ""      ; break;
@@ -67,5 +150,4 @@
   };
 
-
 }; // end namespace morpheo              
 
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 82)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Update_Prediction_Table/include/Update_Prediction_Table.h	(revision 88)
@@ -51,4 +51,12 @@
 #ifdef STATISTICS
   public    : Stat                           * _stat;
+
+  private   : counter_t                     ** _stat_nb_branch_hit       ; //[nb_context]
+  private   : counter_t                     ** _stat_nb_branch_miss      ; //[nb_context]
+  private   : counter_t                     ** _stat_nb_branch_unused    ; //[nb_context]
+  private   : counter_t                     ** _stat_queue_nb_cycle_empty; //[nb_context]
+  private   : counter_t                     ** _stat_queue_nb_cycle_full ; //[nb_context]
+  private   : counter_t                     ** _stat_queue_nb_elt        ; //[nb_context]
+
 #endif
 
@@ -59,37 +67,37 @@
     // ~~~~~[ Interface ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     // ~~~~~[ Interface : "" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-  public    : SC_CLOCK                      *  in_CLOCK        ;
-  public    : SC_IN (Tcontrol_t)            *  in_NRESET       ;
+  public    : SC_CLOCK                      *  in_CLOCK                          ;
+  public    : SC_IN (Tcontrol_t)            *  in_NRESET                         ;
 
     // ~~~~~[ Interface : "predict" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-  public    : SC_IN (Tcontrol_t         )  **  in_PREDICT_VAL                 ; //[nb_inst_predict]
-  public    : SC_OUT(Tcontrol_t         )  ** out_PREDICT_ACK                 ; //[nb_inst_predict]
-  public    : SC_IN (Tcontext_t         )  **  in_PREDICT_CONTEXT_ID          ; //[nb_inst_predict]
-  public    : SC_IN (Taddress_t         )  **  in_PREDICT_BTB_ADDRESS_SRC     ; //[nb_inst_predict]
-  public    : SC_IN (Taddress_t         )  **  in_PREDICT_BTB_ADDRESS_DEST    ; //[nb_inst_predict]
-  public    : SC_IN (Tbranch_condition_t)  **  in_PREDICT_BTB_CONDITION       ; //[nb_inst_predict]
-  public    : SC_IN (Tcontrol_t         )  **  in_PREDICT_BTB_LAST_TAKE       ; //[nb_inst_predict]
-  public    : SC_IN (Tcontrol_t         )  **  in_PREDICT_BTB_IS_ACCURATE     ; //[nb_inst_predict]
-  public    : SC_IN (Thistory_t         )  **  in_PREDICT_DIR_HISTORY         ; //[nb_inst_predict]
-  public    : SC_IN (Taddress_t         )  **  in_PREDICT_RAS_ADDRESS         ; //[nb_inst_predict]
-  public    : SC_IN (Tptr_t             )  **  in_PREDICT_RAS_INDEX           ; //[nb_inst_predict]
-//public    : SC_OUT(Tprediction_ptr_t  )  ** out_PREDICT_UPDATE_PREDICTION_ID; //[nb_inst_predict]
+  public    : SC_IN (Tcontrol_t         )  **  in_PREDICT_VAL                    ; //[nb_inst_predict]
+  public    : SC_OUT(Tcontrol_t         )  ** out_PREDICT_ACK                    ; //[nb_inst_predict]
+  public    : SC_IN (Tcontext_t         )  **  in_PREDICT_CONTEXT_ID             ; //[nb_inst_predict]
+  public    : SC_IN (Taddress_t         )  **  in_PREDICT_BTB_ADDRESS_SRC        ; //[nb_inst_predict]
+  public    : SC_IN (Taddress_t         )  **  in_PREDICT_BTB_ADDRESS_DEST       ; //[nb_inst_predict]
+  public    : SC_IN (Tbranch_condition_t)  **  in_PREDICT_BTB_CONDITION          ; //[nb_inst_predict]
+  public    : SC_IN (Tcontrol_t         )  **  in_PREDICT_BTB_LAST_TAKE          ; //[nb_inst_predict]
+  public    : SC_IN (Tcontrol_t         )  **  in_PREDICT_BTB_IS_ACCURATE        ; //[nb_inst_predict]
+  public    : SC_IN (Thistory_t         )  **  in_PREDICT_DIR_HISTORY            ; //[nb_inst_predict]
+  public    : SC_IN (Taddress_t         )  **  in_PREDICT_RAS_ADDRESS            ; //[nb_inst_predict]
+  public    : SC_IN (Tptr_t             )  **  in_PREDICT_RAS_INDEX              ; //[nb_inst_predict]
+  public    : SC_OUT(Tprediction_ptr_t  )  ** out_PREDICT_UPDATE_PREDICTION_ID   ; //[nb_inst_predict]
 
     // ~~~~~[ Interface : "decod" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-  public    : SC_IN (Tcontrol_t         )  **  in_DECOD_VAL                   ; //[nb_inst_decod]
-  public    : SC_OUT(Tcontrol_t         )  ** out_DECOD_ACK                   ; //[nb_inst_decod]
-  public    : SC_IN (Tcontext_t         )  **  in_DECOD_CONTEXT_ID            ; //[nb_inst_decod]
-  public    : SC_IN (Taddress_t         )  **  in_DECOD_BTB_ADDRESS_SRC       ; //[nb_inst_decod]
-  public    : SC_IN (Taddress_t         )  **  in_DECOD_BTB_ADDRESS_DEST      ; //[nb_inst_decod]
-  public    : SC_IN (Tbranch_condition_t)  **  in_DECOD_BTB_CONDITION         ; //[nb_inst_decod]
-  public    : SC_IN (Tcontrol_t         )  **  in_DECOD_BTB_LAST_TAKE         ; //[nb_inst_decod]
-//public    : SC_IN (Tcontrol_t         )  **  in_DECOD_BTB_IS_ACCURATE       ; //[nb_inst_decod]
-//public    : SC_IN (Thistory_t         )  **  in_DECOD_DIR_HISTORY           ; //[nb_inst_decod] // if ifetch prediction is miss -> miss btb -> make a static state
-  public    : SC_IN (Taddress_t         )  **  in_DECOD_RAS_ADDRESS           ; //[nb_inst_decod]
-  public    : SC_IN (Tptr_t             )  **  in_DECOD_RAS_INDEX             ; //[nb_inst_decod]
-  public    : SC_IN (Tcontrol_t         )  **  in_DECOD_MISS_IFETCH           ; //[nb_inst_decod]
-  public    : SC_IN (Tcontrol_t         )  **  in_DECOD_MISS_DECOD            ; //[nb_inst_decod]
-  public    : SC_IN (Tprediction_ptr_t  )  **  in_DECOD_UPDATE_PREDICTION_ID  ; //[nb_inst_decod]
-//public    : SC_OUT(Tdepth_t           )  ** out_DECOD_DEPTH                 ; //[nb_inst_decod]
+  public    : SC_IN (Tcontrol_t         )  **  in_DECOD_VAL                      ; //[nb_inst_decod]
+  public    : SC_OUT(Tcontrol_t         )  ** out_DECOD_ACK                      ; //[nb_inst_decod]
+  public    : SC_IN (Tcontext_t         )  **  in_DECOD_CONTEXT_ID               ; //[nb_inst_decod]
+  public    : SC_IN (Taddress_t         )  **  in_DECOD_BTB_ADDRESS_SRC          ; //[nb_inst_decod]
+  public    : SC_IN (Taddress_t         )  **  in_DECOD_BTB_ADDRESS_DEST         ; //[nb_inst_decod]
+  public    : SC_IN (Tbranch_condition_t)  **  in_DECOD_BTB_CONDITION            ; //[nb_inst_decod]
+  public    : SC_IN (Tcontrol_t         )  **  in_DECOD_BTB_LAST_TAKE            ; //[nb_inst_decod]
+//public    : SC_IN (Thistory_t         )  **  in_DECOD_DIR_HISTORY              ; //[nb_inst_decod] // if ifetch prediction is miss -> miss btb -> make a static state
+  public    : SC_IN (Taddress_t         )  **  in_DECOD_RAS_ADDRESS              ; //[nb_inst_decod]
+  public    : SC_IN (Tptr_t             )  **  in_DECOD_RAS_INDEX                ; //[nb_inst_decod]
+  public    : SC_IN (Tcontrol_t         )  **  in_DECOD_MISS_IFETCH              ; //[nb_inst_decod]
+  public    : SC_IN (Tcontrol_t         )  **  in_DECOD_MISS_DECOD               ; //[nb_inst_decod]
+  public    : SC_IN (Tprediction_ptr_t  )  **  in_DECOD_UPDATE_PREDICTION_ID     ; //[nb_inst_decod]
+//public    : SC_OUT(Tdepth_t           )  ** out_DECOD_DEPTH                    ; //[nb_inst_decod]
+  public    : SC_IN (Tcontrol_t         )  **  in_DECOD_IS_ACCURATE              ; //[nb_inst_decod]
 
     // ~~~~~[ Interface : "branch_complete" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -106,48 +114,69 @@
 
     // ~~~~~[ Interface : "branch_event" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-  public    : SC_OUT(Tcontrol_t         )  ** out_BRANCH_EVENT_VAL            ; //[nb_context]
-  public    : SC_IN (Tcontrol_t         )  **  in_BRANCH_EVENT_ACK            ; //[nb_context]
-//public    : SC_OUT(Tcontext_t         )  ** out_BRANCH_EVENT_CONTEXT_ID     ; //[nb_context]
-//public    : SC_OUT(Tdepth_t           )  ** out_BRANCH_EVENT_DEPTH          ; //[nb_context]
-//public    : SC_OUT(Tcontrol_t         )  ** out_BRANCH_EVENT_MISS_PREDICTION; //[nb_context] is always miss prediction
-  public    : SC_OUT(Taddress_t         )  ** out_BRANCH_EVENT_ADDRESS_SRC    ; //[nb_context]
-  public    : SC_OUT(Taddress_t         )  ** out_BRANCH_EVENT_ADDRESS_DEST   ; //[nb_context]
+  public    : SC_OUT(Tcontrol_t         )  ** out_BRANCH_EVENT_VAL               ; //[nb_context]
+  public    : SC_IN (Tcontrol_t         )  **  in_BRANCH_EVENT_ACK               ; //[nb_context]
+//public    : SC_OUT(Tcontext_t         )  ** out_BRANCH_EVENT_CONTEXT_ID        ; //[nb_context]
+//public    : SC_OUT(Tdepth_t           )  ** out_BRANCH_EVENT_DEPTH             ; //[nb_context]
+//public    : SC_OUT(Tcontrol_t         )  ** out_BRANCH_EVENT_MISS_PREDICTION   ; //[nb_context] is always miss prediction
+  public    : SC_OUT(Taddress_t         )  ** out_BRANCH_EVENT_ADDRESS_SRC       ; //[nb_context]
+  public    : SC_OUT(Taddress_t         )  ** out_BRANCH_EVENT_ADDRESS_DEST      ; //[nb_context]
 
     // ~~~~~[ Interface : "update" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-  public    : SC_OUT(Tcontrol_t         )  ** out_UPDATE_VAL                  ; //[nb_inst_update]
-  public    : SC_IN (Tcontrol_t         )  **  in_UPDATE_ACK                  ; //[nb_inst_update]
-  public    : SC_OUT(Tcontext_t         )  ** out_UPDATE_CONTEXT_ID           ; //[nb_inst_update]
-  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_BTB_VAL              ; //[nb_inst_update]
-  public    : SC_OUT(Taddress_t         )  ** out_UPDATE_BTB_ADDRESS_SRC      ; //[nb_inst_update]
-  public    : SC_OUT(Taddress_t         )  ** out_UPDATE_BTB_ADDRESS_DEST     ; //[nb_inst_update]
-  public    : SC_OUT(Tbranch_condition_t)  ** out_UPDATE_BTB_CONDITION        ; //[nb_inst_update]
-  public    : SC_OUT(Tcontrol_t         )  ** out_UPDATE_DIR_VAL              ; //[nb_inst_update]
-  public    : SC_OUT(Thistory_t         )  ** out_UPDATE_DIR_HISTORY          ; //[nb_inst_update]
-  public    : SC_OUT(Tcontrol_t         )  ** out_UPDATE_RAS_VAL              ; //[nb_inst_update]
-  public    : SC_OUT(Tcontrol_t         )  ** out_UPDATE_RAS_PUSH             ; //[nb_inst_update]
-  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]
+  public    : SC_OUT(Tcontrol_t         )  ** out_UPDATE_VAL                     ; //[nb_inst_update]
+  public    : SC_IN (Tcontrol_t         )  **  in_UPDATE_ACK                     ; //[nb_inst_update]
+  public    : SC_OUT(Tcontext_t         )  ** out_UPDATE_CONTEXT_ID              ; //[nb_inst_update]
+  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_BTB_VAL                 ; //[nb_inst_update]
+  public    : SC_OUT(Taddress_t         )  ** out_UPDATE_BTB_ADDRESS_SRC         ; //[nb_inst_update]
+  public    : SC_OUT(Taddress_t         )  ** out_UPDATE_BTB_ADDRESS_DEST        ; //[nb_inst_update]
+  public    : SC_OUT(Tbranch_condition_t)  ** out_UPDATE_BTB_CONDITION           ; //[nb_inst_update]
+  public    : SC_OUT(Tcontrol_t         )  ** out_UPDATE_DIR_VAL                 ; //[nb_inst_update]
+  public    : SC_OUT(Thistory_t         )  ** out_UPDATE_DIR_HISTORY             ; //[nb_inst_update]
+  public    : SC_OUT(Tcontrol_t         )  ** out_UPDATE_RAS_VAL                 ; //[nb_inst_update]
+  public    : SC_OUT(Tcontrol_t         )  ** out_UPDATE_RAS_PUSH                ; //[nb_inst_update]
+  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 : "depth" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-  public    : SC_OUT(Tdepth_t           )  ** out_DEPTH_NB_BRANCH; //[nb_context]
-  public    : SC_OUT(Tdepth_t           )  ** out_DEPTH_TAIL; //[nb_context]
+  public    : SC_OUT(Tdepth_t           )  ** out_DEPTH_CURRENT                  ; //[nb_context] 
+  public    : SC_OUT(Tdepth_t           )  ** out_DEPTH_MIN                      ; //[nb_context]
+  public    : SC_OUT(Tdepth_t           )  ** out_DEPTH_MAX                      ; //[nb_context]
+    // If DEPTH_CURRENT :
+    // equal at     DEPTH_MIN            -> not speculative
+    // not include ]DEPTH_MIN:DEPTH_MAX[ -> previous branch miss
+    //     include ]DEPTH_MIN:DEPTH_MAX[ -> speculative
 
     // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~    
 
     // ~~~~~[ Register ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~    
-  private   : uint32_t                      * reg_TOP                    ; //[nb_context]
-  private   : uint32_t                      * reg_BOTTOM                 ; //[nb_context]
-  private   : uint32_t                      * reg_NB_ELT                 ; //[nb_context]
-  private   : uint32_t                      * reg_NB_ELT_UPDATE          ; //[nb_context]
-  private   : uint32_t                      * reg_NB_ELT_NEED_UPDATE     ; //[nb_context]
-  private   : entry_t                      ** reg_UPDATE_PREDICTION_TABLE; //[nb_context][size_queue]
-  private   : uint32_t                        reg_UPDATE_PRIORITY        ;
+  private   : uint32_t                        reg_UPDATE_PRIORITY                ;
+                                                                                 
+  private   : ufpt_entry_t                 ** reg_UPDATE_FETCH_PREDICTION_TABLE  ; //[nb_context][size_ufpt_queue]
+  private   : uint32_t                      * reg_UFPT_BOTTOM                    ; //[nb_context]
+  private   : uint32_t                      * reg_UFPT_TOP                       ; //[nb_context]
+  private   : uint32_t                      * reg_UFPT_UPDATE                    ; //[nb_context]
+  private   : uint32_t                      * reg_UFPT_NB_NEED_UPDATE            ; //[nb_context]
+                                                                                              
+  private   : upt_entry_t                  ** reg_UPDATE_PREDICTION_TABLE        ; //[nb_context][size_upt_queue]
+  private   : uint32_t                      * reg_UPT_BOTTOM                     ; //[nb_context]
+  private   : uint32_t                      * reg_UPT_TOP                        ; //[nb_context]
+  private   : uint32_t                      * reg_UPT_UPDATE                     ; //[nb_context]
+  private   : uint32_t                      * reg_UPT_NB_NEED_UPDATE             ; //[nb_context]
+                                                                                              
+  private   : bool                          * reg_IS_ACCURATE                    ; //[nb_context]
+
+  private   : event_state_t                 * reg_EVENT_STATE                    ; //[nb_context]
+  private   : Tcontrol_t                    * reg_EVENT_RAS_CORRUPTED            ; //[nb_context] // RAS must be flush
+  private   : Taddress_t                    * reg_EVENT_ADDRESS_SRC              ; //[nb_context] // Address branch
+  private   : Tcontrol_t                    * reg_EVENT_ADDRESS_SRC_VAL          ; //[nb_context] // if miss ifetch, decod issue branch, dest must be reload
+  private   : Taddress_t                    * reg_EVENT_ADDRESS_DEST             ; //[nb_context] // Address dest
 
     // ~~~~~[ Internal ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   private   : Tcontrol_t                    * internal_PREDICT_ACK                    ; //[nb_inst_predict]
+  private   : Tdepth_t                      * internal_PREDICT_UPDATE_PREDICTION_ID   ; //[nb_inst_predict]
   private   : Tcontrol_t                    * internal_DECOD_ACK                      ; //[nb_inst_decod]
+  private   : uint32_t                      * internal_DECOD_UPT_PTR_WRITE            ; //[nb_inst_decod]
   private   : Tcontrol_t                    * internal_BRANCH_COMPLETE_ACK            ; //[nb_inst_branch_complete]
   private   : Tcontrol_t                    * internal_BRANCH_COMPLETE_MISS_PREDICTION; //[nb_inst_branch_complete]
@@ -157,6 +186,10 @@
   private   : Tdepth_t                      * internal_BRANCH_EVENT_DEPTH             ; //[nb_context]
   private   : Tcontrol_t                    * internal_UPDATE_VAL                     ; //[nb_inst_update]
+  private   : Tcontrol_t                    * internal_UPDATE_VAL_WITHOUT_ACK         ; //[nb_inst_update]
   private   : Tcontext_t                    * internal_UPDATE_CONTEXT_ID              ; //[nb_inst_update]
+  private   : bool                          * internal_UPDATE_FROM_UFPT               ; //[nb_inst_update]
   private   : Tdepth_t                      * internal_UPDATE_DEPTH                   ; //[nb_inst_update]
+  private   : bool                          * internal_UPDATE_RAS                     ; //[nb_inst_update]
+
 #endif
 
