Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Component_generate_file.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Component_generate_file.cpp	(revision 118)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Component_generate_file.cpp	(revision 124)
@@ -25,5 +25,5 @@
 	XML xml = toXML();
 
-	xml.filename_extension (".pos");
+	xml.filename_extension ("pos");
 	
 	xml.generate_file(MORPHEO_POSITION,"ISO-8859-1");
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Simulation.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Simulation.cpp	(revision 118)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Simulation.cpp	(revision 124)
@@ -14,17 +14,36 @@
 
   static bool          simulation_initialized;
+  bool                _simulation_stop_exception;
   double              _simulation_nb_cycle;
   double              _simulation_nb_instruction;
   std::vector<double> _simulation_nb_instruction_commited;
+  bool                _simulation_file_with_date;
+  bool                _simulation_file_with_pid ;
+
   Model               _model;
 
   void simulation_init (double nb_cycle,
-                        double nb_instruction)
+                        double debug_nb_cycle,
+                        double nb_instruction,
+                        bool   file_with_date,
+                        bool   file_with_pid )
   {
     if (not simulation_initialized)
       {
-        _simulation_nb_cycle                = nb_cycle;
+        if (debug_nb_cycle == 0)
+          {
+            _simulation_nb_cycle                = nb_cycle;
+            _simulation_stop_exception          = false;
+          }
+        else
+          {
+            _simulation_nb_cycle                = (debug_nb_cycle<nb_cycle)?debug_nb_cycle:nb_cycle;
+            _simulation_stop_exception          = (debug_nb_cycle<nb_cycle);
+          }
+
         _simulation_nb_instruction          = nb_instruction;
 //      _simulation_nb_instruction_commited = new std::vector<double>;
+        _simulation_file_with_date          = file_with_date;
+        _simulation_file_with_pid           = file_with_pid ;
 
         simulation_initialized = true;
@@ -34,9 +53,24 @@
         msg_printf(WARNING,_("Multi instance of Morpheo : stop condition, take the highest."));
 
-        if (_simulation_nb_cycle < nb_cycle)
-          _simulation_nb_cycle = nb_cycle;
+        if (//(_simulation_nb_cycle == 0) or
+            (_simulation_nb_cycle < debug_nb_cycle))
+          {
+            _simulation_nb_cycle       = debug_nb_cycle;
+            _simulation_stop_exception = true;
+          }
 
-        if (_simulation_nb_instruction < nb_instruction)
+        if (//(_simulation_nb_cycle == 0) or
+            (_simulation_nb_cycle < nb_cycle))
+          {
+            _simulation_nb_cycle       = nb_cycle;
+            _simulation_stop_exception = false;
+          }
+        
+        if (//(_simulation_nb_instruction == 0) or
+            (_simulation_nb_instruction < nb_instruction))
           _simulation_nb_instruction = nb_instruction;
+
+        _simulation_file_with_date          |= file_with_date;
+        _simulation_file_with_pid           |= file_with_pid ;
       }
   }
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Simulation_test_end.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Simulation_test_end.cpp	(revision 118)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Simulation_test_end.cpp	(revision 124)
@@ -9,4 +9,5 @@
 #include "Behavioural/include/Simulation.h"
 #include "Common/include/Systemc.h"
+#include "Common/include/ErrorMorpheo.h"
 
 namespace morpheo              {
@@ -47,5 +48,11 @@
       end_inst = true;
     
-    return end_cycle and end_inst;
+    if (end_cycle and _simulation_stop_exception)
+      {
+        throw ErrorMorpheo(_("Maximal cycles Reached"));
+        return false;
+      }
+    else
+      return end_cycle and end_inst;
   }
 
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Stat.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Stat.cpp	(revision 118)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Stat.cpp	(revision 124)
@@ -19,4 +19,5 @@
 
     _cycle         = create_variable("cycle");
+//  _cycle         = create_counter("cycle","","");
     *_cycle        = 0; // for the first period
 
@@ -39,4 +40,5 @@
 
     _cycle         = create_variable("cycle");
+//  _cycle         = create_counter("cycle","","");
     *_cycle        = 0; // for the first period
 
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Stat_end_cycle.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Stat_end_cycle.cpp	(revision 118)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Stat_end_cycle.cpp	(revision 124)
@@ -17,4 +17,10 @@
 	test_and_save(false);
       }
+    else
+      if ((_cycle_sum+1) == _nb_cycle_before_begin)
+        {
+          // Init counter
+          reset (false);
+        }
   }
 };  
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Stat_generate_file.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Stat_generate_file.cpp	(revision 118)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Stat_generate_file.cpp	(revision 124)
@@ -30,5 +30,5 @@
     xml->balise_close();
 
-    xml->filename_extension (".stat");
+    xml->filename_extension ("stat");
     xml->generate_file(MORPHEO_STATISTICS);
 
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Stat_reset.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Stat_reset.cpp	(revision 124)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Stat_reset.cpp	(revision 124)
@@ -0,0 +1,20 @@
+#ifdef STATISTICS
+#include "Behavioural/include/Stat.h"
+
+namespace morpheo {
+namespace behavioural {  
+  void Stat::reset (bool save)
+  {
+    for (std::map<std::string, var_t>::iterator i=_list_operand->begin();
+         i!= _list_operand->end();
+         ++i)
+      {
+        if (save)
+          i->second.save_counter.push_back(*(i->second.counter));
+
+        *(i->second.counter) = 0;
+      }
+  }
+};  
+};
+#endif
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Stat_test_and_save.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Stat_test_and_save.cpp	(revision 118)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Stat_test_and_save.cpp	(revision 124)
@@ -9,13 +9,6 @@
       {
 	eval_exprs(false); // evalue les expression non periodique au cycle
-	
-	for (std::map<std::string, var_t>::iterator i=_list_operand->begin();
-	     i!= _list_operand->end();
-	     ++i)
-	  {
-	    // save and reset !
-	    i->second.save_counter.push_back(*(i->second.counter));
-	    *(i->second.counter) = 0;
-	  }
+
+        reset (true);
       }
   }
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/src/XML.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/src/XML.cpp	(revision 118)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/src/XML.cpp	(revision 124)
@@ -17,5 +17,5 @@
   {
     log_printf(FUNC,Behavioural,FUNCTION,"Begin");
-    _filename_extension=".xml";
+    _filename_extension="xml";
     log_printf(FUNC,Behavioural,FUNCTION,"End");
   };
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/src/XML_generate_file.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/src/XML_generate_file.cpp	(revision 118)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/src/XML_generate_file.cpp	(revision 124)
@@ -8,4 +8,5 @@
 #include "Behavioural/include/XML.h"
 #include "Common/include/ErrorMorpheo.h"
+#include "Common/include/Filename.h"
 #include <fstream>
 
@@ -21,5 +22,11 @@
     header (encoding);
 
-    std::string filename = dirname + "/" + _name + _filename_extension;
+    std::string filename = morpheo::filename(dirname,
+                                             _name,
+                                             "",
+                                             _filename_extension,
+                                             _simulation_file_with_date,
+                                             _simulation_file_with_pid ,
+                                             true);
 
     msg_printf(INFORMATION,_("Generate file \"%s\"."),filename.c_str());
