Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Core_Glue/src/Core_Glue_genMealy_issue.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Core_Glue/src/Core_Glue_genMealy_issue.cpp	(revision 136)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Core_Glue/src/Core_Glue_genMealy_issue.cpp	(revision 138)
@@ -16,28 +16,28 @@
 
   /*
-      OOO        SLOT     Execute Loop                                  
-    ---+                      +-----
-       |  +-----+     +-----+ |     
-      -+->|     |     |     |-+->   
-       |  |     |-()->|     | |     
-      -+->| _ _ |     |     |-+->   
-       |  | _X_ |-()->|     | |     
-      -+->|     |     |     | +-----
-       |  |     |-()->|     |       
-      -+->|     |     |     | +-----
-       |  +-----+     |     | |     
-    ---+  crossbar    | _ _ |-+->   
-                      | _X_ | |     
-    ---+              |     |-+->   
-       |  +-----+     |     | |     
-      -+->|     |     |     | +-----
-       |  |     |-()->|     |       
-      -+->| _ _ |     |     | +-----
-       |  | _X_ |-()->|     | |     
-      -+->|     |     |     |-+->   
-       |  |     |-()->|     | |     
-      -+->|     |     |     |-+->   
-       |  +-----+     +-----+ |     
-    ---+  crossbar   dispatch +-----
+      OOO     Execute Loop                                  
+    ---+          +-----
+       |  +-----+ |     
+      -+->|     |-+->   
+       |  |     | |     
+      -+->|     |-+->   
+       |  |     | |     
+      -+->|     | +-----
+       |  |     |       
+      -+->|     | +-----
+       |  |     | |     
+    ---+  | _ _ |-+->   
+          | _X_ | |     
+    ---+  |     |-+->   
+       |  |     | |     
+      -+->|     | +-----
+       |  |     |       
+      -+->|     | +-----
+       |  |     | |     
+      -+->|     |-+->   
+       |  |     | |     
+      -+->|     |-+->   
+       |  +-----+ |     
+    ---+ dispatch +-----
   */
 
@@ -75,11 +75,6 @@
       {
     Tcontrol_t READ_UNIT_ENABLE       [_param->_nb_execute_loop][_param->_max_nb_read_unit];
-    Tcontrol_t SLOT_ENABLE            [_param->_nb_ooo_engine  ][_param->_max_nb_inst_issue_slot];
     
     // Init -> all at 0
-    for (uint32_t i=0; i<_param->_nb_ooo_engine; ++i)
-      for (uint32_t j=0; j<_param->_nb_inst_issue_slot[i]; ++j)
-        SLOT_ENABLE [i][j] = 1;         
-
     for (uint32_t i=0; i<_param->_nb_execute_loop; ++i)
       for (uint32_t j=0; j<_param->_nb_read_unit[i]; ++j)
@@ -90,39 +85,4 @@
         }
 
-//     std::list<num_read_unit_t> SLOT_TYPE [_param->_nb_ooo_engine][_param->_max_nb_inst_issue_slot][_param->_nb_type];
-
-//     // for each read_unit
-//     for (uint32_t i=0; i<_param->_nb_execute_loop; ++i)
-//       for (uint32_t j=0; j<_param->_nb_read_unit[i]; ++j)
-//         // test if this read_unit can receive an instruction
-//         if (PORT_READ(in_ISSUE_EXECUTE_LOOP_ACK [i][j]) == 1)
-//           for (uint32_t x=0; x<_nb_ooo_engine; ++x)
-//             for (uint32_t y=0; y<_nb_inst_issue_slot[y]; ++y)
-//               // test if can dispatch
-//               if (_param->_table_dispatch [x][y][i][j])
-//                 for (uint32_t k=0;k<_param->_nb_type; ++k)
-//                   // Can receive this type
-//                   if (_param->_table_dispatch [i][j][k])
-//                     SLOT_TYPE[x][y][k].push_back(num_read_unit_t(i,j));
-
-//     // Select an issue_slot of an ooo_engine
-//     std::list<generic::priority::select_t> * select_ooo_engine = _priority_ooo_engine->select();
-//     for (std::list<generic::priority::select_t>::iterator it_ooo_engine=select_ooo_engine->begin();
-//          it_ooo_engine!=select_ooo_engine->end();
-//          ++it_ooo_engine)
-//       { 
-//         // ... get id of the most priotary
-//         const uint32_t num_ooo_engine      = it_ooo_engine->grp;
-//         const uint32_t num_inst_issue_slot = it_ooo_engine->elt;
-
-//         // Test if this ooo_engine is enable (can be desable if issue in_order)
-//         if (OOO_ENGINE_ENABLE[num_ooo_engine])
-//           {
-
-//           }
-//       }
-
-//     for (uint32_t num_ooo_engine=0; num_ooo_engine<_param->_nb_ooo_engine; ++num_ooo_engine)
-
     std::list<generic::priority::select_t> * select_ooo_engine = _priority_ooo_engine->select();
     for (std::list<generic::priority::select_t>::iterator it_ooo_engine=select_ooo_engine->begin();
@@ -130,100 +90,98 @@
          ++it_ooo_engine)
       {
-        uint32_t num_ooo_engine      = it_ooo_engine->grp;
+        // select the most priotary 
+        uint32_t num_ooo_engine = it_ooo_engine->grp;
 
         for (uint32_t num_inst_issue_queue=0; num_inst_issue_queue<_param->_nb_inst_issue_queue[num_ooo_engine]; ++num_inst_issue_queue)
           {
+            // init stop condition
             bool find = false;
             
-            Tcontrol_t val  = PORT_READ(in_ISSUE_OOO_ENGINE_VAL  [num_ooo_engine][num_inst_issue_queue]);
-            Ttype_t    type = PORT_READ(in_ISSUE_OOO_ENGINE_TYPE [num_ooo_engine][num_inst_issue_queue]);
+            // Read request information from issue_queue
+            Tcontrol_t val          = PORT_READ(in_ISSUE_OOO_ENGINE_VAL  [num_ooo_engine][num_inst_issue_queue]);
+            Ttype_t    type         = PORT_READ(in_ISSUE_OOO_ENGINE_TYPE [num_ooo_engine][num_inst_issue_queue]);
+            Tcontext_t context_id   = (_param->_have_port_context_id  )?PORT_READ(in_ISSUE_OOO_ENGINE_CONTEXT_ID   [num_ooo_engine][num_inst_issue_queue]):0;
+            Tcontext_t front_end_id = (_param->_have_port_front_end_id)?PORT_READ(in_ISSUE_OOO_ENGINE_FRONT_END_ID [num_ooo_engine][num_inst_issue_queue]):0;
+            uint32_t   num_thread    = _param->_translate_num_context_to_num_thread[num_ooo_engine][front_end_id][context_id];
             
             log_printf(TRACE,Core_Glue,FUNCTION,"  * num_ooo_engine                : %d",num_ooo_engine      );
             log_printf(TRACE,Core_Glue,FUNCTION,"  * num_inst_issue_queue          : %d",num_inst_issue_queue);
             log_printf(TRACE,Core_Glue,FUNCTION,"    * val                         : %d",val);
-            log_printf(TRACE,Core_Glue,FUNCTION,"    * type                        : %d",type);
-            
+            log_printf(TRACE,Core_Glue,FUNCTION,"    * type                        : %d",type);  
+            log_printf(TRACE,Core_Glue,FUNCTION,"    * context_id                  : %d",context_id);
+            log_printf(TRACE,Core_Glue,FUNCTION,"    * front_end_id                : %d",front_end_id);
+            log_printf(TRACE,Core_Glue,FUNCTION,"    * num_thread                  : %d",num_thread);
+          
             if (val)
-              for (uint32_t num_inst_issue_slot=0; num_inst_issue_slot<_param->_nb_inst_issue_slot[num_ooo_engine]; ++num_inst_issue_slot)
+              // for each execute_loop
+              for (uint32_t num_execute_loop=0; num_execute_loop<_param->_nb_execute_loop; ++num_execute_loop)
                 {
-                  log_printf(TRACE,Core_Glue,FUNCTION,"    * num_inst_issue_slot         : %d",num_inst_issue_slot);
-                  
-                  // scan all read_unit
-                  
-                  if (SLOT_ENABLE [num_ooo_engine][num_inst_issue_slot])
-                    for (uint32_t num_execute_loop=0; num_execute_loop<_param->_nb_execute_loop; ++num_execute_loop)
-                      {
-                        std::list<generic::priority::select_t> * select_read_unit = _priority_read_unit[num_execute_loop]->select();
-                        for (std::list<generic::priority::select_t>::iterator it_read_unit=select_read_unit->begin();
-                             it_read_unit!=select_read_unit->end();
-                             ++it_read_unit)
-                          {
-                            // get the most priotary ...
-                            uint32_t num_read_unit = it_read_unit->grp;
-                            Tcontrol_t ack = READ_UNIT_ENABLE [num_execute_loop][num_read_unit];
-                            
-                            log_printf(TRACE,Core_Glue,FUNCTION,"      * num_execute_loop          : %d",num_execute_loop);
-                            log_printf(TRACE,Core_Glue,FUNCTION,"      * num_read_unit             : %d",num_read_unit   );
-                            log_printf(TRACE,Core_Glue,FUNCTION,"        * read_unit_enable        : %d",ack             );
-                            
-                            // test if :
-                            //  * read_unit can accept an instruction (valid and no previous instruction)
-                            //  * slot can issue an instruction at this read_unit
-                            //  * read_unit can accept this type
-                            if (ack and
-                                _param->_table_dispatch [num_ooo_engine][num_inst_issue_slot][num_execute_loop][num_read_unit] and
-                                _param->_table_issue_type [num_execute_loop][num_read_unit][type])
-                              {
-                                log_printf(TRACE,Core_Glue,FUNCTION,"  * find !!!");
-                                
-                                // find !
-                                // Transaction
-                                READ_UNIT_ENABLE       [num_execute_loop][num_read_unit] = false; // now, this read_unit is busy
-                                ISSUE_EXECUTE_LOOP_VAL [num_execute_loop][num_read_unit] = 1; // = val
-                                ISSUE_OOO_ENGINE_ACK   [num_ooo_engine][num_inst_issue_queue] = 1; // = ack
-                                SLOT_ENABLE            [num_ooo_engine][num_inst_issue_slot]  = false; // now this slot is used
-                                      
-                                if (_param->_have_port_context_id)
-			        PORT_WRITE(out_ISSUE_EXECUTE_LOOP_CONTEXT_ID            [num_execute_loop][num_read_unit],PORT_READ(in_ISSUE_OOO_ENGINE_CONTEXT_ID            [num_ooo_engine][num_inst_issue_queue]));
-			        if (_param->_have_port_front_end_id)
-			        PORT_WRITE(out_ISSUE_EXECUTE_LOOP_FRONT_END_ID          [num_execute_loop][num_read_unit],PORT_READ(in_ISSUE_OOO_ENGINE_FRONT_END_ID          [num_ooo_engine][num_inst_issue_queue]));
-			        if (_param->_have_port_ooo_engine_id)
-                                  {
-                                Tcontext_t ooo_engine_id = _param->_translate_num_ooo_engine_to_execute_loop_ooo_engine_id [num_ooo_engine][num_execute_loop];
-			        PORT_WRITE(out_ISSUE_EXECUTE_LOOP_OOO_ENGINE_ID         [num_execute_loop][num_read_unit],ooo_engine_id);
-                                  }
-			        if (_param->_have_port_rob_ptr)
-			        PORT_WRITE(out_ISSUE_EXECUTE_LOOP_PACKET_ID             [num_execute_loop][num_read_unit],PORT_READ(in_ISSUE_OOO_ENGINE_PACKET_ID             [num_ooo_engine][num_inst_issue_queue]));
-			        PORT_WRITE(out_ISSUE_EXECUTE_LOOP_OPERATION             [num_execute_loop][num_read_unit],PORT_READ(in_ISSUE_OOO_ENGINE_OPERATION             [num_ooo_engine][num_inst_issue_queue]));
-			        PORT_WRITE(out_ISSUE_EXECUTE_LOOP_TYPE                  [num_execute_loop][num_read_unit],type);
-			        PORT_WRITE(out_ISSUE_EXECUTE_LOOP_CANCEL                [num_execute_loop][num_read_unit],PORT_READ(in_ISSUE_OOO_ENGINE_CANCEL                [num_ooo_engine][num_inst_issue_queue]));
-			        PORT_WRITE(out_ISSUE_EXECUTE_LOOP_STORE_QUEUE_PTR_WRITE [num_execute_loop][num_read_unit],PORT_READ(in_ISSUE_OOO_ENGINE_STORE_QUEUE_PTR_WRITE [num_ooo_engine][num_inst_issue_queue]));
-			        PORT_WRITE(out_ISSUE_EXECUTE_LOOP_STORE_QUEUE_PTR_READ  [num_execute_loop][num_read_unit],PORT_READ(in_ISSUE_OOO_ENGINE_STORE_QUEUE_PTR_READ  [num_ooo_engine][num_inst_issue_queue]));
-			        PORT_WRITE(out_ISSUE_EXECUTE_LOOP_STORE_QUEUE_EMPTY     [num_execute_loop][num_read_unit],PORT_READ(in_ISSUE_OOO_ENGINE_STORE_QUEUE_EMPTY     [num_ooo_engine][num_inst_issue_queue]));
-			        if (_param->_have_port_load_queue_ptr)
-			        PORT_WRITE(out_ISSUE_EXECUTE_LOOP_LOAD_QUEUE_PTR_WRITE  [num_execute_loop][num_read_unit],PORT_READ(in_ISSUE_OOO_ENGINE_LOAD_QUEUE_PTR_WRITE  [num_ooo_engine][num_inst_issue_queue]));
-			        PORT_WRITE(out_ISSUE_EXECUTE_LOOP_HAS_IMMEDIAT          [num_execute_loop][num_read_unit],PORT_READ(in_ISSUE_OOO_ENGINE_HAS_IMMEDIAT          [num_ooo_engine][num_inst_issue_queue]));
-			        PORT_WRITE(out_ISSUE_EXECUTE_LOOP_IMMEDIAT              [num_execute_loop][num_read_unit],PORT_READ(in_ISSUE_OOO_ENGINE_IMMEDIAT              [num_ooo_engine][num_inst_issue_queue]));
-			        PORT_WRITE(out_ISSUE_EXECUTE_LOOP_READ_RA               [num_execute_loop][num_read_unit],PORT_READ(in_ISSUE_OOO_ENGINE_READ_RA               [num_ooo_engine][num_inst_issue_queue]));
-			        PORT_WRITE(out_ISSUE_EXECUTE_LOOP_NUM_REG_RA            [num_execute_loop][num_read_unit],PORT_READ(in_ISSUE_OOO_ENGINE_NUM_REG_RA            [num_ooo_engine][num_inst_issue_queue]));
-			        PORT_WRITE(out_ISSUE_EXECUTE_LOOP_READ_RB               [num_execute_loop][num_read_unit],PORT_READ(in_ISSUE_OOO_ENGINE_READ_RB               [num_ooo_engine][num_inst_issue_queue]));
-			        PORT_WRITE(out_ISSUE_EXECUTE_LOOP_NUM_REG_RB            [num_execute_loop][num_read_unit],PORT_READ(in_ISSUE_OOO_ENGINE_NUM_REG_RB            [num_ooo_engine][num_inst_issue_queue]));
-			        PORT_WRITE(out_ISSUE_EXECUTE_LOOP_READ_RC               [num_execute_loop][num_read_unit],PORT_READ(in_ISSUE_OOO_ENGINE_READ_RC               [num_ooo_engine][num_inst_issue_queue]));
-			        PORT_WRITE(out_ISSUE_EXECUTE_LOOP_NUM_REG_RC            [num_execute_loop][num_read_unit],PORT_READ(in_ISSUE_OOO_ENGINE_NUM_REG_RC            [num_ooo_engine][num_inst_issue_queue]));
-			        PORT_WRITE(out_ISSUE_EXECUTE_LOOP_WRITE_RD              [num_execute_loop][num_read_unit],PORT_READ(in_ISSUE_OOO_ENGINE_WRITE_RD              [num_ooo_engine][num_inst_issue_queue]));
-			        PORT_WRITE(out_ISSUE_EXECUTE_LOOP_NUM_REG_RD            [num_execute_loop][num_read_unit],PORT_READ(in_ISSUE_OOO_ENGINE_NUM_REG_RD            [num_ooo_engine][num_inst_issue_queue]));
-			        PORT_WRITE(out_ISSUE_EXECUTE_LOOP_WRITE_RE              [num_execute_loop][num_read_unit],PORT_READ(in_ISSUE_OOO_ENGINE_WRITE_RE              [num_ooo_engine][num_inst_issue_queue]));
-			        PORT_WRITE(out_ISSUE_EXECUTE_LOOP_NUM_REG_RE            [num_execute_loop][num_read_unit],PORT_READ(in_ISSUE_OOO_ENGINE_NUM_REG_RE            [num_ooo_engine][num_inst_issue_queue]));
-                              
-                                
-                                find = true;
-                                break;
-                              }
-                            //if (find)
-                            //  break;
-                          }
-                        if (find)
+                  // for each read_unit
+                  std::list<generic::priority::select_t> * select_read_unit = _priority_read_unit[num_execute_loop]->select();
+                  for (std::list<generic::priority::select_t>::iterator it_read_unit=select_read_unit->begin();
+                       it_read_unit!=select_read_unit->end();
+                       ++it_read_unit)
+                    {
+                      // get the most priotary ...
+                      uint32_t num_read_unit = it_read_unit->grp;
+                      Tcontrol_t ack = READ_UNIT_ENABLE [num_execute_loop][num_read_unit];
+                      
+                      log_printf(TRACE,Core_Glue,FUNCTION,"      * num_execute_loop          : %d",num_execute_loop);
+                      log_printf(TRACE,Core_Glue,FUNCTION,"      * num_read_unit             : %d",num_read_unit   );
+                      log_printf(TRACE,Core_Glue,FUNCTION,"        * read_unit_enable        : %d",ack             );
+                      
+                      // test if :
+                      //  * read_unit can accept an instruction (valid and no previous instruction)
+                      //  * read_unit can accept this type
+                      if (ack and
+                          _param->_table_issue_type   [num_execute_loop][num_read_unit][type] and
+                          _param->_table_issue_thread [num_execute_loop][num_read_unit][num_thread])
+                        {
+                          log_printf(TRACE,Core_Glue,FUNCTION,"  * find !!!");
+                          
+                          // find !
+                          // Transaction
+                          find = true;
+
+                          READ_UNIT_ENABLE       [num_execute_loop][num_read_unit] = false; // now, this read_unit is busy
+                          ISSUE_EXECUTE_LOOP_VAL [num_execute_loop][num_read_unit] = 1; // = val
+                          ISSUE_OOO_ENGINE_ACK   [num_ooo_engine][num_inst_issue_queue] = 1; // = ack
+                          
+                          if (_param->_have_port_context_id)
+                          PORT_WRITE(out_ISSUE_EXECUTE_LOOP_CONTEXT_ID            [num_execute_loop][num_read_unit],context_id);
+                          if (_param->_have_port_front_end_id)
+			  PORT_WRITE(out_ISSUE_EXECUTE_LOOP_FRONT_END_ID          [num_execute_loop][num_read_unit],front_end_id);
+                          if (_param->_have_port_ooo_engine_id)
+                            {
+                          Tcontext_t ooo_engine_id = _param->_translate_num_ooo_engine_to_execute_loop_ooo_engine_id [num_ooo_engine][num_execute_loop];
+                          PORT_WRITE(out_ISSUE_EXECUTE_LOOP_OOO_ENGINE_ID         [num_execute_loop][num_read_unit],ooo_engine_id);
+                            }
+                          if (_param->_have_port_rob_ptr)
+                          PORT_WRITE(out_ISSUE_EXECUTE_LOOP_PACKET_ID             [num_execute_loop][num_read_unit],PORT_READ(in_ISSUE_OOO_ENGINE_PACKET_ID             [num_ooo_engine][num_inst_issue_queue]));
+                          PORT_WRITE(out_ISSUE_EXECUTE_LOOP_OPERATION             [num_execute_loop][num_read_unit],PORT_READ(in_ISSUE_OOO_ENGINE_OPERATION             [num_ooo_engine][num_inst_issue_queue]));
+                          PORT_WRITE(out_ISSUE_EXECUTE_LOOP_TYPE                  [num_execute_loop][num_read_unit],type);
+                          PORT_WRITE(out_ISSUE_EXECUTE_LOOP_CANCEL                [num_execute_loop][num_read_unit],PORT_READ(in_ISSUE_OOO_ENGINE_CANCEL                [num_ooo_engine][num_inst_issue_queue]));
+                          PORT_WRITE(out_ISSUE_EXECUTE_LOOP_STORE_QUEUE_PTR_WRITE [num_execute_loop][num_read_unit],PORT_READ(in_ISSUE_OOO_ENGINE_STORE_QUEUE_PTR_WRITE [num_ooo_engine][num_inst_issue_queue]));
+                          PORT_WRITE(out_ISSUE_EXECUTE_LOOP_STORE_QUEUE_PTR_READ  [num_execute_loop][num_read_unit],PORT_READ(in_ISSUE_OOO_ENGINE_STORE_QUEUE_PTR_READ  [num_ooo_engine][num_inst_issue_queue]));
+                          PORT_WRITE(out_ISSUE_EXECUTE_LOOP_STORE_QUEUE_EMPTY     [num_execute_loop][num_read_unit],PORT_READ(in_ISSUE_OOO_ENGINE_STORE_QUEUE_EMPTY     [num_ooo_engine][num_inst_issue_queue]));
+                          if (_param->_have_port_load_queue_ptr)
+			  PORT_WRITE(out_ISSUE_EXECUTE_LOOP_LOAD_QUEUE_PTR_WRITE  [num_execute_loop][num_read_unit],PORT_READ(in_ISSUE_OOO_ENGINE_LOAD_QUEUE_PTR_WRITE  [num_ooo_engine][num_inst_issue_queue]));
+                          PORT_WRITE(out_ISSUE_EXECUTE_LOOP_HAS_IMMEDIAT          [num_execute_loop][num_read_unit],PORT_READ(in_ISSUE_OOO_ENGINE_HAS_IMMEDIAT          [num_ooo_engine][num_inst_issue_queue]));
+                          PORT_WRITE(out_ISSUE_EXECUTE_LOOP_IMMEDIAT              [num_execute_loop][num_read_unit],PORT_READ(in_ISSUE_OOO_ENGINE_IMMEDIAT              [num_ooo_engine][num_inst_issue_queue]));
+                          PORT_WRITE(out_ISSUE_EXECUTE_LOOP_READ_RA               [num_execute_loop][num_read_unit],PORT_READ(in_ISSUE_OOO_ENGINE_READ_RA               [num_ooo_engine][num_inst_issue_queue]));
+                          PORT_WRITE(out_ISSUE_EXECUTE_LOOP_NUM_REG_RA            [num_execute_loop][num_read_unit],PORT_READ(in_ISSUE_OOO_ENGINE_NUM_REG_RA            [num_ooo_engine][num_inst_issue_queue]));
+                          PORT_WRITE(out_ISSUE_EXECUTE_LOOP_READ_RB               [num_execute_loop][num_read_unit],PORT_READ(in_ISSUE_OOO_ENGINE_READ_RB               [num_ooo_engine][num_inst_issue_queue]));
+                          PORT_WRITE(out_ISSUE_EXECUTE_LOOP_NUM_REG_RB            [num_execute_loop][num_read_unit],PORT_READ(in_ISSUE_OOO_ENGINE_NUM_REG_RB            [num_ooo_engine][num_inst_issue_queue]));
+                          PORT_WRITE(out_ISSUE_EXECUTE_LOOP_READ_RC               [num_execute_loop][num_read_unit],PORT_READ(in_ISSUE_OOO_ENGINE_READ_RC               [num_ooo_engine][num_inst_issue_queue]));
+                          PORT_WRITE(out_ISSUE_EXECUTE_LOOP_NUM_REG_RC            [num_execute_loop][num_read_unit],PORT_READ(in_ISSUE_OOO_ENGINE_NUM_REG_RC            [num_ooo_engine][num_inst_issue_queue]));
+                          PORT_WRITE(out_ISSUE_EXECUTE_LOOP_WRITE_RD              [num_execute_loop][num_read_unit],PORT_READ(in_ISSUE_OOO_ENGINE_WRITE_RD              [num_ooo_engine][num_inst_issue_queue]));
+                          PORT_WRITE(out_ISSUE_EXECUTE_LOOP_NUM_REG_RD            [num_execute_loop][num_read_unit],PORT_READ(in_ISSUE_OOO_ENGINE_NUM_REG_RD            [num_ooo_engine][num_inst_issue_queue]));
+                          PORT_WRITE(out_ISSUE_EXECUTE_LOOP_WRITE_RE              [num_execute_loop][num_read_unit],PORT_READ(in_ISSUE_OOO_ENGINE_WRITE_RE              [num_ooo_engine][num_inst_issue_queue]));
+                          PORT_WRITE(out_ISSUE_EXECUTE_LOOP_NUM_REG_RE            [num_execute_loop][num_read_unit],PORT_READ(in_ISSUE_OOO_ENGINE_NUM_REG_RE            [num_ooo_engine][num_inst_issue_queue]));
                           break;
-                      }
+                        }
+                      //if (find)
+                      //  break;
+                    }
                   if (find)
                     break;
@@ -240,5 +198,5 @@
           }
       }
-
+    
       }
 
@@ -260,151 +218,2 @@
 }; // end namespace morpheo              
 #endif
-
-    /*
-    bool       OOO_ENGINE_ENABLE      [_param->_nb_ooo_engine  ];
-    Tcontrol_t SLOT_ENABLE            [_param->_nb_ooo_engine  ][_param->_max_nb_inst_issue_slot];
-    bool       READ_UNIT_ENABLE       [_param->_nb_execute_loop][_param->_max_nb_read_unit];
-
-    // Init -> all at 0
-    for (uint32_t i=0; i<_param->_nb_ooo_engine; ++i)
-      {
-        OOO_ENGINE_ENABLE [i] = true;
-
-        for (uint32_t j=0; j<_param->_nb_inst_issue_slot[i]; ++j)
-          SLOT_ENABLE [i][j] = 1;         
-      }
-
-    for (uint32_t i=0; i<_param->_nb_execute_loop; ++i)
-      for (uint32_t j=0; j<_param->_nb_read_unit[i]; ++j)
-        {
-          // Read unit is enable is signal ack is set
-          READ_UNIT_ENABLE       [i][j] = (PORT_READ(in_ISSUE_EXECUTE_LOOP_ACK [i][j]) == 1);
-	  log_printf(TRACE,Core_Glue,FUNCTION,"  * Read_unit [%d][%d].enable : %d",i,j,READ_UNIT_ENABLE[i][j]);
-        }
-
-
-    // for each execute_loop
-    for (uint32_t i=0; i<_param->_nb_execute_loop; ++i)
-      {
-        // Scan all read_unit
-        std::list<generic::priority::select_t> * select_read_unit = _priority_read_unit[i]->select();
-        for (std::list<generic::priority::select_t>::iterator it_read_unit=select_read_unit->begin();
-             it_read_unit!=select_read_unit->end();
-             ++it_read_unit)
-          {
-            // get the most priotary ...
-            uint32_t num_read_unit = it_read_unit->grp;
-            
-            log_printf(TRACE,Core_Glue,FUNCTION,"  * read_unit [%d][%d]",i,num_read_unit);
-
-            // ... and test if this read_unit is valid
-            if (READ_UNIT_ENABLE [i][num_read_unit])
-              {
-                bool find = false;
-                
-                // This read_unit is valid, now find an valid instruction
-                // for each issue of each ooo_engine ...
-                std::list<generic::priority::select_t> * select_ooo_engine = _priority_ooo_engine[i]->select();
-                for (std::list<generic::priority::select_t>::iterator it_ooo_engine=select_ooo_engine->begin();
-                     it_ooo_engine!=select_ooo_engine->end();
-                     ++it_ooo_engine)
-                  { 
-                    // ... get id of the most priotary
-                    const uint32_t ooo_engine_id       = it_ooo_engine->grp;
-                    const uint32_t num_ooo_engine      = _param->_translate_execute_loop_num_ooo_engine [i][ooo_engine_id];
-                    const uint32_t num_inst_issue_slot = it_ooo_engine->elt;
-                    
-                    log_printf(TRACE,Core_Glue,FUNCTION,"    * num_ooo_engine [%d (%d)][%d]",num_ooo_engine, ooo_engine_id,num_inst_issue_slot);
-                    
-                    if (OOO_ENGINE_ENABLE [num_ooo_engine] and SLOT_ENABLE [num_ooo_engine][num_inst_issue_slot])
-                      {
-                        uint32_t num_inst_issue_queue = 0;
-                        for (; num_inst_issue_queue < _param->_nb_inst_issue_queue [num_ooo_engine]; num_inst_issue_queue ++)
-                          {
-                            // Test if this instruction is not previously send at a read_unit
-                            if (not ISSUE_OOO_ENGINE_ACK [num_ooo_engine][num_inst_issue_queue])
-                              {
-                                Tcontrol_t ooo_engine_val = PORT_READ(in_ISSUE_OOO_ENGINE_VAL  [num_ooo_engine][num_inst_issue_queue]);
-                                Ttype_t    type           = PORT_READ(in_ISSUE_OOO_ENGINE_TYPE [num_ooo_engine][num_inst_issue_queue]);
-                                // Test if have an link and read unit is enable
-                                bool can_dispatch   = _param->_table_dispatch [num_ooo_engine][num_inst_issue_slot][i][num_read_unit];
-                                bool can_issue_type = _param->_table_issue_type [i][num_read_unit][type];
-                                
-                                log_printf(TRACE,Core_Glue,FUNCTION,"      * num_ooo_engine_queue  : %d",num_inst_issue_queue);
-                                log_printf(TRACE,Core_Glue,FUNCTION,"      * type                  : %s",toString(type).c_str());
-                                log_printf(TRACE,Core_Glue,FUNCTION,"      * ISSUE_OOO_ENGINE_VAL  : %d",ooo_engine_val);
-                                log_printf(TRACE,Core_Glue,FUNCTION,"      * table_dispatch        : %d",can_dispatch);
-                                log_printf(TRACE,Core_Glue,FUNCTION,"      * table_issue_type      : %d",can_issue_type);
-                                
-                                
-                                // test if have a request ?
-                                // and test if have a link between the issue slot and read_unit 
-                                // and if the read_unit accept this instruction's type
-                                if (ooo_engine_val and 
-                                    can_dispatch   and
-                                    can_issue_type)
-                                  {
-//                                     log_printf(TRACE,Core_Glue,FUNCTION,"          * find !!!");
-                                    
-                                    // Transaction
-                                    READ_UNIT_ENABLE       [i][num_read_unit] = false; // now, this read_unit is busy
-                                    ISSUE_EXECUTE_LOOP_VAL [i][num_read_unit] = ooo_engine_val;
-                                    ISSUE_OOO_ENGINE_ACK   [num_ooo_engine][num_inst_issue_queue] = 1;
-                                    SLOT_ENABLE            [num_ooo_engine][num_inst_issue_slot]  = 0; // now this slot is used
-                                      
-			            if (_param->_have_port_context_id)
-			            PORT_WRITE(out_ISSUE_EXECUTE_LOOP_CONTEXT_ID            [i][num_read_unit],PORT_READ(in_ISSUE_OOO_ENGINE_CONTEXT_ID            [num_ooo_engine][num_inst_issue_queue]));
-			            if (_param->_have_port_front_end_id)
-			            PORT_WRITE(out_ISSUE_EXECUTE_LOOP_FRONT_END_ID          [i][num_read_unit],PORT_READ(in_ISSUE_OOO_ENGINE_FRONT_END_ID          [num_ooo_engine][num_inst_issue_queue]));
-			            if (_param->_have_port_ooo_engine_id)
-			            PORT_WRITE(out_ISSUE_EXECUTE_LOOP_OOO_ENGINE_ID         [i][num_read_unit],ooo_engine_id);
-			            if (_param->_have_port_rob_ptr)
-			            PORT_WRITE(out_ISSUE_EXECUTE_LOOP_PACKET_ID             [i][num_read_unit],PORT_READ(in_ISSUE_OOO_ENGINE_PACKET_ID             [num_ooo_engine][num_inst_issue_queue]));
-			            PORT_WRITE(out_ISSUE_EXECUTE_LOOP_OPERATION             [i][num_read_unit],PORT_READ(in_ISSUE_OOO_ENGINE_OPERATION             [num_ooo_engine][num_inst_issue_queue]));
-			            PORT_WRITE(out_ISSUE_EXECUTE_LOOP_TYPE                  [i][num_read_unit],type);
-			            PORT_WRITE(out_ISSUE_EXECUTE_LOOP_STORE_QUEUE_PTR_WRITE [i][num_read_unit],PORT_READ(in_ISSUE_OOO_ENGINE_STORE_QUEUE_PTR_WRITE [num_ooo_engine][num_inst_issue_queue]));
-			            if (_param->_have_port_load_queue_ptr)
-			            PORT_WRITE(out_ISSUE_EXECUTE_LOOP_LOAD_QUEUE_PTR_WRITE  [i][num_read_unit],PORT_READ(in_ISSUE_OOO_ENGINE_LOAD_QUEUE_PTR_WRITE  [num_ooo_engine][num_inst_issue_queue]));
-			            PORT_WRITE(out_ISSUE_EXECUTE_LOOP_HAS_IMMEDIAT          [i][num_read_unit],PORT_READ(in_ISSUE_OOO_ENGINE_HAS_IMMEDIAT          [num_ooo_engine][num_inst_issue_queue]));
-			            PORT_WRITE(out_ISSUE_EXECUTE_LOOP_IMMEDIAT              [i][num_read_unit],PORT_READ(in_ISSUE_OOO_ENGINE_IMMEDIAT              [num_ooo_engine][num_inst_issue_queue]));
-			            PORT_WRITE(out_ISSUE_EXECUTE_LOOP_READ_RA               [i][num_read_unit],PORT_READ(in_ISSUE_OOO_ENGINE_READ_RA               [num_ooo_engine][num_inst_issue_queue]));
-			            PORT_WRITE(out_ISSUE_EXECUTE_LOOP_NUM_REG_RA            [i][num_read_unit],PORT_READ(in_ISSUE_OOO_ENGINE_NUM_REG_RA            [num_ooo_engine][num_inst_issue_queue]));
-			            PORT_WRITE(out_ISSUE_EXECUTE_LOOP_READ_RB               [i][num_read_unit],PORT_READ(in_ISSUE_OOO_ENGINE_READ_RB               [num_ooo_engine][num_inst_issue_queue]));
-			            PORT_WRITE(out_ISSUE_EXECUTE_LOOP_NUM_REG_RB            [i][num_read_unit],PORT_READ(in_ISSUE_OOO_ENGINE_NUM_REG_RB            [num_ooo_engine][num_inst_issue_queue]));
-			            PORT_WRITE(out_ISSUE_EXECUTE_LOOP_READ_RC               [i][num_read_unit],PORT_READ(in_ISSUE_OOO_ENGINE_READ_RC               [num_ooo_engine][num_inst_issue_queue]));
-			            PORT_WRITE(out_ISSUE_EXECUTE_LOOP_NUM_REG_RC            [i][num_read_unit],PORT_READ(in_ISSUE_OOO_ENGINE_NUM_REG_RC            [num_ooo_engine][num_inst_issue_queue]));
-			            PORT_WRITE(out_ISSUE_EXECUTE_LOOP_WRITE_RD              [i][num_read_unit],PORT_READ(in_ISSUE_OOO_ENGINE_WRITE_RD              [num_ooo_engine][num_inst_issue_queue]));
-			            PORT_WRITE(out_ISSUE_EXECUTE_LOOP_NUM_REG_RD            [i][num_read_unit],PORT_READ(in_ISSUE_OOO_ENGINE_NUM_REG_RD            [num_ooo_engine][num_inst_issue_queue]));
-			            PORT_WRITE(out_ISSUE_EXECUTE_LOOP_WRITE_RE              [i][num_read_unit],PORT_READ(in_ISSUE_OOO_ENGINE_WRITE_RE              [num_ooo_engine][num_inst_issue_queue]));
-			            PORT_WRITE(out_ISSUE_EXECUTE_LOOP_NUM_REG_RE            [i][num_read_unit],PORT_READ(in_ISSUE_OOO_ENGINE_NUM_REG_RE            [num_ooo_engine][num_inst_issue_queue]));
-                                    
-                                    find = true;// find : stop scan read_unit
-                                  }
-                              }
-                            if (find)
-                              break;
-                          }
-
-                        if (find)
-                          {
-                            log_printf(TRACE,Core_Glue,FUNCTION,"    * find !!!");
-                            break;
-                          }
-                        else
-                          {
-                            log_printf(TRACE,Core_Glue,FUNCTION,"    * not find !!!");
-                            log_printf(TRACE,Core_Glue,FUNCTION,"      * issue_queue_in_order: %d",_param->_issue_queue_in_order [num_ooo_engine]);
-                            log_printf(TRACE,Core_Glue,FUNCTION,"      * num_inst_issue_queue: %d",num_inst_issue_queue);
-                            log_printf(TRACE,Core_Glue,FUNCTION,"      * nb_inst_reexecute   : %d",_param->_nb_inst_reexecute [num_ooo_engine]);
-
-                            if (_param->_issue_queue_in_order [num_ooo_engine] and
-                                (num_inst_issue_queue >= _param->_nb_inst_reexecute [num_ooo_engine]))
-                                OOO_ENGINE_ENABLE [num_ooo_engine] = false;
-                          }
-                      }
-                  }
-              }
-          }
-      }
-    */ 
-
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Core_Glue/src/Parameters.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Core_Glue/src/Parameters.cpp	(revision 136)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Core_Glue/src/Parameters.cpp	(revision 138)
@@ -32,5 +32,5 @@
    uint32_t              * nb_inst_reexecute                    ,//[nb_ooo_engine]
    uint32_t              * nb_inst_issue_queue                  ,//[nb_ooo_engine]
-   uint32_t              * nb_inst_issue_slot                   ,//[nb_ooo_engine]
+// uint32_t              * nb_inst_issue_slot                   ,//[nb_ooo_engine]
    uint32_t             ** nb_inst_execute                      ,//[nb_ooo_engine][ooo_engine_nb_execute_loop]
    bool                  * issue_queue_in_order                 ,//[nb_ooo_engine]
@@ -47,9 +47,11 @@
    Tpriority_t             dispatch_priority                    ,
    Tload_balancing_t       dispatch_load_balancing              ,
-   bool               **** table_dispatch                       ,//[nb_ooo_engine][nb_inst_issue_slot][execute_loop][nb_read_unit]
+// bool               **** table_dispatch                       ,//[nb_ooo_engine][nb_inst_issue_slot][execute_loop][nb_read_unit]
    bool                *** table_issue_type                     ,//                                   [execute_loop][nb_read_unit][nb_type]
+   bool                *** table_issue_thread                   ,//                                   [execute_loop][nb_read_unit][nb_thread]
    uint32_t             ** translate_ooo_engine_num_front_end   ,//[nb_ooo_engine][ooo_engine_nb_front_end]
    uint32_t             ** translate_ooo_engine_num_execute_loop,//[nb_ooo_engine][ooo_engine_nb_execute_loop]
    uint32_t             ** translate_execute_loop_num_ooo_engine,//[nb_execute_loop][execute_loop_nb_ooo_engine]
+   uint32_t            *** translate_num_context_to_num_thread  ,//[nb_ooo_engine][ooo_engine_nb_front_end][nb_context]
    bool                    is_toplevel)
   {
@@ -69,5 +71,5 @@
     _nb_inst_reexecute                     = nb_inst_reexecute                    ;
     _nb_inst_issue_queue                   = nb_inst_issue_queue                  ;
-    _nb_inst_issue_slot                    = nb_inst_issue_slot                   ;
+//  _nb_inst_issue_slot                    = nb_inst_issue_slot                   ;
     _nb_inst_execute                       = nb_inst_execute                      ;
     _issue_queue_in_order                  = issue_queue_in_order                 ;
@@ -76,9 +78,11 @@
     _dispatch_priority                     = dispatch_priority                    ;
     _dispatch_load_balancing               = dispatch_load_balancing              ;
-    _table_dispatch                        = table_dispatch                       ;
+//  _table_dispatch                        = table_dispatch                       ;
     _table_issue_type                      = table_issue_type                     ;
+    _table_issue_thread                    = table_issue_thread                   ;
     _translate_ooo_engine_num_front_end    = translate_ooo_engine_num_front_end   ;
     _translate_ooo_engine_num_execute_loop = translate_ooo_engine_num_execute_loop;
     _translate_execute_loop_num_ooo_engine = translate_execute_loop_num_ooo_engine;
+    _translate_num_context_to_num_thread   = translate_num_context_to_num_thread  ;
 
     test();
@@ -118,13 +122,13 @@
 
 //  ALLOC2(_execute_loop_nb_inst_insert,uint32_t,_nb_execute_loop,_execute_loop_nb_ooo_engine[it1]);
-    ALLOC2(_execute_loop_nb_inst_issue_slot ,uint32_t,_nb_execute_loop,_execute_loop_nb_ooo_engine[it1]);
-
-    for (uint32_t i=0; i<_nb_execute_loop; ++i)
-      for (uint32_t j=0; j<_execute_loop_nb_ooo_engine[i]; ++j)
-        {
-          uint32_t num_ooo_engine = _translate_execute_loop_num_ooo_engine [i][j];
-          _execute_loop_nb_inst_issue_slot [i][j] = _nb_inst_issue_slot [num_ooo_engine];
-//        _execute_loop_nb_inst_insert     [i][j] = _nb_inst_insert     [num_ooo_engine];
-        }
+//  ALLOC2(_execute_loop_nb_inst_issue_slot ,uint32_t,_nb_execute_loop,_execute_loop_nb_ooo_engine[it1]);
+
+//     for (uint32_t i=0; i<_nb_execute_loop; ++i)
+//       for (uint32_t j=0; j<_execute_loop_nb_ooo_engine[i]; ++j)
+//         {
+//           uint32_t num_ooo_engine = _translate_execute_loop_num_ooo_engine [i][j];
+//           _execute_loop_nb_inst_issue_slot [i][j] = _nb_inst_issue_slot [num_ooo_engine];
+//           _execute_loop_nb_inst_insert     [i][j] = _nb_inst_insert     [num_ooo_engine];
+//         }
 
     _max_ooo_engine_nb_inst_branch_complete = max<uint32_t>(_ooo_engine_nb_inst_branch_complete,_nb_ooo_engine);
@@ -135,5 +139,5 @@
 //  _max_nb_inst_insert                     = max<uint32_t>(_nb_inst_insert            ,_nb_ooo_engine);
     _max_nb_inst_issue_queue                = max<uint32_t>(_nb_inst_issue_queue       ,_nb_ooo_engine);
-    _max_nb_inst_issue_slot                 = max<uint32_t>(_nb_inst_issue_slot        ,_nb_ooo_engine);
+//  _max_nb_inst_issue_slot                 = max<uint32_t>(_nb_inst_issue_slot        ,_nb_ooo_engine);
     _max_nb_read_unit                       = max<uint32_t>(_nb_read_unit              ,_nb_execute_loop);
 
@@ -188,5 +192,5 @@
     log_begin(Core_Glue,FUNCTION);
 
-    DELETE2(_execute_loop_nb_inst_issue_slot                         ,_nb_execute_loop,_execute_loop_nb_ooo_engine[it1]);
+//  DELETE2(_execute_loop_nb_inst_issue_slot                         ,_nb_execute_loop,_execute_loop_nb_ooo_engine[it1]);
 //  DELETE2(_execute_loop_nb_inst_insert                             ,_nb_execute_loop,_execute_loop_nb_ooo_engine[it1]);
     DELETE2(_translate_num_ooo_engine_to_execute_loop_ooo_engine_id  ,_nb_ooo_engine,_nb_execute_loop);
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Core_Glue/src/Parameters_msg_error.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Core_Glue/src/Parameters_msg_error.cpp	(revision 136)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Core_Glue/src/Parameters_msg_error.cpp	(revision 138)
@@ -8,4 +8,5 @@
 #include "Behavioural/include/Types.h"
 #include "Behavioural/Core/Core_Glue/include/Parameters.h"
+#include "Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Issue_queue/include/Types.h"
 #include <sstream>
 
@@ -58,4 +59,25 @@
         }
 
+    {
+      bool issue_queue_can_ooo [_nb_ooo_engine];
+      for (uint32_t i=0; i<_nb_ooo_engine; ++i)
+        issue_queue_can_ooo [i] = true;
+
+      for (uint32_t i=0; i<_nb_execute_loop; ++i)
+        for (uint32_t j=0; j<_execute_loop_nb_ooo_engine[i]; ++j)
+          {
+            Tcontext_t num_ooo_engine = _translate_execute_loop_num_ooo_engine [i][j];
+            
+            // Test if multiple ooo_engine for this execute loop
+            if (_execute_loop_nb_ooo_engine[i]>1)
+              issue_queue_can_ooo [num_ooo_engine] = false;
+          }
+
+      for (uint32_t i=0; i<_nb_ooo_engine; ++i)
+        if (not _issue_queue_in_order [i] and // out of order
+            not issue_queue_can_ooo [i])
+          test.error(toString(_("The scheme of Issue queue in ooo_engine [%d] must be \"%s\" because, the execute loop can be access with multiple ooo_engine (deadlock is possible).\n"),i,toString(core::multi_ooo_engine::ooo_engine::issue_queue::ISSUE_QUEUE_SCHEME_IN_ORDER).c_str()));
+    }
+
     if (_dispatch_load_balancing != LOAD_BALANCING_MAXIMUM_FOR_PRIORITY)
       test.error(toString(_("distpatch load_balancing scheme \"%s\" is not yet supported.\n"),toString(_dispatch_load_balancing).c_str()));
