Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Issue_queue/src/Issue_queue_transition.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Issue_queue/src/Issue_queue_transition.cpp	(revision 109)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Issue_queue/src/Issue_queue_transition.cpp	(revision 110)
@@ -32,4 +32,5 @@
 	for (uint32_t i=0; i<_param->_nb_bank; i++)
 	  _issue_queue [i].clear();
+        _reexecute_queue.clear();
       }
     else
@@ -42,123 +43,118 @@
 	// =====[ ISSUE_IN ]==================================================
 	// ===================================================================
+
 	for (uint32_t i=0; i<_param->_nb_bank; i++)
 	  if (internal_BANK_IN_ACK [i])
 	    {
-	      entry_t * entry = NULL;
-
-	      if (internal_BANK_IN_IS_REEXECUTE [i])
-		{
-		  uint32_t y = internal_BANK_IN_NUM_INST [i];
-	      
-		  if (PORT_READ(in_REEXECUTE_VAL [y]))
-		    {
-                      log_printf(TRACE,Issue_queue,FUNCTION,"  * ISSUE_IN [%d] - Transaction with REEXECUTE [%d]",i,y);
+              uint32_t x = internal_BANK_IN_NUM_RENAME_UNIT [i];
+              uint32_t y = internal_BANK_IN_NUM_INST [i];
+              
+              if (PORT_READ(in_ISSUE_IN_VAL[x][y]))
+                {
+                  log_printf(TRACE,Issue_queue,FUNCTION,"  * ISSUE_IN [%d] - Transaction with ISSUE_IN [%d][%d]",i,x,y);
+
 #ifdef STATISTICS
-                      if (usage_is_set(_usage,USE_STATISTICS))
-                        (*_stat_nb_inst_reexecute) ++;
-#endif
-		      entry = new entry_t
-			(
-			 (_param->_have_port_context_id    )?PORT_READ(in_REEXECUTE_CONTEXT_ID            [y]):0,
-			 (_param->_have_port_front_end_id  )?PORT_READ(in_REEXECUTE_FRONT_END_ID          [y]):0,
-			 (_param->_have_port_rob_ptr       )?PORT_READ(in_REEXECUTE_PACKET_ID             [y]):0,
-			                                     PORT_READ(in_REEXECUTE_OPERATION             [y]),
-			                                     PORT_READ(in_REEXECUTE_TYPE                  [y]),
-			                                     PORT_READ(in_REEXECUTE_STORE_QUEUE_PTR_WRITE [y]),
-			 (_param->_have_port_load_queue_ptr)?PORT_READ(in_REEXECUTE_LOAD_QUEUE_PTR_WRITE  [y]):0,
-			                                     PORT_READ(in_REEXECUTE_HAS_IMMEDIAT          [y]),
-			                                     PORT_READ(in_REEXECUTE_IMMEDIAT              [y]),
-			                                     PORT_READ(in_REEXECUTE_READ_RA               [y]),
-			                                     PORT_READ(in_REEXECUTE_NUM_REG_RA            [y]),
-			                                     PORT_READ(in_REEXECUTE_READ_RB               [y]),
-			                                     PORT_READ(in_REEXECUTE_NUM_REG_RB            [y]),
-			                                     PORT_READ(in_REEXECUTE_READ_RC               [y]),
-			                                     PORT_READ(in_REEXECUTE_NUM_REG_RC            [y]),
-			                                     PORT_READ(in_REEXECUTE_WRITE_RD              [y]),
-			                                     PORT_READ(in_REEXECUTE_NUM_REG_RD            [y]),
-			                                     PORT_READ(in_REEXECUTE_WRITE_RE              [y]),
-			                                     PORT_READ(in_REEXECUTE_NUM_REG_RE            [y])
-			 );
-		    }
-		}
-	      else
-		{
-		  uint32_t x = internal_BANK_IN_NUM_RENAME_UNIT [i];
-		  uint32_t y = internal_BANK_IN_NUM_INST [i];
-
-		  if (PORT_READ(in_ISSUE_IN_VAL[x][y]))
-		    {
-                      log_printf(TRACE,Issue_queue,FUNCTION,"  * ISSUE_IN [%d] - Transaction with ISSUE_IN [%d][%d]",i,x,y);
-
+                  if (usage_is_set(_usage,USE_STATISTICS))
+                    (*_stat_nb_inst_issue_in [x]) ++;
+#endif
+                  entry_t * entry = new entry_t
+                    (
+                     (_param->_have_port_context_id    )?PORT_READ(in_ISSUE_IN_CONTEXT_ID            [x][y]):0,
+                     (_param->_have_port_front_end_id  )?PORT_READ(in_ISSUE_IN_FRONT_END_ID          [x][y]):0,
+                     (_param->_have_port_rob_ptr       )?PORT_READ(in_ISSUE_IN_PACKET_ID             [x][y]):0,
+			                                 PORT_READ(in_ISSUE_IN_OPERATION             [x][y]),
+			                                 PORT_READ(in_ISSUE_IN_TYPE                  [x][y]),
+			                                 PORT_READ(in_ISSUE_IN_STORE_QUEUE_PTR_WRITE [x][y]),
+                     (_param->_have_port_load_queue_ptr)?PORT_READ(in_ISSUE_IN_LOAD_QUEUE_PTR_WRITE  [x][y]):0,
+			                                 PORT_READ(in_ISSUE_IN_HAS_IMMEDIAT          [x][y]),
+			                                 PORT_READ(in_ISSUE_IN_IMMEDIAT              [x][y]),
+			                                 PORT_READ(in_ISSUE_IN_READ_RA               [x][y]),
+			                                 PORT_READ(in_ISSUE_IN_NUM_REG_RA            [x][y]),
+			                                 PORT_READ(in_ISSUE_IN_READ_RB               [x][y]),
+			                                 PORT_READ(in_ISSUE_IN_NUM_REG_RB            [x][y]),
+			                                 PORT_READ(in_ISSUE_IN_READ_RC               [x][y]),
+			                                 PORT_READ(in_ISSUE_IN_NUM_REG_RC            [x][y]),
+			                                 PORT_READ(in_ISSUE_IN_WRITE_RD              [x][y]),
+			                                 PORT_READ(in_ISSUE_IN_NUM_REG_RD            [x][y]),
+			                                 PORT_READ(in_ISSUE_IN_WRITE_RE              [x][y]),
+			                                 PORT_READ(in_ISSUE_IN_NUM_REG_RE            [x][y])
+                     );
+
+                  _issue_queue [i].push_back(entry);
+                }
+	    }
+
+	// ===================================================================
+	// =====[ REEXECUTE_UNIT ]============================================
+	// ===================================================================
+
+        for (uint32_t i=0; i<_param->_nb_inst_reexecute; ++i)
+          if (PORT_READ(in_REEXECUTE_VAL [i]) and internal_REEXECUTE_ACK [i])
+            {
+              log_printf(TRACE,Issue_queue,FUNCTION,"  * REEXECUTE [%d]",i);
 #ifdef STATISTICS
-                      if (usage_is_set(_usage,USE_STATISTICS))
-                        (*_stat_nb_inst_issue_in [x]) ++;
-#endif
-		      entry = new entry_t
-			(
-			 (_param->_have_port_context_id    )?PORT_READ(in_ISSUE_IN_CONTEXT_ID            [x][y]):0,
-			 (_param->_have_port_front_end_id  )?PORT_READ(in_ISSUE_IN_FRONT_END_ID          [x][y]):0,
-			 (_param->_have_port_rob_ptr       )?PORT_READ(in_ISSUE_IN_PACKET_ID             [x][y]):0,
-			                                     PORT_READ(in_ISSUE_IN_OPERATION             [x][y]),
-			                                     PORT_READ(in_ISSUE_IN_TYPE                  [x][y]),
-			                                     PORT_READ(in_ISSUE_IN_STORE_QUEUE_PTR_WRITE [x][y]),
-			 (_param->_have_port_load_queue_ptr)?PORT_READ(in_ISSUE_IN_LOAD_QUEUE_PTR_WRITE  [x][y]):0,
-			                                     PORT_READ(in_ISSUE_IN_HAS_IMMEDIAT          [x][y]),
-			                                     PORT_READ(in_ISSUE_IN_IMMEDIAT              [x][y]),
-			                                     PORT_READ(in_ISSUE_IN_READ_RA               [x][y]),
-			                                     PORT_READ(in_ISSUE_IN_NUM_REG_RA            [x][y]),
-			                                     PORT_READ(in_ISSUE_IN_READ_RB               [x][y]),
-			                                     PORT_READ(in_ISSUE_IN_NUM_REG_RB            [x][y]),
-			                                     PORT_READ(in_ISSUE_IN_READ_RC               [x][y]),
-			                                     PORT_READ(in_ISSUE_IN_NUM_REG_RC            [x][y]),
-			                                     PORT_READ(in_ISSUE_IN_WRITE_RD              [x][y]),
-			                                     PORT_READ(in_ISSUE_IN_NUM_REG_RD            [x][y]),
-			                                     PORT_READ(in_ISSUE_IN_WRITE_RE              [x][y]),
-			                                     PORT_READ(in_ISSUE_IN_NUM_REG_RE            [x][y])
-			 );
-		    }
-		}
-
-	      if (entry != NULL)
-		_issue_queue [i].push_back(entry);
-	    }
+              if (usage_is_set(_usage,USE_STATISTICS))
+                (*_stat_nb_inst_reexecute) ++;
+#endif
+              entry_t * entry = new entry_t
+                (
+                 (_param->_have_port_context_id    )?PORT_READ(in_REEXECUTE_CONTEXT_ID            [i]):0,
+                 (_param->_have_port_front_end_id  )?PORT_READ(in_REEXECUTE_FRONT_END_ID          [i]):0,
+                 (_param->_have_port_rob_ptr       )?PORT_READ(in_REEXECUTE_PACKET_ID             [i]):0,
+			                             PORT_READ(in_REEXECUTE_OPERATION             [i]),
+			                             PORT_READ(in_REEXECUTE_TYPE                  [i]),
+			                             PORT_READ(in_REEXECUTE_STORE_QUEUE_PTR_WRITE [i]),
+                 (_param->_have_port_load_queue_ptr)?PORT_READ(in_REEXECUTE_LOAD_QUEUE_PTR_WRITE  [i]):0,
+			                             PORT_READ(in_REEXECUTE_HAS_IMMEDIAT          [i]),
+			                             PORT_READ(in_REEXECUTE_IMMEDIAT              [i]),
+			                             PORT_READ(in_REEXECUTE_READ_RA               [i]),
+			                             PORT_READ(in_REEXECUTE_NUM_REG_RA            [i]),
+			                             PORT_READ(in_REEXECUTE_READ_RB               [i]),
+			                             PORT_READ(in_REEXECUTE_NUM_REG_RB            [i]),
+			                             PORT_READ(in_REEXECUTE_READ_RC               [i]),
+			                             PORT_READ(in_REEXECUTE_NUM_REG_RC            [i]),
+			                             PORT_READ(in_REEXECUTE_WRITE_RD              [i]),
+			                             PORT_READ(in_REEXECUTE_NUM_REG_RD            [i]),
+			                             PORT_READ(in_REEXECUTE_WRITE_RE              [i]),
+			                             PORT_READ(in_REEXECUTE_NUM_REG_RE            [i])
+                 );
+
+              _reexecute_queue.push_back(entry);
+            }
 
 	// ===================================================================
 	// =====[ ISSUE_OUT ]=================================================
 	// ===================================================================
-	for (uint32_t i=0; i<_param->_nb_bank; i++)
-	  {
-// 	    log_printf(TRACE,Issue_queue,FUNCTION,"  * internal_BANK_OUT [%d] val %d, num_inst %d",i,internal_BANK_OUT_VAL [i],internal_BANK_OUT_NUM_INST [i]);
-
-	    if (internal_BANK_OUT_VAL [i])
-	      {
-#ifdef STATISTICS
-                if (usage_is_set(_usage,USE_STATISTICS))
-                  (*_stat_nb_inst_issue_out) ++;
-#endif
-
-		uint32_t x = internal_BANK_OUT_NUM_INST [i];
-// 		log_printf(TRACE,Issue_queue,FUNCTION,"    * ISSUE_OUT_ACK : %d",PORT_READ(in_ISSUE_OUT_ACK [x]));
-		
-		if (PORT_READ(in_ISSUE_OUT_ACK [x]))
-		  {
-                    log_printf(TRACE,Issue_queue,FUNCTION,"  * ISSUE_OUT [%d] - Transaction with ISSUE_OUT [%d]",i,x);
-
-
-		    entry_t * entry =  _issue_queue [i].front();
-		    _issue_queue [i].pop_front();
-		    delete entry;
-		  }
-	      }
-	  }
+
+        for (uint32_t i=0; i<_param->_nb_inst_issue; ++i)
+          if (internal_ISSUE_OUT_VAL [i] and PORT_READ(in_ISSUE_OUT_ACK [i]))
+            {
+              entry_t * entry    = internal_ISSUE_OUT_ENTRY    [i];
+
+              if (internal_ISSUE_OUT_FROM_REEXECUTE [i])
+                {
+                  log_printf(TRACE,Issue_queue,FUNCTION,"  * ISSUE_OUT [%d] - From Reexecute_queue",i);
+                  
+                  _reexecute_queue.remove(entry);
+                }
+              else
+                {
+                  // front ...
+                  uint32_t  num_bank = internal_ISSUE_OUT_NUM_BANK [i];
+
+                  log_printf(TRACE,Issue_queue,FUNCTION,"  * ISSUE_OUT [%d] - From issue_queue [%d]",i,num_bank);
+
+                  _issue_queue [num_bank].remove(entry);
+                }
+
+              delete entry;
+            } 
       }
 
+#if defined(DEBUG) and defined(DEBUG_Issue_queue) and (DEBUG >= DEBUG_TRACE)
     log_printf(TRACE,Issue_queue,FUNCTION,"  * Dump Issue_queue");
+
     for (uint32_t i=0; i<_param->_nb_bank; i++)
       {
-#ifdef STATISTICS
-        if (usage_is_set(_usage,USE_STATISTICS))
-          *(_stat_bank_nb_inst [i]) += _issue_queue[i].size();
-#endif
 	log_printf(TRACE,Issue_queue,FUNCTION,"    * Bank [%d] size : %d",i,(int)_issue_queue[i].size());
 
@@ -199,6 +195,53 @@
                 ++j;
               }
-
       }
+
+    {
+      log_printf(TRACE,Issue_queue,FUNCTION,"    * Reexecute_queue - size : %d",(int)_reexecute_queue.size());
+      
+      uint32_t i = 0;
+
+      for (std::list<entry_t*>::iterator it=_reexecute_queue.begin();it!=_reexecute_queue.end(); ++it)
+        {
+          log_printf(TRACE,Issue_queue,FUNCTION,"      [%.4d] %.2d %.2d %.4d, %.2d %.3d, %.2d %.2d, %.1d %.8x, %.1d %.4d, %.1d %.4d, %.1d %.4d, %.1d %.4d, %.1d %.4d",
+                     i,
+                     
+                     (*it)->_context_id           ,
+                     (*it)->_front_end_id         ,
+                     (*it)->_packet_id            ,
+                     
+                     (*it)->_type                 ,
+                     (*it)->_operation            ,
+                     
+                     (*it)->_store_queue_ptr_write,
+                     (*it)->_load_queue_ptr_write ,
+                     
+                     (*it)->_has_immediat         ,
+                     (*it)->_immediat             ,
+                     
+                     (*it)->_read_ra              ,
+                     (*it)->_num_reg_ra           ,
+                     
+                     (*it)->_read_rb              ,
+                     (*it)->_num_reg_rb           ,
+                     
+                     (*it)->_read_rc              ,
+                     (*it)->_num_reg_rc           ,
+                     
+                     (*it)->_write_rd             ,
+                     (*it)->_num_reg_rd           ,
+                     
+                     (*it)->_write_re             ,
+                     (*it)->_num_reg_re           );
+          ++i;
+        }
+    }
+#endif
+
+#ifdef STATISTICS
+    if (usage_is_set(_usage,USE_STATISTICS))
+      for (uint32_t i=0; i<_param->_nb_bank; i++)
+        *(_stat_bank_nb_inst [i]) += _issue_queue[i].size();
+#endif
 
 #if defined(STATISTICS) or defined(VHDL_TESTBENCH)
