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.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.cpp	(revision 106)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Execute_unit/Execute_unit/Load_store_unit/src/Load_store_unit.cpp	(revision 110)
@@ -56,5 +56,5 @@
         log_printf(INFO,Load_store_unit,FUNCTION,"Allocation of statistics");
         
-        statistics_declaration(param_statistics);
+        statistics_allocation(param_statistics);
       }
 #endif
@@ -181,9 +181,5 @@
 #ifdef STATISTICS
     if (usage_is_set(_usage,USE_STATISTICS))
-      {	
-        log_printf(INFO,Load_store_unit,FUNCTION,"Generate Statistics file");
-        
-        delete _stat;
-      }
+      statistics_deallocation ();
 #endif
 
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 106)
+++ 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 110)
@@ -602,4 +602,9 @@
 			      _load_queue[index_load]._exception = EXCEPTION_MEMORY_MISS_SPECULATION;
 			      _load_queue[index_load]._write_rd  = 1; // write the good result
+
+#ifdef STATISTICS
+                              if (usage_is_set(_usage,USE_STATISTICS))
+                                (*_stat_nb_inst_load_commit_miss) ++;
+#endif
 			    }
 			  
@@ -696,5 +701,5 @@
 #ifdef DEBUG_TEST
 		      if (is_operation_memory_store_head(operation) == true)
-			throw ErrorMorpheo(_("Transaction in memory_in's interface, actual state of store_queue is \"STORE_QUEUE_NO_VALID_NO_SPECULATIVE\", also a previous store_head have been receiveid. But this operation is a store_head."));
+			throw ERRORMORPHEO(FUNCTION,_("Transaction in memory_in's interface, actual state of store_queue is \"STORE_QUEUE_NO_VALID_NO_SPECULATIVE\", also a previous store_head have been receiveid. But this operation is a store_head."));
 #endif
 		      // Test if have a new exception (priority : miss_speculation)
@@ -714,5 +719,5 @@
 #ifdef DEBUG_TEST
 		      if (is_operation_memory_store_head(operation) == false)
-			throw ErrorMorpheo(_("Transaction in memory_in's interface, actual state of store_queue is \"STORE_QUEUE_VALID_SPECULATIVE\", also a previous access with register and address have been receiveid. But this operation is a not store_head."));
+			throw ERRORMORPHEO(FUNCTION,_("Transaction in memory_in's interface, actual state of store_queue is \"STORE_QUEUE_VALID_SPECULATIVE\", also a previous access with register and address have been receiveid. But this operation is a not store_head."));
 #endif
 		      if (operation == OPERATION_MEMORY_STORE_HEAD_KO)
@@ -729,5 +734,5 @@
 		  case STORE_QUEUE_COMMIT                  :
 		    {
-		      throw ErrorMorpheo("<Load_store_unit::function_speculative_load_commit_transition> Invalid state and operation");
+		      throw ERRORMORPHEO(FUNCTION,"<Load_store_unit::function_speculative_load_commit_transition> Invalid state and operation");
 		    }
 		  }
@@ -847,4 +852,10 @@
 		  // if the speculation is a miss, write_rd is re set at 1.
 		  _load_queue [internal_MEMORY_OUT_PTR]._write_rd = 0;
+
+#ifdef STATISTICS
+                  if (usage_is_set(_usage,USE_STATISTICS))
+                    (*_stat_nb_inst_load_commit_speculative) ++;
+#endif
+
 		  break;
 		}
@@ -889,5 +900,5 @@
 	      case SELECT_LOAD_QUEUE :
 		{
-		  throw ErrorMorpheo(_("Invalid selection"));
+		  throw ERRORMORPHEO(FUNCTION,_("Invalid selection"));
 		  break;
 		}
@@ -964,5 +975,10 @@
 	    
 	    _speculative_access_queue_control->pop();
-	  }
+
+#ifdef STATISTICS
+            if (usage_is_set(_usage,USE_STATISTICS))
+              (*_stat_nb_inst_load) ++;
+#endif
+          }
 
 	//================================================================
@@ -993,5 +1009,5 @@
 #ifdef DEBUG_TEST
 		if (not have_dcache_rsp(_load_queue [packet_id]._operation))
-		  throw ErrorMorpheo(_("Receive of respons, but the corresponding operation don't wait a respons."));
+		  throw ERRORMORPHEO(FUNCTION,_("Receive of respons, but the corresponding operation don't wait a respons."));
 #endif
 
@@ -1032,5 +1048,5 @@
 		      case LOAD_QUEUE_WAIT_CHECK : _load_queue [packet_id]._state = LOAD_QUEUE_COMMIT_CHECK; break;
 		      case LOAD_QUEUE_WAIT       : _load_queue [packet_id]._state = LOAD_QUEUE_COMMIT      ; break;
-		      default : throw ErrorMorpheo(_("Illegal state (dcache_rsp).")); break;
+		      default : throw ERRORMORPHEO(FUNCTION,_("Illegal state (dcache_rsp).")); break;
 		      }
 		  }
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_statistics_allocation.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_statistics_allocation.cpp	(revision 110)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Execute_unit/Execute_unit/Load_store_unit/src/Load_store_unit_statistics_allocation.cpp	(revision 110)
@@ -0,0 +1,72 @@
+#ifdef STATISTICS
+/*
+ * $Id$
+ *
+ * [ Description ]
+ * 
+ */
+
+#include "Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Execute_unit/Execute_unit/Load_store_unit/include/Load_store_unit.h"
+
+namespace morpheo {
+namespace behavioural {
+namespace core {
+namespace multi_execute_loop {
+namespace execute_loop {
+namespace multi_execute_unit {
+namespace execute_unit {
+namespace load_store_unit {
+
+
+#undef  FUNCTION
+#define FUNCTION "Load_store_unit::statistics_allocation"
+  void Load_store_unit::statistics_allocation (morpheo::behavioural::Parameters_Statistics * param_statistics)
+  {
+    log_printf(FUNC,Load_store_unit,FUNCTION,"Begin");
+
+    _stat = new Stat (static_cast<std::string>(_name),
+		      "Load_store_unit",
+		      param_statistics);
+
+    _stat_use_store_queue                      = _stat->create_variable("use_store_queue");
+    _stat_use_load_queue                       = _stat->create_variable("use_load_queue");
+    _stat_use_speculative_access_queue         = _stat->create_variable("use_speculative_access_queue");
+
+    _stat_average_use_store_queue              = _stat->create_counter("average_use_store_queue"              , "", "Average by cycle of the store_queue occupation ");
+    _stat_average_use_load_queue               = _stat->create_counter("average_use_load_queue"               , "", "Average by cycle of the load_queue occupation");
+    _stat_average_use_speculative_access_queue = _stat->create_counter("average_use_speculative_access_queue" , "", "Average by cycle of the speculative_access_queue occupation");
+
+    _stat_percent_use_store_queue              = _stat->create_counter("percent_use_store_queue"              , "%", "Percent of store_queue usage");
+    _stat_percent_use_load_queue               = _stat->create_counter("percent_use_load_queue"               , "%", "Percent of load_queue usage");
+    _stat_percent_use_speculative_access_queue = _stat->create_counter("percent_use_speculative_access_queue" , "%", "Percent of speculative_access_queue usage");
+
+    _stat->create_expr("average_use_store_queue"             , "/ use_store_queue              cycle", false);
+    _stat->create_expr("average_use_load_queue"              , "/ use_load_queue               cycle", false);
+    _stat->create_expr("average_use_speculative_access_queue", "/ use_speculative_access_queue cycle", false);
+
+    _stat->create_expr("percent_use_store_queue"              , "/ * average_use_store_queue              100 " + toString(_param->_size_store_queue             ), false);
+    _stat->create_expr("percent_use_load_queue"               , "/ * average_use_load_queue               100 " + toString(_param->_size_load_queue              ), false);
+    _stat->create_expr("percent_use_speculative_access_queue" , "/ * average_use_speculative_access_queue 100 " + toString(_param->_size_speculative_access_queue), false);
+
+
+    _stat_nb_inst_load                         = _stat->create_variable("nb_inst_load"                   );
+    _stat_nb_inst_load_commit_speculative      = _stat->create_variable("nb_inst_load_commit_speculative");
+    _stat_nb_inst_load_commit_miss             = _stat->create_variable("nb_inst_load_commit_miss"       );
+
+    _stat->create_expr_percent("percent_nb_inst_load_commit_speculative","nb_inst_load_commit_speculative", "nb_inst_load"                   , "Percent of load instruction with a speculative commit ");
+    _stat->create_expr_percent("percent_nb_inst_load_commit_miss"       ,"nb_inst_load_commit_miss"       , "nb_inst_load_commit_speculative", "Percent of load instruction with a miss speculative commit");
+
+
+    log_printf(FUNC,Load_store_unit,FUNCTION,"End");
+  };
+
+}; // end namespace load_store_unit
+}; // end namespace execute_unit
+}; // end namespace multi_execute_unit
+}; // end namespace execute_loop
+}; // end namespace multi_execute_loop
+}; // end namespace core
+
+}; // end namespace behavioural
+}; // end namespace morpheo              
+#endif
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_statistics_deallocation.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_statistics_deallocation.cpp	(revision 110)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Execute_unit/Execute_unit/Load_store_unit/src/Load_store_unit_statistics_deallocation.cpp	(revision 110)
@@ -0,0 +1,43 @@
+#ifdef STATISTICS
+/*
+ * $Id$
+ *
+ * [ Description ]
+ * 
+ */
+
+#include "Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Execute_unit/Execute_unit/Load_store_unit/include/Load_store_unit.h"
+
+namespace morpheo {
+namespace behavioural {
+namespace core {
+namespace multi_execute_loop {
+namespace execute_loop {
+namespace multi_execute_unit {
+namespace execute_unit {
+namespace load_store_unit {
+
+
+#undef  FUNCTION
+#define FUNCTION "Load_store_unit::statistics_deallocation"
+  void Load_store_unit::statistics_deallocation (void)
+  {
+    log_printf(FUNC,Load_store_unit,FUNCTION,"Begin");
+
+    log_printf(INFO,Load_store_unit,FUNCTION,"Generate Statistics file");
+    
+    delete _stat;
+    
+    log_printf(FUNC,Load_store_unit,FUNCTION,"End");
+  };
+
+}; // end namespace load_store_unit
+}; // end namespace execute_unit
+}; // end namespace multi_execute_unit
+}; // end namespace execute_loop
+}; // end namespace multi_execute_loop
+}; // end namespace core
+
+}; // end namespace behavioural
+}; // end namespace morpheo              
+#endif
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_statistics_declaration.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_statistics_declaration.cpp	(revision 106)
+++ 	(revision )
@@ -1,63 +1,0 @@
-#ifdef STATISTICS
-/*
- * $Id$
- *
- * [ Description ]
- * 
- */
-
-#include "Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Execute_unit/Execute_unit/Load_store_unit/include/Load_store_unit.h"
-
-namespace morpheo {
-namespace behavioural {
-namespace core {
-namespace multi_execute_loop {
-namespace execute_loop {
-namespace multi_execute_unit {
-namespace execute_unit {
-namespace load_store_unit {
-
-
-#undef  FUNCTION
-#define FUNCTION "Load_store_unit::statistics_declaration"
-  void Load_store_unit::statistics_declaration (morpheo::behavioural::Parameters_Statistics * param_statistics)
-  {
-    log_printf(FUNC,Load_store_unit,FUNCTION,"Begin");
-
-    _stat = new Stat (static_cast<std::string>(_name),
-		      "Load_store_unit",
-		      param_statistics);
-
-    _stat_use_store_queue                      = _stat->create_variable("use_store_queue");
-    _stat_use_load_queue                       = _stat->create_variable("use_load_queue");
-    _stat_use_speculative_access_queue         = _stat->create_variable("use_speculative_access_queue");
-
-    _stat_average_use_store_queue              = _stat->create_counter("average_use_store_queue"              , "", "Average by cycle of the store_queue occupation ");
-    _stat_average_use_load_queue               = _stat->create_counter("average_use_load_queue"               , "", "Average by cycle of the load_queue occupation");
-    _stat_average_use_speculative_access_queue = _stat->create_counter("average_use_speculative_access_queue" , "", "Average by cycle of the speculative_access_queue occupation");
-
-    _stat_percent_use_store_queue              = _stat->create_counter("percent_use_store_queue"              , "%", "Percent of store_queue usage");
-    _stat_percent_use_load_queue               = _stat->create_counter("percent_use_load_queue"               , "%", "Percent of load_queue usage");
-    _stat_percent_use_speculative_access_queue = _stat->create_counter("percent_use_speculative_access_queue" , "%", "Percent of speculative_access_queue usage");
-
-    _stat->create_expr("average_use_store_queue"             , "/ use_store_queue              cycle", false);
-    _stat->create_expr("average_use_load_queue"              , "/ use_load_queue               cycle", false);
-    _stat->create_expr("average_use_speculative_access_queue", "/ use_speculative_access_queue cycle", false);
-
-    _stat->create_expr("percent_use_store_queue"              , "/ * average_use_store_queue              100 " + toString(_param->_size_store_queue             ), false);
-    _stat->create_expr("percent_use_load_queue"               , "/ * average_use_load_queue               100 " + toString(_param->_size_load_queue              ), false);
-    _stat->create_expr("percent_use_speculative_access_queue" , "/ * average_use_speculative_access_queue 100 " + toString(_param->_size_speculative_access_queue), false);
-
-    log_printf(FUNC,Load_store_unit,FUNCTION,"End");
-  };
-
-}; // end namespace load_store_unit
-}; // end namespace execute_unit
-}; // end namespace multi_execute_unit
-}; // end namespace execute_loop
-}; // end namespace multi_execute_loop
-}; // end namespace core
-
-}; // end namespace behavioural
-}; // end namespace morpheo              
-#endif
