Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Commit_unit/src/Commit_unit_statistics_allocation.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Commit_unit/src/Commit_unit_statistics_allocation.cpp	(revision 109)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Commit_unit/src/Commit_unit_statistics_allocation.cpp	(revision 110)
@@ -28,43 +28,88 @@
 
     _stat_nb_inst_insert                = new counter_t * [_param->_nb_rename_unit];
-    _stat_nb_inst_retire_ok             = new counter_t * [_param->_nb_rename_unit];
-    _stat_nb_inst_retire_ko             = new counter_t * [_param->_nb_rename_unit];
+    _stat_nb_inst_retire                = new counter_t * [_param->_nb_rename_unit];
+    _stat_nb_inst_retire_ok             = new counter_t * [_param->_nb_thread];
+    _stat_nb_inst_retire_ko             = new counter_t * [_param->_nb_thread];
+    _stat_nb_inst_type                  = new counter_t * [_param->_nb_type];
     _stat_bank_nb_inst                  = new counter_t * [_param->_nb_bank];
     
     {
       std::string sum_nb_inst_insert    = "0";
-      std::string sum_nb_inst_retire_ok = "0";
-      std::string sum_nb_inst_retire_ko = "0";
+      std::string sum_nb_inst_retire    = "0";
 
       for (uint32_t i=0; i<_param->_nb_rename_unit; i++)
 	{
 	  _stat_nb_inst_insert    [i] = _stat->create_variable("nb_inst_insert_"   +toString(i));
-	  _stat_nb_inst_retire_ok [i] = _stat->create_variable("nb_inst_retire_ok_"+toString(i));
-	  _stat_nb_inst_retire_ko [i] = _stat->create_variable("nb_inst_retire_ko_"+toString(i));
+	  _stat_nb_inst_retire    [i] = _stat->create_variable("nb_inst_retire_"   +toString(i));
 	  
 	  _stat->create_expr_average_by_cycle("average_use_interface_insert_"+toString(i), "nb_inst_insert_"+toString(i), "", toString(_("Average instruction by cycle on insert interface (rename_unit %d)"),i));
-	  _stat->create_expr_average_by_cycle("average_use_interface_retire_"+toString(i), "+ nb_inst_retire_ok_"+toString(i)+" nb_inst_retire_ko_"+toString(i), "", toString(_("Average instruction by cycle on retire interface (rename_unit %d)"),i));
+	  _stat->create_expr_average_by_cycle("average_use_interface_retire_"+toString(i), "nb_inst_retire_"+toString(i), "", toString(_("Average instruction by cycle on retire interface (rename_unit %d)"),i));
 	  _stat->create_expr_percent         ("percent_use_interface_insert_"+toString(i) , "average_use_interface_insert_"+toString(i), toString(_param->_nb_inst_insert [i]), toString(_("Percent usage of insert interface (rename_unit %d)"),i));
 	  _stat->create_expr_percent         ("percent_use_interface_retire_"+toString(i) , "average_use_interface_retire_"+toString(i), toString(_param->_nb_inst_retire [i]), toString(_("Percent usage of retire interface (rename_unit %d)"),i));
 
           sum_nb_inst_insert    = "+ nb_inst_insert_"+   toString(i) + " " +sum_nb_inst_insert;
-          sum_nb_inst_retire_ok = "+ nb_inst_retire_ok_"+toString(i) + " " +sum_nb_inst_retire_ok;
-          sum_nb_inst_retire_ko = "+ nb_inst_retire_ko_"+toString(i) + " " +sum_nb_inst_retire_ko;
-	}
+          sum_nb_inst_retire    = "+ nb_inst_retire_"+   toString(i) + " " +sum_nb_inst_retire;
+        }
 
       _stat->create_expr_average_by_cycle("average_inst_insert"   , sum_nb_inst_insert   , "", _("Average instruction insert by cycle"));
-      _stat->create_expr_average_by_cycle("average_inst_retire_ok", sum_nb_inst_retire_ok, "", _("Average instruction retire ok by cycle (IPC)"));
-      _stat->create_expr_average_by_cycle("average_inst_retire_ko", sum_nb_inst_retire_ko, "", _("Average instruction retire ko (event, miss) by cycle"));
-      _stat->create_expr_average_by_cycle("average_inst_retire"   , "+ "+sum_nb_inst_retire_ok+" "+sum_nb_inst_retire_ko, "", _("Average instruction retire by cycle"));
+      _stat->create_expr_average_by_cycle("average_inst_retire"   , sum_nb_inst_retire   , "", _("Average instruction retire by cycle"));
+    }
 
-      _stat->create_expr                 ("IPC_ok" , "average_inst_retire_ok", TYPE_COUNTER, "inst/cycle", "Instruction Per Cycle (Instruction Ok)");
+    {
+      std::string sum_nb_inst_retire_ok = "0";
+      std::string sum_nb_inst_retire_ko = "0";
+
+      for (uint32_t i=0; i<_param->_nb_thread; i++)
+        if (_param->_have_thread [i])
+          {
+            _stat_nb_inst_retire_ok [i] = _stat->create_variable("nb_inst_retire_ok_"+toString(i));
+            _stat_nb_inst_retire_ko [i] = _stat->create_variable("nb_inst_retire_ko_"+toString(i));
+            
+            sum_nb_inst_retire_ok = "+ nb_inst_retire_ok_"+toString(i) + " " +sum_nb_inst_retire_ok;
+            sum_nb_inst_retire_ko = "+ nb_inst_retire_ko_"+toString(i) + " " +sum_nb_inst_retire_ko;
+            
+            _stat->create_expr_average_by_cycle("average_inst_retire_ok_"+toString(i), sum_nb_inst_retire_ok, "", toString(_("Average instruction retire ok by cycle (IPC) (thread %d)"),i));
+            _stat->create_expr_average_by_cycle("average_inst_retire_ko_"+toString(i), sum_nb_inst_retire_ko, "", toString(_("Average instruction retire ko (event, miss) by cycle (thread %d)"),i));
+            
+            _stat->create_expr                 ("IPC_ok_"+toString(i) , "average_inst_retire_ok_"+toString(i), TYPE_COUNTER, "inst/cycle", toString("Instruction Per Cycle (Instruction Ok) (thread %d)",i));
+            _stat->create_expr                 ("CPI_ok_"+toString(i) , "/ 1 IPC_ok_"+toString(i)            , TYPE_COUNTER, "cycle/inst", toString("Cycle Per Instruction (Instruction Ok) (thread %d)",i));
+            
+            _stat->create_expr                 ("IPC_ko_"+toString(i) , "average_inst_retire_ko_"+toString(i), TYPE_COUNTER, "inst/cycle", toString("Instruction Per Cycle (Instruction Ko) (thread %d)",i));
+            _stat->create_expr                 ("CPI_ko_"+toString(i) , "/ 1 IPC_ko_"+toString(i)            , TYPE_COUNTER, "cycle/inst", toString("Cycle Per Instruction (Instruction Ko) (thread %d)",i));
+            
+            _stat->create_expr                 ("IPC_all_"+toString(i), "+ IPC_ok_"+toString(i)+" IPC_ko_"+toString(i), TYPE_COUNTER, "inst/cycle", toString("Instruction Per Cycle (Instruction Ok and Ko) (thread %d)",i));
+            _stat->create_expr                 ("CPI_all_"+toString(i), "/ 1 IPC_all_"+toString(i)           , TYPE_COUNTER, "cycle/inst", toString("Cycle Per Instruction (Instruction Ok and Ko) (thread %d)",i));
+          }
+
+      _stat->create_expr                 ("IPC_ok" , "/ "+sum_nb_inst_retire_ok+" cycle", TYPE_COUNTER, "inst/cycle", "Instruction Per Cycle (Instruction Ok)");
       _stat->create_expr                 ("CPI_ok" , "/ 1 IPC_ok"            , TYPE_COUNTER, "cycle/inst", "Cycle Per Instruction (Instruction Ok)");
 
-      _stat->create_expr                 ("IPC_ko" , "average_inst_retire_ko", TYPE_COUNTER, "inst/cycle", "Instruction Per Cycle (Instruction Ko)");
+      _stat->create_expr                 ("IPC_ko" , "/ "+sum_nb_inst_retire_ko+" cycle", TYPE_COUNTER, "inst/cycle", "Instruction Per Cycle (Instruction Ko)");
       _stat->create_expr                 ("CPI_ko" , "/ 1 IPC_ko"            , TYPE_COUNTER, "cycle/inst", "Cycle Per Instruction (Instruction Ko)");
 
-      _stat->create_expr                 ("IPC_all", "average_inst_retire"   , TYPE_COUNTER, "inst/cycle", "Instruction Per Cycle (Instruction Ok and Ko)");
+      _stat->create_expr                 ("IPC_all", "+ IPC_ok IPC_ko"       , TYPE_COUNTER, "inst/cycle", "Instruction Per Cycle (Instruction Ok and Ko)");
       _stat->create_expr                 ("CPI_all", "/ 1 IPC_all"           , TYPE_COUNTER, "cycle/inst", "Cycle Per Instruction (Instruction Ok and Ko)");
     }
+
+    {
+      std::string sum_nb_inst_type = "0";
+
+      for (uint32_t i=0; i<_param->_nb_type; i++)
+        if (is_type_valid(i))
+          {
+            _stat_nb_inst_type [i] = _stat->create_variable("nb_inst_type_"+toString(i));
+            
+            sum_nb_inst_type = "+ nb_inst_type_"+toString(i) + " " +sum_nb_inst_type;
+          }
+ 
+      for (uint32_t i=0; i<_param->_nb_type; i++)
+        if (is_type_valid(i))
+          {
+            std::string name = toString(static_cast<type_t>(i)).c_str();
+//          _stat->create_expr_average_by_cycle("average_inst_type_"+toString(name), "nb_inst_type_"+toString(i), "", toString(_("Average instruction retire ok by cycle (type %s)"),name.c_str()));
+            _stat->create_expr_percent         ("percent_inst_type_"+toString(name), "nb_inst_type_"+toString(i), sum_nb_inst_type, toString(_("Percent instruction retire ok by cycle (type %s)"),name.c_str()));
+          }
+    }
+
 
     _stat_nb_inst_commit = _stat->create_variable("nb_inst_commit");
