Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Execute_unit/Execute_unit/Load_store_unit/src/Load_store_unit_function_speculative_load_commit_transition.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Execute_unit/Execute_unit/Load_store_unit/src/Load_store_unit_function_speculative_load_commit_transition.cpp	(revision 88)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Execute_unit/Execute_unit/Load_store_unit/src/Load_store_unit_function_speculative_load_commit_transition.cpp	(revision 97)
@@ -23,5 +23,6 @@
   void Load_store_unit::function_speculative_load_commit_transition (void)
   {
-    log_printf(FUNC,Load_store_unit,FUNCTION,"Begin");
+    log_begin(Load_store_unit,FUNCTION);
+    log_function(Load_store_unit,FUNCTION,_name.c_str());
 
     if (PORT_READ(in_NRESET) == 0)
@@ -53,5 +54,5 @@
 
 	// solution 1)
- 	log_printf(TRACE,Load_store_unit,FUNCTION,"CHECK");
+ 	log_printf(TRACE,Load_store_unit,FUNCTION,"  * CHECK");
 	for (uint32_t i=0, nb_check=0; (nb_check<_param->_nb_port_check) and (i<_param->_size_load_queue); i++)
 	  {
@@ -63,5 +64,5 @@
 		is_operation_memory_load(_load_queue[index_load]._operation))
 	      {
-		log_printf(TRACE,Load_store_unit,FUNCTION,"  * Find a load : %d",index_load);
+		log_printf(TRACE,Load_store_unit,FUNCTION,"    * Find a load : %d",index_load);
 
 		nb_check++; // use one port
@@ -283,10 +284,10 @@
 		//   - second is the information of re order buffer : the store become not speculative and can access at the data cache
 
-		log_printf(TRACE,Load_store_unit,FUNCTION,"store_queue");
-		log_printf(TRACE,Load_store_unit,FUNCTION," * PUSH");
+		log_printf(TRACE,Load_store_unit,FUNCTION,"    * store_queue");
+		log_printf(TRACE,Load_store_unit,FUNCTION,"      * PUSH");
 		
 		// Write pointer is define in rename stage :
 		Tlsq_ptr_t           index         = PORT_READ(in_MEMORY_IN_STORE_QUEUE_PTR_WRITE[internal_MEMORY_IN_PORT]);
-		log_printf(TRACE,Load_store_unit,FUNCTION,"   * index         : %d",index);
+		log_printf(TRACE,Load_store_unit,FUNCTION,"      * index         : %d",index);
 		
 		// Need read : state and exception.
@@ -373,5 +374,5 @@
 		if (update_info == true)
 		  {
-		    log_printf(TRACE,Load_store_unit,FUNCTION,"   * Update information");
+		    log_printf(TRACE,Load_store_unit,FUNCTION,"      * Update information");
 
 		    _store_queue [index]._context_id           = (not _param->_have_port_context_id   )?0:PORT_READ(in_MEMORY_IN_CONTEXT_ID   [internal_MEMORY_IN_PORT]);
@@ -395,11 +396,11 @@
 
 		// In speculative access queue, they are many type's request
-		log_printf(TRACE,Load_store_unit,FUNCTION,"speculative_access_queue");
-		log_printf(TRACE,Load_store_unit,FUNCTION," * PUSH");
+		log_printf(TRACE,Load_store_unit,FUNCTION,"    * speculative_access_queue");
+		log_printf(TRACE,Load_store_unit,FUNCTION,"      * PUSH");
 		
 		// Write in reservation station
 		uint32_t     index = _speculative_access_queue_control->push();
 
-		log_printf(TRACE,Load_store_unit,FUNCTION,"   * index : %d", index);
+		log_printf(TRACE,Load_store_unit,FUNCTION,"      * index : %d", index);
 
 		Texception_t exception;
@@ -428,5 +429,5 @@
 		_speculative_access_queue [index]._exception            = exception;
 		
-		log_printf(TRACE,Load_store_unit,FUNCTION,"   * index         : %d",index);
+		log_printf(TRACE,Load_store_unit,FUNCTION,"      * index         : %d",index);
 	      }
 	  }
@@ -439,5 +440,5 @@
             (PORT_READ(in_MEMORY_OUT_ACK[0]) == 1))
           {
-	    log_printf(TRACE,Load_store_unit,FUNCTION,"MEMORY_OUT transaction");
+	    log_printf(TRACE,Load_store_unit,FUNCTION,"  * MEMORY_OUT transaction");
 
 	    switch (internal_MEMORY_OUT_SELECT_QUEUE)
@@ -449,5 +450,5 @@
 		  // =======================
 		  
-		  log_printf(TRACE,Load_store_unit,FUNCTION," * store_queue [%d]",reg_STORE_QUEUE_PTR_READ);
+		  log_printf(TRACE,Load_store_unit,FUNCTION,"    * store_queue [%d]",reg_STORE_QUEUE_PTR_READ);
 	    
 		  // Entry flush and increase the read pointer
@@ -464,5 +465,5 @@
 		  // ======================
 		  
-		  log_printf(TRACE,Load_store_unit,FUNCTION," * load_queue  [%d]",internal_MEMORY_OUT_PTR);
+		  log_printf(TRACE,Load_store_unit,FUNCTION,"    * load_queue  [%d]",internal_MEMORY_OUT_PTR);
 		  
 		  // Entry flush and increase the read pointer
@@ -476,5 +477,5 @@
 	      case SELECT_LOAD_QUEUE_SPECULATIVE :
 		{
-		  log_printf(TRACE,Load_store_unit,FUNCTION," * load_queue  [%d] (speculative)",internal_MEMORY_OUT_PTR);
+		  log_printf(TRACE,Load_store_unit,FUNCTION,"    * load_queue  [%d] (speculative)",internal_MEMORY_OUT_PTR);
 		  
 		  _load_queue [internal_MEMORY_OUT_PTR]._state    = LOAD_QUEUE_CHECK;
@@ -497,5 +498,5 @@
             (PORT_READ(in_DCACHE_REQ_ACK[0]) == 1))
           {
-	    log_printf(TRACE,Load_store_unit,FUNCTION,"DCACHE_REQ");
+	    log_printf(TRACE,Load_store_unit,FUNCTION,"  * DCACHE_REQ");
 
 	    switch (internal_DCACHE_REQ_SELECT_QUEUE)
@@ -587,6 +588,6 @@
 	    _load_queue [ptr_write]._rdata             = address; // to the exception
 	    
-	    log_printf(TRACE,Load_store_unit,FUNCTION,"  * speculative_access_queue");
-	    log_printf(TRACE,Load_store_unit,FUNCTION,"    * POP[%d]",(*_speculative_access_queue_control)[0]);
+	    log_printf(TRACE,Load_store_unit,FUNCTION,"    * speculative_access_queue");
+	    log_printf(TRACE,Load_store_unit,FUNCTION,"      * POP[%d]",(*_speculative_access_queue_control)[0]);
 	    
 	    _speculative_access_queue [(*_speculative_access_queue_control)[0]]._state = SPECULATIVE_ACCESS_QUEUE_EMPTY;
@@ -601,5 +602,5 @@
             (    internal_DCACHE_RSP_ACK == 1))
           {
-	    log_printf(TRACE,Load_store_unit,FUNCTION,"DCACHE_RSP");
+	    log_printf(TRACE,Load_store_unit,FUNCTION,"  * DCACHE_RSP");
 
 	    // don't use context_id : because there are one queue for all thread
@@ -609,5 +610,5 @@
 	    Tdcache_error_t error      = PORT_READ(in_DCACHE_RSP_ERROR     [0]);
 
-	    log_printf(TRACE,Load_store_unit,FUNCTION," * original packet_id : %d", packet_id);
+	    log_printf(TRACE,Load_store_unit,FUNCTION,"    * original packet_id : %d", packet_id);
 	    
 	    if (DCACHE_RSP_IS_LOAD(packet_id) == 1)
@@ -615,5 +616,5 @@
 		packet_id >>= 1;
 
-		log_printf(TRACE,Load_store_unit,FUNCTION," * packet is a LOAD  : %d", packet_id);
+		log_printf(TRACE,Load_store_unit,FUNCTION,"    * packet is a LOAD  : %d", packet_id);
  
 
@@ -626,5 +627,5 @@
 		if (error != DCACHE_ERROR_NONE)
 		  {
-		    log_printf(TRACE,Load_store_unit,FUNCTION," * have a bus error !!!");
+		    log_printf(TRACE,Load_store_unit,FUNCTION,"    * have a bus error !!!");
 
 		    _load_queue [packet_id]._exception = EXCEPTION_MEMORY_BUS_ERROR;
@@ -633,6 +634,6 @@
 		else
 		  {
-		    log_printf(TRACE,Load_store_unit,FUNCTION," * have no bus error.");
-		    log_printf(TRACE,Load_store_unit,FUNCTION,"   * previous state : %d.",_load_queue [packet_id]._state);
+		    log_printf(TRACE,Load_store_unit,FUNCTION,"    * have no bus error.");
+		    log_printf(TRACE,Load_store_unit,FUNCTION,"      * previous state : %d.",_load_queue [packet_id]._state);
 
 		    // FIXME : convention : if bus error, the cache return the fautive address !
@@ -650,5 +651,5 @@
 	    else
 	      {
-		log_printf(TRACE,Load_store_unit,FUNCTION," * packet is a STORE");
+		log_printf(TRACE,Load_store_unit,FUNCTION,"    * packet is a STORE");
 		
 		// TODO : les stores ne génére pas de réponse sauf quand c'est un bus error !!!
@@ -664,33 +665,77 @@
 #if defined(DEBUG) and (DEBUG>=DEBUG_TRACE)
 	// ***** dump store queue
-	std::cout << "Dump STORE_QUEUE :" << std::endl
-		  << "ptr_read : " << toString(static_cast<uint32_t>(reg_STORE_QUEUE_PTR_READ)) << std::endl;
+        log_printf(TRACE,Load_store_unit,FUNCTION,"  * Dump STORE_QUEUE");
+        log_printf(TRACE,Load_store_unit,FUNCTION,"    * ptr_read : %d",reg_STORE_QUEUE_PTR_READ);
 	
 	for (uint32_t i=0; i<_param->_size_store_queue; i++)
 	  {
 	    uint32_t j = (reg_STORE_QUEUE_PTR_READ+i)%_param->_size_store_queue;
-	    std::cout << "{" << j << "}" << std::endl
-		      << _store_queue[j] << std::endl;
+
+            log_printf(TRACE,Load_store_unit,FUNCTION,"    [%.4d] %.4d %.4d %.4d, %.4d, %.4d, %.4d, %.8x %.8x, %.2d, %s",
+                       j,
+                       _store_queue[j]._context_id          ,
+                       _store_queue[j]._front_end_id        ,
+                       _store_queue[j]._ooo_engine_id       ,
+                       _store_queue[j]._packet_id           ,
+                       _store_queue[j]._operation           ,
+                       _store_queue[j]._load_queue_ptr_write,
+                       _store_queue[j]._address             ,
+                       _store_queue[j]._wdata               ,
+                     //_store_queue[j]._write_rd            ,
+                     //_store_queue[j]._num_reg_rd          ,
+                       _store_queue[j]._exception           ,
+                       toString(_store_queue[j]._state).c_str());
 	  }
 
 	// ***** dump speculative_access queue
-	std::cout << "Dump SPECULATIVE_ACCESS_QUEUE :" << std::endl;
+	log_printf(TRACE,Load_store_unit,FUNCTION,"  * Dump SPECULATIVE_ACCESS_QUEUE");
 	
 	for (uint32_t i=0; i<_param->_size_speculative_access_queue; i++)
 	  {
 	    uint32_t j = (*_speculative_access_queue_control)[i];
-	    std::cout << "{" << j << "}" << std::endl
-		 << _speculative_access_queue[j] << std::endl;
+
+            log_printf(TRACE,Load_store_unit,FUNCTION,"    [%.4d] %.4d %.4d %.4d, %.4d, %.4d, %.4d %.4d, %.8x, %.1d %.6d, %.2d, %s",
+                       j,
+                       _speculative_access_queue[j]._context_id          ,
+                       _speculative_access_queue[j]._front_end_id        ,
+                       _speculative_access_queue[j]._ooo_engine_id       ,
+                       _speculative_access_queue[j]._packet_id           ,
+                       _speculative_access_queue[j]._operation           ,
+                       _speculative_access_queue[j]._load_queue_ptr_write,
+                       _speculative_access_queue[j]._store_queue_ptr_write,
+                       _speculative_access_queue[j]._address             ,
+                       _speculative_access_queue[j]._write_rd            ,
+                       _speculative_access_queue[j]._num_reg_rd          ,
+                       _speculative_access_queue[j]._exception           ,
+                       toString(_speculative_access_queue[j]._state).c_str());
 	  }
 
 	// ***** dump load queue
-	std::cout << "Dump LOAD_QUEUE :" << std::endl
-	     << "ptr_read_check_priority : " << toString(static_cast<uint32_t>(reg_LOAD_QUEUE_CHECK_PRIORITY)) << std::endl;
+	log_printf(TRACE,Load_store_unit,FUNCTION,"  * Dump LOAD_QUEUE");
+        log_printf(TRACE,Load_store_unit,FUNCTION,"    * ptr_read_check_priority : %d",reg_LOAD_QUEUE_CHECK_PRIORITY);
 	
 	for (uint32_t i=0; i<_param->_size_load_queue; i++)
 	  {
 	    uint32_t j = i;
-	    std::cout << "{" << j << "}" << std::endl
-		 << _load_queue[j] << std::endl;
+
+            log_printf(TRACE,Load_store_unit,FUNCTION,"    [%.4d] %.4d %.4d %.4d, %.4d, %.4d, %.4d, %.8x %.1x %.1d %.2d %.1d %.2d, %.8x, %.1d %.6d, %.2d, %s",
+                       j,
+                       _load_queue[j]._context_id          ,
+                       _load_queue[j]._front_end_id        ,
+                       _load_queue[j]._ooo_engine_id       ,
+                       _load_queue[j]._packet_id           ,
+                       _load_queue[j]._operation           ,
+                       _load_queue[j]._store_queue_ptr_write,
+                       _load_queue[j]._address             ,
+                       _load_queue[j]._check_hit_byte      , 
+                       _load_queue[j]._check_hit           ,
+                       _load_queue[j]._shift               ,
+                       _load_queue[j]._is_load_signed      ,
+                       _load_queue[j]._access_size         ,
+                       _load_queue[j]._rdata               ,
+                       _load_queue[j]._write_rd            ,
+                       _load_queue[j]._num_reg_rd          ,
+                       _load_queue[j]._exception           ,
+                       toString(_load_queue[j]._state).c_str());
 	  }
 #endif
@@ -712,5 +757,5 @@
       }
 
-    log_printf(FUNC,Load_store_unit,FUNCTION,"End");
+    log_end(Load_store_unit,FUNCTION);
   };
 
