Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Rename_unit/Rename_select/src/Rename_select_genMealy.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Rename_unit/Rename_select/src/Rename_select_genMealy.cpp	(revision 81)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Rename_unit/Rename_select/src/Rename_select_genMealy.cpp	(revision 88)
@@ -22,28 +22,46 @@
   void Rename_select::genMealy (void)
   {
-    log_printf(FUNC,Rename_select,FUNCTION,"Begin");
+    log_begin(Rename_select,FUNCTION);
+    log_function(Rename_select,FUNCTION,_name.c_str());
 
-    Tcontrol_t ack [_param->_nb_front_end][_param->_max_nb_inst_decod];
+    Tcontrol_t val                  [_param->_nb_inst_rename];
+    Tcontrol_t ack                  [_param->_nb_front_end][_param->_max_nb_inst_decod];
+    Tcontrol_t previous_transaction [_param->_nb_front_end];
+
+    for (uint32_t i=0; i<_param->_nb_inst_rename; ++i)
+      val [i] = false;
     for (uint32_t i=0; i<_param->_nb_front_end; i++)
-      for (uint32_t j=0; j<_param->_nb_inst_decod[i]; j++)
-	ack [i][j] = false;
-    
-    std::list<select_t>::iterator it=select.begin();
+      {
+        previous_transaction [i] = true;
+        for (uint32_t j=0; j<_param->_nb_inst_decod[i]; j++)
+          ack [i][j] = false;
+      }
+
+    std::list<generic::priority::select_t> * select = _priority->select();
+    std::list<generic::priority::select_t>::iterator it=select->begin();
 
     for (uint32_t i=0; i<_param->_nb_inst_rename; i++)
       {
-	Tcontrol_t val = false;
+        log_printf(TRACE,Rename_select,FUNCTION,"  * inst_rename [%d]",i);
 
-	while ((it != select.end()) and (val == false))
+        // Scan all instruction until find
+	while ((it != select->end()) and (val [i] == false))
 	  {
-	    Tcontext_t x = it->_front_end ;
-	    uint32_t   y = it->_inst_decod;
+	    Tcontext_t x = it->grp;
+	    uint32_t   y = it->elt;
 
-	    // Test if this instruction is valid
-	    if (PORT_READ(in_RENAME_IN_VAL[x][y]) == 1)
+            log_printf(TRACE,Rename_select,FUNCTION,"    * front_end[%d].inst_decod[%d]",x,y);
+            log_printf(TRACE,Rename_select,FUNCTION,"      * rename_in_val        : %d",PORT_READ(in_RENAME_IN_VAL[x][y]));
+            log_printf(TRACE,Rename_select,FUNCTION,"      * previous_transaction : %d",previous_transaction[x]);
+
+	    // Test if this instruction is valid and if all previous instruction of this front end is an valid transaction
+	    if (previous_transaction [x] and
+                PORT_READ(in_RENAME_IN_VAL[x][y]))
 	      {
 		// Find !!!
-		val        = true;
+		val [i]    = true;
 		ack [x][y] = PORT_READ(in_RENAME_OUT_ACK [i]);
+
+                log_printf(TRACE,Rename_select,FUNCTION,"      * rename_out_ack       : %d",PORT_READ(in_RENAME_OUT_ACK[i]));
 
 		if (_param->_have_port_front_end_id)
@@ -55,4 +73,6 @@
 		PORT_WRITE(out_RENAME_OUT_TYPE         [i],PORT_READ(in_RENAME_IN_TYPE          [x][y]));
 		PORT_WRITE(out_RENAME_OUT_OPERATION    [i],PORT_READ(in_RENAME_IN_OPERATION     [x][y]));
+		PORT_WRITE(out_RENAME_OUT_NO_EXECUTE   [i],PORT_READ(in_RENAME_IN_NO_EXECUTE    [x][y]));
+		PORT_WRITE(out_RENAME_OUT_IS_DELAY_SLOT[i],PORT_READ(in_RENAME_IN_IS_DELAY_SLOT [x][y]));
 		PORT_WRITE(out_RENAME_OUT_ADDRESS      [i],PORT_READ(in_RENAME_IN_ADDRESS       [x][y]));
 		PORT_WRITE(out_RENAME_OUT_HAS_IMMEDIAT [i],PORT_READ(in_RENAME_IN_HAS_IMMEDIAT  [x][y]));
@@ -69,11 +89,17 @@
 		PORT_WRITE(out_RENAME_OUT_NUM_REG_RE   [i],PORT_READ(in_RENAME_IN_NUM_REG_RE    [x][y]));
 		PORT_WRITE(out_RENAME_OUT_EXCEPTION_USE[i],PORT_READ(in_RENAME_IN_EXCEPTION_USE [x][y]));
+		PORT_WRITE(out_RENAME_OUT_EXCEPTION    [i],PORT_READ(in_RENAME_IN_EXCEPTION     [x][y]));
 	      }
+
+            // ack = 1 if previous_transaction == true and rename_in_val == true and rename_out == true
+            previous_transaction [x] = ack [x][y];
 
 	    it ++;
 	  }
 
-	PORT_WRITE(out_RENAME_OUT_VAL [i], val);
       }
+
+    for (uint32_t i=0; i<_param->_nb_inst_rename; ++i)
+      PORT_WRITE(out_RENAME_OUT_VAL [i], val [i]);
 
     for (uint32_t i=0; i<_param->_nb_front_end; i++)
@@ -81,5 +107,5 @@
 	PORT_WRITE(out_RENAME_IN_ACK [i][j], ack [i][j]);
 
-    log_printf(FUNC,Rename_select,FUNCTION,"End");
+    log_end(Rename_select,FUNCTION);
   };
 
