Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Prediction_unit_Glue/src/Prediction_unit_Glue_genMealy_decod.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Prediction_unit_Glue/src/Prediction_unit_Glue_genMealy_decod.cpp	(revision 107)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Prediction_unit_Glue/src/Prediction_unit_Glue_genMealy_decod.cpp	(revision 110)
@@ -78,4 +78,5 @@
           //   * branch was not detected
           Tcontrol_t        miss_decod            = (branch_state == BRANCH_STATE_NONE);
+          Tcontrol_t        can_continue          = false;
 
 	  log_printf(TRACE,Prediction_unit_Glue,FUNCTION,"  * DECOD [%d][%d]          : valid",decod_unit,i);
@@ -90,5 +91,5 @@
 	    {
 	      Tbranch_condition_t condition    = PORT_READ(in_DECOD_BRANCH_CONDITION            [decod_unit][i]);
-	      Tcontrol_t          direction    = PORT_READ(in_DECOD_BRANCH_DIRECTION            [decod_unit][i]);
+	      Tcontrol_t          take;
 	      Taddress_t          address_src  = PORT_READ(in_DECOD_ADDRESS_SRC                 [decod_unit][i]);
 	      Taddress_t          address_dest = PORT_READ(in_DECOD_ADDRESS_DEST                [decod_unit][i]);
@@ -105,4 +106,5 @@
                     log_printf(TRACE,Prediction_unit_Glue,FUNCTION,"      * BRANCH_CONDITION_NONE_WITH_WRITE_STACK");
 
+                    take        = true ;
 		    is_accurate = true ;//PORT_READ(in_DECOD_RAS_HIT [port]);
 		    use_ras     = true ;
@@ -119,4 +121,5 @@
                     log_printf(TRACE,Prediction_unit_Glue,FUNCTION,"      * BRANCH_CONDITION_READ_REGISTER_WITH_WRITE_STACK");
 
+                    take        = true ;
 		    is_accurate = false; // address unknow : in a register
 		    use_ras     = true;
@@ -132,4 +135,5 @@
                     log_printf(TRACE,Prediction_unit_Glue,FUNCTION,"      * BRANCH_CONDITION_READ_STACK");
 
+                    take        = true ;
 		    is_accurate = PORT_READ(in_DECOD_RAS_HIT [port]);
 		    use_ras     = true;
@@ -146,4 +150,5 @@
 
 		    //   * READ_REGISTER_WITHOUT_WRITE_STACK : Take but destination is unknow - don't continue
+                    take        = true ;
 		    is_accurate = false; // address unknow : in a register
 
@@ -158,4 +163,5 @@
                     log_printf(TRACE,Prediction_unit_Glue,FUNCTION,"      * BRANCH_CONDITION_FLAG");
 
+                    take        = PORT_READ(in_DECOD_BRANCH_DIRECTION [decod_unit][i]);
 		    is_accurate = true; // address dest is know
 
@@ -168,4 +174,5 @@
                     log_printf(TRACE,Prediction_unit_Glue,FUNCTION,"      * BRANCH_CONDITION_NONE_WITHOUT_WRITE_STACK");
 
+                    take        = true;
 		    is_accurate = true;
 
@@ -173,4 +180,6 @@
 		  }
 		}
+
+              log_printf(TRACE,Prediction_unit_Glue,FUNCTION,"    * take         : %d",take);
 
 	      if (use_btb)
@@ -181,5 +190,5 @@
 		  PORT_WRITE(out_DECOD_BTB_ADDRESS_DEST    [port],address_dest);
 		  PORT_WRITE(out_DECOD_BTB_CONDITION       [port],condition);
-		  PORT_WRITE(out_DECOD_BTB_LAST_TAKE       [port],direction);
+		  PORT_WRITE(out_DECOD_BTB_LAST_TAKE       [port],take);
 		  PORT_WRITE(out_DECOD_BTB_MISS_PREDICTION [port],1);
 		  PORT_WRITE(out_DECOD_BTB_IS_ACCURATE     [port],is_accurate);
@@ -198,22 +207,32 @@
 		  PORT_WRITE(out_DECOD_UPT_BTB_ADDRESS_DEST[port],address_dest);
 		  PORT_WRITE(out_DECOD_UPT_BTB_CONDITION   [port],condition);
-		  PORT_WRITE(out_DECOD_UPT_BTB_LAST_TAKE   [port],direction);
+		  PORT_WRITE(out_DECOD_UPT_BTB_LAST_TAKE   [port],take);
 		  PORT_WRITE(out_DECOD_UPT_RAS_ADDRESS     [port],PORT_READ(in_DECOD_RAS_ADDRESS_POP [port]));
 		  PORT_WRITE(out_DECOD_UPT_IS_ACCURATE     [port],is_accurate);
 		}
+
+              can_continue = false; // need update upt
 	    }
-// 	  else
-// 	    {
-//               log_printf(TRACE,Prediction_unit_Glue,FUNCTION,"    * hit");
+ 	  else
+ 	    {
+              log_printf(TRACE,Prediction_unit_Glue,FUNCTION,"    * hit");
+
+              if (branch_state == BRANCH_STATE_SPEC_NTAKE)
+                can_continue = PORT_READ(in_DECOD_UPT_CAN_CONTINUE [port]);
+              else
+                // BRANCH_STATE_NONE       -> miss
+                // BRANCH_STATE_NSPEC_TAKE -> take
+                // BRANCH_STATE_SPEC_TAKE  -> take
+                can_continue = false;
 
 // 	      miss_decod = false;
 // 	      // Hit speculation
-// 	    }
+ 	    }
 	  
-
 	  // in all case
-	  log_printf(TRACE,Prediction_unit_Glue,FUNCTION,"    * use_btb : %d",use_btb);
-	  log_printf(TRACE,Prediction_unit_Glue,FUNCTION,"    * use_ras : %d",use_ras);
-	  log_printf(TRACE,Prediction_unit_Glue,FUNCTION,"    * use_upt : %d",use_upt);
+	  log_printf(TRACE,Prediction_unit_Glue,FUNCTION,"    * can_continue : %d",can_continue);
+	  log_printf(TRACE,Prediction_unit_Glue,FUNCTION,"    * use_btb      : %d",use_btb);
+	  log_printf(TRACE,Prediction_unit_Glue,FUNCTION,"    * use_ras      : %d",use_ras);
+	  log_printf(TRACE,Prediction_unit_Glue,FUNCTION,"    * use_upt      : %d",use_upt);
 	  log_printf(TRACE,Prediction_unit_Glue,FUNCTION,"    * btb_ack [%d] : %d",port,PORT_READ(in_DECOD_BTB_ACK [port]));
 	  log_printf(TRACE,Prediction_unit_Glue,FUNCTION,"    * ras_ack [%d] : %d",port,PORT_READ(in_DECOD_RAS_ACK [port]));
@@ -250,5 +269,6 @@
 	  if (_param->_have_port_depth)
 	  PORT_WRITE(out_DECOD_UPT_UPDATE_PREDICTION_ID [port],depth);
-	  
+          PORT_WRITE(out_DECOD_CAN_CONTINUE [decod_unit][i], can_continue);
+
 	  port ++; // have find port
 	}
