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 115)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Rename_unit/Rename_select/src/Rename_select_genMealy.cpp	(revision 122)
@@ -17,4 +17,5 @@
 namespace rename_select {
 
+// #define CONTINUE_ON_EVENT_STOP
 
 #undef  FUNCTION
@@ -59,63 +60,74 @@
                 PORT_READ(in_RENAME_IN_VAL[x][y]))
 	      {
-		// Find !!!
-		val [i]    = true;
-		ack [x][y] = PORT_READ(in_RENAME_OUT_ACK [i]);
 
                 log_printf(TRACE,Rename_select,FUNCTION,"      * in_RENAME_OUT_ACK    : %d",PORT_READ(in_RENAME_OUT_ACK[i]));
                 Tcontext_t front_end_id = (_param->_have_port_front_end_id)?PORT_READ(in_RENAME_IN_FRONT_END_ID [x][y]):0;
                 Tcontext_t context_id   = (_param->_have_port_context_id  )?PORT_READ(in_RENAME_IN_CONTEXT_ID   [x][y]):0;
+		Tcontrol_t stop         = PORT_READ(in_RETIRE_EVENT_STOP  [x][context_id]);
 
 		log_printf(TRACE,Rename_select,FUNCTION,"      * front_end_id         : %d",front_end_id);
 		log_printf(TRACE,Rename_select,FUNCTION,"      * context_id           : %d",context_id);
+                log_printf(TRACE,Rename_select,FUNCTION,"      * stop                 : %d",stop);
                 
                 // Test if ROB is Flushed
-                Tevent_state_t event_state         = PORT_READ(in_RETIRE_EVENT_STATE [x][context_id]);
-		Tcontrol_t     have_event          = (event_state != EVENT_STATE_NO_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     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,"      * event_state          : %d",event_state);
-                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);
-
-		if (_param->_have_port_front_end_id)
-		PORT_WRITE(out_RENAME_OUT_FRONT_END_ID [i],front_end_id);
-		if (_param->_have_port_context_id)
-                PORT_WRITE(out_RENAME_OUT_CONTEXT_ID   [i],context_id);
-		if (_param->_have_port_depth)
-		PORT_WRITE(out_RENAME_OUT_DEPTH        [i],PORT_READ(in_RENAME_IN_DEPTH         [x][y]));
-		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],no_execute);
-		PORT_WRITE(out_RENAME_OUT_IS_DELAY_SLOT[i],PORT_READ(in_RENAME_IN_IS_DELAY_SLOT [x][y]));
-#ifdef DEBUG
-		PORT_WRITE(out_RENAME_OUT_ADDRESS      [i],PORT_READ(in_RENAME_IN_ADDRESS       [x][y]));
+#ifndef CONTINUE_ON_EVENT_STOP
+                if (not stop)
 #endif
-		PORT_WRITE(out_RENAME_OUT_ADDRESS_NEXT [i],PORT_READ(in_RENAME_IN_ADDRESS_NEXT  [x][y]));
-		PORT_WRITE(out_RENAME_OUT_HAS_IMMEDIAT [i],PORT_READ(in_RENAME_IN_HAS_IMMEDIAT  [x][y]));
-		PORT_WRITE(out_RENAME_OUT_IMMEDIAT     [i],PORT_READ(in_RENAME_IN_IMMEDIAT      [x][y]));
-		PORT_WRITE(out_RENAME_OUT_READ_RA      [i],read_ra);
-		PORT_WRITE(out_RENAME_OUT_NUM_REG_RA   [i],PORT_READ(in_RENAME_IN_NUM_REG_RA    [x][y]));
-		PORT_WRITE(out_RENAME_OUT_READ_RB      [i],read_rb);
-		PORT_WRITE(out_RENAME_OUT_NUM_REG_RB   [i],PORT_READ(in_RENAME_IN_NUM_REG_RB    [x][y]));
-		PORT_WRITE(out_RENAME_OUT_READ_RC      [i],read_rc);
-		PORT_WRITE(out_RENAME_OUT_NUM_REG_RC   [i],PORT_READ(in_RENAME_IN_NUM_REG_RC    [x][y]));
-		PORT_WRITE(out_RENAME_OUT_WRITE_RD     [i],write_rd);
-		PORT_WRITE(out_RENAME_OUT_NUM_REG_RD   [i],PORT_READ(in_RENAME_IN_NUM_REG_RD    [x][y]));
-		PORT_WRITE(out_RENAME_OUT_WRITE_RE     [i],write_re);
-		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]));
+                  {
+                    // Find !!!
+                    val [i]    = true;
+                    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]));
+                    
+                    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);
+                    
+		    if (_param->_have_port_front_end_id)
+		    PORT_WRITE(out_RENAME_OUT_FRONT_END_ID [i],front_end_id);
+		    if (_param->_have_port_context_id)
+                    PORT_WRITE(out_RENAME_OUT_CONTEXT_ID   [i],context_id);
+		    if (_param->_have_port_depth)
+		    PORT_WRITE(out_RENAME_OUT_DEPTH        [i],PORT_READ(in_RENAME_IN_DEPTH         [x][y]));
+		    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],no_execute);
+		    PORT_WRITE(out_RENAME_OUT_IS_DELAY_SLOT[i],PORT_READ(in_RENAME_IN_IS_DELAY_SLOT [x][y]));
+#ifdef DEBUG        
+		    PORT_WRITE(out_RENAME_OUT_ADDRESS      [i],PORT_READ(in_RENAME_IN_ADDRESS       [x][y]));
+#endif              
+		    PORT_WRITE(out_RENAME_OUT_ADDRESS_NEXT [i],PORT_READ(in_RENAME_IN_ADDRESS_NEXT  [x][y]));
+		    PORT_WRITE(out_RENAME_OUT_HAS_IMMEDIAT [i],PORT_READ(in_RENAME_IN_HAS_IMMEDIAT  [x][y]));
+		    PORT_WRITE(out_RENAME_OUT_IMMEDIAT     [i],PORT_READ(in_RENAME_IN_IMMEDIAT      [x][y]));
+		    PORT_WRITE(out_RENAME_OUT_READ_RA      [i],read_ra);
+		    PORT_WRITE(out_RENAME_OUT_NUM_REG_RA   [i],PORT_READ(in_RENAME_IN_NUM_REG_RA    [x][y]));
+		    PORT_WRITE(out_RENAME_OUT_READ_RB      [i],read_rb);
+		    PORT_WRITE(out_RENAME_OUT_NUM_REG_RB   [i],PORT_READ(in_RENAME_IN_NUM_REG_RB    [x][y]));
+		    PORT_WRITE(out_RENAME_OUT_READ_RC      [i],read_rc);
+		    PORT_WRITE(out_RENAME_OUT_NUM_REG_RC   [i],PORT_READ(in_RENAME_IN_NUM_REG_RC    [x][y]));
+		    PORT_WRITE(out_RENAME_OUT_WRITE_RD     [i],write_rd);
+		    PORT_WRITE(out_RENAME_OUT_NUM_REG_RD   [i],PORT_READ(in_RENAME_IN_NUM_REG_RD    [x][y]));
+		    PORT_WRITE(out_RENAME_OUT_WRITE_RE     [i],write_re);
+		    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]));
+                  }
 	      }
 
