Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Signal.h
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Signal.h	(revision 137)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Signal.h	(revision 138)
@@ -143,4 +143,5 @@
 	}
     }
+#endif
 
 #undef  FUNCTION
@@ -184,5 +185,31 @@
       log_printf(FUNC,Behavioural,FUNCTION,"End");
     }
-#endif
+
+
+#undef  FUNCTION
+#define FUNCTION "Signal::alloc"
+  void              dealloc         (void)
+    {
+      log_printf(FUNC,Behavioural,FUNCTION,"Begin");
+
+      switch (_direction)
+        {
+        case INTERNAL :
+          switch (_type_info)
+            {
+            case BOOL     : delete (static_cast<sc_signal <bool    > *>(_sc_signal_map)); break; 
+            case UINT8_T  : delete (static_cast<sc_signal <uint8_t > *>(_sc_signal_map)); break; 
+            case UINT16_T : delete (static_cast<sc_signal <uint16_t> *>(_sc_signal_map)); break;
+            case UINT32_T : delete (static_cast<sc_signal <uint32_t> *>(_sc_signal_map)); break; 
+            case UINT64_T : delete (static_cast<sc_signal <uint64_t> *>(_sc_signal_map)); break; 
+            default       : throw (ErrorMorpheo ("Signal \""+_name+"\" : type unknow.\n"));
+            }
+        default : throw (ErrorMorpheo ("Signal \""+_name+"\" : invalid direction.\n"));
+
+
+        }
+
+      log_printf(FUNC,Behavioural,FUNCTION,"End");
+    }
 
 #ifdef VHDL
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Simulation.h
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Simulation.h	(revision 137)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Simulation.h	(revision 138)
@@ -19,8 +19,16 @@
 namespace behavioural          {
 
+  typedef enum
+    {
+      ALL_THREAD,
+      EACH_THREAD_AND_CONTINUE,
+      EACH_THREAD_AND_STOP
+    } stop_type_t;
+
   extern bool                _simulation_stop_exception;
   extern double              _simulation_nb_cycle;
   extern double              _simulation_nb_instruction;
   extern std::vector<double> _simulation_nb_instruction_commited;
+  extern stop_type_t         _simulation_stop_type;
   extern bool                _simulation_file_with_date;
   extern bool                _simulation_file_with_pid ;
@@ -29,10 +37,40 @@
 
   bool simulation_test_end (void);
-  void simulation_init     (double nb_cycle,
-                            double denug_nb_cycle,
-                            double nb_instruction,
-                            bool   file_with_date,
-                            bool   file_with_pid);
+  void simulation_init     (double      nb_cycle,
+                            double      denug_nb_cycle,
+                            double      nb_instruction,
+                            stop_type_t stop_type,
+                            bool        file_with_date,
+                            bool        file_with_pid);
 }; // end namespace behavioural          
+
+  template<> inline std::string toString<morpheo::behavioural::stop_type_t>(const morpheo::behavioural::stop_type_t& x)
+  {
+    switch (x)
+      {
+      case morpheo::behavioural::ALL_THREAD               : return "all_thread"; break;
+      case morpheo::behavioural::EACH_THREAD_AND_CONTINUE : return "each_thread_and_continue"; break;
+      case morpheo::behavioural::EACH_THREAD_AND_STOP     : return "each_thread_and_stop"; break;
+      default : return ""; break;
+      }
+  };
+
+  template<> inline morpheo::behavioural::stop_type_t fromString<morpheo::behavioural::stop_type_t>(const std::string& x)
+  {
+    if ((x.compare(toString(static_cast<uint32_t>(morpheo::behavioural::ALL_THREAD))) == 0) or
+        (x.compare(toString(                      morpheo::behavioural::ALL_THREAD )) == 0))
+      return morpheo::behavioural::ALL_THREAD;
+
+    if ((x.compare(toString(static_cast<uint32_t>(morpheo::behavioural::EACH_THREAD_AND_CONTINUE))) == 0) or
+        (x.compare(toString(                      morpheo::behavioural::EACH_THREAD_AND_CONTINUE )) == 0))
+      return morpheo::behavioural::EACH_THREAD_AND_CONTINUE;
+
+    if ((x.compare(toString(static_cast<uint32_t>(morpheo::behavioural::EACH_THREAD_AND_STOP))) == 0) or
+        (x.compare(toString(                      morpheo::behavioural::EACH_THREAD_AND_STOP )) == 0))
+      return morpheo::behavioural::EACH_THREAD_AND_STOP;
+
+    throw (ERRORMORPHEO ("fromString","Unknow string : \""+x+"\""));
+  };
+
 }; // end namespace morpheo              
 
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Stat.h
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Stat.h	(revision 137)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Stat.h	(revision 138)
@@ -49,14 +49,16 @@
     private: const cycle_t                  _period;
     private: const bool                     _save_periodic;
+    private: bool                           _generate_file;
+
       // Tableau des variables
     private: std::map<std::string, var_t> * _list_operand;
       // Liste chaîné des expressions
     private: std::list<expr_t>            * _list_expr;
+      // List chaîné des "counters" (seulement pour la désallocation)
+    private: std::list<counters_t*>       * _list_counters;
 
     private: counter_t                    * _cycle;
 
     private: std::list<Stat *>            * _list_stat;
-
-    private: bool                           _generate_file;
 
     public :                     Stat                         (std::string name_instance,
@@ -73,4 +75,10 @@
 						               std::string unit,
 						               std::string description);
+    public  : counters_t *       create_counters              (std::string varname,
+                                                               uint32_t    nb_counter,
+						               std::string unit,
+						               std::string description_counter, // need one %d
+                                                               std::string description_percent, // need one %d
+                                                               std::string description_average);
     private : counter_t *        alloc_operand                (counter_type_t type,
 						               std::string varname,
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Stat_type.h
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Stat_type.h	(revision 137)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Stat_type.h	(revision 138)
@@ -6,4 +6,5 @@
 #include <map>
 #include <utility>
+#include <cassert>
 
 namespace morpheo {
@@ -19,4 +20,62 @@
 //typedef std::pair<std::string, operator_t> pair_string_operator_t;
 
+  class counters_t
+  {
+  private : const uint32_t     _nb_counter;
+  private :       counter_t ** _counter;
+
+  public  : counters_t (uint32_t nb_counter):
+    _nb_counter (nb_counter+1)
+    {
+      assert(nb_counter>0);
+
+      _counter = new counter_t * [_nb_counter];
+    }
+
+  // public : counters_t (const counters_t & x):
+  //   _nb_counter (x._nb_counter)
+  //   {
+  //     _counter = new counter_t [_nb_counter];
+      
+  //     for (uint32_t i=0; i<_nb_counter; ++i)
+  //       _counter[i] = x._counter[i];
+  //   }
+    
+  public  : ~counters_t (void)
+    {
+      delete [] _counter;
+    }
+
+  public  : void set_counter (counter_t * counter,
+                              uint32_t    index)
+    {
+      assert((index >= 0) and (index < _nb_counter));
+
+      _counter [index] = counter;
+    }
+
+  // public : friend const counters_t  operator+ (const counters_t & left,
+  //                                              const uint32_t     right)
+  //   {
+  //     assert((right >= 0) and (right <= left._nb_counter));
+      
+  //     counters_t tmp=left;
+      
+  //     tmp._counter[right] ++;
+    
+  //     return tmp;
+  //   }
+
+  public : const counters_t & operator+= (const uint32_t value)
+    {
+      assert((value >= 0) and (value <= _nb_counter));
+      
+      (*_counter[value]) ++;
+      
+      return *this;
+    }
+
+  };
+
 };
 };
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Types.h
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Types.h	(revision 137)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Types.h	(revision 138)
@@ -172,10 +172,12 @@
   template<> inline morpheo::behavioural::Tpriority_t fromString<morpheo::behavioural::Tpriority_t>(const std::string& x)
   {
-    if ( (x.compare(toString(static_cast<uint32_t>(morpheo::behavioural::PRIORITY_STATIC))) == 0) or
-         (x.compare("priority_static")      == 0))
+    if ((x.compare(toString(static_cast<uint32_t>(morpheo::behavioural::PRIORITY_STATIC))) == 0) or
+        (x.compare(toString(                      morpheo::behavioural::PRIORITY_STATIC )) == 0))
       return morpheo::behavioural::PRIORITY_STATIC;
-    if ( (x.compare(toString(static_cast<uint32_t>(morpheo::behavioural::PRIORITY_ROUND_ROBIN))) == 0) or
-         (x.compare("priority_round_robin") == 0))
+
+    if ((x.compare(toString(static_cast<uint32_t>(morpheo::behavioural::PRIORITY_ROUND_ROBIN))) == 0) or
+        (x.compare(toString(                      morpheo::behavioural::PRIORITY_ROUND_ROBIN )) == 0))
       return morpheo::behavioural::PRIORITY_ROUND_ROBIN;
+
     throw (ERRORMORPHEO ("fromString","Unknow string : \""+x+"\""));
   };
@@ -193,10 +195,12 @@
   template<> inline morpheo::behavioural::Tload_balancing_t fromString<morpheo::behavioural::Tload_balancing_t>(const std::string& x)
   {
-    if ( (x.compare(toString(static_cast<uint32_t>(morpheo::behavioural::LOAD_BALANCING_BALANCE))) == 0) or
-         (x.compare("load_balancing_balance") == 0))
+    if ((x.compare(toString(static_cast<uint32_t>(morpheo::behavioural::LOAD_BALANCING_BALANCE))) == 0) or
+        (x.compare(toString(                      morpheo::behavioural::LOAD_BALANCING_BALANCE )) == 0))
       return morpheo::behavioural::LOAD_BALANCING_BALANCE;
-    if ( (x.compare(toString(static_cast<uint32_t>(morpheo::behavioural::LOAD_BALANCING_MAXIMUM_FOR_PRIORITY))) == 0) or
-         (x.compare("load_balancing_maximum_for_priority") == 0))
+
+    if ((x.compare(toString(static_cast<uint32_t>(morpheo::behavioural::LOAD_BALANCING_MAXIMUM_FOR_PRIORITY))) == 0) or
+        (x.compare(toString(                      morpheo::behavioural::LOAD_BALANCING_MAXIMUM_FOR_PRIORITY )) == 0))
       return morpheo::behavioural::LOAD_BALANCING_MAXIMUM_FOR_PRIORITY;
+
     throw (ERRORMORPHEO ("fromString","Unknow string : \""+x+"\""));
   };
@@ -218,22 +222,28 @@
   template<> inline morpheo::behavioural::Tvictim_t fromString<morpheo::behavioural::Tvictim_t>(const std::string& x)
   {
-    if ( (x.compare(toString(static_cast<uint32_t>(morpheo::behavioural::VICTIM_RANDOM     ))) == 0) or
-         (x.compare("victim_random")      == 0))
+    if ((x.compare(toString(static_cast<uint32_t>(morpheo::behavioural::VICTIM_RANDOM     ))) == 0) or
+        (x.compare(toString(                      morpheo::behavioural::VICTIM_RANDOM      )) == 0))
       return morpheo::behavioural::VICTIM_RANDOM;
-    if ( (x.compare(toString(static_cast<uint32_t>(morpheo::behavioural::VICTIM_ROUND_ROBIN))) == 0) or
-         (x.compare("victim_round_robin") == 0))
+
+    if ((x.compare(toString(static_cast<uint32_t>(morpheo::behavioural::VICTIM_ROUND_ROBIN))) == 0) or
+        (x.compare(toString(                      morpheo::behavioural::VICTIM_ROUND_ROBIN )) == 0))
       return morpheo::behavioural::VICTIM_ROUND_ROBIN;
-    if ( (x.compare(toString(static_cast<uint32_t>(morpheo::behavioural::VICTIM_NLU        ))) == 0) or
-         (x.compare("victim_nlu")         == 0))
+
+    if ((x.compare(toString(static_cast<uint32_t>(morpheo::behavioural::VICTIM_NLU        ))) == 0) or
+        (x.compare(toString(                      morpheo::behavioural::VICTIM_NLU         )) == 0))
       return morpheo::behavioural::VICTIM_NLU;
-    if ( (x.compare(toString(static_cast<uint32_t>(morpheo::behavioural::VICTIM_PSEUDO_LRU ))) == 0) or
-         (x.compare("victim_pseudo_lru")  == 0))
+
+    if ((x.compare(toString(static_cast<uint32_t>(morpheo::behavioural::VICTIM_PSEUDO_LRU ))) == 0) or
+        (x.compare(toString(                      morpheo::behavioural::VICTIM_PSEUDO_LRU  )) == 0))
       return morpheo::behavioural::VICTIM_PSEUDO_LRU;
-    if ( (x.compare(toString(static_cast<uint32_t>(morpheo::behavioural::VICTIM_LRU        ))) == 0) or
-         (x.compare("victim_lru")         == 0))
+
+    if ((x.compare(toString(static_cast<uint32_t>(morpheo::behavioural::VICTIM_LRU        ))) == 0) or
+        (x.compare(toString(                      morpheo::behavioural::VICTIM_LRU         )) == 0))
       return morpheo::behavioural::VICTIM_LRU;
-    if ( (x.compare(toString(static_cast<uint32_t>(morpheo::behavioural::VICTIM_FIFO       ))) == 0) or
-         (x.compare("victim_fifo")        == 0))
+
+    if ((x.compare(toString(static_cast<uint32_t>(morpheo::behavioural::VICTIM_FIFO       ))) == 0) or
+        (x.compare(toString(                      morpheo::behavioural::VICTIM_FIFO        )) == 0))
       return morpheo::behavioural::VICTIM_FIFO;
+
     throw (ERRORMORPHEO ("fromString","Unknow string : \""+x+"\""));
   };
@@ -258,31 +268,40 @@
   template<> inline morpheo::behavioural::Tpredictor_t fromString<morpheo::behavioural::Tpredictor_t>(const std::string& x)
   {
-    if ( (x.compare(toString(static_cast<uint32_t>(morpheo::behavioural::PREDICTOR_NEVER_TAKE ))) == 0) or
-         (x.compare("predictor_never_take")  == 0))
+    if ((x.compare(toString(static_cast<uint32_t>(morpheo::behavioural::PREDICTOR_NEVER_TAKE ))) == 0) or
+        (x.compare(toString(                      morpheo::behavioural::PREDICTOR_NEVER_TAKE  )) == 0))
       return morpheo::behavioural::PREDICTOR_NEVER_TAKE;
-    if ( (x.compare(toString(static_cast<uint32_t>(morpheo::behavioural::PREDICTOR_ALWAYS_TAKE))) == 0) or
-         (x.compare("predictor_always_take") == 0))
+
+    if ((x.compare(toString(static_cast<uint32_t>(morpheo::behavioural::PREDICTOR_ALWAYS_TAKE))) == 0) or
+        (x.compare(toString(                      morpheo::behavioural::PREDICTOR_ALWAYS_TAKE )) == 0))
       return morpheo::behavioural::PREDICTOR_ALWAYS_TAKE;
-    if ( (x.compare(toString(static_cast<uint32_t>(morpheo::behavioural::PREDICTOR_STATIC     ))) == 0) or
-         (x.compare("predictor_static")      == 0))
+
+    if ((x.compare(toString(static_cast<uint32_t>(morpheo::behavioural::PREDICTOR_STATIC     ))) == 0) or
+        (x.compare(toString(                      morpheo::behavioural::PREDICTOR_STATIC      )) == 0))
       return morpheo::behavioural::PREDICTOR_STATIC;
-    if ( (x.compare(toString(static_cast<uint32_t>(morpheo::behavioural::PREDICTOR_LAST_TAKE  ))) == 0) or
-         (x.compare("predictor_last_take")   == 0))
+
+    if ((x.compare(toString(static_cast<uint32_t>(morpheo::behavioural::PREDICTOR_LAST_TAKE  ))) == 0) or
+        (x.compare(toString(                      morpheo::behavioural::PREDICTOR_LAST_TAKE   )) == 0))
       return morpheo::behavioural::PREDICTOR_LAST_TAKE;
-    if ( (x.compare(toString(static_cast<uint32_t>(morpheo::behavioural::PREDICTOR_COUNTER    ))) == 0) or
-         (x.compare("predictor_counter")     == 0))
+
+    if ((x.compare(toString(static_cast<uint32_t>(morpheo::behavioural::PREDICTOR_COUNTER    ))) == 0) or
+        (x.compare(toString(                      morpheo::behavioural::PREDICTOR_COUNTER     )) == 0))
       return morpheo::behavioural::PREDICTOR_COUNTER;
-    if ( (x.compare(toString(static_cast<uint32_t>(morpheo::behavioural::PREDICTOR_LOCAL      ))) == 0) or
-         (x.compare("predictor_local")       == 0))
+
+    if ((x.compare(toString(static_cast<uint32_t>(morpheo::behavioural::PREDICTOR_LOCAL      ))) == 0) or
+        (x.compare(toString(                      morpheo::behavioural::PREDICTOR_LOCAL       )) == 0))
       return morpheo::behavioural::PREDICTOR_LOCAL;
-    if ( (x.compare(toString(static_cast<uint32_t>(morpheo::behavioural::PREDICTOR_GLOBAL     ))) == 0) or
-         (x.compare("predictor_global")      == 0))
+
+    if ((x.compare(toString(static_cast<uint32_t>(morpheo::behavioural::PREDICTOR_GLOBAL     ))) == 0) or
+        (x.compare(toString(                      morpheo::behavioural::PREDICTOR_GLOBAL      )) == 0))
       return morpheo::behavioural::PREDICTOR_GLOBAL;
-    if ( (x.compare(toString(static_cast<uint32_t>(morpheo::behavioural::PREDICTOR_META       ))) == 0) or
-         (x.compare("predictor_meta")        == 0))
+
+    if ((x.compare(toString(static_cast<uint32_t>(morpheo::behavioural::PREDICTOR_META       ))) == 0) or
+        (x.compare(toString(                      morpheo::behavioural::PREDICTOR_META        )) == 0))
       return morpheo::behavioural::PREDICTOR_META;
-    if ( (x.compare(toString(static_cast<uint32_t>(morpheo::behavioural::PREDICTOR_CUSTOM     ))) == 0) or
-         (x.compare("predictor_custom")      == 0))
+
+    if ((x.compare(toString(static_cast<uint32_t>(morpheo::behavioural::PREDICTOR_CUSTOM     ))) == 0) or
+        (x.compare(toString(                      morpheo::behavioural::PREDICTOR_CUSTOM      )) == 0))
       return morpheo::behavioural::PREDICTOR_CUSTOM;
+
     throw (ERRORMORPHEO ("fromString","Unknow string : \""+x+"\""));
   };
