Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Execute_unit/Execute_unit/Functionnal_unit/src/Functionnal_unit_transition.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Execute_unit/Execute_unit/Functionnal_unit/src/Functionnal_unit_transition.cpp	(revision 81)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Execute_unit/Execute_unit/Functionnal_unit/src/Functionnal_unit_transition.cpp	(revision 88)
@@ -23,9 +23,11 @@
   void Functionnal_unit::transition (void)
   {
-    log_printf(FUNC,Functionnal_unit,FUNCTION,"Begin");
+    log_begin(Functionnal_unit,FUNCTION);
+    log_function(Functionnal_unit,FUNCTION,_name.c_str());
 
     if (PORT_READ(in_NRESET) == 0)
       {
-	reg_BUSY = false;
+	reg_BUSY_IN  = false;
+	reg_BUSY_OUT = false;
 	
 	for (uint32_t i=0; i<_param->_nb_context; i++)
@@ -33,11 +35,11 @@
 	    for (uint32_t k=0; k<_param->_nb_ooo_engine; k++)
 	      {
-		uint32_t num_thread = get_num_thread(i,_param->_size_context_id,
-						     j,_param->_size_front_end_id,
-						     k,_param->_size_ooo_engine_id);
+// 		uint32_t num_thread = get_num_thread(i,_param->_size_context_id,
+// 						     j,_param->_size_front_end_id,
+// 						     k,_param->_size_ooo_engine_id);
 		
 		for (uint32_t x=GROUP_CUSTOM_1; x<GROUP_CUSTOM_8; x++)
 		  {
-		    function_execute_end_cycle_t * fct = (_param->_get_custom_information(num_thread)._get_custom_execute_reset(x));
+		    function_execute_end_cycle_t * fct = (_param->_get_custom_information()._get_custom_execute_reset(x));
 		    
 		    if (fct != NULL)
@@ -51,6 +53,7 @@
 	if (internal_EXECUTE_OUT_VAL and PORT_READ(in_EXECUTE_OUT_ACK))
 	  {
+            log_printf(TRACE,Functionnal_unit,FUNCTION,"  * EXECUTE_OUT : Transaction Accepted");
 	    // transaction
-	    reg_BUSY = false;
+	    reg_BUSY_OUT = false;
 	  }
 	
@@ -60,29 +63,47 @@
 	if (PORT_READ(in_EXECUTE_IN_VAL) and internal_EXECUTE_IN_ACK)
 	  {
-	    reg_BUSY = true;
+            log_printf(TRACE,Functionnal_unit,FUNCTION,"  * EXECUTE_IN : Transaction Accepted");
+
+	    reg_BUSY_IN = true;
 
 	    Tcontext_t   context_id    = (_param->_have_port_context_id   )?PORT_READ(in_EXECUTE_IN_CONTEXT_ID   ):0;
 	    Tcontext_t   front_end_id  = (_param->_have_port_front_end_id )?PORT_READ(in_EXECUTE_IN_FRONT_END_ID ):0;
 	    Tcontext_t   ooo_engine_id = (_param->_have_port_ooo_engine_id)?PORT_READ(in_EXECUTE_IN_OOO_ENGINE_ID):0;
-	    Tcontext_t   packet_id     = (_param->_have_port_packet_id    )?PORT_READ(in_EXECUTE_IN_PACKET_ID    ):0;
+	    Tcontext_t   packet_id     = (_param->_have_port_rob_ptr      )?PORT_READ(in_EXECUTE_IN_PACKET_ID    ):0;
 	    Toperation_t operation     = PORT_READ(in_EXECUTE_IN_OPERATION);
 	    Ttype_t      type          = PORT_READ(in_EXECUTE_IN_TYPE);
 	    
-	    _execute_operation->_context_id    = context_id   ;
-	    _execute_operation->_front_end_id  = front_end_id ;
-	    _execute_operation->_ooo_engine_id = ooo_engine_id;
-	    _execute_operation->_packet_id     = packet_id    ;
-	    _execute_operation->_operation     = operation    ;
-	    _execute_operation->_type          = type         ;
-	    _execute_operation->_has_immediat  = PORT_READ(in_EXECUTE_IN_HAS_IMMEDIAT);
-	    _execute_operation->_immediat      = PORT_READ(in_EXECUTE_IN_IMMEDIAT    );
-	    _execute_operation->_data_ra       = PORT_READ(in_EXECUTE_IN_DATA_RA     );
-	    _execute_operation->_data_rb       = PORT_READ(in_EXECUTE_IN_DATA_RB     );
-	    _execute_operation->_data_rc       = PORT_READ(in_EXECUTE_IN_DATA_RC     );
-	    _execute_operation->_write_rd      = PORT_READ(in_EXECUTE_IN_WRITE_RD    );
-	    _execute_operation->_num_reg_rd    = PORT_READ(in_EXECUTE_IN_NUM_REG_RD  );
-	    _execute_operation->_write_re      = PORT_READ(in_EXECUTE_IN_WRITE_RE    );
-	    _execute_operation->_num_reg_re    = PORT_READ(in_EXECUTE_IN_NUM_REG_RE  );
-
+	    _execute_operation_in->_context_id    = context_id   ;
+	    _execute_operation_in->_front_end_id  = front_end_id ;
+	    _execute_operation_in->_ooo_engine_id = ooo_engine_id;
+	    _execute_operation_in->_packet_id     = packet_id    ;
+	    _execute_operation_in->_operation     = operation    ;
+	    _execute_operation_in->_type          = type         ;
+	    _execute_operation_in->_has_immediat  = PORT_READ(in_EXECUTE_IN_HAS_IMMEDIAT);
+	    _execute_operation_in->_immediat      = PORT_READ(in_EXECUTE_IN_IMMEDIAT    );
+	    _execute_operation_in->_data_ra       = PORT_READ(in_EXECUTE_IN_DATA_RA     );
+	    _execute_operation_in->_data_rb       = PORT_READ(in_EXECUTE_IN_DATA_RB     );
+	    _execute_operation_in->_data_rc       = PORT_READ(in_EXECUTE_IN_DATA_RC     );
+	    _execute_operation_in->_write_rd      = PORT_READ(in_EXECUTE_IN_WRITE_RD    );
+	    _execute_operation_in->_num_reg_rd    = PORT_READ(in_EXECUTE_IN_NUM_REG_RD  );
+	    _execute_operation_in->_write_re      = PORT_READ(in_EXECUTE_IN_WRITE_RE    );
+	    _execute_operation_in->_num_reg_re    = PORT_READ(in_EXECUTE_IN_NUM_REG_RE  );
+
+            log_printf(TRACE,Functionnal_unit,FUNCTION,"    * context_id    : %d",_execute_operation_in->_context_id   );
+            log_printf(TRACE,Functionnal_unit,FUNCTION,"    * front_end_id  : %d",_execute_operation_in->_front_end_id );
+            log_printf(TRACE,Functionnal_unit,FUNCTION,"    * ooo_engine_id : %d",_execute_operation_in->_ooo_engine_id);
+            log_printf(TRACE,Functionnal_unit,FUNCTION,"    * packet_id     : %d",_execute_operation_in->_packet_id    );
+            log_printf(TRACE,Functionnal_unit,FUNCTION,"    * operation     : %d",_execute_operation_in->_operation    );
+            log_printf(TRACE,Functionnal_unit,FUNCTION,"    * type          : %s",toString_type(_execute_operation_in->_type).c_str());
+            log_printf(TRACE,Functionnal_unit,FUNCTION,"    * has_immediat  : %d",_execute_operation_in->_has_immediat );
+            log_printf(TRACE,Functionnal_unit,FUNCTION,"    * immediat      : %.8x",_execute_operation_in->_immediat     );
+            log_printf(TRACE,Functionnal_unit,FUNCTION,"    * data_ra       : %.8x",_execute_operation_in->_data_ra      );
+            log_printf(TRACE,Functionnal_unit,FUNCTION,"    * data_rb       : %.8x",_execute_operation_in->_data_rb      );
+            log_printf(TRACE,Functionnal_unit,FUNCTION,"    * data_rc       : %.8x",_execute_operation_in->_data_rc      );
+            log_printf(TRACE,Functionnal_unit,FUNCTION,"    * write_rd      : %d"  ,_execute_operation_in->_write_rd     );
+            log_printf(TRACE,Functionnal_unit,FUNCTION,"    * num_reg_rd    : %d"  ,_execute_operation_in->_num_reg_rd   );
+            log_printf(TRACE,Functionnal_unit,FUNCTION,"    * write_re      : %d"  ,_execute_operation_in->_write_re     );
+            log_printf(TRACE,Functionnal_unit,FUNCTION,"    * num_reg_re    : %d"  ,_execute_operation_in->_num_reg_re   );
+            
 #ifdef DEBUG_TEST
 	    if (type >= _param->_nb_type)
@@ -98,18 +119,30 @@
 	    if (type == TYPE_CUSTOM)
 	      {
-		uint32_t num_thread = get_num_thread(context_id   ,_param->_size_context_id,
-						     front_end_id ,_param->_size_front_end_id,
-						     ooo_engine_id,_param->_size_ooo_engine_id);
-
-		(*(_param->_get_custom_information(num_thread)._get_custom_execute_genMoore(operation))) (_execute_operation, execute_register, _execute_param);
+// 		uint32_t num_thread = get_num_thread(context_id   ,_param->_size_context_id,
+// 						     front_end_id ,_param->_size_front_end_id,
+// 						     ooo_engine_id,_param->_size_ooo_engine_id);
+
+		(*(_param->_get_custom_information()._get_custom_execute_genMoore(operation))) (_execute_operation_in, execute_register, _execute_param);
 	      }
 	    else
-	      (*(_function_execute[type][operation])) (_execute_operation, execute_register, _execute_param);
-
+	      (*(_function_execute[type][operation])) (_execute_operation_in, execute_register, _execute_param);
+
+
+            log_printf(TRACE,Functionnal_unit,FUNCTION,"    -----------------");
+            log_printf(TRACE,Functionnal_unit,FUNCTION,"    * latence       : %.8x",_execute_operation_in->_timing._latence);
+            log_printf(TRACE,Functionnal_unit,FUNCTION,"    * delay         : %.8x",_execute_operation_in->_timing._delay);
+            log_printf(TRACE,Functionnal_unit,FUNCTION,"    * data_rd       : %.8x",_execute_operation_in->_data_rd    );
+            log_printf(TRACE,Functionnal_unit,FUNCTION,"    * data_re       : %.8x",_execute_operation_in->_data_re    );
+            log_printf(TRACE,Functionnal_unit,FUNCTION,"    * exception     : %d"  ,_execute_operation_in->_exception  );
+            log_printf(TRACE,Functionnal_unit,FUNCTION,"    * no_sequence   : %d"  ,_execute_operation_in->_no_sequence);
+            log_printf(TRACE,Functionnal_unit,FUNCTION,"    * address       : %.8x",_execute_operation_in->_address    );
 
 #ifdef STATISTICS
-            (*_stat_use_functionnal_unit) ++;
-	    (*_stat_sum_delay)   += _execute_operation->_timing._delay;
-	    (*_stat_sum_latence) += _execute_operation->_timing._latence;
+            if (usage_is_set(_usage,USE_STATISTICS))
+              {
+                (*_stat_use_functionnal_unit) ++;
+                (*_stat_sum_delay)   += _execute_operation_in->_timing._delay;
+                (*_stat_sum_latence) += _execute_operation_in->_timing._latence;
+              }
 #endif
 	  }
@@ -121,11 +154,11 @@
 	      for (uint32_t k=0; k<_param->_nb_ooo_engine; k++)
 		{
-		  uint32_t num_thread = get_num_thread(i,_param->_size_context_id,
-						       j,_param->_size_front_end_id,
-						       k,_param->_size_ooo_engine_id);
+// 		  uint32_t num_thread = get_num_thread(i,_param->_size_context_id,
+// 						       j,_param->_size_front_end_id,
+// 						       k,_param->_size_ooo_engine_id);
 
 		  for (uint32_t x=GROUP_CUSTOM_1; x<GROUP_CUSTOM_8; x++)
 		    {
-		      function_execute_end_cycle_t * fct = (_param->_get_custom_information(num_thread)._get_custom_execute_transition(x));
+		      function_execute_end_cycle_t * fct = (_param->_get_custom_information()._get_custom_execute_transition(x));
 		      
 		      if (fct != NULL)
@@ -142,9 +175,37 @@
 	    }
 	}
+
+	if (reg_BUSY_IN and not reg_BUSY_OUT)
+	  {
+	    reg_BUSY_OUT = reg_BUSY_IN;
+	    reg_BUSY_IN  = false;
+
+	    _execute_operation_out->_timing        = _execute_operation_in->_timing       ;
+	    _execute_operation_out->_context_id    = _execute_operation_in->_context_id   ;
+	    _execute_operation_out->_front_end_id  = _execute_operation_in->_front_end_id ;
+	    _execute_operation_out->_ooo_engine_id = _execute_operation_in->_ooo_engine_id;
+	    _execute_operation_out->_packet_id     = _execute_operation_in->_packet_id    ;
+	    _execute_operation_out->_operation     = _execute_operation_in->_operation    ;
+	    _execute_operation_out->_type          = _execute_operation_in->_type         ;
+	    _execute_operation_out->_has_immediat  = _execute_operation_in->_has_immediat ;
+	    _execute_operation_out->_immediat      = _execute_operation_in->_immediat     ;
+	    _execute_operation_out->_data_ra       = _execute_operation_in->_data_ra      ;
+	    _execute_operation_out->_data_rb       = _execute_operation_in->_data_rb      ;
+	    _execute_operation_out->_data_rc       = _execute_operation_in->_data_rc      ;
+	    _execute_operation_out->_data_rd       = _execute_operation_in->_data_rd      ;
+	    _execute_operation_out->_data_re       = _execute_operation_in->_data_re      ;
+	    _execute_operation_out->_write_rd      = _execute_operation_in->_write_rd     ;
+	    _execute_operation_out->_num_reg_rd    = _execute_operation_in->_num_reg_rd   ;
+	    _execute_operation_out->_write_re      = _execute_operation_in->_write_re     ;
+	    _execute_operation_out->_num_reg_re    = _execute_operation_in->_num_reg_re   ;
+	    _execute_operation_out->_exception     = _execute_operation_in->_exception    ;
+	    _execute_operation_out->_no_sequence   = _execute_operation_in->_no_sequence  ;
+	    _execute_operation_out->_address       = _execute_operation_in->_address      ;
+	  }
+	
+	// each cycle : decrease the latence
+	if (reg_BUSY_OUT and (_execute_operation_out->_timing._latence > 0))
+	  _execute_operation_out->_timing._latence --;
       }
-
-    // each cycle : decrease the latence
-    if (reg_BUSY and (_execute_operation->_timing._latence > 0))
-      _execute_operation->_timing._latence --;
 
 #if defined(STATISTICS) or defined(VHDL_TESTBENCH)
@@ -152,5 +213,5 @@
 #endif
 
-    log_printf(FUNC,Functionnal_unit,FUNCTION,"End");
+    log_end(Functionnal_unit,FUNCTION);
   };
 
