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 122)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Rename_unit/Rename_select/src/Rename_select_genMealy.cpp	(revision 123)
@@ -17,6 +17,4 @@
 namespace rename_select {
 
-// #define CONTINUE_ON_EVENT_STOP
-
 #undef  FUNCTION
 #define FUNCTION "Rename_select::genMealy"
@@ -28,14 +26,16 @@
     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;
+    
+    if (PORT_READ(in_NRESET))
       {
-        previous_transaction [i] = true;
-        for (uint32_t j=0; j<_param->_nb_inst_decod[i]; j++)
-          ack [i][j] = false;
-      }
+        Tcontrol_t previous_transaction [_param->_nb_front_end];
+        for (uint32_t i=0; i<_param->_nb_front_end; i++)
+          previous_transaction [i] = true;
 
     std::list<generic::priority::select_t> * select = _priority->select();
@@ -71,7 +71,5 @@
                 
                 // Test if ROB is Flushed
-#ifndef CONTINUE_ON_EVENT_STOP
                 if (not stop)
-#endif
                   {
                     // Find !!!
@@ -79,25 +77,23 @@
                     ack [x][y] = PORT_READ(in_RENAME_OUT_ACK [i]);
                     
-		    Tcontrol_t     have_event          = (PORT_READ(in_RETIRE_EVENT_FLUSH [x][context_id]) 
-#ifdef CONTINUE_ON_EVENT_STOP
-                                                          or stop
-#endif
-                                                          );
-		    Tcontrol_t     can_register_access = not have_event;
-		    Tcontrol_t     no_execute          = (PORT_READ(in_RENAME_IN_NO_EXECUTE [x][y]) or have_event);
-		    Tcontrol_t     read_ra             = (PORT_READ(in_RENAME_IN_READ_RA    [x][y]) and can_register_access);
-		    Tcontrol_t     read_rb             = (PORT_READ(in_RENAME_IN_READ_RB    [x][y]) and can_register_access);
-		    Tcontrol_t     read_rc             = (PORT_READ(in_RENAME_IN_READ_RC    [x][y]) and can_register_access);
-		    Tcontrol_t     write_rd            = (PORT_READ(in_RENAME_IN_WRITE_RD   [x][y]) and can_register_access);
-		    Tcontrol_t     write_re            = (PORT_READ(in_RENAME_IN_WRITE_RE   [x][y]) and can_register_access);
-// 		    Tcontrol_t     read_ra             = (PORT_READ(in_RENAME_IN_READ_RA    [x][y]));
-// 		    Tcontrol_t     read_rb             = (PORT_READ(in_RENAME_IN_READ_RB    [x][y]));
-// 		    Tcontrol_t     read_rc             = (PORT_READ(in_RENAME_IN_READ_RC    [x][y]));
-// 		    Tcontrol_t     write_rd            = (PORT_READ(in_RENAME_IN_WRITE_RD   [x][y]));
-// 		    Tcontrol_t     write_re            = (PORT_READ(in_RENAME_IN_WRITE_RE   [x][y]));
+// 		    Tcontrol_t     have_event          = (PORT_READ(in_RETIRE_EVENT_FLUSH [x][context_id]) // or
+//                                                           );
+//                  log_printf(TRACE,Rename_select,FUNCTION,"      * have_event           : %d",have_event);
+
+// 		    Tcontrol_t     can_register_access = not have_event;
+// 		    Tcontrol_t     no_execute          = (PORT_READ(in_RENAME_IN_NO_EXECUTE [x][y]) or have_event);
+// 		    Tcontrol_t     read_ra             = (PORT_READ(in_RENAME_IN_READ_RA    [x][y]) and can_register_access);
+// 		    Tcontrol_t     read_rb             = (PORT_READ(in_RENAME_IN_READ_RB    [x][y]) and can_register_access);
+// 		    Tcontrol_t     read_rc             = (PORT_READ(in_RENAME_IN_READ_RC    [x][y]) and can_register_access);
+// 		    Tcontrol_t     write_rd            = (PORT_READ(in_RENAME_IN_WRITE_RD   [x][y]) and can_register_access);
+// 		    Tcontrol_t     write_re            = (PORT_READ(in_RENAME_IN_WRITE_RE   [x][y]) and can_register_access);
+		    Tcontrol_t     no_execute          = (PORT_READ(in_RENAME_IN_NO_EXECUTE [x][y]));
+		    Tcontrol_t     read_ra             = (PORT_READ(in_RENAME_IN_READ_RA    [x][y]));
+		    Tcontrol_t     read_rb             = (PORT_READ(in_RENAME_IN_READ_RB    [x][y]));
+		    Tcontrol_t     read_rc             = (PORT_READ(in_RENAME_IN_READ_RC    [x][y]));
+		    Tcontrol_t     write_rd            = (PORT_READ(in_RENAME_IN_WRITE_RD   [x][y]));
+		    Tcontrol_t     write_re            = (PORT_READ(in_RENAME_IN_WRITE_RE   [x][y]));
                     
-                    log_printf(TRACE,Rename_select,FUNCTION,"      * have_event           : %d",have_event);
-                    log_printf(TRACE,Rename_select,FUNCTION,"      * no_execute (before)  : %d",PORT_READ(in_RENAME_IN_NO_EXECUTE [x][y]));
-                    log_printf(TRACE,Rename_select,FUNCTION,"      * no_execute (after)   : %d",no_execute);
+                    log_printf(TRACE,Rename_select,FUNCTION,"      * no_execute           : %d",no_execute);
                     
 		    if (_param->_have_port_front_end_id)
@@ -110,4 +106,5 @@
 		    PORT_WRITE(out_RENAME_OUT_OPERATION    [i],PORT_READ(in_RENAME_IN_OPERATION     [x][y]));
 		    PORT_WRITE(out_RENAME_OUT_NO_EXECUTE   [i],no_execute);
+		    PORT_WRITE(out_RENAME_OUT_LAST_EVENT   [i],PORT_READ(in_RENAME_IN_LAST_EVENT    [x][y]));
 		    PORT_WRITE(out_RENAME_OUT_IS_DELAY_SLOT[i],PORT_READ(in_RENAME_IN_IS_DELAY_SLOT [x][y]));
 #ifdef DEBUG        
@@ -140,4 +137,9 @@
       }
 
+      }
+//     else
+//       {
+//       }
+
     for (uint32_t i=0; i<_param->_nb_inst_rename; ++i)
       PORT_WRITE(out_RENAME_OUT_VAL [i], val [i]);
@@ -146,4 +148,5 @@
       for (uint32_t j=0; j<_param->_nb_inst_decod[i]; j++)
 	PORT_WRITE(out_RENAME_IN_ACK [i][j], ack [i][j]);
+
 
     log_end(Rename_select,FUNCTION);
