Index: trunk/IPs/systemC/processor/Morpheo/Common/include/Address.h
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Common/include/Address.h	(revision 44)
+++ trunk/IPs/systemC/processor/Morpheo/Common/include/Address.h	(revision 44)
@@ -0,0 +1,37 @@
+#ifndef morpheo_Address
+#define morpheo_Address
+
+/*
+ * $Id$
+ *
+ * [ Description ]
+ * 
+ */
+
+namespace morpheo              {
+
+  // get_tag, get_index, get_offset ...............
+  template <typename T>
+  T get_tag    (T value, uint32_t size_tag, uint32_t size_index, uint32_t size_offset) 
+  {
+    const T mask = gen_mask<T>(size_tag   ); 
+    return (value >> (size_index+size_offset)) & mask;
+  }
+  
+  template <typename T>
+  T get_index  (T value, uint32_t size_tag, uint32_t size_index, uint32_t size_offset) 
+  {
+    const T mask = gen_mask<T>(size_index ); 
+    return (value >> (           size_offset)) & mask;
+  }
+  
+  template <typename T>
+  T get_offset (T value, uint32_t size_tag, uint32_t size_index, uint32_t size_offset) 
+  {
+    const T mask = gen_mask<T>(size_offset); 
+    return (value                            ) & mask;
+  }
+
+}; // end namespace morpheo              
+
+#endif
Index: trunk/IPs/systemC/processor/Morpheo/Common/include/Average.h
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Common/include/Average.h	(revision 44)
+++ trunk/IPs/systemC/processor/Morpheo/Common/include/Average.h	(revision 44)
@@ -0,0 +1,20 @@
+#ifndef morpheo_Average
+#define morpheo_Average
+
+/*
+ * $Id$
+ *
+ * [ Description ]
+ * 
+ */
+
+namespace morpheo              {
+
+  inline double average (double   val, double   val_max) {return ((val_max == 0)?0:(val/val_max));}
+  inline double average (uint32_t val, double   val_max) {return (average(static_cast<double>(val),                    val_max ));}
+  inline double average (double   val, uint32_t val_max) {return (average(                    val ,static_cast<double>(val_max)));}
+  inline double average (uint32_t val, uint32_t val_max) {return (average(static_cast<double>(val),static_cast<double>(val_max)));}
+  
+}; // end namespace morpheo              
+
+#endif
Index: trunk/IPs/systemC/processor/Morpheo/Common/include/BitManipulation.h
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Common/include/BitManipulation.h	(revision 44)
+++ trunk/IPs/systemC/processor/Morpheo/Common/include/BitManipulation.h	(revision 44)
@@ -0,0 +1,160 @@
+#ifndef morpheo_BitManipulation
+#define morpheo_BitManipulation
+
+/*
+ * $Id$
+ *
+ * [ Description ]
+ * 
+ */
+
+#include <stdint.h>
+#include <iostream>
+using namespace std;
+
+namespace morpheo              {
+
+  // gen_mask .....................................
+
+  template <typename T>
+  T gen_mask       (uint32_t size) 
+  { 
+    T mask = 0; 
+    for (uint32_t i=0; i<size; i++)
+      {
+	mask <<= 1;
+	mask  |= 1;
+      }
+    return mask;
+  };
+
+  // shift_left_logic, shift_right_logic ..........
+  template <typename T>
+  T shift_logic_left (uint32_t size, uint32_t data, uint32_t value)  
+  {
+    T mask = gen_mask<T> (size);
+
+    return (mask & ((mask & data) << value));
+  }
+
+  template <typename T>
+  T shift_logic_right (uint32_t size, uint32_t data, uint32_t value)  
+  {
+    T mask = gen_mask<T> (size);
+
+    return (mask & ((mask & data) >> value));
+  }
+
+  // shift_logic ..................................
+  template <typename T>
+  T shift_logic      (uint32_t size, uint32_t data, uint32_t value, bool is_direction_left)
+  {
+    if (is_direction_left == true)
+      return shift_logic_left  <T> (size, data, value);
+    else
+      return shift_logic_right <T> (size, data, value);
+  }
+
+  // shift_left_arithmetic, shift_right_arithmetic 
+  template <typename T>
+  T shift_arithmetic_left (uint32_t size, uint32_t data, uint32_t value)  
+  {
+    bool carry = (data&1) != 0;
+
+    if (carry == false)
+      return shift_logic_left <T> (size,data,value);
+    else
+      {
+	if (value > size)
+	  return gen_mask<T> (size);
+
+	T mask = gen_mask<T> (value);
+	return shift_logic_left <T> (size,data,value) | mask;
+      }
+  }
+
+
+  template <typename T>
+  T shift_arithmetic_right (uint32_t size, uint32_t data, uint32_t value)  
+  {
+    bool carry = (data&(1<<(size-1))) != 0;
+
+    if (carry == false)
+      return shift_logic_right <T> (size,data,value);
+    else
+      {
+	if (value > size)
+	  return gen_mask<T> (size);
+	
+	T mask = gen_mask<T> (value) << (size-value);
+	return ((shift_logic_right <T> (size,data,value)) | mask);
+      }
+  }
+
+  // shift_arithmetic .............................
+  template <typename T>
+  T shift_arithmetic      (uint32_t size, uint32_t data, uint32_t value, bool is_direction_left)
+  {
+    if (is_direction_left == true)
+      return shift_arithmetic_left  <T> (size, data, value);
+    else
+      return shift_arithmetic_right <T> (size, data, value);
+  }
+
+  // shift ........................................
+  template <typename T>
+  T shift            (uint32_t size, uint32_t data, uint32_t value, bool is_direction_left, bool is_shift_arithmetic)
+  {
+    if (is_shift_arithmetic == true)
+      return shift_arithmetic <T> (size, data, value, is_direction_left);
+    else
+      return shift_logic      <T> (size, data, value, is_direction_left);
+  }
+
+  // rotate_left, rotate_right ....................
+
+  template <typename T>
+  T rotate_left    (uint32_t size, uint32_t data, uint32_t value)  
+  {
+    T mask        = gen_mask<T> (size);
+    T rotate_mask = gen_mask<T> (value);
+    T rotate      = rotate_mask & shift_logic_right<T>(size,data,size-value);
+    return (mask & (shift_logic_left <T> (size, data, value) | rotate));
+  }
+
+  template <typename T>
+  T rotate_right    (uint32_t size, uint32_t data, uint32_t value)  
+  {
+    T mask        = gen_mask<T> (size);
+    T rotate_mask = gen_mask<T> (value);
+    T rotate      = shift_logic_left <T> (size,rotate_mask & data,size-value);
+    return (mask & (shift_logic_right<T> (size, data, value) | rotate));
+  }
+
+  // rotate .......................................
+  template <typename T>
+  T rotate         (uint32_t size, uint32_t data, uint32_t value, bool is_direction_left)  
+  {
+    if (is_direction_left == true)
+      return rotate_left  <T> (size, data, value);
+    else
+      return rotate_right <T> (size, data, value);
+  }
+
+  // range ........................................
+  template <typename T>
+  T range          (uint32_t size, uint32_t data, uint32_t index_max, uint32_t index_min)  
+  {
+    return gen_mask<T>(index_max-index_min+1) & shift_logic_left<T> (size, data, index_min);
+  }
+
+  template <typename T>
+  T range          (uint32_t size, uint32_t data, uint32_t nb_bits)  
+  {
+    return gen_mask<T>(nb_bits) & data;
+  }
+
+
+}; // end namespace morpheo              
+
+#endif
Index: trunk/IPs/systemC/processor/Morpheo/Common/include/ChangeCase.h
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Common/include/ChangeCase.h	(revision 44)
+++ trunk/IPs/systemC/processor/Morpheo/Common/include/ChangeCase.h	(revision 44)
@@ -0,0 +1,42 @@
+#ifndef morpheo_changecase
+#define morpheo_changecase
+
+/*
+ * $Id$
+ *
+ * [ Description ]
+ * 
+ */
+
+#include <string>
+#include <stdint.h>
+
+using namespace std;
+
+namespace morpheo              {
+  
+  void UpperCase(string& S)
+  {
+    uint32_t n = S.size();
+    for (uint32_t j = 0; j < n; j++)
+      {
+	char sj = S[j];
+	if (sj >= 'a' && sj <= 'z')
+	  S[j] = static_cast<char>(sj - ('a' - 'A'));
+      }
+  }
+  
+  void LowerCase(string& S)
+  {
+    uint32_t n = S.size();
+    for (uint32_t j = 0; j < n; j++)
+      {
+	char sj = S[j];
+	if (sj >= 'A' && sj <= 'Z')
+	  S[j] = static_cast<char>(sj + ('a' - 'A'));
+      }
+  }
+  
+}; // end namespace morpheo              
+
+#endif
Index: trunk/IPs/systemC/processor/Morpheo/Common/include/Debug.h
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Common/include/Debug.h	(revision 44)
+++ trunk/IPs/systemC/processor/Morpheo/Common/include/Debug.h	(revision 44)
@@ -0,0 +1,73 @@
+#ifndef DEBUG_H
+#define DEBUG_H
+
+#include "Behavioural/include/Debug_component.h"
+#include <stdio.h>
+#include <string.h>
+#include <iostream>
+#include <sstream>
+#include <string>
+using namespace std;
+
+// Debug's Level :
+//  * None    : print elementary information
+//  * Info    : print basic information
+//  * Trace   : trace internal variable
+//  * Func    : trace call and return function
+//  * All     : print all information
+
+enum _debug_verbosity 
+  {
+    DEBUG_NONE ,
+    DEBUG_INFO ,
+    DEBUG_TRACE,
+    DEBUG_FUNC ,
+    DEBUG_ALL
+  };
+
+#ifdef DEBUG
+//Debug
+
+#  define log_printf(level, component, func, str... )                   \
+do                                                                      \
+{                                                                       \
+    if ( (DEBUG == DEBUG_ALL) 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)
+
+#else
+// No debug
+
+#  define log_printf(level, component, func, str... )                                 \
+do                                                                                    \
+{                                                                                     \
+} while(0)
+
+#endif // DEBUG
+
+#endif // !DEBUG_H
Index: trunk/IPs/systemC/processor/Morpheo/Common/include/ErrorMorpheo.h
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Common/include/ErrorMorpheo.h	(revision 44)
+++ trunk/IPs/systemC/processor/Morpheo/Common/include/ErrorMorpheo.h	(revision 44)
@@ -0,0 +1,45 @@
+#ifndef morpheo_ErrorMorpheo
+#define morpheo_ErrorMorpheo
+
+/*
+ * $Id$
+ *
+ * [ Description ]
+ * 
+ */
+
+#include <iostream>
+#include <exception>
+
+using namespace std;
+
+namespace morpheo              {
+
+  class ErrorMorpheo : public exception 
+  {
+    // -----[ fields ]----------------------------------------------------
+  private : string _msg;
+    
+    // -----[ methods ]---------------------------------------------------
+  public  :             ErrorMorpheo  ()           throw() { _msg = "Exception detected ...";}
+  public  :             ErrorMorpheo  (string msg) throw() { _msg = msg;}
+  public  :             ~ErrorMorpheo (void)       throw() {}
+  public  : const char* what          ()    const  throw() { return ( _msg.c_str() );}
+
+  };
+
+  class TestMorpheo : public exception 
+  {
+    // -----[ fields ]----------------------------------------------------
+  private : 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() );}
+  };
+
+}; // end namespace morpheo              
+
+#endif
Index: trunk/IPs/systemC/processor/Morpheo/Common/include/FromString.h
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Common/include/FromString.h	(revision 44)
+++ trunk/IPs/systemC/processor/Morpheo/Common/include/FromString.h	(revision 44)
@@ -0,0 +1,31 @@
+#ifndef morpheo_fromstring
+#define morpheo_fromstring
+
+/*
+ * $Id$
+ *
+ * [ Description ]
+ * 
+ */
+
+// #include <iosfwd>
+// #include <sstream>
+// #include <iomanip>
+#include <string>
+// #include <limits>
+
+namespace morpheo {
+  
+  template<typename T> inline T   fromString             (const std::string& x)
+  {
+    return static_cast<T>(x.c_str());
+  }
+  
+  template<>           inline int fromString<int>        (const std::string& x)
+  {
+    return atoi(x.c_str());
+  }
+  
+}; // end namespace morpheo              
+
+#endif
Index: trunk/IPs/systemC/processor/Morpheo/Common/include/Message.h
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Common/include/Message.h	(revision 44)
+++ trunk/IPs/systemC/processor/Morpheo/Common/include/Message.h	(revision 44)
@@ -0,0 +1,13 @@
+/*
+ * $Id$
+ *
+ * [ Description ]
+ * 
+ * Routine of Test
+ */
+
+namespace morpheo    {
+
+#define cerr_msg   cerr << "<" << __FILE__ << "> line " << __LINE__ << " : "
+  
+}; // end namespace morpheo
Index: trunk/IPs/systemC/processor/Morpheo/Common/include/Percent.h
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Common/include/Percent.h	(revision 44)
+++ trunk/IPs/systemC/processor/Morpheo/Common/include/Percent.h	(revision 44)
@@ -0,0 +1,20 @@
+#ifndef morpheo_Percent
+#define morpheo_Percent
+
+/*
+ * $Id$
+ *
+ * [ Description ]
+ * 
+ */
+
+namespace morpheo              {
+  
+  inline double percent (double   val, double   val_max) {return ((val_max == 0)?0:(100.0 * val)/val_max);}
+  inline double percent (uint32_t val, double   val_max) {return (percent(static_cast<double>(val),                    val_max ));}
+  inline double percent (double   val, uint32_t val_max) {return (percent(                    val ,static_cast<double>(val_max)));}
+  inline double percent (uint32_t val, uint32_t val_max) {return (percent(static_cast<double>(val),static_cast<double>(val_max)));}
+
+}; // end namespace morpheo              
+
+#endif
Index: trunk/IPs/systemC/processor/Morpheo/Common/include/Test.h
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Common/include/Test.h	(revision 44)
+++ trunk/IPs/systemC/processor/Morpheo/Common/include/Test.h	(revision 44)
@@ -0,0 +1,47 @@
+#ifndef TEST_H
+#define TEST_H
+
+#include <iostream>
+#include <sstream>
+#include <stdint.h>
+#include "Common/include/ErrorMorpheo.h"
+using namespace std;
+
+//-----[ Routine de test ]---------------------------------------
+
+static uint32_t num_test;
+
+template <class T>
+void test_ko (T exp1, T exp2, char * file, uint32_t line)
+{
+  string msg = ("<"+toString(num_test)+"> : Test KO\n" +
+		" * Localisation\n"                    +
+		"   - File : "+file+"\n"               +
+		"   - Line : "+toString(line)+"\n"     +
+		" * Expression is different\n"         +
+		"   - exp1 : "+toString(exp1)+"\n"     +
+		"   - exp2 : "+toString(exp2)+"\n");
+  
+  throw (ErrorMorpheo (msg));
+};
+
+void test_ok ()
+{
+  cout << "{" << num_test << "} : Test OK" << endl;
+
+  num_test ++;
+};
+
+template <class T>
+void test(T exp1, T exp2, char * file, uint32_t line)
+{
+  if (exp1 != exp2)
+    test_ko <T> (exp1,exp2,file,line);
+  else
+    test_ok     ();
+};
+
+#define TEST(type,exp1,exp2)            do {                      test<type> (exp1,exp2,__FILE__,__LINE__);} while(0)
+#define TEST_STR(type,exp1,exp2,str...) do { fprintf(stdout,str); test<type> (exp1,exp2,__FILE__,__LINE__);} while(0)
+
+#endif
Index: trunk/IPs/systemC/processor/Morpheo/Common/include/ToBase2.h
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Common/include/ToBase2.h	(revision 44)
+++ trunk/IPs/systemC/processor/Morpheo/Common/include/ToBase2.h	(revision 44)
@@ -0,0 +1,58 @@
+#ifndef morpheo_ToBase2
+#define morpheo_ToBase2
+
+/*
+ * $Id$
+ *
+ * [ Description ]
+ * 
+ */
+
+#include <sstream>
+using namespace std;
+
+namespace morpheo              {
+
+  template<typename T> inline std::string toBase2 (const T& value, const uint32_t & size)
+  {
+    ostringstream res;
+    T mask = 1<<(size-1);
+    
+    while (mask != 0)
+      {
+	res  << ((value&mask)?'1':'0');
+	mask >>= 1;
+      }
+
+    return res.str();
+  }
+
+  inline std::string toBase2 (const bool    & value)
+  {
+    return toBase2<bool   >  (value, 1);
+  }
+
+  inline std::string toBase2 (const uint8_t & value, const uint32_t & size)
+  {
+    return toBase2<uint8_t>  (value, size);
+  }
+
+  inline std::string toBase2 (const uint16_t& value, const uint32_t & size)
+  {
+    return toBase2<uint16_t> (value, size);
+  }
+
+  inline std::string toBase2 (const uint32_t& value, const uint32_t & size)
+  {
+    return toBase2<uint32_t> (value, size);
+  }
+
+  inline std::string toBase2 (const uint64_t& value, const uint32_t & size)
+  {
+    return toBase2<uint64_t> (value, size);
+  }
+
+
+}; // end namespace morpheo              
+
+#endif
Index: trunk/IPs/systemC/processor/Morpheo/Common/include/ToString.h
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Common/include/ToString.h	(revision 44)
+++ trunk/IPs/systemC/processor/Morpheo/Common/include/ToString.h	(revision 44)
@@ -0,0 +1,64 @@
+#ifndef morpheo_tostring
+#define morpheo_tostring
+
+/*
+ * $Id$
+ *
+ * [ Description ]
+ * 
+ */
+
+#include <iosfwd>
+#include <sstream>
+#include <iomanip>
+#include <string>
+#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;
+    out << x;
+    return out.str();
+  }
+  
+  template<>           inline std::string toString<bool>       (const bool& x)
+  {
+    ostringstream out;
+    //out << boolalpha << x;
+    out << x;
+    return out.str();
+  }
+  
+  template<>           inline std::string toString<float>      (const float& x)
+  {
+    const int sigdigits = std::numeric_limits<float>::digits10;
+    ostringstream out;
+    out << setprecision(sigdigits) << x;
+    return out.str();
+  }
+  
+  template<>           inline std::string toString<double>     (const double& x)
+  {
+    const int sigdigits = std::numeric_limits<double>::digits10;
+    ostringstream out;
+    out << setprecision(sigdigits) << x;
+    return out.str();
+  }
+  
+  template<>           inline std::string toString<long double>(const long double& x)
+  {
+    const int sigdigits = std::numeric_limits<long double>::digits10;
+    ostringstream out;
+    out << setprecision(sigdigits) << x;
+    return out.str();
+  }
+  
+}; // end namespace morpheo              
+
+#endif
Index: trunk/IPs/systemC/processor/Morpheo/Common/include/Types.h
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Common/include/Types.h	(revision 44)
+++ trunk/IPs/systemC/processor/Morpheo/Common/include/Types.h	(revision 44)
@@ -0,0 +1,54 @@
+#ifndef morpheo_Type
+#define morpheo_Type
+
+/*
+ * $Id$
+ *
+ * [ Description ]
+ * 
+ */
+
+#include <stdint.h>
+
+namespace morpheo              {
+
+#ifdef SYSTEMC
+
+// Definition of type
+#if ( defined(SC_CLOCK) || defined(SC_INTERNAL) || defined(SC_SIGNAL) || defined(SC_REGISTER) || defined(SC_IN) || defined(SC_OUT) )
+#  error "A type is already defined"
+#endif
+
+#if ( defined(PORT_READ)     || defined(PORT_WRITE)     )
+#  error "Action is already defined"
+#endif
+#if ( defined(INTERNAL_READ) || defined(INTERNAL_WRITE) )
+#  error "Action is already defined"
+#endif
+#if ( defined(SIGNAL_READ)   || defined(SIGNAL_WRITE) )
+#  error "Action is already defined"
+#endif
+#if ( defined(REGISTER_READ) || defined(REGISTER_WRITE) )
+#  error "Action is already defined"
+#endif
+
+#define SC_CLOCK                 sc_in_clk       
+#define SC_INTERNAL(type)        type
+#define SC_REGISTER(type)        sc_signal<type >
+#define SC_SIGNAL(type)          sc_signal<type >
+#define SC_IN(type)              sc_in    <type >
+#define SC_OUT(type)             sc_out   <type >
+			         
+#define PORT_READ(sig)           sig->read()
+#define PORT_WRITE(sig,val)      sig->write(val)
+#define INTERNAL_READ(sig)       (*sig)
+#define INTERNAL_WRITE(sig,val)  (*sig) = val
+#define SIGNAL_READ(sig)         sig->read()
+#define SIGNAL_WRITE(sig,val)    sig->write(val)
+#define REGISTER_READ(sig)       sig->read()
+#define REGISTER_WRITE(sig,val)  sig->write(val)
+
+#endif  
+}; // end namespace morpheo              
+
+#endif
