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 111)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Core_Glue/src/Core_Glue_genMealy_issue.cpp	(revision 115)
@@ -27,4 +27,5 @@
     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)
       for (uint32_t j=0; j<_param->_nb_inst_issue[i]; ++j)
@@ -36,4 +37,5 @@
           // 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] : %d",i,j,READ_UNIT_ENABLE[i][j]);
         }
 
@@ -42,4 +44,5 @@
         log_printf(TRACE,Core_Glue,FUNCTION,"  * execute_loop [%d]",i);
 
+	// 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();
@@ -47,20 +50,23 @@
              ++it_ooo_engine)
           {
+	    // get id
             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 = it_ooo_engine->elt;
 
-            log_printf(TRACE,Core_Glue,FUNCTION,"    * num_ooo_engine [%d] (id : %d)",num_ooo_engine, ooo_engine_id);
+            log_printf(TRACE,Core_Glue,FUNCTION,"    * num_ooo_engine [%d] (id -> %d)",num_ooo_engine, ooo_engine_id);
             log_printf(TRACE,Core_Glue,FUNCTION,"    * num_inst_issue          : %d",num_inst_issue);
-            log_printf(TRACE,Core_Glue,FUNCTION,"    * ISSUE_OOO_ENGINE_VAL    : %d",PORT_READ(in_ISSUE_OOO_ENGINE_VAL [num_ooo_engine][num_inst_issue]));
 
-            // have request ?
             Tcontrol_t ooo_engine_val = PORT_READ(in_ISSUE_OOO_ENGINE_VAL [num_ooo_engine][num_inst_issue]);
 
-//             if (ooo_engine_val)
+            log_printf(TRACE,Core_Glue,FUNCTION,"    * ISSUE_OOO_ENGINE_VAL    : %d",ooo_engine_val);
+
+            // test if have a request ?
+// 	    if (ooo_engine_val)
               {
 //              // If ooo_engine can issue instruction on multiple execute_loop
 //              if (not ISSUE_OOO_ENGINE_ACK [num_ooo_engine][num_inst_issue])
 
+		// 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();
@@ -69,45 +75,51 @@
                   {
                     uint32_t num_read_unit = it_read_unit->grp;
+		    
+		    // Test if have an link and read unit is enable
+		    log_printf(TRACE,Core_Glue,FUNCTION,"      * read_unit             : %d",num_read_unit);
+		    log_printf(TRACE,Core_Glue,FUNCTION,"        * READ_UNIT_ENABLE    : %d",READ_UNIT_ENABLE [i][num_read_unit]);
+		    log_printf(TRACE,Core_Glue,FUNCTION,"        * table_dispatch      : %d",_param->_table_dispatch [num_ooo_engine][num_inst_issue][i][num_read_unit]);
+		    
+		    Tcontrol_t read_unit_enable = READ_UNIT_ENABLE [i][num_read_unit];
 
-                  // Test if have an link and read unit is enable
-                  log_printf(TRACE,Core_Glue,FUNCTION,"    * read_unit               : %d",num_read_unit);
-                  log_printf(TRACE,Core_Glue,FUNCTION,"      * READ_UNIT_ENABLE      : %d",READ_UNIT_ENABLE [i][num_read_unit]);
-                  log_printf(TRACE,Core_Glue,FUNCTION,"      * table_dispatch        : %d",_param->_table_dispatch [num_ooo_engine][num_inst_issue][i][num_read_unit]);
+		    // Test if the read_unit is not busy and if an link is between the issue slot and read_unit
+		    if (read_unit_enable and 
+			_param->_table_dispatch [num_ooo_engine][num_inst_issue][i][num_read_unit])
+		      {
+			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; // = 1
+			ISSUE_OOO_ENGINE_ACK   [num_ooo_engine][num_inst_issue] = read_unit_enable; // = 1
+			
+			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]));
+			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]));
+			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]));
+			PORT_WRITE(out_ISSUE_EXECUTE_LOOP_OPERATION             [i][num_read_unit],PORT_READ(in_ISSUE_OOO_ENGINE_OPERATION             [num_ooo_engine][num_inst_issue]));
+			PORT_WRITE(out_ISSUE_EXECUTE_LOOP_TYPE                  [i][num_read_unit],PORT_READ(in_ISSUE_OOO_ENGINE_TYPE                  [num_ooo_engine][num_inst_issue]));
+			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]));
+			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]));
+			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]));
+			PORT_WRITE(out_ISSUE_EXECUTE_LOOP_IMMEDIAT              [i][num_read_unit],PORT_READ(in_ISSUE_OOO_ENGINE_IMMEDIAT              [num_ooo_engine][num_inst_issue]));
+			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]));
+			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]));
+			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]));
+			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]));
+			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]));
+			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]));
+			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]));
+			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]));
+			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]));
+			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]));
 
-                  Tcontrol_t read_unit_enable = READ_UNIT_ENABLE [i][num_read_unit];
-                  if (read_unit_enable and 
-                      _param->_table_dispatch [num_ooo_engine][num_inst_issue][i][num_read_unit])
-                    {
-                      // Transaction
-                      ISSUE_EXECUTE_LOOP_VAL [i][num_read_unit] = ooo_engine_val;
-                      ISSUE_OOO_ENGINE_ACK   [num_ooo_engine][num_inst_issue] = read_unit_enable; // = 1
-                      READ_UNIT_ENABLE       [i][num_read_unit] = false; // now, this read_unit is busy
-
-                      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]));
-                      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]));
-                      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]));
-                      PORT_WRITE(out_ISSUE_EXECUTE_LOOP_OPERATION             [i][num_read_unit],PORT_READ(in_ISSUE_OOO_ENGINE_OPERATION             [num_ooo_engine][num_inst_issue]));
-                      PORT_WRITE(out_ISSUE_EXECUTE_LOOP_TYPE                  [i][num_read_unit],PORT_READ(in_ISSUE_OOO_ENGINE_TYPE                  [num_ooo_engine][num_inst_issue]));
-                      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]));
-                      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]));
-                      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]));
-                      PORT_WRITE(out_ISSUE_EXECUTE_LOOP_IMMEDIAT              [i][num_read_unit],PORT_READ(in_ISSUE_OOO_ENGINE_IMMEDIAT              [num_ooo_engine][num_inst_issue]));
-                      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]));
-                      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]));
-                      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]));
-                      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]));
-                      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]));
-                      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]));
-                      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]));
-                      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]));
-                      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]));
-                      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]));
-                    }            
+			break; // find : stop scan read_unit
+		      }
                   }
               }
