Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Decod_unit/Decod/SelfTest/src/test.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Decod_unit/Decod/SelfTest/src/test.cpp	(revision 108)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Decod_unit/Decod/SelfTest/src/test.cpp	(revision 110)
@@ -100,5 +100,5 @@
   ALLOC1_SC_SIGNAL(out_PREDICT_ADDRESS_SRC                ,"out_PREDICT_ADDRESS_SRC                ",Tgeneral_data_t    ,_param->_nb_inst_decod);
   ALLOC1_SC_SIGNAL(out_PREDICT_ADDRESS_DEST               ,"out_PREDICT_ADDRESS_DEST               ",Tgeneral_data_t    ,_param->_nb_inst_decod);
-//   ALLOC1_SC_SIGNAL( in_PREDICT_CAN_CONTINUE               ," in_PREDICT_CAN_CONTINUE               ",Tcontrol_t         ,_param->_nb_inst_decod);
+  ALLOC1_SC_SIGNAL( in_PREDICT_CAN_CONTINUE               ," in_PREDICT_CAN_CONTINUE               ",Tcontrol_t         ,_param->_nb_inst_decod);
   ALLOC1_SC_SIGNAL( in_CONTEXT_DECOD_ENABLE               ," in_CONTEXT_DECOD_ENABLE               ",Tcontrol_t         ,_param->_nb_context);
   ALLOC1_SC_SIGNAL( in_CONTEXT_DEPTH_VAL                  ," in_CONTEXT_DEPTH_VAL                  ",Tcontrol_t         ,_param->_nb_context);
@@ -183,5 +183,5 @@
   INSTANCE1_SC_SIGNAL(_Decod,out_PREDICT_ADDRESS_SRC                ,_param->_nb_inst_decod);
   INSTANCE1_SC_SIGNAL(_Decod,out_PREDICT_ADDRESS_DEST               ,_param->_nb_inst_decod);
-//   INSTANCE1_SC_SIGNAL(_Decod, in_PREDICT_CAN_CONTINUE               ,_param->_nb_inst_decod);
+  INSTANCE1_SC_SIGNAL(_Decod, in_PREDICT_CAN_CONTINUE               ,_param->_nb_inst_decod);
   INSTANCE1_SC_SIGNAL(_Decod, in_CONTEXT_DECOD_ENABLE               ,_param->_nb_context);
   INSTANCE1_SC_SIGNAL(_Decod, in_CONTEXT_DEPTH_VAL                  ,_param->_nb_context);
@@ -306,5 +306,5 @@
 
 		in_PREDICT_ACK          [i]->write((rand()%100)<percent_transaction_predict);
-// 		in_PREDICT_CAN_CONTINUE [i]->write(0);
+ 		in_PREDICT_CAN_CONTINUE [i]->write(0);
 	      }
 	  }
@@ -486,5 +486,5 @@
   delete [] out_PREDICT_ADDRESS_SRC                ;
   delete [] out_PREDICT_ADDRESS_DEST               ;
-//delete []  in_PREDICT_CAN_CONTINUE               ;
+  delete []  in_PREDICT_CAN_CONTINUE               ;
   
   delete []  in_CONTEXT_DECOD_ENABLE               ;
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Decod_unit/Decod/include/Decod.h
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Decod_unit/Decod/include/Decod.h	(revision 108)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Decod_unit/Decod/include/Decod.h	(revision 110)
@@ -119,5 +119,5 @@
   public    : SC_OUT(Tgeneral_data_t    )  ** out_PREDICT_ADDRESS_SRC                ;//[nb_inst_decod]
   public    : SC_OUT(Tgeneral_data_t    )  ** out_PREDICT_ADDRESS_DEST               ;//[nb_inst_decod]
-//public    : SC_IN (Tcontrol_t         )  **  in_PREDICT_CAN_CONTINUE               ;//[nb_inst_decod]
+  public    : SC_IN (Tcontrol_t         )  **  in_PREDICT_CAN_CONTINUE               ;//[nb_inst_decod]
 
     // ~~~~~[ Interface : "context" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Decod_unit/Decod/src/Decod_allocation.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Decod_unit/Decod/src/Decod_allocation.cpp	(revision 108)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Decod_unit/Decod/src/Decod_allocation.cpp	(revision 110)
@@ -124,5 +124,5 @@
       ALLOC1_SIGNAL_OUT(out_PREDICT_ADDRESS_SRC                ,"address_src"                ,Tgeneral_data_t    ,_param->_size_instruction_address    );
       ALLOC1_SIGNAL_OUT(out_PREDICT_ADDRESS_DEST               ,"address_dest"               ,Tgeneral_data_t    ,_param->_size_instruction_address    );
-//    ALLOC1_SIGNAL_IN ( in_PREDICT_CAN_CONTINUE               ,"can_continue"               ,Tcontrol_t         ,1                             );
+      ALLOC1_SIGNAL_IN ( in_PREDICT_CAN_CONTINUE               ,"can_continue"               ,Tcontrol_t         ,1                             );
     }
     
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Decod_unit/Decod/src/Decod_deallocation.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Decod_unit/Decod/src/Decod_deallocation.cpp	(revision 108)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Decod_unit/Decod/src/Decod_deallocation.cpp	(revision 110)
@@ -79,5 +79,5 @@
         DELETE1_SIGNAL(out_PREDICT_ADDRESS_SRC                ,_param->_nb_inst_decod,_param->_size_instruction_address    );
         DELETE1_SIGNAL(out_PREDICT_ADDRESS_DEST               ,_param->_nb_inst_decod,_param->_size_instruction_address    );
-//      DELETE1_SIGNAL( in_PREDICT_CAN_CONTINUE               ,_param->_nb_inst_decod,1                             );
+        DELETE1_SIGNAL( in_PREDICT_CAN_CONTINUE               ,_param->_nb_inst_decod,1                             );
 
         DELETE1_SIGNAL(in_CONTEXT_DECOD_ENABLE, _param->_nb_context,1);
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Decod_unit/Decod/src/Decod_genMealy.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Decod_unit/Decod/src/Decod_genMealy.cpp	(revision 108)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Decod_unit/Decod/src/Decod_genMealy.cpp	(revision 110)
@@ -43,6 +43,5 @@
 
     Tcontrol_t can_continue      [_param->_nb_context];
-//     Tcontrol_t can_continue_next [_param->_nb_context];
-//     Tcontrol_t have_decod_branch [_param->_nb_context];
+    Tcontrol_t have_decod_branch [_param->_nb_context];
 
     for (uint32_t i=0; i<_param->_nb_context; i++)
@@ -53,6 +52,5 @@
 	
 	can_continue                      [i] = PORT_READ(in_CONTEXT_DECOD_ENABLE [i]);
-//  	can_continue_next                 [i] = PORT_READ(in_CONTEXT_DECOD_ENABLE [i]);
-//         have_decod_branch                 [i] = false;
+        have_decod_branch                 [i] = false;
       }
     
@@ -80,6 +78,4 @@
                 log_printf(TRACE,Decod,FUNCTION,"  * IFETCH [%d][%d]",x,y);    
                 log_printf(TRACE,Decod,FUNCTION,"    * decod_ack [%d] : %d",i,PORT_READ(in_DECOD_ACK [i]));
-
-//  		can_continue [x] = can_continue_next [x];
 
 		decod_val  [i]    = true;                        // fetch_val and decod_enable 
@@ -131,6 +127,10 @@
 
 		Ttype_t      type      = _decod_instruction->_type;
-                Tdepth_t     depth     = (_param->_have_port_depth)?PORT_READ(in_CONTEXT_DEPTH [x]):0; // DEPTH_CURRENT
-
+                // Depth current. If have decod a branch and i can continue : depth = depth_next
+                Tdepth_t     depth     = (_param->_have_port_depth)?PORT_READ(in_CONTEXT_DEPTH [x]):0;
+
+                if ((_param->_nb_branch_speculated[x] > 0) and have_decod_branch [x])
+                  depth = (depth+1)%_param->_nb_branch_speculated[x];
+                
 		if (_param->_have_port_context_id)
 		PORT_WRITE(out_DECOD_CONTEXT_ID    [i], x);
@@ -179,8 +179,9 @@
 		    log_printf(TRACE,Decod,FUNCTION,"      * address dest : %.8x (%.8x)",_decod_instruction->_address_next,_decod_instruction->_address_next<<2);
                     
-		    predict_val [i]     = ifetch_ack  [x][y] // and decod_val [i]
+                    // test if have already decod an branch : one branch per context
+		    predict_val [i]     = not have_decod_branch [x] and ifetch_ack  [x][y] // and decod_val [i]
 		      ;
-                    decod_val   [i]    &= PORT_READ(in_PREDICT_ACK [i]);// predict_ack and fetch_val and decod_enable 		    
-                    ifetch_ack  [x][y] &= PORT_READ(in_PREDICT_ACK [i]);// predict_ack and fetch_val and decod_enable and decod_ack
+                    decod_val   [i]    &= not have_decod_branch [x] and PORT_READ(in_PREDICT_ACK [i]);// predict_ack and fetch_val and decod_enable 		    
+                    ifetch_ack  [x][y] &= not have_decod_branch [x] and PORT_READ(in_PREDICT_ACK [i]);// predict_ack and fetch_val and decod_enable and decod_ack
                 
 		    if (_param->_have_port_context_id)
@@ -196,8 +197,9 @@
 		    PORT_WRITE(out_PREDICT_ADDRESS_DEST                [i],_decod_instruction->_address_next      );
 		
-		    //can_continue_next [x] = PORT_READ(in_PREDICT_CAN_CONTINUE [i]); // can continue is set if direction is "not take" (also, continue is sequential order)
- 		    can_continue [x] = false; // one branch per context, the DS don't execute
-//  		    can_continue_next [x] = false; // one branch per context, the DS don't execute
-//                     have_decod_branch [x] = true;
+                    // can continue is set if direction is "not take" (also, continue is sequential order)
+
+//   		    can_continue [x] = false; // one branch per context, the DS don't execute
+  		    can_continue [x]&= PORT_READ(in_PREDICT_CAN_CONTINUE [i]); // one branch per context, the DS don't execute
+                    have_decod_branch [x] = true;
 		  }
 
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Decod_unit/Decod/src/Decod_statistics_allocation.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Decod_unit/Decod/src/Decod_statistics_allocation.cpp	(revision 108)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Decod_unit/Decod/src/Decod_statistics_allocation.cpp	(revision 110)
@@ -33,6 +33,4 @@
     _stat->create_expr_average_by_cycle ("average_nb_inst_decod","sum_inst_decod","","Average of decod instruction by cycle");
     _stat->create_expr_percent          ("percent_nb_inst_decod","average_nb_inst_decod", toString(_param->_nb_inst_decod), "Percent of decod instruction by cycle");
-  
-
  
     log_printf(FUNC,Decod,FUNCTION,"End");
