Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Simulation.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Simulation.cpp	(revision 101)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Simulation.cpp	(revision 110)
@@ -13,28 +13,8 @@
 namespace behavioural          {
 
-  static bool            simulation_initialized;
-//   static uint32_t       _simulation_num_context_next;
-  double                _simulation_nb_cycle;
-//   double                _simulation_nb_instruction;
-//   std::vector<double> * _simulation_nb_instruction_commited;
-
-//   Simulation::Simulation (void):
-//     _num_context (_simulation_num_context_next)
-//   {
-//     // Test if is first context create
-//     if (_simulation_num_context_next == 0)
-//       _simulation_nb_instruction_commited = new std::vector<double>;
-
-//     _simulation_num_context_next ++;
-//   }
-  
-//   Simulation::~Simulation (void)
-//   {
-//     _simulation_num_context_next --;
-    
-//     // Test if is last context destroy
-//     if (_simulation_num_context_next == 0)
-//       delete _simulation_nb_instruction_commited;
-//   }
+  static bool          simulation_initialized;
+  double              _simulation_nb_cycle;
+  double              _simulation_nb_instruction;
+  std::vector<double> _simulation_nb_instruction_commited;
 
   void simulation_init (double nb_cycle,
@@ -43,11 +23,8 @@
     if (not simulation_initialized)
       {
-//         _simulation_num_context_next = 0;
-        _simulation_nb_cycle         = nb_cycle       ;
-//         _simulation_nb_instruction   = nb_instruction;
+        _simulation_nb_cycle                = nb_cycle;
+        _simulation_nb_instruction          = nb_instruction;
+//      _simulation_nb_instruction_commited = new std::vector<double>;
 
-        if (nb_instruction != 0)
-          throw ERRORMORPHEO("simulation_init",_("Stop Condition on number instruction is not yet implemented"));
-        
         simulation_initialized = true;
       }
@@ -59,6 +36,6 @@
           _simulation_nb_cycle = nb_cycle;
 
-//         if (_simulation_nb_instruction < nb_instruction)
-//           _simulation_nb_instruction = nb_instruction;
+        if (_simulation_nb_instruction < nb_instruction)
+          _simulation_nb_instruction = nb_instruction;
       }
   }
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Simulation_end_cycle.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Simulation_end_cycle.cpp	(revision 101)
+++ 	(revision )
@@ -1,23 +1,0 @@
-#ifdef SYSTEMC
-/*
- * $Id$
- *
- * [ Description ]
- * 
- */
-
-#include "Behavioural/include/Simulation.h"
-
-namespace morpheo              {
-namespace behavioural          {
-
-//   void Simulation::end_cycle (double nb_instruction_commited)
-//   {
-//     // must test if _simulation_nb_instruction_commited is allocate
-//     (*_simulation_nb_instruction_commited) [_num_context] += nb_instruction_commited;
-//   }
-
-}; // end namespace behavioural          
-}; // end namespace morpheo              
-
-#endif
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Simulation_test_end.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Simulation_test_end.cpp	(revision 101)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Simulation_test_end.cpp	(revision 110)
@@ -17,29 +17,34 @@
 
     // Test if a stop condition is activate
-    if ((_simulation_nb_cycle == 0)//  and
-//         (_simulation_nb_instruction == 0)
+    if ((_simulation_nb_cycle == 0) and
+        (_simulation_nb_instruction == 0)
         )
       return false;
 
-    bool end_cycle = true;
-//     bool end_inst  = true;
+    bool end_cycle;
+    bool end_inst ;
 
     if (_simulation_nb_cycle != 0)
       end_cycle = (_simulation_nb_cycle <= sc_simulation_time());
+    else
+      end_cycle = true;
 
-//     if (_simulation_nb_instruction != 0)
-//       {
-//         std::vector<double>::iterator it=_simulation_nb_instruction_commited->begin();
+    if (_simulation_nb_instruction != 0)
+      {
+        end_inst = true;
+
+        std::vector<double>::iterator it=_simulation_nb_instruction_commited.begin();
         
-//         // Scan all context and test if all can finish
-//         while (end_inst and it!=_simulation_nb_instruction_commited->end())
-//           {
-//             end_inst &= (*it <= _simulation_nb_instruction);
-//             it ++;
-//           }
-//       }
+        // Scan all context and test if all can finish
+        while (end_inst and it!=_simulation_nb_instruction_commited.end())
+          {
+            end_inst &= (_simulation_nb_instruction <= *it);
+            it ++;
+          }
+      }
+    else
+      end_inst = true;
     
-    return end_cycle // and end_inst
-      ;
+    return end_cycle and end_inst;
   }
 
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Stat_alloc_operand.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Stat_alloc_operand.cpp	(revision 101)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Stat_alloc_operand.cpp	(revision 110)
@@ -4,8 +4,11 @@
 namespace morpheo {
 namespace behavioural {
+
+#undef FUNCTION
+#define FUNCTION "Stat::alloc_operand"
   counter_t * Stat::alloc_operand (counter_type_t type, std::string varname, std::string unit, std::string description)
   {
     if (not is_valid_var (varname))
-      throw(ERRORMORPHEO("Stat::alloc_operand",_("Variable is not valid.")));
+      throw(ERRORMORPHEO(FUNCTION,toString(_("<%s> : Variable \"%s\" is not valid."),_name_instance.c_str(),varname.c_str())));
 
     counter_t * counter = new counter_t;
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Stat_create_expr.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Stat_create_expr.cpp	(revision 101)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Stat_create_expr.cpp	(revision 110)
@@ -5,4 +5,6 @@
 namespace behavioural {
 
+#undef  FUNCTION
+#define FUNCTION "Stat::create_expr"
   void Stat::create_expr (std::string varname,
 			  std::string expr,
@@ -10,5 +12,5 @@
   {
     if (is_valid_var (varname))
-      throw(ERRORMORPHEO("Stat::create_expr",_("Variable is not valid.")));
+      throw(ERRORMORPHEO(FUNCTION,toString(_("<%s> Variable \"%s\" is not valid."),_name_instance.c_str(),varname.c_str())));
     
     expr_t expression;
