Index: trunk/IPs/systemC/processor/Morpheo/Common/include/BitManipulation.h
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Common/include/BitManipulation.h	(revision 67)
+++ trunk/IPs/systemC/processor/Morpheo/Common/include/BitManipulation.h	(revision 71)
@@ -11,9 +11,10 @@
 #include <stdint.h>
 #include <iostream>
-using namespace std;
 
 namespace morpheo              {
 
+  //............................................................................
   // gen_mask ..................................................................
+  //............................................................................
   
   template <typename T>
@@ -29,20 +30,36 @@
   };
 
+  template <typename T>
+  T gen_mask       (uint32_t index_max, uint32_t index_min) 
+  { 
+    return  (gen_mask<T>(index_max-index_min+1)<<index_min);
+  };
+
+  template <typename T>
+  T gen_mask_not   (uint32_t index_max, uint32_t index_min) 
+  { 
+    return ~(gen_mask<T>(index_max-index_min+1)<<index_min);
+  };
+
+  //............................................................................
   // mask, mask_not ............................................................
-  template <typename T>
-  T mask           (uint32_t data, uint32_t index_max, uint32_t index_min)  
-  {
-    return     (gen_mask<T>(index_max-index_min+1)<<index_min) & data;
-  }
-
-  template <typename T>
-  T mask_not       (uint32_t data, uint32_t index_max, uint32_t index_min)  
-  {
-    return (~(gen_mask<T>(index_max-index_min+1)<<index_min)) & data;
-  }
-
+  //............................................................................
+  template <typename T>
+  T mask           (T data, uint32_t index_max, uint32_t index_min)  
+  {
+    return gen_mask    <T>(index_max,index_min) & data;
+  }
+
+  template <typename T>
+  T mask_not       (T data, uint32_t index_max, uint32_t index_min)  
+  {
+    return gen_mask_not<T>(index_max,index_min) & data;
+  }
+
+  //............................................................................
   // shift_left_logic, shift_right_logic .......................................
-  template <typename T>
-  T shift_logic_left (uint32_t size, uint32_t data, uint32_t value)  
+  //............................................................................
+  template <typename T>
+  T shift_logic_left (uint32_t size, T data, T value)  
   {
     T mask = gen_mask<T> (size);
@@ -52,5 +69,5 @@
 
   template <typename T>
-  T shift_logic_right (uint32_t size, uint32_t data, uint32_t value)  
+  T shift_logic_right (uint32_t size, T data, T value)  
   {
     T mask = gen_mask<T> (size);
@@ -59,7 +76,9 @@
   }
 
+  //............................................................................
   // shift_logic ...............................................................
-  template <typename T>
-  T shift_logic      (uint32_t size, uint32_t data, uint32_t value, bool is_direction_left)
+  //............................................................................
+  template <typename T>
+  T shift_logic      (uint32_t size, T data, T value, bool is_direction_left)
   {
     if (is_direction_left == true)
@@ -69,7 +88,9 @@
   }
 
+  //............................................................................
   // shift_left_arithmetic, shift_right_arithmetic .............................
-  template <typename T>
-  T shift_arithmetic_left (uint32_t size, uint32_t data, uint32_t value)  
+  //............................................................................
+  template <typename T>
+  T shift_arithmetic_left (uint32_t size, T data, T value)  
   {
     bool carry = (data&1) != 0;
@@ -89,5 +110,5 @@
 
   template <typename T>
-  T shift_arithmetic_right (uint32_t size, uint32_t data, uint32_t value)  
+  T shift_arithmetic_right (uint32_t size, T data, T value)  
   {
     bool carry = (data&(1<<(size-1))) != 0;
@@ -105,7 +126,9 @@
   }
 
+  //............................................................................
   // shift_arithmetic ..........................................................
-  template <typename T>
-  T shift_arithmetic      (uint32_t size, uint32_t data, uint32_t value, bool is_direction_left)
+  //............................................................................
+  template <typename T>
+  T shift_arithmetic      (uint32_t size, T data, T value, bool is_direction_left)
   {
     if (is_direction_left == true)
@@ -115,7 +138,9 @@
   }
 
+  //............................................................................
   // shift .....................................................................
-  template <typename T>
-  T shift            (uint32_t size, uint32_t data, uint32_t value, bool is_direction_left, bool is_shift_arithmetic)
+  //............................................................................
+  template <typename T>
+  T shift            (uint32_t size, T data, T value, bool is_direction_left, bool is_shift_arithmetic)
   {
     if (is_shift_arithmetic == true)
@@ -125,8 +150,9 @@
   }
 
+  //............................................................................
   // rotate_left, rotate_right .................................................
-
-  template <typename T>
-  T rotate_left    (uint32_t size, uint32_t data, uint32_t value)  
+  //............................................................................
+  template <typename T>
+  T rotate_left    (uint32_t size, T data, T value)  
   {
     T mask        = gen_mask<T> (size);
@@ -137,5 +163,5 @@
 
   template <typename T>
-  T rotate_right    (uint32_t size, uint32_t data, uint32_t value)  
+  T rotate_right    (uint32_t size, T data, T value)  
   {
     T mask        = gen_mask<T> (size);
@@ -145,7 +171,9 @@
   }
 
+  //............................................................................
   // rotate ....................................................................
-  template <typename T>
-  T rotate         (uint32_t size, uint32_t data, uint32_t value, bool is_direction_left)  
+  //............................................................................
+  template <typename T>
+  T rotate         (uint32_t size, T data, T value, bool is_direction_left)  
   {
     if (is_direction_left == true)
@@ -155,7 +183,9 @@
   }
 
+  //............................................................................
   // range .....................................................................
-  template <typename T>
-  T range          (uint32_t data, uint32_t index_max, uint32_t index_min)  
+  //............................................................................
+  template <typename T>
+  T range          (T data, uint32_t index_max, uint32_t index_min)  
   {
     return gen_mask<T>(index_max-index_min+1) & (data << index_min);
@@ -163,8 +193,56 @@
 
   template <typename T>
-  T range          (uint32_t data, uint32_t nb_bits)  
+  T range          (T data, uint32_t nb_bits)  
   {
     return gen_mask<T>(nb_bits) & data;
   }
+
+  //............................................................................
+  // insert ....................................................................
+  //............................................................................
+  template <typename T>
+  T insert         (T data_old, T data_new, uint32_t index_max, uint32_t index_min)  
+  {
+    return (mask<T>(data_new,index_max,index_min) | mask_not<T>(data_old,index_max,index_min));
+  }
+
+  //............................................................................
+  // extend ....................................................................
+  //............................................................................
+  template <typename T>
+  T extend         (uint32_t size, T data, bool extend_with_sign, uint32_t nb_bits_keep)
+  {
+    if (size < nb_bits_keep)
+      return data;
+
+    if (extend_with_sign and ((data>>(nb_bits_keep-1))&1))
+      return data | (mask<T>(gen_mask<T>(size),size-1, nb_bits_keep));
+    else
+      return data & (mask<T>(gen_mask<T>(size),nb_bits_keep-1, 0));
+  }
+
+  //............................................................................
+  // duplicate..................................................................
+  //............................................................................
+
+  template <typename T>
+  T duplicate (uint32_t size, T data_src, uint32_t nb_bits, uint32_t index_min)
+  {
+    T data_duplicate = mask<T>((data_src)>>index_min, nb_bits-1, 0);
+    T data_dest      = 0;
+    
+    for (uint32_t i=0; i < size; i+=nb_bits)
+      data_dest |= (data_duplicate<<i);
+    
+    return data_dest;
+  }
+
+  template <typename T>
+  T duplicate (uint32_t size, T data_src, uint32_t nb_bits)
+  {
+    return duplicate<T> (size,data_src,nb_bits,0);
+  }
+
+
 }; // end namespace morpheo              
 
Index: trunk/IPs/systemC/processor/Morpheo/Common/include/ChangeCase.h
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Common/include/ChangeCase.h	(revision 67)
+++ trunk/IPs/systemC/processor/Morpheo/Common/include/ChangeCase.h	(revision 71)
@@ -12,9 +12,7 @@
 #include <stdint.h>
 
-using namespace std;
-
 namespace morpheo              {
   
-  inline void UpperCase(string& S)
+  inline void UpperCase(std::string& S)
   {
     uint32_t n = S.size();
@@ -27,5 +25,5 @@
   }
   
-  inline void LowerCase(string& S)
+  inline void LowerCase(std::string& S)
   {
     uint32_t n = S.size();
Index: trunk/IPs/systemC/processor/Morpheo/Common/include/Debug.h
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Common/include/Debug.h	(revision 67)
+++ trunk/IPs/systemC/processor/Morpheo/Common/include/Debug.h	(revision 71)
@@ -2,4 +2,5 @@
 #define DEBUG_H
 
+#include "Common/include/Message.h"
 #include "Behavioural/include/Debug_component.h"
 #include <stdio.h>
@@ -8,5 +9,4 @@
 #include <sstream>
 #include <string>
-using namespace std;
 
 // Debug's Level :
@@ -29,35 +29,35 @@
 //Debug
 #  define log_printf(level, component, func, str... )                   \
-do                                                                      \
-{                                                                       \
-    if ( (DEBUG == DEBUG_ALL ) or                                       \
-         (DEBUG_ ## level == DEBUG_NONE) or                             \
-         (( DEBUG_ ## level     <= DEBUG) and                           \
-          ( DEBUG_ ## component == true )) )                            \
-      {                                                                 \
-        if (DEBUG >= DEBUG_ALL )                                        \
-          {                                                             \
-            switch (DEBUG_ ## level)                                    \
-            {                                                           \
-	    case DEBUG_NONE  : fprintf(stdout,"(none       ) "); break; \
-	    case DEBUG_INFO  : fprintf(stdout,"(information) "); break; \
-	    case DEBUG_TRACE : fprintf(stdout,"(trace      ) "); break; \
-	    case DEBUG_FUNC  : fprintf(stdout,"(function   ) "); break; \
-	    case DEBUG_ALL   : fprintf(stdout,"(all        ) "); break; \
-	    default          : fprintf(stdout,"(undefine   ) "); break; \
-	    }                                                           \
-          }                                                             \
-        fprintf(stdout,"<%s> ",func);                                   \
-        if (DEBUG >= DEBUG_FUNC)                                        \
-        {                                                               \
-          fprintf(stdout,"In file %s, ",__FILE__);                      \
-          fprintf(stdout,"at line %d, ",__LINE__);                      \
-        }                                                               \
-        fprintf(stdout,": ");                                           \
-        fprintf(stdout,str);                                            \
-        fprintf(stdout,"\n");                                           \
-        fflush (stdout);                                                \
-      }                                                                 \
-} while(0)
+  do									\
+    {									\
+      if ((DEBUG == DEBUG_ALL ) or					\
+	  (DEBUG_ ## level == DEBUG_NONE) or				\
+	  (( DEBUG_ ## level     <= DEBUG) and				\
+	   ( DEBUG_ ## component == true )) )				\
+	{								\
+	  if (DEBUG >= DEBUG_ALL )					\
+	    {								\
+	      switch (DEBUG_ ## level)					\
+		{							\
+		case DEBUG_NONE  : msg(_("(none       ) ")); break;	\
+		case DEBUG_INFO  : msg(_("(information) ")); break;	\
+		case DEBUG_TRACE : msg(_("(trace      ) ")); break;	\
+		case DEBUG_FUNC  : msg(_("(function   ) ")); break;	\
+		case DEBUG_ALL   : msg(_("(all        ) ")); break;	\
+		default          : msg(_("(undefine   ) ")); break;	\
+		}							\
+	    }								\
+	  msg(_("<%s> "),func);						\
+	  if (DEBUG >= DEBUG_FUNC)					\
+	    {								\
+	      msg(_("In file %s, "),__FILE__);				\
+	      msg(_("at line %d, "),__LINE__);				\
+	    }								\
+	  msg(_(": "));							\
+	  msg(str);							\
+	  msg(_("\n"));							\
+	  fflush (stdout);						\
+	}								\
+    } while(0)
 
 #else
Index: trunk/IPs/systemC/processor/Morpheo/Common/include/ErrorMorpheo.h
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Common/include/ErrorMorpheo.h	(revision 67)
+++ trunk/IPs/systemC/processor/Morpheo/Common/include/ErrorMorpheo.h	(revision 71)
@@ -5,23 +5,31 @@
  * $Id$
  *
- * [ Description ]
+ * [ Description ]
  * 
  */
 
+#include "ToString.h"
 #include <iostream>
 #include <exception>
 
-using namespace std;
-
 namespace morpheo              {
 
-  class ErrorMorpheo : public exception 
+#define ERRORMORPHEO(funcname,msg) ErrorMorpheo(funcname,msg,__LINE__,__FILE__)
+
+  class ErrorMorpheo : public std::exception 
   {
     // -----[ fields ]----------------------------------------------------
-  private : string _msg;
+  private : std::string _msg;
     
     // -----[ methods ]---------------------------------------------------
-  public  :             ErrorMorpheo  ()           throw() { _msg = "Exception detected ...";}
-  public  :             ErrorMorpheo  (string msg) throw() { _msg = msg;}
+  public  :             ErrorMorpheo  ()                throw() {_msg="Exception detected ...";}
+  public  :             ErrorMorpheo  (std::string msg) throw() {_msg=msg;}
+  public  :             ErrorMorpheo  (std::string funcname,
+				       std::string msg     ,
+				       int         line    ,
+				       std::string file    ) throw() 
+    { 
+      _msg = "<"+funcname+"> at line " + toString(line) + ", in file " + file + " : "+msg;
+    }
   public  :             ~ErrorMorpheo (void)       throw() {}
   public  : const char* what          ()    const  throw() { return ( _msg.c_str() );}
@@ -29,14 +37,14 @@
   };
 
-  class TestMorpheo : public exception 
+  class TestMorpheo : public std::exception 
   {
     // -----[ fields ]----------------------------------------------------
-  private : string _msg;
+  private : std::string _msg;
     
     // -----[ methods ]---------------------------------------------------
-  public  :             TestMorpheo   ()           throw() { _msg = "Test error ...";}
-  public  :             TestMorpheo   (string msg) throw() { _msg = msg;}
-  public  :             ~TestMorpheo  (void)       throw() {}
-  public  : const char* what          ()    const  throw() { return ( _msg.c_str() );}
+  public  :             TestMorpheo   ()                throw() {_msg="Test error ...";}
+  public  :             TestMorpheo   (std::string msg) throw() {_msg=msg;}
+  public  :             ~TestMorpheo  (void)            throw() {}
+  public  : const char* what          ()    const       throw() { return ( _msg.c_str() );}
   };
 
Index: trunk/IPs/systemC/processor/Morpheo/Common/include/Log2.h
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Common/include/Log2.h	(revision 67)
+++ trunk/IPs/systemC/processor/Morpheo/Common/include/Log2.h	(revision 71)
@@ -11,5 +11,4 @@
 #include <stdint.h>
 #include <math.h>
-using namespace std;
 
 namespace morpheo              {
Index: trunk/IPs/systemC/processor/Morpheo/Common/include/Message.h
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Common/include/Message.h	(revision 67)
+++ trunk/IPs/systemC/processor/Morpheo/Common/include/Message.h	(revision 71)
@@ -1,13 +1,27 @@
+#ifndef MESSAGE_H
+#define MESSAGE_H
 /*
  * $Id$
  *
- * [ Description ]
+ * [ Description ]
  * 
  * Routine of Test
  */
 
-namespace morpheo    {
+#include <stdio.h>
+#include <string.h>
+#include <libintl.h>
 
-#define cerr_msg   cerr << "<" << __FILE__ << "> line " << __LINE__ << " : "
-  
+namespace morpheo {
+
+#ifdef NO_TRANSLATION
+# define _(String) (String)
+#else
+# define _(String) gettext (String)
+#endif
+
+#define msg(arg...) fprintf(stdout,arg);
+#define err(arg...) fprintf(stderr,arg);
+
 }; // end namespace morpheo
+#endif
Index: trunk/IPs/systemC/processor/Morpheo/Common/include/Test.h
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Common/include/Test.h	(revision 67)
+++ trunk/IPs/systemC/processor/Morpheo/Common/include/Test.h	(revision 71)
@@ -5,6 +5,7 @@
 #include <sstream>
 #include <stdint.h>
+#include "Common/include/Message.h"
 #include "Common/include/ErrorMorpheo.h"
-using namespace std;
+#include "Common/include/ToString.h"
 
 //-----[ Routine de test ]---------------------------------------
@@ -12,12 +13,12 @@
 static uint32_t num_test;
 
-void test_ko_error (void)
+inline void test_ko_error (void)
 {
-  string msg = "Test ko : error in test \""+toString(num_test)+"\"";
-  throw (ErrorMorpheo (msg));
+  string msg = "Test ko : error in test \""+morpheo::toString(num_test)+"\"";
+  throw (morpheo::ErrorMorpheo (msg));
 }
   
 template <class T>
-void test_ko (char * file, uint32_t line, T exp1, T exp2)
+inline void test_ko (char * file, uint32_t line, T exp1, T exp2)
 {
   cerr << "[" << num_test << "] : Test KO"
@@ -27,11 +28,11 @@
        << "   - Line : " << line                      << endl
        << " * Expression is different"                << endl
-       << "   - exp1 : "+toString(exp1)               << endl
-       << "   - exp2 : "+toString(exp2)               << endl;
+       << "   - exp1 : "+morpheo::toString(exp1)               << endl
+       << "   - exp2 : "+morpheo::toString(exp2)               << endl;
 
   test_ko_error ();
 };
 
-void test_ko (char * file, uint32_t line)
+inline void test_ko (char * file, uint32_t line)
 {
   cerr << "[" << num_test << "] : Test KO"
@@ -44,19 +45,15 @@
 };
 
-void test_ok ()
+inline void test_ok ()
 {
-  cout << "[" << num_test << "] : Test OK"            << endl;
+  msg (_("[%d] : Test OK\n"), num_test);
 
   num_test ++;
 };
 
-void test_ok (char * file, uint32_t line)
+inline void test_ok (char * file, uint32_t line)
 {
-  cout << "[" << num_test << "] : Test OK"
-       << "\tline " << line                           << endl
-//     << " * Localisation"                           << endl
-//     << "   - File : " << file                      << endl
-//     << "   - Line : " << line                      << endl
-    ;
+  msg (_("[%d] : Test OK\n"), num_test);
+  msg (_("\tline %d\n"), line);
 
   num_test ++;
@@ -64,15 +61,9 @@
 
 template <class T>
-void test_ok (char * file, uint32_t line, T exp)
+inline void test_ok (char * file, uint32_t line, T exp)
 {
-  cout << "[" << num_test << "] : Test OK"
-       << "\tline " << line                           
-       << "\tvalue : " << toString(exp)               << endl
-//     << " * Localisation"                           << endl
-//     << "   - File : " << file                      << endl
-//     << "   - Line : " << line                      << endl
-//     << " * Expression"                             << endl
-//     << "   - exp  : "+toString(exp)                << endl
-    ;
+  msg (_("[%d] : Test OK\n"), num_test);
+  msg (_("\tline %d\n"), line);
+  msg (_("\tvalue %s\n"), (morpheo::toString(exp)).c_str());
 
   num_test ++;
@@ -80,5 +71,5 @@
 
 template <class T>
-void test(char * file, uint32_t line, T exp1, T exp2)
+inline void test(char * file, uint32_t line, T exp1, T exp2)
 {
   if (exp1 != exp2)
Index: trunk/IPs/systemC/processor/Morpheo/Common/include/Time.h
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Common/include/Time.h	(revision 71)
+++ trunk/IPs/systemC/processor/Morpheo/Common/include/Time.h	(revision 71)
@@ -0,0 +1,44 @@
+#ifndef TIME_H
+#define TIME_H
+
+#ifdef SYSTEMC
+#include "systemc.h"
+#endif
+
+#include <string>
+#include <iostream>
+#include <sys/time.h>
+
+class Time 
+{
+private : timeval time_begin;
+// private : timeval time_end;
+  
+public  : Time ()
+  {
+    gettimeofday(&time_begin     ,NULL);
+  };
+
+public  : ~Time ()
+  {
+    std::cout << *this;
+  };
+
+public  : friend std::ostream& operator<< (std::ostream& output_stream,
+					   const Time & x)
+  {
+    timeval time_end;
+    
+    gettimeofday(&time_end       ,NULL);
+    
+    uint32_t nb_cycles = static_cast<uint32_t>(sc_simulation_time());
+
+    double average = static_cast<double>(nb_cycles) / static_cast<double>(time_end.tv_sec-x.time_begin.tv_sec);
+    
+    output_stream << nb_cycles << "\t(" << average << " cycles / seconds )" << std::endl;
+
+    return output_stream;
+  }
+};
+
+#endif
Index: trunk/IPs/systemC/processor/Morpheo/Common/include/ToString.h
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Common/include/ToString.h	(revision 67)
+++ trunk/IPs/systemC/processor/Morpheo/Common/include/ToString.h	(revision 71)
@@ -17,13 +17,9 @@
 #include <limits>
 
-using std::setprecision ; 
-using std::ostringstream ; 
-using std::boolalpha ;
-
 namespace morpheo              {
   
   template<typename T> inline std::string toString             (const T& x)
   {
-    ostringstream out("");
+    std::ostringstream out("");
     out << x;
     return out.str();
@@ -32,5 +28,5 @@
   template<>           inline std::string toString<bool>       (const bool& x)
   {
-    ostringstream out("");
+    std::ostringstream out("");
     //out << boolalpha << x;
     out << x;
@@ -41,6 +37,6 @@
   {
     const int sigdigits = std::numeric_limits<float>::digits10;
-    ostringstream out("");
-    out << setprecision(sigdigits) << x;
+    std::ostringstream out("");
+    out << std::setprecision(sigdigits) << x;
     return out.str();
   }
@@ -49,6 +45,6 @@
   {
     const int sigdigits = std::numeric_limits<double>::digits10;
-    ostringstream out("");
-    out << setprecision(sigdigits) << x;
+    std::ostringstream out("");
+    out << std::setprecision(sigdigits) << x;
     return out.str();
   }
@@ -57,6 +53,6 @@
   {
     const int sigdigits = std::numeric_limits<long double>::digits10;
-    ostringstream out("");
-    out << setprecision(sigdigits) << x;
+    std::ostringstream out("");
+    out << std::setprecision(sigdigits) << x;
     return out.str();
   }
@@ -64,5 +60,5 @@
 //   template<>           inline std::string toString< int8_t>       (const int8_t& x)
 //   {
-//     ostringstream out("");
+//     std::ostringstream out("");
 //     out << x;
 //     return out.str();
@@ -71,5 +67,5 @@
 //   template<>           inline std::string toString<uint8_t>       (const uint8_t& x)
 //   {
-//     ostringstream out("");
+//     std::ostringstream out("");
 //     out << x;
 //     return out.str();
@@ -78,5 +74,5 @@
 //   template<>           inline std::string toString< int16_t>      (const int16_t& x)
 //   {
-//     ostringstream out("");
+//     std::ostringstream out("");
 //     out << x;
 //     return out.str();
@@ -85,5 +81,5 @@
 //   template<>           inline std::string toString<uint16_t>      (const uint16_t& x)
 //   {
-//     ostringstream out("");
+//     std::ostringstream out("");
 //     out << x;
 //     return out.str();
@@ -92,5 +88,5 @@
 //   template<>           inline std::string toString< int32_t>      (const int32_t& x)
 //   {
-//     ostringstream out("");
+//     std::ostringstream out("");
 //     out << x;
 //     return out.str();
@@ -99,5 +95,5 @@
 //   template<>           inline std::string toString<uint32_t>      (const uint32_t& x)
 //   {
-//     ostringstream out("");
+//     std::ostringstream out("");
 //     out << x;
 //     return out.str();
