Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Context_State/src/Context_State_transition.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Context_State/src/Context_State_transition.cpp	(revision 106)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Context_State/src/Context_State_transition.cpp	(revision 108)
@@ -82,4 +82,13 @@
                   break;
                 }
+              case CONTEXT_STATE_KO_MISS_BRANCH_AND_LOAD_WAITEND :
+                {
+                  // Wait end of all instruction
+                  if (inst_all == 0)
+                    
+//                  state = CONTEXT_STATE_OK; // @@@ TODO : make MISS fast (miss decod)
+                    state = CONTEXT_STATE_KO_MISS_BRANCH_AND_LOAD_ADDR;
+                  break;
+                }
               case CONTEXT_STATE_KO_EXCEP_SPR    :
                 {
@@ -93,4 +102,9 @@
                 }
               case CONTEXT_STATE_KO_MISS_LOAD_ADDR    :
+                {
+                  // nothing, wait the update of internal register (pc)
+                  break;
+                }
+              case CONTEXT_STATE_KO_MISS_BRANCH_AND_LOAD_ADDR    :
                 {
                   // nothing, wait the update of internal register (pc)
@@ -209,8 +223,10 @@
 
               // priority : miss > excep > spr/sync
-              uint8_t    priority0  = ((state == CONTEXT_STATE_KO_MISS_BRANCH_ADDR   ) or
-                                       (state == CONTEXT_STATE_KO_MISS_LOAD_ADDR     ) or
-                                       (state == CONTEXT_STATE_KO_MISS_BRANCH_WAITEND) or
-                                       (state == CONTEXT_STATE_KO_MISS_LOAD_WAITEND  ))?2:((state == EVENT_TYPE_EXCEPTION)?1:0);
+              uint8_t    priority0  = ((state == CONTEXT_STATE_KO_MISS_BRANCH_ADDR            ) or
+                                       (state == CONTEXT_STATE_KO_MISS_LOAD_ADDR              ) or
+                                       (state == CONTEXT_STATE_KO_MISS_BRANCH_AND_LOAD_ADDR   ) or
+                                       (state == CONTEXT_STATE_KO_MISS_BRANCH_WAITEND         ) or
+                                       (state == CONTEXT_STATE_KO_MISS_LOAD_WAITEND           ) or
+                                       (state == CONTEXT_STATE_KO_MISS_BRANCH_AND_LOAD_WAITEND))?2:((state == EVENT_TYPE_EXCEPTION)?1:0);
               uint8_t    priority1  = 2; // miss
 
@@ -272,8 +288,10 @@
               
               // miss > excep > spr/sync
-              uint8_t    priority0  = ((state == CONTEXT_STATE_KO_MISS_BRANCH_ADDR   ) or
-                                       (state == CONTEXT_STATE_KO_MISS_LOAD_ADDR     ) or
-                                       (state == CONTEXT_STATE_KO_MISS_BRANCH_WAITEND) or
-                                       (state == CONTEXT_STATE_KO_MISS_LOAD_WAITEND  ))?2:((state == CONTEXT_STATE_KO_EXCEP)?1:0);
+              uint8_t    priority0  = ((state == CONTEXT_STATE_KO_MISS_BRANCH_ADDR            ) or
+                                       (state == CONTEXT_STATE_KO_MISS_LOAD_ADDR              ) or
+                                       (state == CONTEXT_STATE_KO_MISS_BRANCH_AND_LOAD_ADDR   ) or
+                                       (state == CONTEXT_STATE_KO_MISS_BRANCH_WAITEND         ) or
+                                       (state == CONTEXT_STATE_KO_MISS_LOAD_WAITEND           ) or
+                                       (state == CONTEXT_STATE_KO_MISS_BRANCH_AND_LOAD_WAITEND))?2:((state == CONTEXT_STATE_KO_EXCEP)?1:0);
               uint8_t    priority1  = (state == EVENT_TYPE_EXCEPTION)?1:0;
 
@@ -405,8 +423,10 @@
             
             // miss > excep > spr/sync
-            uint8_t    priority0  = ((state == CONTEXT_STATE_KO_MISS_BRANCH_ADDR   ) or
-                                     (state == CONTEXT_STATE_KO_MISS_LOAD_ADDR     ) or
-                                     (state == CONTEXT_STATE_KO_MISS_BRANCH_WAITEND) or
-                                     (state == CONTEXT_STATE_KO_MISS_LOAD_WAITEND  ))?2:((state == CONTEXT_STATE_KO_EXCEP)?1:0);
+              uint8_t    priority0  = ((state == CONTEXT_STATE_KO_MISS_BRANCH_ADDR            ) or
+                                       (state == CONTEXT_STATE_KO_MISS_LOAD_ADDR              ) or
+                                       (state == CONTEXT_STATE_KO_MISS_BRANCH_AND_LOAD_ADDR   ) or
+                                       (state == CONTEXT_STATE_KO_MISS_BRANCH_WAITEND         ) or
+                                       (state == CONTEXT_STATE_KO_MISS_LOAD_WAITEND           ) or
+                                       (state == CONTEXT_STATE_KO_MISS_BRANCH_AND_LOAD_WAITEND))?2:((state == CONTEXT_STATE_KO_EXCEP)?1:0);
             uint8_t    priority1  = (state == EVENT_TYPE_EXCEPTION)?1:2; // else load_miss_speculation (EVENT_TYPE_MISS_SPECULATION)
 
@@ -437,5 +457,16 @@
                   {
                   case EVENT_TYPE_EXCEPTION               : {state_next = CONTEXT_STATE_KO_EXCEP;             break;}
-                  case EVENT_TYPE_LOAD_MISS_SPECULATION   : {state_next = CONTEXT_STATE_KO_MISS_LOAD_WAITEND; break;}
+                  case EVENT_TYPE_LOAD_MISS_SPECULATION   : 
+                    {
+                      // Test if previous branch occure
+                      if ((state == CONTEXT_STATE_KO_MISS_BRANCH_ADDR            ) or
+                          (state == CONTEXT_STATE_KO_MISS_BRANCH_WAITEND         ) or
+                          (state == CONTEXT_STATE_KO_MISS_BRANCH_AND_LOAD_ADDR   ) or
+                          (state == CONTEXT_STATE_KO_MISS_BRANCH_AND_LOAD_WAITEND))
+                        state_next = CONTEXT_STATE_KO_MISS_BRANCH_AND_LOAD_WAITEND;
+                      else
+                        state_next = CONTEXT_STATE_KO_MISS_LOAD_WAITEND;
+                      break;
+                    }
                   case EVENT_TYPE_BRANCH_MISS_SPECULATION :
                   case EVENT_TYPE_SPR_ACCESS              :
@@ -480,4 +511,5 @@
                   }
                 case CONTEXT_STATE_KO_MISS_BRANCH_ADDR:
+
 //                   {
 //                     reg_STATE [i] = CONTEXT_STATE_KO_MISS_WAITEND; //@@@ TODO : make MISS fast (miss decod)
@@ -489,4 +521,9 @@
                   {
                     reg_STATE [i] = CONTEXT_STATE_OK;
+                    break;
+                  }
+                case CONTEXT_STATE_KO_MISS_BRANCH_AND_LOAD_ADDR:
+                  {
+                    reg_STATE [i] = CONTEXT_STATE_KO_MISS_LOAD_ADDR;
                     break;
                   }
