Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Allocation.h
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Allocation.h	(revision 77)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Allocation.h	(revision 78)
@@ -7,4 +7,9 @@
 // -----[ NO ITERATION ]-------------------------------------------------
 // ----------------------------------------------------------------------
+
+#define __ALLOC_SIGNAL(sig, name, type)		\
+  {						\
+    sig = new type (name);			\
+  }
 
 #ifdef POSITION
@@ -16,27 +21,19 @@
 #endif
 
-#define ALLOC_VALACK_IN(  sig, name, type)				\
+#define ALLOC_VAL_ACK_IN(  sig, name, type)				\
   {									\
     sig = interface->set_signal_valack_in (name, type);			\
   }									
-#define ALLOC_VALACK_OUT( sig, name, type)				\
+#define ALLOC_VAL_ACK_OUT( sig, name, type)				\
   {									\
     sig = interface->set_signal_valack_out(name, type);			\
   }									
-#define ALLOC_VAL_IN(     sig)						\
-  {									\
-    sig = interface->set_signal_valack_in (VAL);			\
+#define ALLOC_VALACK_IN(     sig, type)					\
+  {									\
+    sig = interface->set_signal_valack_in (type);			\
   }									
-#define ALLOC_VAL_OUT(    sig)						\
-  {									\
-    sig = interface->set_signal_valack_out(VAL);			\
-  }									
-#define ALLOC_ACK_IN(     sig)						\
-  {									\
-    sig = interface->set_signal_valack_in (ACK);			\
-  }									
-#define ALLOC_ACK_OUT(    sig)						\
-  {									\
-    sig = interface->set_signal_valack_out(ACK);			\
+#define ALLOC_VALACK_OUT(    sig, type)					\
+  {									\
+    sig = interface->set_signal_valack_out(type);			\
   }									
 #define ALLOC_SIGNAL_IN(  sig, name, type, size)			\
@@ -60,4 +57,30 @@
 // -----[ ITERATION 1 ]--------------------------------------------------
 // ----------------------------------------------------------------------
+
+#define __ALLOC1_INTERFACE(name, it1)		\
+  const std::string interface_name = name;	\
+  const uint32_t iterator_1 = it1;
+
+#define __ALLOC1_SIGNAL_IN( sig, name, type)		\
+  {									\
+    sig = new SC_IN(type) * [iterator_1];				\
+    std::string separator="_";						\
+    for (uint32_t alloc_signal_it1=0; alloc_signal_it1<iterator_1; alloc_signal_it1++) \
+      {									\
+	std::string str = "in_"+interface_name+separator+toString(alloc_signal_it1)+separator+name; \
+	sig [alloc_signal_it1] = new SC_IN(type) (str.c_str());		\
+      }									\
+  }
+
+#define __ALLOC1_SIGNAL_OUT( sig, name, type)		\
+  {									\
+    sig = new SC_OUT(type) * [iterator_1];				\
+    std::string separator="_";						\
+    for (uint32_t alloc_signal_it1=0; alloc_signal_it1<iterator_1; alloc_signal_it1++) \
+      {									\
+	std::string str = "out_"+interface_name+separator+toString(alloc_signal_it1)+separator+name; \
+	sig [alloc_signal_it1] = new SC_OUT(type) (str.c_str());		\
+      }									\
+  }
 
 #ifdef POSITION
@@ -66,8 +89,8 @@
   Interface_fifo * interface [iterator_1];				\
   {									\
-    std::string      separator="_";					\
-    for (uint32_t i=0; i<iterator_1; i++)				\
-      {									\
-	interface [i] = _interfaces->set_interface( name+separator+toString(i), direction, localisation, str); \
+    std::string separator="_";						\
+    for (uint32_t alloc_interface_it1=0; alloc_interface_it1<iterator_1; alloc_interface_it1++)	\
+      {									\
+	interface [alloc_interface_it1] = _interfaces->set_interface( name+separator+toString(alloc_interface_it1), direction, localisation, str); \
       }									\
   }
@@ -77,59 +100,42 @@
   Interface_fifo * interface [iterator_1];				\
   {									\
-    std::string      separator="_";					\
-    for (uint32_t i=0; i<iterator_1; i++)				\
-      {									\
-	interface [i] = _interfaces->set_interface( name+separator+toString(i)); \
+    std::string separator="_";						\
+    for (uint32_t alloc_interface_it1=0; alloc_interface_it1<iterator_1; alloc_interface_it1++)	\
+      {									\
+	interface [alloc_interface_it1] = _interfaces->set_interface( name+separator+toString(alloc_interface_it1)); \
       }									\
   }
 #endif
 
-
-#define ALLOC1_VALACK_IN( sig, name, type)				\
+#define ALLOC1_VAL_ACK_IN( sig, name, type)				\
   {									\
     sig = new SC_IN (Tcontrol_t) * [iterator_1];			\
-    for (uint32_t i=0; i<iterator_1; i++)				\
-      {									\
-	sig [i] = interface[i]->set_signal_valack_in (name, type);	\
-      }									\
-  }
-#define ALLOC1_VALACK_OUT(sig, name, type)				\
+    for (uint32_t alloc_signal_it1=0; alloc_signal_it1<iterator_1; alloc_signal_it1++) \
+      {									\
+	sig [alloc_signal_it1] = interface[alloc_signal_it1]->set_signal_valack_in (name, type); \
+      }									\
+  }
+#define ALLOC1_VAL_ACK_OUT(sig, name, type)				\
   {									\
     sig = new SC_OUT(Tcontrol_t) * [iterator_1];			\
-    for (uint32_t i=0; i<iterator_1; i++)				\
-      {									\
-	sig [i] = interface[i]->set_signal_valack_out(name, type);	\
-      }									\
-  }
-#define ALLOC1_VAL_IN(    sig)						\
+    for (uint32_t alloc_signal_it1=0; alloc_signal_it1<iterator_1; alloc_signal_it1++) \
+      {									\
+	sig [alloc_signal_it1] = interface[alloc_signal_it1]->set_signal_valack_out(name, type); \
+      }									\
+  }
+#define ALLOC1_VALACK_IN(    sig, type)					\
   {									\
     sig = new SC_IN (Tcontrol_t) * [iterator_1];			\
-    for (uint32_t i=0; i<iterator_1; i++)				\
-      {									\
-	sig [i] = interface[i]->set_signal_valack_in (VAL);		\
-      }									\
-  }
-#define ALLOC1_VAL_OUT(   sig)						\
+    for (uint32_t alloc_signal_it1=0; alloc_signal_it1<iterator_1; alloc_signal_it1++) \
+      {									\
+	sig [alloc_signal_it1] = interface[alloc_signal_it1]->set_signal_valack_in (type); \
+      }									\
+  }
+#define ALLOC1_VALACK_OUT(   sig, type)					\
   {									\
     sig = new SC_OUT(Tcontrol_t) * [iterator_1];			\
-    for (uint32_t i=0; i<iterator_1; i++)				\
-      {									\
-	sig [i] = interface[i]->set_signal_valack_out(VAL);		\
-      }									\
-  }
-#define ALLOC1_ACK_IN(    sig)						\
-  {									\
-    sig = new SC_IN (Tcontrol_t) * [iterator_1];			\
-    for (uint32_t i=0; i<iterator_1; i++)				\
-      {									\
-	sig [i] = interface[i]->set_signal_valack_in (ACK);		\
-      }									\
-  }
-#define ALLOC1_ACK_OUT(   sig)						\
-  {									\
-    sig = new SC_OUT(Tcontrol_t) * [iterator_1];			\
-    for (uint32_t i=0; i<iterator_1; i++)				\
-      {									\
-	sig [i] = interface[i]->set_signal_valack_out(ACK);		\
+    for (uint32_t alloc_signal_it1=0; alloc_signal_it1<iterator_1; alloc_signal_it1++) \
+      {									\
+	sig [alloc_signal_it1] = interface[alloc_signal_it1]->set_signal_valack_out(type); \
       }									\
   }
@@ -138,7 +144,7 @@
     {									\
       sig = new SC_IN (type) * [iterator_1];				\
-      for (uint32_t i=0; i<iterator_1; i++)				\
+      for (uint32_t alloc_signal_it1=0; alloc_signal_it1<iterator_1; alloc_signal_it1++) \
 	{								\
-	  sig [i] = interface[i]->set_signal_in <type> (name, size);	\
+	  sig [alloc_signal_it1] = interface[alloc_signal_it1]->set_signal_in <type> (name, size); \
 	}								\
     }
@@ -148,7 +154,7 @@
     {									\
       sig = new SC_OUT(type) * [iterator_1];				\
-      for (uint32_t i=0; i<iterator_1; i++)				\
+      for (uint32_t alloc_signal_it1=0; alloc_signal_it1<iterator_1; alloc_signal_it1++) \
 	{								\
-	  sig [i] = interface[i]->set_signal_out<type> (name, size);	\
+	  sig [alloc_signal_it1] = interface[alloc_signal_it1]->set_signal_out<type> (name, size); \
 	}								\
     }
@@ -159,16 +165,169 @@
     std::string separator="_";						\
     std::string str;							\
-    for (uint32_t i=0; i<it1; i++)					\
-      {									\
-	str = name+separator+toString(i);				\
-	sig [i] = new sc_signal<type> (str.c_str());			\
-      }									\
-  }
-
-#define INSTANCE1_SC_SIGNAL(component, sig, it1)	\
-  for (uint32_t i=0; i<it1; i++)			\
-    {							\
-      (*(component->sig[i])) (*(sig[i]));		\
-    }
-
+    for (uint32_t alloc_signal_it1=0; alloc_signal_it1<it1; alloc_signal_it1++)	\
+      {									\
+	str = name+separator+toString(alloc_signal_it1);		\
+	sig [alloc_signal_it1] = new sc_signal<type> (str.c_str());	\
+      }									\
+  }
+
+#define INSTANCE1_SC_SIGNAL(component, sig, it1)			\
+  for (uint32_t alloc_signal_it1=0; alloc_signal_it1<it1; alloc_signal_it1++) \
+    {									\
+      (*(component->sig[alloc_signal_it1])) (*(sig[alloc_signal_it1]));	\
+    }
+
+// ----------------------------------------------------------------------
+// -----[ ITERATION 2 ]--------------------------------------------------
+// ----------------------------------------------------------------------
+
+#ifdef POSITION
+#define ALLOC2_INTERFACE( name, direction, localisation, str, it1, it2)	\
+  uint32_t iterator_1 = 0;						\
+  uint32_t iterator_2 = 0;						\
+  Interface_fifo *** interface;						\
+  {									\
+    std::string separator="_";						\
+    iterator_1 = it1;							\
+    interface = new Interface_fifo ** [iterator_1];			\
+    for (uint32_t alloc_interface_it1=0; alloc_interface_it1<iterator_1; alloc_interface_it1++)	\
+      {									\
+	iterator_2 = it2;						\
+	interface [alloc_interface_it1] = new Interface_fifo * [iterator_2]; \
+	for (uint32_t alloc_interface_it2=0; alloc_interface_it2<iterator_2; alloc_interface_it2++) \
+	  {								\
+	    interface [alloc_interface_it1][alloc_interface_it2] = _interfaces->set_interface( name+separator+toString(alloc_interface_it1)+separator+toString(alloc_interface_it2), direction, localisation, str); \
+	  }								\
+      }									\
+  }
+#else
+#define ALLOC2_INTERFACE( name, direction, localisation, str, it1, it2)	\
+  uint32_t iterator_1 = 0;						\
+  uint32_t iterator_2 = 0;						\
+  Interface_fifo *** interface;						\
+  {									\
+    std::string separator="_";						\
+    iterator_1 = it1;							\
+    interface = new Interface_fifo ** [iterator_1];			\
+    for (uint32_t alloc_interface_it1=0; alloc_interface_it1<iterator_1; alloc_interface_it1++)	\
+      {									\
+	iterator_2 = it2;						\
+	interface [alloc_interface_it1] = new Interface_fifo * [iterator_2]; \
+	for (uint32_t alloc_interface_it2=0; alloc_interface_it2<iterator_2; alloc_interface_it2++) \
+	  {								\
+	    interface [alloc_interface_it1][alloc_interface_it2] = _interfaces->set_interface( name+separator+toString(alloc_interface_it1)+separator+toString(alloc_interface_it2)); \
+	  }								\
+      }									\
+  }
 #endif
+
+#define _ALLOC2_VAL_ACK_IN( sig, name, type, it1, it2)			\
+  {									\
+    sig = new SC_IN (Tcontrol_t) ** [it1];				\
+    for (uint32_t alloc_signal_it1=0; alloc_signal_it1<it1; alloc_signal_it1++) \
+      {									\
+	sig [alloc_signal_it1] = new SC_IN (Tcontrol_t) * [it2];	\
+	for (uint32_t alloc_signal_it2=0; alloc_signal_it2<it2; alloc_signal_it2++) \
+	  {								\
+	    sig [alloc_signal_it1][alloc_signal_it2] = interface[alloc_signal_it1][alloc_signal_it2]->set_signal_valack_in (name, type); \
+	  }								\
+      }									\
+  }
+
+#define _ALLOC2_VAL_ACK_OUT( sig, name, type, it1, it2)			\
+  {									\
+    sig = new SC_OUT (Tcontrol_t) ** [it1];				\
+    for (uint32_t alloc_signal_it1=0; alloc_signal_it1<it1; alloc_signal_it1++) \
+      {									\
+	sig [alloc_signal_it1] = new SC_OUT (Tcontrol_t) * [it2];	\
+	for (uint32_t alloc_signal_it2=0; alloc_signal_it2<it2; alloc_signal_it2++) \
+	  {								\
+	    sig [alloc_signal_it1][alloc_signal_it2] = interface[alloc_signal_it1][alloc_signal_it2]->set_signal_valack_out (name, type); \
+	  }								\
+      }									\
+  }
+
+#define _ALLOC2_VALACK_IN(    sig,type, it1, it2)			\
+  {									\
+    sig = new SC_IN (Tcontrol_t) ** [it1];				\
+    for (uint32_t alloc_signal_it1=0; alloc_signal_it1<it1; alloc_signal_it1++)	\
+      {									\
+	sig [alloc_signal_it1] = new SC_IN (Tcontrol_t) * [it2];	\
+	for (uint32_t alloc_signal_it2=0; alloc_signal_it2<it2; alloc_signal_it2++) \
+	  {								\
+	    sig [alloc_signal_it1][alloc_signal_it2] = interface[alloc_signal_it1][alloc_signal_it2]->set_signal_valack_in (type); \
+	  }								\
+      }									\
+  }
+
+#define _ALLOC2_VALACK_OUT(    sig,type, it1, it2)			\
+  {									\
+    sig = new SC_OUT (Tcontrol_t) ** [it1];				\
+    for (uint32_t alloc_signal_it1=0; alloc_signal_it1<it1; alloc_signal_it1++)	\
+      {									\
+	sig [alloc_signal_it1] = new SC_OUT (Tcontrol_t) * [it2];	\
+	for (uint32_t alloc_signal_it2=0; alloc_signal_it2<it2; alloc_signal_it2++) \
+	  {								\
+	    sig [alloc_signal_it1][alloc_signal_it2] = interface[alloc_signal_it1][alloc_signal_it2]->set_signal_valack_out (type); \
+	  }								\
+      }									\
+  }
+
+#define _ALLOC2_SIGNAL_IN( sig, name, type, size, it1, it2)		\
+  if (size > 0)								\
+    {									\
+      sig = new SC_IN (type) ** [it1];					\
+      for (uint32_t alloc_signal_it1=0; alloc_signal_it1<it1; alloc_signal_it1++) \
+	{								\
+	  sig [alloc_signal_it1] = new SC_IN (type) * [it2];		\
+	  for (uint32_t alloc_signal_it2=0; alloc_signal_it2<it2; alloc_signal_it2++) \
+	    {								\
+	      sig [alloc_signal_it1][alloc_signal_it2] = interface[alloc_signal_it1][alloc_signal_it2]->set_signal_in <type> (name, size); \
+	    }								\
+	}								\
+    }
+
+#define _ALLOC2_SIGNAL_OUT( sig, name, type, size, it1, it2)		\
+  if (size > 0)								\
+    {									\
+      sig = new SC_OUT (type) ** [it1];					\
+      for (uint32_t alloc_signal_it1=0; alloc_signal_it1<it1; alloc_signal_it1++) \
+	{								\
+	  sig [alloc_signal_it1] = new SC_OUT (type) * [it2];		\
+	  for (uint32_t alloc_signal_it2=0; alloc_signal_it2<it2; alloc_signal_it2++) \
+	    {								\
+	      sig [alloc_signal_it1][alloc_signal_it2] = interface[alloc_signal_it1][alloc_signal_it2]->set_signal_out <type> (name, size); \
+	    }								\
+	}								\
+    }
+
+#define ALLOC2_VAL_ACK_IN( sig, name, type      ) _ALLOC2_VAL_ACK_IN( sig, name, type      , iterator_1, iterator_2) 
+#define ALLOC2_VAL_ACK_OUT(sig, name, type      ) _ALLOC2_VAL_ACK_OUT(sig, name, type      , iterator_1, iterator_2) 
+#define ALLOC2_VALACK_IN(  sig,       type      ) _ALLOC2_VALACK_IN(  sig,       type      , iterator_1, iterator_2) 
+#define ALLOC2_VALACK_OUT( sig,       type      ) _ALLOC2_VALACK_OUT( sig,       type      , iterator_1, iterator_2) 
+#define ALLOC2_SIGNAL_IN(  sig, name, type, size) _ALLOC2_SIGNAL_IN(  sig, name, type, size, iterator_1, iterator_2) 
+#define ALLOC2_SIGNAL_OUT( sig, name, type, size) _ALLOC2_SIGNAL_OUT( sig, name, type, size, iterator_1, iterator_2) 
+
+#define ALLOC2_SC_SIGNAL( sig, name, type, it1, it2)			\
+  sc_signal<type> *** sig = new sc_signal<type> ** [it1];		\
+  {									\
+    std::string separator="_";						\
+    std::string str;							\
+    for (uint32_t alloc_signal_it1=0; alloc_signal_it1<it1; alloc_signal_it1++)	\
+      {									\
+	sig [alloc_signal_it1] = new sc_signal<type> * [it2];		\
+	for (uint32_t alloc_signal_it2=0; alloc_signal_it2<it2; alloc_signal_it2++) \
+	  {								\
+	    str = name+separator+toString(alloc_signal_it1)+separator+toString(alloc_signal_it2); \
+	    sig [alloc_signal_it1][alloc_signal_it2] = new sc_signal<type> (str.c_str()); \
+	  }								\
+      }									\
+  }
+
+#define INSTANCE2_SC_SIGNAL(component, sig, it1, it2)			\
+  for (uint32_t alloc_signal_it1=0; alloc_signal_it1<it1; alloc_signal_it1++) \
+    for (uint32_t alloc_signal_it2=0; alloc_signal_it2<it2; alloc_signal_it2++)	\
+      {									\
+	(*(component->sig[alloc_signal_it1][alloc_signal_it2])) (*(sig[alloc_signal_it1][alloc_signal_it2])); \
+      }
+#endif
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Component.h
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Component.h	(revision 77)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Component.h	(revision 78)
@@ -25,4 +25,36 @@
 namespace behavioural          {
 
+#ifdef DEBUG
+# define PORT_MAP(x,a,b,c,d)						\
+  do									\
+    {									\
+      try								\
+	{								\
+	  x->port_map(a,b,c,d);						\
+	}								\
+      catch (morpheo::ErrorMorpheo & error)				\
+	{								\
+	  throw (ErrorMorpheo ("In file "+toString(__FILE__)+", at line "+toString(__LINE__)+"\n"+error.what ())); \
+	}								\
+    }									\
+  while (0)
+#else
+# define PORT_MAP(x,a,b,c,d)						\
+  do									\
+    {									\
+      x->port_map(a,b,c,d);						\
+    }									\
+  while (0)
+#endif
+
+#define COMPONENT_MAP(x,a,b,c,d)					\
+  do									\
+    {									\
+      PORT_MAP(x,a,b,c,d);						\
+      PORT_MAP(x,c,d,a,b);						\
+    }									\
+  while (0)
+  
+
   typedef uint8_t Tinstance_t;
 
@@ -35,6 +67,7 @@
   typedef struct
   {
-    public : Tinstance_t _instance;
-    public : Entity    * _entity  ;
+//public : Component * _component;
+  public : Entity    * _entity   ;
+  public : Tinstance_t _instance ;
   } Tcomponent_t;    
   
@@ -42,6 +75,6 @@
   {
     // -----[ fields ]----------------------------------------------------
-  private   : const Tusage_t        _usage;
-  private   : Entity              * _entity        ;
+  private   : const Tusage_t             _usage;
+  private   : Entity                   * _entity        ;
   private   : std::list<Tcomponent_t*> * _list_component;
 
@@ -57,5 +90,5 @@
 #endif
 						       );
-  private   : std::string                get_entity        (void);
+  private   : std::string           get_entity        (void);
 
   public    : void                  set_component     (Component * component
@@ -69,5 +102,5 @@
 						       );
 
-  private   : std::string                get_component     (void);
+  private   : std::string           get_component     (void);
 
   private   : Entity *              find_entity       (std::string name);
@@ -87,8 +120,7 @@
 						       std::string component_dest,
 						       std::string port_dest    );
-  public    : void                  port_map          (std::string component_src ,
-						       std::string port_src      );
 
-  public    : bool                  test_map          (void);
+  public    : bool                  test_map          (bool recursive=true);
+  private   : bool                  test_map          (uint32_t depth, bool recursive);
 
 #ifdef POSITION
@@ -102,6 +134,6 @@
   public    : void                  generate_file     (void);
 #endif    
-  public    : friend std::ostream&       operator<<        (std::ostream& output_stream,
-							    morpheo::behavioural::Component & x);
+  public    : friend std::ostream&  operator<<        (std::ostream& output_stream,
+						       morpheo::behavioural::Component & x);
   };
 
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Constants.h
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Constants.h	(revision 77)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Constants.h	(revision 78)
@@ -161,13 +161,22 @@
 #  define OPERATION_FIND_L_FL1                     0x2        // 000_0000 l.fl1
 
-#  define OPERATION_SPECIAL_L_MFSPR                0x1        // 000_0000 l.mfspr
-#  define OPERATION_SPECIAL_L_MTSPR                0x2        // 000_0000 l.mtspr
-#  define OPERATION_SPECIAL_L_MAC                  0x4        // 000_0000 l.mac   , l.maci
-#  define OPERATION_SPECIAL_L_MACRC                0x8        // 000_0000 l.macrc
-#  define OPERATION_SPECIAL_L_MSB                  0x10       // 000_0000 l.msb
-
-#  define OPERATION_BRANCH_L_TEST_NF               0x1        // 000_0000 l.bnf
-#  define OPERATION_BRANCH_L_TEST_F                0x2        // 000_0000 l.bf
-#  define OPERATION_BRANCH_L_JALR                  0x4        // 000_0000 l.jal   , l.jalr , l.jr
+#  define OPERATION_SPECIAL_L_NOP                  0xff       // 000_0000 l.nop   
+#  define OPERATION_SPECIAL_L_MFSPR                0x1        // 000_0001 l.mfspr
+#  define OPERATION_SPECIAL_L_MTSPR                0x2        // 000_0010 l.mtspr
+#  define OPERATION_SPECIAL_L_RFE                  0x4        // 000_0100 l.rfe  
+#  define OPERATION_SPECIAL_L_MAC                  0x11       // 001_0001 l.mac   , l.maci
+#  define OPERATION_SPECIAL_L_MACRC                0x12       // 001_0010 l.macrc
+#  define OPERATION_SPECIAL_L_MSB                  0x14       // 001_0100 l.msb
+#  define OPERATION_SPECIAL_L_MSYNC                0x21       // 010_0001 l.msync
+#  define OPERATION_SPECIAL_L_PSYNC                0x22       // 010_0010 l.psync
+#  define OPERATION_SPECIAL_L_CSYNC                0x24       // 010_0100 l.csync
+#  define OPERATION_SPECIAL_L_SYS                  0x41       // 100_0001 l.sys  
+#  define OPERATION_SPECIAL_L_TRAP                 0x42       // 100_0010 l.trap 
+
+
+#  define OPERATION_BRANCH_NONE                    0x1        // 000_0000 l.j
+#  define OPERATION_BRANCH_L_TEST_NF               0x2        // 000_0000 l.bnf
+#  define OPERATION_BRANCH_L_TEST_F                0x4        // 000_0000 l.bf
+#  define OPERATION_BRANCH_L_JALR                  0x8        // 000_0000 l.jal   , l.jalr , l.jr
 
   //-------------------------------------------------------[ Custom ]-----
@@ -195,4 +204,10 @@
 
 #  define SIZE_EXCEPTION                           5
+#  define SIZE_EXCEPTION_USE                       4
+#  define SIZE_EXCEPTION_MEMORY                    3
+#  define SIZE_EXCEPTION_CUSTOM                    3
+#  define SIZE_EXCEPTION_ALU                       2
+#  define SIZE_EXCEPTION_DECOD                     2
+#  define SIZE_EXCEPTION_IFETCH                    2
 
 #  define EXCEPTION_NONE                           0x00       // none exception
@@ -229,4 +244,5 @@
 #  define EXCEPTION_CUSTOM_6                       0x1f       // Reserved for custom exceptions
 
+
 #define exception_to_address(x) (x<<8)
 
@@ -253,4 +269,50 @@
 #  define EXCEPTION_ALU_SPR_ACCESS_INVALID         0x2        // SPR     present in ALU but not compatible privilege
 #  define EXCEPTION_ALU_SPR_ACCESS_NOT_COMPLETE    0x3        // SPR not present in ALU
+
+#  define EXCEPTION_DECOD_NONE                     0x0        // none exception
+#  define EXCEPTION_DECOD_ILLEGAL_INSTRUCTION      0x1        // Instruction is illegal (no implemented)
+#  define EXCEPTION_DECOD_SYSCALL                  0x2        // System Call
+//#define EXCEPTION_DECOD_TRAP                     0x4        // L.trap or debug unit (note : must read SR !)
+
+#  define EXCEPTION_IFETCH_NONE                    0x0        // Fetch Unit generate none exception
+#  define EXCEPTION_IFETCH_INSTRUCTION_TLB         0x1        // ITLB miss
+#  define EXCEPTION_IFETCH_INSTRUCTION_PAGE        0x2        // No matching or page violation protection in pages tables
+#  define EXCEPTION_IFETCH_BUS_ERROR               0x3        // Access at a invalid physical address
+
+#  define EXCEPTION_USE_NONE                       0x0        // 
+#  define EXCEPTION_USE_ILLEGAL_INSTRUCTION        0x1        // illegal_instruction
+#  define EXCEPTION_USE_RANGE                      0x2        // range
+#  define EXCEPTION_USE_MEMORY_WITH_ALIGNMENT      0x3        // TLB miss, page fault, bus error, alignment
+#  define EXCEPTION_USE_MEMORY_WITHOUT_ALIGNMENT   0x4        // TLB miss, page fault, bus error
+#  define EXCEPTION_USE_SYSCALL                    0x5        // syscall
+#  define EXCEPTION_USE_TRAP                       0x6        // trap
+#  define EXCEPTION_USE_CUSTOM_0                   0x7        // 
+#  define EXCEPTION_USE_CUSTOM_1                   0x8        // 
+#  define EXCEPTION_USE_CUSTOM_2                   0x9        // 
+#  define EXCEPTION_USE_CUSTOM_3                   0xa        // 
+#  define EXCEPTION_USE_CUSTOM_4                   0xb        // 
+#  define EXCEPTION_USE_CUSTOM_5                   0xc        // 
+#  define EXCEPTION_USE_CUSTOM_6                   0xd        // 
+
+  //=======================================================[ icache ]=====
+
+  //--------------------------------------------------[ icache_type ]-----
+
+#  define SIZE_ICACHE_TYPE                              2
+
+#  define ICACHE_TYPE_LOAD                              0x0        // 0000
+#  define ICACHE_TYPE_LOCK                              0x1        // 0001
+#  define ICACHE_TYPE_INVALIDATE                        0x2        // 0010
+#  define ICACHE_TYPE_PREFETCH                          0x3        // 0011
+
+// just take the 2 less significative bits.
+#define operation_to_icache_type(x) (x&0x3)
+
+  //-------------------------------------------------[ icache_error ]-----
+
+#  define SIZE_ICACHE_ERROR                             1
+
+#  define ICACHE_ERROR_NONE                             0x0
+#  define ICACHE_ERROR_BUS_ERROR                        0x1
 
   //=======================================================[ dcache ]=====
@@ -377,4 +439,11 @@
 #  define SPR_MACHI                                2          // MAC High
 
+#  define NB_SPR_LOGIC                             2
+#  define LOG2_NB_SPR_LOGIC                        1
+  // SPR_LOGIC[0] = F
+  // SPR_LOGIC[1] = Carry, Overflow
+#  define SPR_LOGIC_SR_F                           0x0        // Status register bit F                   (size = 1)
+#  define SPR_LOGIC_SR_CY_OV                       0x1        // Status register bit overflow and carry  (size = 2)
+
   //----------------------------------------------[ spr_mode_access ]-----
 
@@ -385,44 +454,415 @@
 #  define SPR_ACCESS_MODE_READ_ONLY_COND           0x5        // 101 special read
 
+  //--------------------------------------------------------[ event ]-----
+#  define SIZE_EVENT_STATE                         2
+
+#  define EVENT_STATE_NO_EVENT                     0          // no event : current case
+#  define EVENT_STATE_EVENT                        1          // Have a event : make necessary to manage the event
+#  define EVENT_STATE_WAITEND                      2          // Wait end of manage event (restaure a good context)
+#  define EVENT_STATE_END                          3          // CPU can continue
+
+#  define SIZE_EVENT_TYPE                          3
+
+#  define EVENT_TYPE_NONE                          0          // no event
+#  define EVENT_TYPE_MISS_SPECULATION              1          // miss of speculation (load or branch miss speculation)
+#  define EVENT_TYPE_EXCEPTION                     2          // exception or interruption occure
+#  define EVENT_TYPE_BRANCH_NO_ACCURATE            3          // branch is no accurate (old speculation is a miss)
+#  define EVENT_TYPE_SPR_ACCESS                    4          // decod a mtspr or mfspr instruction
+#  define EVENT_TYPE_MSYNC                         5          // decod a memory   synchronization
+#  define EVENT_TYPE_PSYNC                         6          // decod a pipeline synchronization
+#  define EVENT_TYPE_CSYNC                         7          // decod a context  synchronization
+
+  //-------------------------------------------------[ branch_state ]-----
+#  define SIZE_BRANCH_STATE                        2
+
+#  define BRANCH_STATE_NONE                        0x0        // 0 0
+#  define BRANCH_STATE_NSPEC_TAKE                  0x1        // 0 1  -> incondionnal
+#  define BRANCH_STATE_SPEC_NTAKE                  0x2        // 1 0
+#  define BRANCH_STATE_SPEC_TAKE                   0x3        // 1 1
+
+  //---------------------------------------------[ branch_condition ]-----
+
+#  define SIZE_BRANCH_CONDITION                    4
+
+#  define BRANCH_CONDITION_NONE_WITHOUT_WRITE_STACK          0x0        // None condition (jump)
+#  define BRANCH_CONDITION_NONE_WITH_WRITE_STACK             0x8        // None condition (jump)
+#  define BRANCH_CONDITION_FLAG_UNSET                        0x2        // Branch if Flag is clear
+#  define BRANCH_CONDITION_FLAG_SET                          0x3        // Branch if Flag is set
+#  define BRANCH_CONDITION_READ_REGISTER_WITHOUT_WRITE_STACK 0x4        // Branch if a register is read
+#  define BRANCH_CONDITION_READ_REGISTER_WITH_WRITE_STACK    0xc        // Branch if a register is read
+#  define BRANCH_CONDITION_READ_STACK                        0xf        // Branch with pop  in stack pointer
+
+  //--------------------------------------------------[ instruction ]-----
+#  define NB_INSTRUCTION                           213        // 92 ORBIS, 30 ORFPX (15 simple, 15 double), 91 ORVDX (38 on byte, 41 on half, 12 independant format)
+
+  enum 
+    {
+      // ORBIS
+      INSTRUCTION_L_ADD,
+      INSTRUCTION_L_ADDC,
+      INSTRUCTION_L_ADDI,
+      INSTRUCTION_L_ADDIC,
+      INSTRUCTION_L_AND,
+      INSTRUCTION_L_ANDI,
+      INSTRUCTION_L_BF,
+      INSTRUCTION_L_BNF,
+      INSTRUCTION_L_CMOV,
+      INSTRUCTION_L_CSYNC,
+      INSTRUCTION_L_CUST1,
+      INSTRUCTION_L_CUST2,
+      INSTRUCTION_L_CUST3,
+      INSTRUCTION_L_CUST4,
+      INSTRUCTION_L_CUST5,
+      INSTRUCTION_L_CUST6,
+      INSTRUCTION_L_CUST7,
+      INSTRUCTION_L_CUST8,
+      INSTRUCTION_L_DIV,
+      INSTRUCTION_L_DIVU,
+      INSTRUCTION_L_EXTBS,
+      INSTRUCTION_L_EXTBZ,
+      INSTRUCTION_L_EXTHS,
+      INSTRUCTION_L_EXTHZ,
+      INSTRUCTION_L_EXTWS,
+      INSTRUCTION_L_EXTWZ,
+      INSTRUCTION_L_FF1,
+      INSTRUCTION_L_FL1,
+      INSTRUCTION_L_J,
+      INSTRUCTION_L_JAL,
+      INSTRUCTION_L_JALR,
+      INSTRUCTION_L_JR,
+      INSTRUCTION_L_LBS,
+      INSTRUCTION_L_LBZ,
+      INSTRUCTION_L_LD,
+      INSTRUCTION_L_LHS,
+      INSTRUCTION_L_LHZ,
+      INSTRUCTION_L_LWS,
+      INSTRUCTION_L_LWZ,
+      INSTRUCTION_L_MAC,
+      INSTRUCTION_L_MACI,
+      INSTRUCTION_L_MACRC,
+      INSTRUCTION_L_MFSPR,
+      INSTRUCTION_L_MOVHI,
+      INSTRUCTION_L_MSB,
+      INSTRUCTION_L_MSYNC,
+      INSTRUCTION_L_MTSPR,
+      INSTRUCTION_L_MUL,
+      INSTRUCTION_L_MULI,
+      INSTRUCTION_L_MULU,
+      INSTRUCTION_L_NOP,
+      INSTRUCTION_L_OR,
+      INSTRUCTION_L_ORI,
+      INSTRUCTION_L_PSYNC,
+      INSTRUCTION_L_RFE,
+      INSTRUCTION_L_ROR,
+      INSTRUCTION_L_RORI,
+      INSTRUCTION_L_SB,
+      INSTRUCTION_L_SD,
+      INSTRUCTION_L_SFEQ,
+      INSTRUCTION_L_SFEQI,
+      INSTRUCTION_L_SFGES,
+      INSTRUCTION_L_SFGESI,
+      INSTRUCTION_L_SFGEU,
+      INSTRUCTION_L_SFGEUI,
+      INSTRUCTION_L_SFGTS,
+      INSTRUCTION_L_SFGTSI,
+      INSTRUCTION_L_SFGTU,
+      INSTRUCTION_L_SFGTUI,
+      INSTRUCTION_L_SFLES,
+      INSTRUCTION_L_SFLESI,
+      INSTRUCTION_L_SFLEU,
+      INSTRUCTION_L_SFLEUI,
+      INSTRUCTION_L_SFLTS,
+      INSTRUCTION_L_SFLTSI,
+      INSTRUCTION_L_SFLTU,
+      INSTRUCTION_L_SFLTUI,
+      INSTRUCTION_L_SFNE,
+      INSTRUCTION_L_SFNEI,
+      INSTRUCTION_L_SH,
+      INSTRUCTION_L_SLL,
+      INSTRUCTION_L_SLLI,
+      INSTRUCTION_L_SRA,
+      INSTRUCTION_L_SRAI,
+      INSTRUCTION_L_SRL,
+      INSTRUCTION_L_SRLI,
+      INSTRUCTION_L_SUB,
+      INSTRUCTION_L_SW,
+      INSTRUCTION_L_SYS,
+      INSTRUCTION_L_TRAP,
+      INSTRUCTION_L_XOR,
+      INSTRUCTION_L_XORI,
+      // ORFPX
+      INSTRUCTION_LF_ADD_D,
+      INSTRUCTION_LF_ADD_S,
+      INSTRUCTION_LF_CUST1_D,
+      INSTRUCTION_LF_CUST1_S,
+      INSTRUCTION_LF_DIV_D,
+      INSTRUCTION_LF_DIV_S,
+      INSTRUCTION_LF_FTOI_D,
+      INSTRUCTION_LF_FTOI_S,
+      INSTRUCTION_LF_ITOF_D,
+      INSTRUCTION_LF_ITOF_S,
+      INSTRUCTION_LF_MADD_D,
+      INSTRUCTION_LF_MADD_S,
+      INSTRUCTION_LF_MUL_D,
+      INSTRUCTION_LF_MUL_S,
+      INSTRUCTION_LF_REM_D,
+      INSTRUCTION_LF_REM_S,
+      INSTRUCTION_LF_SFEQ_D,
+      INSTRUCTION_LF_SFEQ_S,
+      INSTRUCTION_LF_SFGE_D,
+      INSTRUCTION_LF_SFGE_S,
+      INSTRUCTION_LF_SFGT_D,
+      INSTRUCTION_LF_SFGT_S,
+      INSTRUCTION_LF_SFLE_D,
+      INSTRUCTION_LF_SFLE_S,
+      INSTRUCTION_LF_SFLT_D,
+      INSTRUCTION_LF_SFLT_S,
+      INSTRUCTION_LF_SFNE_D,
+      INSTRUCTION_LF_SFNE_S,
+      INSTRUCTION_LF_SUB_D,
+      INSTRUCTION_LF_SUB_S,
+      // ORVDX
+      INSTRUCTION_LV_ADD_B,
+      INSTRUCTION_LV_ADD_H,
+      INSTRUCTION_LV_ADDS_B,
+      INSTRUCTION_LV_ADDS_H,
+      INSTRUCTION_LV_ADDU_B,
+      INSTRUCTION_LV_ADDU_H,
+      INSTRUCTION_LV_ADDUS_B,
+      INSTRUCTION_LV_ADDUS_H,
+      INSTRUCTION_LV_ALL_EQ_B,
+      INSTRUCTION_LV_ALL_EQ_H,
+      INSTRUCTION_LV_ALL_GE_B,
+      INSTRUCTION_LV_ALL_GE_H,
+      INSTRUCTION_LV_ALL_GT_B,
+      INSTRUCTION_LV_ALL_GT_H,
+      INSTRUCTION_LV_ALL_LE_B,
+      INSTRUCTION_LV_ALL_LE_H,
+      INSTRUCTION_LV_ALL_LT_B,
+      INSTRUCTION_LV_ALL_LT_H,
+      INSTRUCTION_LV_ALL_NE_B,
+      INSTRUCTION_LV_ALL_NE_H,
+      INSTRUCTION_LV_AND,
+      INSTRUCTION_LV_ANY_EQ_B,
+      INSTRUCTION_LV_ANY_EQ_H,
+      INSTRUCTION_LV_ANY_GE_B,
+      INSTRUCTION_LV_ANY_GE_H,
+      INSTRUCTION_LV_ANY_GT_B,
+      INSTRUCTION_LV_ANY_GT_H,
+      INSTRUCTION_LV_ANY_LE_B,
+      INSTRUCTION_LV_ANY_LE_H,
+      INSTRUCTION_LV_ANY_LT_B,
+      INSTRUCTION_LV_ANY_LT_H,
+      INSTRUCTION_LV_ANY_NE_B,
+      INSTRUCTION_LV_ANY_NE_H,
+      INSTRUCTION_LV_AVG_B,
+      INSTRUCTION_LV_AVG_H,
+      INSTRUCTION_LV_CMP_EQ_B,
+      INSTRUCTION_LV_CMP_EQ_H,
+      INSTRUCTION_LV_CMP_GE_B,
+      INSTRUCTION_LV_CMP_GE_H,
+      INSTRUCTION_LV_CMP_GT_B,
+      INSTRUCTION_LV_CMP_GT_H,
+      INSTRUCTION_LV_CMP_LE_B,
+      INSTRUCTION_LV_CMP_LE_H,
+      INSTRUCTION_LV_CMP_LT_B,
+      INSTRUCTION_LV_CMP_LT_H,
+      INSTRUCTION_LV_CMP_NE_B,
+      INSTRUCTION_LV_CMP_NE_H,
+      INSTRUCTION_LV_CUST1,
+      INSTRUCTION_LV_CUST2,
+      INSTRUCTION_LV_CUST3,
+      INSTRUCTION_LV_CUST4,
+      INSTRUCTION_LV_MADDS_H,
+      INSTRUCTION_LV_MAX_B,
+      INSTRUCTION_LV_MAX_H,
+      INSTRUCTION_LV_MERGE_B,
+      INSTRUCTION_LV_MERGE_H,
+      INSTRUCTION_LV_MIN_B,
+      INSTRUCTION_LV_MIN_H,
+      INSTRUCTION_LV_MSUBS_H,
+      INSTRUCTION_LV_MULS_H,
+      INSTRUCTION_LV_NAND,
+      INSTRUCTION_LV_NOR,
+      INSTRUCTION_LV_OR,
+      INSTRUCTION_LV_PACK_B,
+      INSTRUCTION_LV_PACK_H,
+      INSTRUCTION_LV_PACKS_B,
+      INSTRUCTION_LV_PACKS_H,
+      INSTRUCTION_LV_PACKUS_B,
+      INSTRUCTION_LV_PACKUS_H,
+      INSTRUCTION_LV_PERM_N,
+      INSTRUCTION_LV_RL_B,
+      INSTRUCTION_LV_RL_H,
+      INSTRUCTION_LV_SLL,
+      INSTRUCTION_LV_SLL_B,
+      INSTRUCTION_LV_SLL_H,
+      INSTRUCTION_LV_SRA_B,
+      INSTRUCTION_LV_SRA_H,
+      INSTRUCTION_LV_SRL,
+      INSTRUCTION_LV_SRL_B,
+      INSTRUCTION_LV_SRL_H,
+      INSTRUCTION_LV_SUB_B,
+      INSTRUCTION_LV_SUB_H,
+      INSTRUCTION_LV_SUBS_B,
+      INSTRUCTION_LV_SUBS_H,
+      INSTRUCTION_LV_SUBU_B,
+      INSTRUCTION_LV_SUBU_H,
+      INSTRUCTION_LV_SUBUS_B,
+      INSTRUCTION_LV_SUBUS_H,
+      INSTRUCTION_LV_UNPACK_B,
+      INSTRUCTION_LV_UNPACK_H,
+      INSTRUCTION_LV_XOR
+    };
+
+  //-----------------------------------------------[ Code Operation ]-----
+
+#  define MAX_OPCOD_0                              64            // Instructions with immediat
+#  define MAX_OPCOD_1                              64            // Instruction ORFPX32/64                  
+#  define MAX_OPCOD_2                              256           // Instruction ORVDX64
+#  define MAX_OPCOD_3                              256           // Instructions Register-Register
+#  define MAX_OPCOD_4                              32            // Instructions "set flag" with register
+#  define MAX_OPCOD_5                              32            // Instructions "set flag" with immediat
+#  define MAX_OPCOD_6                              4             // Instruction Shift/Rotate with immediat
+#  define MAX_OPCOD_7                              16            // Instructions multiply with HI-LO
+#  define MAX_OPCOD_8                              2             // Instructions acces at HI-LO 
+#  define MAX_OPCOD_9                              8             // Instructions special	
+#  define MAX_OPCOD_10                             4             // Instructions no operation
+#  define MAX_OPCOD_11                             4             // Instruction Shift/Rotate with register
+#  define MAX_OPCOD_12                             4             // Instructions extend
+#  define MAX_OPCOD_13                             4             // Instructions extend (64b)
+
+// OPCOD_0                                         - [31:26]      Instructions with immediat
+#  define OPCOD_L_J                                0x00          // 000_000
+#  define OPCOD_L_JAL                              0x01          // 000_001
+#  define OPCOD_L_BNF                              0x03          // 000_011
+#  define OPCOD_L_BF                               0x04          // 000_100
+#  define OPCOD_L_RFE                              0x09          // 001_001
+#  define OPCOD_L_JR                               0x11          // 010_001
+#  define OPCOD_L_JALR                             0x12          // 010_010
+#  define OPCOD_L_MACI                             0x13          // 010_011
+#  define OPCOD_L_CUST1                            0x1c          // 011_100
+#  define OPCOD_L_CUST2                            0x1d          // 011_101
+#  define OPCOD_L_CUST3                            0x1e          // 011_110
+#  define OPCOD_L_CUST4                            0x1f          // 011_111
+#  define OPCOD_L_CUST5                            0x3c          // 111_100
+#  define OPCOD_L_CUST6                            0x3d          // 111_101
+#  define OPCOD_L_CUST7                            0x3e          // 111_110
+#  define OPCOD_L_CUST8                            0x3f          // 111_111
+#  define OPCOD_L_LD                               0x20          // 100_000
+#  define OPCOD_L_LWZ                              0x21          // 100_001
+#  define OPCOD_L_LWS                              0x22          // 100_010
+#  define OPCOD_L_LBZ                              0x23          // 100_011
+#  define OPCOD_L_LBS                              0x24          // 100_100
+#  define OPCOD_L_LHZ                              0x25          // 100_101
+#  define OPCOD_L_LHS                              0x26          // 100_110
+#  define OPCOD_L_ADDI                             0x27          // 100_111
+#  define OPCOD_L_ADDIC                            0x28          // 101_000
+#  define OPCOD_L_ANDI                             0x29          // 101_001
+#  define OPCOD_L_ORI                              0x2a          // 101_010
+#  define OPCOD_L_XORI                             0x2b          // 101_011
+#  define OPCOD_L_MULI                             0x2c          // 101_100
+#  define OPCOD_L_MFSPR                            0x2d          // 101_101
+#  define OPCOD_L_MTSPR                            0x30          // 110_000
+#  define OPCOD_L_SD                               0x34          // 110_100
+#  define OPCOD_L_SW                               0x35          // 110_101
+#  define OPCOD_L_SB                               0x36          // 110_110
+#  define OPCOD_L_SH                               0x37          // 110_111
+				                   
+#  define OPCOD_1                                  0x33          // 110_011         // Instruction ORFPX32/64
+#  define OPCOD_2                                  0x0a          // 001_010         // Instruction ORVDX64
+#  define OPCOD_3                                  0x38          // 111_000         // Instructions Register-Register
+#  define OPCOD_4                                  0x39          // 111_001         // Instructions "set flag" with register
+#  define OPCOD_5                                  0x2f          // 101_111         // Instructions "set flag" with immediat
+#  define OPCOD_6                                  0x2e          // 101_110         // Instruction Shift/Rotate with immediat
+#  define OPCOD_7                                  0x31          // 110_001         // Instructions multiply with HI-LO
+#  define OPCOD_8                                  0x06          // 000_110         // Instructions acces at HI-LO 
+#  define OPCOD_9                                  0x08          // 001_000         // Instructions special
+#  define OPCOD_10                                 0x05          // 000_101         // Instructions no operation
+				                   
+// OPCOD_3         instructions                    - [9:8] [3:0]  Instructions Register-Register
+#  define OPCOD_L_ADD                              0x00          // 00_0000
+#  define OPCOD_L_ADDC                             0x01          // 00_0001
+#  define OPCOD_L_SUB                              0x02          // 00_0010
+#  define OPCOD_L_AND                              0x03          // 00_0011
+#  define OPCOD_L_OR                               0x04          // 00_0100
+#  define OPCOD_L_XOR                              0x05          // 00_0101
+#  define OPCOD_L_CMOV                             0x0e          // 00_1110
+#  define OPCOD_L_FF1                              0x0f          // 00_1111
+#  define OPCOD_L_FL1                              0x1f          // 01_1111
+#  define OPCOD_L_MUL                              0x36          // 11_0110
+#  define OPCOD_L_DIV                              0x39          // 11_1001
+#  define OPCOD_L_DIVU                             0x3a          // 11_1010
+#  define OPCOD_L_MULU                             0x3b          // 11_1011
+				                   
+#  define OPCOD_11                                 0x8           // 1000          // Instruction Shift/Rotate with register
+#  define OPCOD_12                                 0xc           // 1100          // Instructions extend
+#  define OPCOD_13                                 0xd           // 1101          // Instructions extend (64b)
+				                   
+// OPCOD_4         instructions                    - [25:21]      Instructions "set flag" with register
+#  define OPCOD_L_SFEQ                             0x00          // 00000
+#  define OPCOD_L_SFNE                             0x01          // 00001
+#  define OPCOD_L_SFGTU                            0x02          // 00010
+#  define OPCOD_L_SFGEU                            0x03          // 00011
+#  define OPCOD_L_SFLTU                            0x04          // 00100
+#  define OPCOD_L_SFLEU                            0x05          // 00101
+#  define OPCOD_L_SFGTS                            0x0a          // 01010
+#  define OPCOD_L_SFGES                            0x0b          // 01011
+#  define OPCOD_L_SFLTS                            0x0c          // 01100
+#  define OPCOD_L_SFLES                            0x0d          // 01101
+				                   
+// OPCOD_5         instructions                    - [25:21]      Instructions "set flag" with immediat
+#  define OPCOD_L_SFEQI                            0x00          // 00000
+#  define OPCOD_L_SFNEI                            0x01          // 00001
+#  define OPCOD_L_SFGTUI                           0x02          // 00010
+#  define OPCOD_L_SFGEUI                           0x03          // 00011
+#  define OPCOD_L_SFLTUI                           0x04          // 00100
+#  define OPCOD_L_SFLEUI                           0x05          // 00101
+#  define OPCOD_L_SFGTSI                           0x0a          // 01010
+#  define OPCOD_L_SFGESI                           0x0b          // 01011
+#  define OPCOD_L_SFLTSI                           0x0c          // 01100
+#  define OPCOD_L_SFLESI                           0x0d          // 01101
+				                   
+// OPCOD_6         instructions                    - [7:6]        Instruction Shift/Rotate with immediat
+#  define OPCOD_L_SLLI                             0x0           // 00
+#  define OPCOD_L_SRLI                             0x1           // 01
+#  define OPCOD_L_SRAI                             0x2           // 10
+#  define OPCOD_L_RORI                             0x3           // 11
+				                   
+// OPCOD_7         instructions                    - [3:0]        Instructions multiply with HI-LO
+#  define OPCOD_L_MAC                              0x1           // 0001
+#  define OPCOD_L_MSB                              0x2           // 0010
+				                   
+// OPCOD_8         instructions                    - [17]         Instructions acces at HI-LO 
+#  define OPCOD_L_MOVHI                            0x0           // 0
+#  define OPCOD_L_MACRC                            0x1           // 1
+
+// OPCOD_9         instructions                    - [25:23]      Instruction special
+#  define OPCOD_L_SYS                              0x0           // 000
+#  define OPCOD_L_TRAP                             0x2           // 010
+#  define OPCOD_L_MSYNC                            0x4           // 100
+#  define OPCOD_L_PSYNC                            0x5           // 101
+#  define OPCOD_L_CSYNC                            0x6           // 110
+
+// OPCOD_10        instructions                    - [25:24]      Instruction no operation
+#  define OPCOD_L_NOP                              0x1           // 01
+				                   
+// OPCOD_11        instructions                    - [7:6]        Instruction Shift/Rotate with register
+#  define OPCOD_L_SLL                              0x0           // 00
+#  define OPCOD_L_SRL                              0x1           // 01
+#  define OPCOD_L_SRA                              0x2           // 10
+#  define OPCOD_L_ROR                              0x3           // 11
+				                   
+// OPCOD_12        instructions                    - [9:6]          Instructions extend
+#  define OPCOD_L_EXTHS                            0x0           // 0000
+#  define OPCOD_L_EXTHZ                            0x2           // 0010
+#  define OPCOD_L_EXTBS                            0x1           // 0001
+#  define OPCOD_L_EXTBZ                            0x3           // 0011
+				                   
+// OPCOD_13        instructions                    - [9:6]        Instructions extend (64b)
+#  define OPCOD_L_EXTWS                            0x0           // 0000
+#  define OPCOD_L_EXTWZ                            0x1           // 0001
+
   /*
-#define                 _size_instruction             32
-#define                 _size_instruction_log2        5
-
-  //----------------------------------------------------[ Operation ]-----
-// #define                 _nb_operation                 32
-// #define                 _size_operation               5
-
-#define                 _operation_none               0x0
-#define                 _operation_l_adds             0x1
-#define                 _operation_l_addu             0x2
-#define                 _operation_l_subs             0x3
-#define                 _operation_l_and              0x4
-#define                 _operation_l_or               0x5
-#define                 _operation_l_xor              0x6
-#define                 _operation_l_cmove            0x7
-#define                 _operation_l_read_imm         0x8
-#define                 _operation_l_movhi            0x9
-#define                 _operation_l_muls             0xa
-#define                 _operation_l_mulu             0xb
-#define                 _operation_l_divs             0xc
-#define                 _operation_l_divu             0xd
-#define                 _operation_l_exts             0xe
-#define                 _operation_l_extz             0xf
-#define                 _operation_l_ff1              0x10
-#define                 _operation_l_fl1              0x11
-#define                 _operation_l_sll              0x12
-#define                 _operation_l_sla              0x13
-#define                 _operation_l_srl              0x14
-#define                 _operation_l_ror              0x15
-#define                 _operation_l_cmp_eq           0x16
-#define                 _operation_l_cmp_ne           0x17
-#define                 _operation_l_cmp_ges          0x18
-#define                 _operation_l_cmp_geu          0x19
-#define                 _operation_l_cmp_gts          0x1a
-#define                 _operation_l_cmp_gtu          0x1b
-#define                 _operation_l_cmp_les          0x1c
-#define                 _operation_l_cmp_leu          0x1d
-#define                 _operation_l_cmp_lts          0x1e
-#define                 _operation_l_cmp_ltu          0x1f
 
   //--------------------------------------------------[ destination ]-----
@@ -466,9 +906,4 @@
 #define                 mask_CONDITION_STACK          0x8           // Branch with pop  in stack pointer
 
-  //-------------------------------------------------[ branch_state ]-----
-#define                 cst_BRANCH_STATE_NONE         0x0           // 0 0
-#define                 cst_BRANCH_STATE_NSPEC_TAKE   0x1           // 0 1  -> incondionnal
-#define                 cst_BRANCH_STATE_SPEC_NTAKE   0x2           // 1 0
-#define                 cst_BRANCH_STATE_SPEC_TAKE    0x3           // 1 1
   */
 
@@ -620,213 +1055,4 @@
 
   /*
-//----------------------------------------------------
-// Code Operation (before decode)
-//----------------------------------------------------
-
-// Codop                        - [31:26]      Instructions with immediat
-#define OPCOD_L_J             0x00          // 000_000
-#define OPCOD_L_JAL           0x01          // 000_001
-#define OPCOD_L_BNF           0x03          // 000_011
-#define OPCOD_L_BF            0x04          // 000_100
-#define OPCOD_L_RFE           0x09          // 001_001
-#define OPCOD_L_JR            0x11          // 010_001
-#define OPCOD_L_JALR          0x12          // 010_010
-#define OPCOD_L_MACI          0x13          // 010_011
-#define OPCOD_L_CUST1         0x1c          // 011_100
-#define OPCOD_L_CUST2         0x1d          // 011_101
-#define OPCOD_L_CUST3         0x1e          // 011_110
-#define OPCOD_L_CUST4         0x1f          // 011_111
-#define OPCOD_L_CUST5         0x3c          // 111_100
-#define OPCOD_L_CUST6         0x3d          // 111_101
-#define OPCOD_L_CUST7         0x3e          // 111_110
-#define OPCOD_L_CUST8         0x3f          // 111_111
-#define OPCOD_L_LD            0x20          // 100_000
-#define OPCOD_L_LWZ           0x21          // 100_001
-#define OPCOD_L_LWS           0x22          // 100_010
-#define OPCOD_L_LBZ           0x23          // 100_011
-#define OPCOD_L_LBS           0x24          // 100_100
-#define OPCOD_L_LHZ           0x25          // 100_101
-#define OPCOD_L_LHS           0x26          // 100_110
-#define OPCOD_L_ADDI          0x27          // 100_111
-#define OPCOD_L_ADDIC         0x28          // 101_000
-#define OPCOD_L_ANDI          0x29          // 101_001
-#define OPCOD_L_ORI           0x2a          // 101_010
-#define OPCOD_L_XORI          0x2b          // 101_011
-#define OPCOD_L_MULI          0x2c          // 101_100
-#define OPCOD_L_MFSPR         0x2d          // 101_101
-#define OPCOD_L_MTSPR         0x30          // 110_000
-#define OPCOD_L_SD            0x32          // 110_010
-#define OPCOD_L_SW            0x35          // 110_101
-#define OPCOD_L_SB            0x36          // 110_110
-#define OPCOD_L_SH            0x37          // 110_111
-
-#define OPCOD_INST_LV         0x0a          // 001_010         // Instruction ORVDX64
-#define OPCOD_INST_LF         0x33          // 110_011         // Instruction ORFPX32/64
-
-#define OPCOD_SPECIAL         0x38          // 111_000         // Instructions Register-Register
-#define OPCOD_SPECIAL_1       0x39          // 111_001         // Instructions "set flag" with register
-#define OPCOD_SPECIAL_2       0x2f          // 101_111         // Instructions "set flag" with immediat
-#define OPCOD_SPECIAL_6       0x2e          // 101_110         // Instruction Shift/Rotate with immediat
-#define OPCOD_SPECIAL_7       0x31          // 110_001         // Instructions multiply with HI-LO
-#define OPCOD_SPECIAL_8       0x06          // 000_110         // Instructions acces at HI-LO 
-
-// OPCOD_SPECIAL   instructions - [9:8] [3:0]  Instructions Register-Register
-#define OPCOD_L_ADD           0x00          // 00_0000
-#define OPCOD_L_ADDC          0x01          // 00_0001
-#define OPCOD_L_SUB           0x02          // 00_0010
-#define OPCOD_L_AND           0x03          // 00_0011
-#define OPCOD_L_OR            0x04          // 00_0100
-#define OPCOD_L_XOR           0x05          // 00_0101
-#define OPCOD_L_CMOV          0x0e          // 00_1110
-#define OPCOD_L_FF1           0x0f          // 00_1111
-#define OPCOD_L_FL1           0x1f          // 01_1111
-#define OPCOD_L_MUL           0x36          // 11_0110
-#define OPCOD_L_DIV           0x39          // 11_1001
-#define OPCOD_L_DIVU          0x3a          // 11_1010
-#define OPCOD_L_MULU          0x3b          // 11_1011
-
-#define OPCOD_SPECIAL_3       0xc           // 1100          // Instructions extend
-#define OPCOD_SPECIAL_4       0xd           // 1101          // Instructions extend (64b)
-#define OPCOD_SPECIAL_5       0x8           // 1000          // Instruction Shift/Rotate with register
-
-// OPCOD_SPECIAL_1 instructions - [25:21]      Instructions "set flag" with register
-#define OPCOD_L_SFEQ          0x00          // 00000
-#define OPCOD_L_SFNE          0x01          // 00001
-#define OPCOD_L_SFGTU         0x02          // 00010
-#define OPCOD_L_SFGEU         0x03          // 00011
-#define OPCOD_L_SFLTU         0x04          // 00100
-#define OPCOD_L_SFLEU         0x05          // 00101
-#define OPCOD_L_SFGTS         0x0a          // 01010
-#define OPCOD_L_SFGES         0x0b          // 01011
-#define OPCOD_L_SFLTS         0x0c          // 01100
-#define OPCOD_L_SFLES         0x0d          // 01101
-
-// OPCOD_SPECIAL_2 instructions - [25:21]      Instructions "set flag" with immediat
-#define OPCOD_L_SFEQI         0x00          // 00000
-#define OPCOD_L_SFNEI         0x01          // 00001
-#define OPCOD_L_SFGTUI        0x02          // 00010
-#define OPCOD_L_SFGEUI        0x03          // 00011
-#define OPCOD_L_SFLTUI        0x04          // 00100
-#define OPCOD_L_SFLEUI        0x05          // 00101
-#define OPCOD_L_SFGTSI        0x0a          // 01010
-#define OPCOD_L_SFGESI        0x0b          // 01011
-#define OPCOD_L_SFLTSI        0x0c          // 01100
-#define OPCOD_L_SFLESI        0x0d          // 01101
-
-// OPCOD_SPECIAL_3 instructions - [9:6]          Instructions extend
-#define OPCOD_L_EXTHS         0x0           // 0000
-#define OPCOD_L_EXTHZ         0x2           // 0010
-#define OPCOD_L_EXTBS         0x1           // 0001
-#define OPCOD_L_EXTBZ         0x3           // 0011
-
-// OPCOD_SPECIAL_4 instructions - [9:6]        Instructions extend (64b)
-#define OPCOD_L_EXTWS         0x0           // 0000
-#define OPCOD_L_EXTWZ         0x1           // 0001
-
-// OPCOD_SPECIAL_5 instructions - [7:6]        Instruction Shift/Rotate with register
-#define OPCOD_L_SLL           0x0           // 00
-#define OPCOD_L_SRL           0x1           // 01
-#define OPCOD_L_SRA           0x2           // 10
-#define OPCOD_L_ROR           0x3           // 11
-
-// OPCOD_SPECIAL_6 instructions - [7:6]        Instruction Shift/Rotate with immediat
-#define OPCOD_L_SLLI          0x0           // 00
-#define OPCOD_L_SRLI          0x1           // 01
-#define OPCOD_L_SRAI          0x2           // 10
-#define OPCOD_L_RORI          0x3           // 11
-
-// OPCOD_SPECIAL_7 instructions - [3:0]        Instructions multiply with HI-LO
-#define OPCOD_L_MAC           0x1           // 0001
-#define OPCOD_L_MSB           0x2           // 0010
-
-// OPCOD_SPECIAL_8 instructions - [17]         Instructions acces at HI-LO 
-#define OPCOD_L_MOVHI         0x0           // 0
-#define OPCOD_L_MACRC         0x1           // 1
-
-// Particular case                             Instructions systems
-#define OPCOD_L_MSYNC         0x22000000
-#define OPCOD_L_CSYNC         0x23000000
-#define OPCOD_L_PSYNC         0x22800000
-#define OPCOD_L_NOP           0x1500
-#define OPCOD_L_SYS           0x2000
-#define OPCOD_L_TRAP          0x2100
-
-//----------------------------------------------------
-// Code Operation (after decode)
-//----------------------------------------------------
-
-typedef enum
-  {
-    // ##### WARNING : This opcode must be the first#####
-    INST_L_NO_IMPLEMENTED ,         // Operation is not implemented
-
-    INST_L_ADD            ,         // L.ADD    , L.ADDI   , L.ADDC   , L.ADDIC
-    INST_L_AND            ,         // L.AND    , L.ANDI
-    INST_L_OR             ,         // L.OR     , L.ORI
-    INST_L_XOR            ,         // L.XOR    , L.XORI
-    INST_L_CMOV           ,         // L.CMOV
-    INST_L_SUB            ,         // L.SUB
-    INST_L_FF1            ,         // L.FF1
-    INST_L_EXTBS          ,         // L.EXTBS
-    INST_L_EXTBZ          ,         // L.EXTBZ
-    INST_L_EXTHS          ,         // L.EXTHS
-    INST_L_EXTHZ          ,         // L.EXTHZ
-    INST_L_EXTWS          ,         // L.EXTWS
-    INST_L_EXTWZ          ,         // L.EXTWZ
-    INST_L_e              ,         // 
-    INST_L_f              ,         // 
-    INST_L_MUL            ,         // L.MUL    , L.MULI
-    INST_L_MULU           ,         // L.MULU
-    INST_L_DIV            ,         // L.DIV
-    INST_L_DIVU           ,         // L.DIVU
-    INST_L_SLL            ,         // L.SLL    , L.SLLI
-    INST_L_SRL            ,         // L.SRL    , L.SRLI 
-    INST_L_SRA            ,         // L.SRA    , L.SRAI
-    INST_L_ROR            ,         // L.ROR    , L.RORI
-    INST_L_SFGES          ,         // L.SFGES  , L.SFGESI
-    INST_L_SFGEU          ,         // L.SFGEU  , L.SFGEUI
-    INST_L_SFGTS          ,         // L.SFGTS  , L.SFGTSI
-    INST_L_SFGTU          ,         // L.SFGTU  , L.SFGTUI
-    INST_L_SFLES          ,         // L.SFLES  , L.SFLESI
-    INST_L_SFLEU          ,         // L.SFLEU  , L.SFLEUI
-    INST_L_SFLTS          ,         // L.SFLTS  , L.SFLTSI
-    INST_L_SFLTU          ,         // L.SFLTU  , L.SFLTUI
-    INST_L_SFEQ           ,         // L.SFEQ   , L.SFEQI
-    INST_L_SFNE           ,         // L.SFNE   , L.SFNEI
-    INST_L_READ           ,         // L.BNF    , L.BF     , L.JR
-    INST_L_MOVHI          ,         // L.MOVI
-    INST_L_CSYNC          ,         // L.CSYNC
-    INST_L_MSYNC          ,         // L.MSYNC
-    INST_L_PSYNC          ,         // L.PSYNC
-    INST_L_RFE            ,         // L.RFE
-    INST_L_MAC            ,         // L.MAC    , L.MACI
-    INST_L_MSB            ,         // L.MSB
-    INST_L_MACRC          ,         // L.MACRC
-    INST_L_2b             ,         //
-    INST_L_MEMB           ,         // L.LBS    , L.LBZ    , L.SB  
-    INST_L_MEMH           ,         // L.LHS    , L.LHZ    , L.SH 
-    INST_L_MEMW           ,         // L.LWS    , L.LWZ    , L.SW  
-    INST_L_MEMD           ,         // L.LD                , L.SD  
-    INST_L_CUST1          ,         // L.CUST1
-    INST_L_CUST2          ,         // L.CUST2
-    INST_L_CUST3          ,         // L.CUST3
-    INST_L_CUST4          ,         // L.CUST4
-    INST_L_CUST5          ,         // L.CUST5
-    INST_L_CUST6          ,         // L.CUST6 
-    INST_L_CUST7          ,         // L.CUST7
-    INST_L_CUST8          ,         // L.CUST8
-    INST_L_38             ,         //
-    INST_L_39             ,         //
-    INST_L_3a             ,         //
-    INST_L_3b             ,         //
-    INST_L_3c             ,         //  
-    INST_L_3d             ,         //  
-    INST_L_3e             ,         //  
-    INST_NOP                        // L.NOP
-  } opcod_t;
-
-#define LOG2_NB_INST_L        6
-#define      NB_INST_L        64 // +1 -> INST_L_NO_IMPLEMENTED
-//#define      NB_INST_L        (INST_L_NO_IMPLEMENTED+1)
   */
 
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Debug_component.h
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Debug_component.h	(revision 77)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Debug_component.h	(revision 78)
@@ -2,48 +2,74 @@
 #define Debug_component_H
 
-#define DEBUG_Behavioural                                         false
-#define   DEBUG_Generic                                           false
-#define     DEBUG_Counter                                         false 
-#define     DEBUG_Group                                           false
-#define     DEBUG_Queue                                           false 
-#define     DEBUG_Queue_Control                                   false 
-#define     DEBUG_Shifter                                         false
-#define     DEBUG_RegisterFile                                    false
-#define       DEBUG_RegisterFile_Monolithic                       false 
-#define       DEBUG_RegisterFile_Multi_Banked                     false
-#define     DEBUG_Select                                          false
-#define       DEBUG_Select_Priority_Fixed                         false 
-#define     Debug_Victim                                          false
-#define       DEBUG_Victim_Pseudo_LRU                             false
-#define   DEBUG_Core                                              false
-#define     DEBUG_Multi_Execute_loop                              false
-#define       DEBUG_Execute_loop				  false
-#define         DEBUG_Multi_Execute_unit                          false
-#define           DEBUG_Execute_unit                              false
-#define             DEBUG_Functionnal_unit                        false
-#define             DEBUG_Load_store_unit                         false
-#define         DEBUG_Multi_Read_unit				  false
-#define           DEBUG_Read_unit				  false
-#define             DEBUG_Read_queue                              false
-#define             DEBUG_Reservation_station                     false
-#define         DEBUG_Multi_Write_unit				  false
-#define           DEBUG_Write_unit				  false
-#define             DEBUG_Execute_queue                           false
-#define             DEBUG_Write_queue                             false
-#define         DEBUG_Network                                     true
-#define           DEBUG_Execution_unit_to_Write_unit              true
-#define           DEBUG_Read_unit_to_Execution_unit               true
-#define         DEBUG_Register_unit				  false
-#define           DEBUG_Register_unit_Glue			  false
-#define     DEBUG_Multi_Front_end                                 false
-#define       DEBUG_Front_end                                     false
-#define         DEBUG_Prediction_unit                             false
-#define           DEBUG_Direction                                 false
-#define             DEBUG_Meta_Predictor                          false
-#define               DEBUG_Meta_Predictor_Glue                   false
-#define                 DEBUG_Two_Level_Branch_Predictor          false
-#define                   DEBUG_Two_Level_Branch_Predictor_Glue   false 
-#define                   DEBUG_Branch_History_Table              false
-#define                   DEBUG_Pattern_History_Table             false
+#  define DEBUG_true                                                true 
+#  define DEBUG_false                                               false
 
+#  define DEBUG_Behavioural                                         false
+#  define   DEBUG_Generic                                           false
+#  define     DEBUG_Counter                                         false 
+#  define     DEBUG_Queue                                           false 
+#  define     DEBUG_Queue_Control                                   false 
+#  define     DEBUG_RegisterFile                                    false
+#  define       DEBUG_RegisterFile_Monolithic                       false 
+#  define       DEBUG_RegisterFile_Multi_Banked                     false
+#  define     DEBUG_Select                                          false
+#  define       DEBUG_Select_Priority_Fixed                         false 
+#  define     DEBUG_Shifter                                         false
+#  define     DEBUG_Sort                                            false
+#  define     DEBUG_Victim                                          false
+#  define       DEBUG_Victim_Pseudo_LRU                             false
+#  define   DEBUG_Core                                              false
+#  define     DEBUG_Multi_Execute_loop                              false
+#  define       DEBUG_Execute_loop                                  false
+#  define         DEBUG_Multi_Execute_unit                          false
+#  define           DEBUG_Execute_unit                              false
+#  define             DEBUG_Functionnal_unit                        false
+#  define             DEBUG_Load_store_unit                         false
+#  define         DEBUG_Multi_Read_unit                             false
+#  define           DEBUG_Read_unit                                 false
+#  define             DEBUG_Read_queue                              false
+#  define             DEBUG_Reservation_station                     false
+#  define         DEBUG_Multi_Write_unit                            false
+#  define           DEBUG_Write_unit                                false
+#  define             DEBUG_Execute_queue                           false
+#  define             DEBUG_Write_queue                             false
+#  define         DEBUG_Network                                     false
+#  define           DEBUG_Execution_unit_to_Write_unit              false
+#  define           DEBUG_Read_unit_to_Execution_unit               false
+#  define         DEBUG_Register_unit                               false
+#  define           DEBUG_Register_unit_Glue                        false
+#  define     DEBUG_Multi_Front_end                                 false
+#  define       DEBUG_Front_end                                     false
+#  define         DEBUG_Decod_unit                                  false
+#  define           DEBUG_Decod                                     false
+#  define         DEBUG_Ifetch_unit                                 false
+#  define           DEBUG_Address_management                        false
+#  define           DEBUG_Ifetch_queue                              false
+#  define           DEBUG_Ifetch_unit_Glue                          false
+#  define         DEBUG_Prediction_unit                             false
+#  define           DEBUG_Branch_Target_Buffer                      false
+#  define             DEBUG_Branch_Target_Buffer_Glue               false
+#  define             DEBUG_Branch_Target_Buffer_Register           false
+#  define           DEBUG_Direction                                 false
+#  define             DEBUG_Direction_Glue                          false
+#  define             DEBUG_Meta_Predictor                          false
+#  define               DEBUG_Meta_Predictor_Glue                   false
+#  define                 DEBUG_Two_Level_Branch_Predictor          false
+#  define                   DEBUG_Two_Level_Branch_Predictor_Glue   false 
+#  define                   DEBUG_Branch_History_Table              false
+#  define                   DEBUG_Pattern_History_Table             false
+#  define           DEBUG_Return_Address_Stack                      true
+#  define           DEBUG_Update_Prediction_Table                   true
+#  define     DEBUG_Multi_OOO_Engine                                false
+#  define       DEBUG_OOO_Engine                                    false
+#  define         DEBUG_Rename_unit                                 false
+#  define           DEBUG_Load_Store_pointer_unit                   false
+#  define           DEBUG_Register_translation_unit                 false
+#  define             DEBUG_Dependency_checking_unit                false
+#  define             DEBUG_Free_List_unit                          false
+#  define             DEBUG_Register_Address_Translation_unit       false
+#  define             DEBUG_Register_translation_unit_Glue          false
+#  define             DEBUG_Stat_List_unit                          false
+//#define           DEBUG_Rename_queue                              true
+#  define           DEBUG_Rename_select                             false
 #endif
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Entity.h
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Entity.h	(revision 77)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Entity.h	(revision 78)
@@ -78,5 +78,5 @@
 #endif
 
-  public    : bool                  test_map          (bool top_level);
+  public    : bool                  test_map          (uint32_t depth,bool top_level);
 
 #ifdef POSITION
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Environnement.h
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Environnement.h	(revision 77)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Environnement.h	(revision 78)
@@ -22,2 +22,4 @@
 #  define DEBUG_TEST
 #endif
+
+#define MORPHEO_HOME "MORPHEO_HOME"
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Identification.h
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Identification.h	(revision 78)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Identification.h	(revision 78)
@@ -0,0 +1,34 @@
+#ifndef morpheo_behavioural_Identification_h
+#define morpheo_behavioural_Identification_h
+
+#include "Behavioural/include/Types.h"
+#include "Common/include/BitManipulation.h"
+
+namespace morpheo {
+namespace behavioural {
+  
+  uint32_t   get_nb_thread      (uint32_t   nb_context        ,
+				 uint32_t   nb_front_end      ,
+				 uint32_t   nb_ooo_engine     );  
+  Tcontext_t get_num_thread     (Tcontext_t num_context_id    ,
+				 uint32_t   size_context_id   ,
+				 Tcontext_t num_front_end_id  ,
+				 uint32_t   size_front_end_id ,
+				 Tcontext_t num_ooo_engine_id ,
+				 uint32_t   size_ooo_engine_id);
+  Tcontext_t get_num_context    (Tcontext_t num_thread        ,
+				 uint32_t   size_context_id   ,
+				 uint32_t   size_front_end_id ,
+				 uint32_t   size_ooo_engine_id);
+  Tcontext_t get_num_front_end  (Tcontext_t num_thread        ,
+				 uint32_t   size_context_id   ,
+				 uint32_t   size_front_end_id ,
+				 uint32_t   size_ooo_engine_id);
+  Tcontext_t get_num_ooo_engine (Tcontext_t num_thread        ,
+				 uint32_t   size_context_id   ,
+				 uint32_t   size_front_end_id ,
+				 uint32_t   size_ooo_engine_id);
+
+}; // end namespace behavioural
+}; // end namespace morpheo              
+#endif
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Interface.h
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Interface.h	(revision 77)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Interface.h	(revision 78)
@@ -229,5 +229,5 @@
 #endif
 
-  public    : bool                  test_map             (bool top_level);
+  public    : bool                  test_map             (uint32_t depth, bool top_level);
 
 #ifdef POSITION
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Interfaces.h
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Interfaces.h	(revision 77)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Interfaces.h	(revision 78)
@@ -80,5 +80,5 @@
 #endif
 
-  public    : bool                  test_map              (bool top_level);
+  public    : bool                  test_map              (uint32_t depth, bool top_level);
 
   public    : friend std::ostream&       operator<<            (std::ostream& output_stream,
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Parameters.h
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Parameters.h	(revision 77)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Parameters.h	(revision 78)
@@ -14,4 +14,5 @@
 #include "Behavioural/include/Environnement.h"
 #include "Behavioural/include/Constants.h"
+#include "Behavioural/include/Test.h"
 #include "Common/include/ErrorMorpheo.h"
 #include "Common/include/ToString.h"
@@ -22,41 +23,68 @@
 namespace behavioural {
 
+  class Parameters_test
+  {
+  private   : std::string _component;
+  protected : std::string _error;
+  protected : std::string _warning;
+  protected : std::string _information;
+
+  public    : Parameters_test (std::string component) 
+    {
+      _component = component;
+      _error     = "";
+      _warning   = "";
+    };
+  public    : ~Parameters_test (void) {};
+
+  public    : bool        have_error  (void)            { return (_error.length() != 0);};
+  public    : void        error       (std::string str) { _error       += "[   ERROR   ] <" + _component + "> " + str + "\n";}
+  public    : void        warning     (std::string str) { _warning     += "[  WARNING  ] <" + _component + "> " + str + "\n";}
+  public    : void        information (std::string str) { _information += "[INFORMATION] <" + _component + "> " + str + "\n";}
+  public    : std::string print       (void)            { return _error + _warning + _information;};
+  };
+
   // Virtual Class - Interface of each component
   class Parameters
   {
     // -----[ fields ]----------------------------------------------------
-  public   : static const uint32_t   _nb_operation        = MAX_OPERATION;
-  public   : static const uint32_t   _nb_type             = MAX_TYPE;
-  public   : static const uint32_t   _size_operation      = SIZE_OPERATION;
-  public   : static const uint32_t   _size_type           = SIZE_TYPE;     
-  public   : static const uint32_t   _size_exception      = SIZE_EXCEPTION;
-  public   : static const uint32_t   _size_dcache_type    = SIZE_DCACHE_TYPE;
-  public   : static const uint32_t   _size_dcache_error   = SIZE_DCACHE_ERROR;
+  public   : static const uint32_t   _size_instruction            = 32;
+  public   : static const uint32_t   _nb_operation                = MAX_OPERATION;
+  public   : static const uint32_t   _nb_type                     = MAX_TYPE;
+  public   : static const uint32_t   _size_operation              = SIZE_OPERATION;
+  public   : static const uint32_t   _size_type                   = SIZE_TYPE;     
+  public   : static const uint32_t   _size_exception              = SIZE_EXCEPTION;
+  public   : static const uint32_t   _size_exception_use          = SIZE_EXCEPTION_USE;
+  public   : static const uint32_t   _size_exception_memory       = SIZE_EXCEPTION_MEMORY;
+  public   : static const uint32_t   _size_exception_custom       = SIZE_EXCEPTION_CUSTOM;
+  public   : static const uint32_t   _size_exception_alu          = SIZE_EXCEPTION_ALU   ;
+  public   : static const uint32_t   _size_exception_decod        = SIZE_EXCEPTION_DECOD ;
+  public   : static const uint32_t   _size_exception_ifetch       = SIZE_EXCEPTION_IFETCH;
+  public   : static const uint32_t   _size_icache_type            = SIZE_ICACHE_TYPE;
+  public   : static const uint32_t   _size_icache_error           = SIZE_ICACHE_ERROR;
+  public   : static const uint32_t   _size_dcache_type            = SIZE_DCACHE_TYPE;
+  public   : static const uint32_t   _size_dcache_error           = SIZE_DCACHE_ERROR;
+  public   : static const uint32_t   _nb_general_register_logic   = 32;
+  public   : static const uint32_t   _nb_special_register_logic   = NB_SPR_LOGIC;
+  public   : static const uint32_t   _size_general_register_logic = 5;
+  public   : static const uint32_t   _size_special_register_logic = LOG2_NB_SPR_LOGIC;
+  public   : static const uint32_t   _size_event_state            = SIZE_EVENT_STATE;
+  public   : static const uint32_t   _size_event_type             = SIZE_EVENT_TYPE;
+  public   : static const uint32_t   _size_branch_state           = SIZE_BRANCH_STATE;
+  public   : static const uint32_t   _size_branch_condition       = SIZE_BRANCH_CONDITION;
 
     // -----[ methods ]---------------------------------------------------
-  public   :                  Parameters            (void);
-  public   : virtual          ~Parameters           ();
+  public   :                          Parameters           (void);
+  public   : virtual                 ~Parameters           ();
 	
     // methods to print and test parameters
-  public   : virtual std::string   print                 (uint32_t depth) = 0;
-  public   : virtual std::string   msg_error             (void) = 0;
+  public   : virtual std::string     print                 (uint32_t depth) = 0;
+  public   : virtual Parameters_test msg_error             (void) = 0;
 
     // methods to generate configuration file
-
     
     // methods to test
-  public   :         void     test                  (void);
-  public   :         bool     is_natural            (double  val );
-  public   :         bool     is_positive           (double  val );
-  public   :         bool     is_multiple           (uint32_t val1,
-		 	    	                     uint32_t val2);
-  public   :         bool     is_between_inclusive  (uint32_t val,
-						     uint32_t min,
-						     uint32_t max);
-  public   :         bool     is_between_exclusive  (uint32_t val,
-						     uint32_t min,
-						     uint32_t max);
+  public   :         void            test                  (void);
   };
-
 }; // end namespace behavioural          
 }; // end namespace morpheo              
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Signal.h
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Signal.h	(revision 77)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Signal.h	(revision 78)
@@ -51,17 +51,18 @@
 
     // -----[ fields ]----------------------------------------------------
-  private   : const std::string          _name          ;
+  private   : const std::string     _name          ;
   private   : const direction_t     _direction     ;
   private   : const presence_port_t _presence_port ;
   private   :       uint32_t        _size          ;
 
-  private   : Signal *              _connect_to_signal;   // the actual implementaion, this signal link with one signal (but if signal is an output, it can be connect with many signal ...)
-  private   : Signal *              _connect_from_signal; // producter of signal. If NULL, then producteur is the current entity
-  private   : bool                  _is_allocate   ; // Have allocate a sc_in or sc_out port
-  private   : void *                _sc_signal     ; // sc_in or sc_out associated at this signal
-  private   : void *                _sc_signal_map ; // sc_out generated this signal
-  private   : bool                  _is_map_as_src ; 
-  private   : bool                  _is_map_as_dest;
-  private   : type_info_t           _type_info     ;
+  private   : Signal *              _connect_to_signal       ;   // the actual implementaion, this signal link with one signal (but if signal is an output, it can be connect with many signal ...)
+  private   : Signal *              _connect_from_signal     ; // producter of signal. If NULL, then producteur is the current entity
+  private   : bool                  _is_allocate             ; // Have allocate a sc_in or sc_out port
+  private   : void *                _sc_signal               ; // sc_in or sc_out associated at this signal
+  private   : void *                _sc_signal_map           ; // sc_out generated this signal
+  private   : bool                  _is_map_as_toplevel_dest ; 
+  private   : bool                  _is_map_as_component_src ; 
+  private   : bool                  _is_map_as_component_dest;
+  private   : type_info_t           _type_info               ;
 
 #ifdef VHDL_TESTBENCH
@@ -90,5 +91,5 @@
   public    : bool              presence_testbench      (void);
 
-  public    : bool              test_map                (bool top_level);
+  public    : bool              test_map                (uint32_t depth, bool top_level);
 
   public    : void              link                    (Signal * signal_dest,
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Stat.h
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Stat.h	(revision 77)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Stat.h	(revision 78)
@@ -60,43 +60,60 @@
       bool                           _generate_file;
 
-    public :                     Stat            (std::string name_instance,
-						  std::string name_component,
-						  Parameters_Statistics * param);
+    public :                     Stat                         (std::string name_instance,
+						               std::string name_component,
+						               Parameters_Statistics * param);
+    public :                     Stat                         (std::string name_instance,
+						               std::string name_component,
+						               cycle_t nb_cycle_before_begin=0,
+						               cycle_t period=0);
+    public :                    ~Stat                         (void);
 
-    public :                     Stat            (std::string name_instance,
-						  std::string name_component,
-						  cycle_t nb_cycle_before_begin=0,
-						  cycle_t period=0);
-    public :                    ~Stat            (void);
-     
-    public  : counter_t *        create_variable (std::string varname);
-    public  : counter_t *        create_counter  (std::string varname,
-						  std::string unit,
-						  std::string description);
-    private : counter_t *        alloc_operand   (counter_type_t type,
-						  std::string varname,
-						  std::string unit,
-						  std::string description);
-    public  : void               create_expr     (std::string varname,
-						  std::string expr,
-						  bool each_cycle=true);
+    public  : counter_t *        create_variable              (std::string varname);
+    public  : counter_t *        create_counter               (std::string varname,
+						               std::string unit,
+						               std::string description);
+    private : counter_t *        alloc_operand                (counter_type_t type,
+						               std::string varname,
+						               std::string unit,
+						               std::string description);
 
-    private : Stat_binary_tree * string2tree     (std::string expr);
+    public  : void               create_expr                  (std::string varname,
+						               std::string expr,
+						               bool each_cycle=false);
+    public  : void               create_expr_average          (std::string varname,
+						               std::string expr_sum,
+						               std::string expr_deps,
+						               std::string unit,
+						               std::string description);
 
-    public  : void               end_cycle       (void);
-    private : void               end_simulation  (void);
-    private : void               test_and_save   (bool force_save=false);
-    private : void               eval_exprs      (bool only_each_cycle=true);
-    private : void               eval_expr       (expr_t expr);
-      
-    private : bool               is_valid_var    (std::string expr);
+    public  : void               create_expr_average_by_cycle (std::string varname,
+							       std::string expr_sum,
+							       std::string unit,
+							       std::string description);
 
-    private : void               generate_file   (void);
+    public  : void               create_expr_percent          (std::string varname,
+						               std::string expr_sum,
+						               std::string expr_max,
+						               std::string description);
 
-    private : bool               have_counter    (void);
+    private : Stat_binary_tree * string2tree                  (std::string expr);
 
-    public  : void               add_stat        (Stat * stat);
+    public  : void               end_cycle                    (void);
+    private : void               end_simulation               (void);
 
-    public  : std::string        print           (uint32_t depth=0);
+    private : void               test_and_save                (bool force_save=false);
+
+    private : void               eval_exprs                   (bool only_each_cycle=true);
+    private : void               eval_expr                    (expr_t expr);
+
+    private : bool               is_valid_var                 (std::string expr);
+
+    private : void               generate_file                (void);
+
+    private : bool               have_counter                 (void);
+
+    public  : void               add_stat                     (Stat * stat);
+
+    public  : std::string        print                        (uint32_t depth=0);
     };
 
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Test.h
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Test.h	(revision 78)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Test.h	(revision 78)
@@ -0,0 +1,31 @@
+#ifndef morpheo_behavioural_Test_h
+#define morpheo_behavioural_Test_h
+
+/*
+ * $Id$
+ *
+ * [ Description ]
+ * 
+ */
+
+#include <stdint.h>
+#include <math.h>
+
+namespace morpheo     {
+namespace behavioural {
+  
+  bool is_natural            (double   val);
+  bool is_positive           (double   val);
+  bool is_power2             (uint32_t val);
+  bool is_multiple           (uint32_t val1,
+			      uint32_t val2);
+  bool is_between_inclusive  (uint32_t val,
+			      uint32_t min,
+			      uint32_t max);
+  bool is_between_exclusive  (uint32_t val,
+			      uint32_t min,
+			      uint32_t max);
+}; // end namespace behavioural          
+}; // end namespace morpheo              
+
+#endif
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Types.h
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Types.h	(revision 77)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Types.h	(revision 78)
@@ -4,4 +4,6 @@
 #include "Common/include/Types.h"
 #include "Common/include/ToString.h"
+#include "Common/include/FromString.h"
+#include "Common/include/ErrorMorpheo.h"
 #include "Behavioural/include/Constants.h"
 
@@ -14,32 +16,87 @@
 
   // ***** general
-  typedef bool          Tcontrol_t;
-  typedef uint32_t      Toperation_t;
-//typedef uint32_t      Tdestination1_t;
-//typedef uint32_t      Tdestination2_t;
-//typedef uint32_t      Texec_flag_t;
-//typedef bool          Texec_excep_t;
-//typedef uint32_t      Tcondition_t;
-//typedef uint32_t      Tbranch_state_t;
-
-  typedef uint32_t      Texception_t;
-  typedef uint32_t      Tcontext_t;
-  typedef uint32_t      Tpacket_t;
-  typedef uint32_t      Ttype_t;
-
-  // ***** Register
-  typedef uint32_t      Tgeneral_address_t;
-  typedef uint32_t      Tgeneral_data_t;
-  typedef uint32_t      Tspecial_address_t;
-  typedef uint32_t      Tspecial_data_t;
+  typedef uint32_t        Tinstruction_t;
+  typedef bool            Tcontrol_t;
+  typedef uint8_t         Toperation_t;
+//typedef uint32_t        Tdestination1_t;
+//typedef uint32_t        Tdestination2_t;
+//typedef uint32_t        Texec_flag_t;
+//typedef bool            Texec_excep_t;
+			  
+  typedef uint8_t         Texception_t;
+  typedef uint8_t         Tcontext_t;
+  typedef uint8_t         Tpacket_t;
+  typedef uint8_t         Ttype_t;
+  typedef uint8_t         Tevent_state_t;
+  typedef uint8_t         Tevent_type_t;
+  typedef uint8_t         Tcounter_t; // universal counter
+  typedef uint8_t         Tptr_t;     // universal pointer
+			  
+  // ***** Register	  
+  typedef uint32_t        Tgeneral_address_t;
+  typedef uint32_t        Tgeneral_data_t;
+  typedef uint32_t        Tspecial_address_t;
+  typedef uint32_t        Tspecial_data_t;
 
   // ***** component dependant
-  // ~~~~~ load store queue
-  typedef uint32_t      Taccess_t;
-  typedef uint32_t      Tlsq_ptr_t;
-  typedef uint32_t      Tdcache_address_t;
-  typedef uint32_t      Tdcache_data_t;
-  typedef bool          Tdcache_error_t;
-  typedef uint32_t      Tdcache_type_t;
+  // ~~~~~ load store queue
+  typedef uint8_t         Taccess_t;
+  typedef uint8_t         Tlsq_ptr_t;
+  typedef uint32_t        Tdcache_address_t;
+  typedef uint32_t        Tdcache_data_t;
+  typedef bool            Tdcache_error_t;
+  typedef uint8_t         Tdcache_type_t;
+
+  // ~~~~~ prediction_unit
+  typedef uint8_t         Thistory_t;
+  typedef uint8_t         Tprediction_ptr_t;
+  typedef uint8_t         Tbranch_state_t;
+  typedef uint8_t         Tbranch_condition_t;
+  typedef uint8_t         Tdepth_t;      
+  typedef Tgeneral_data_t Taddress_t;
+
+
+  // ~~~~~ ifetch
+  typedef uint8_t         Tinst_ifetch_ptr_t;
+  typedef uint8_t         Tifetch_queue_ptr_t;
+  typedef uint32_t        Ticache_address_t;
+  typedef uint32_t        Ticache_instruction_t;
+  typedef bool            Ticache_error_t;
+  typedef uint8_t         Ticache_type_t;
+
+  typedef enum
+    {
+      PRIORITY_STATIC,
+      PRIORITY_ROUND_ROBIN
+    } Tpriority_t;
+
+  typedef enum
+    {
+      LOAD_BALANCING_BALANCE,
+      LOAD_BALANCING_MAXIMUM_FOR_PRIORITY
+    } Tload_balancing_t;
+
+  typedef enum
+    {
+      VICTIM_RANDOM     , // Random
+      VICTIM_ROUND_ROBIN, // Round Robin
+      VICTIM_NLU        , // Not Last Used
+      VICTIM_PSEUDO_LRU , // Pseudo Least Recently Used
+      VICTIM_LRU        , // Least Recently Used
+      VICTIM_FIFO         // First IN First OUT
+    } Tvictim_t;
+
+  typedef enum
+    {
+      PREDICTOR_NEVER_TAKE      , // Branch is never  Take
+      PREDICTOR_ALWAYS_TAKE     , // Branch is always Take
+      PREDICTOR_STATIC          , // If the adress of destination is previous, then the branch is take
+      PREDICTOR_LAST_TAKE       , // The direction is as the last time (if is the first time : static)
+      PREDICTOR_COUNTER         , // Counter table
+      PREDICTOR_LOCAL           , // Counter bank indexed with history bank
+      PREDICTOR_GLOBAL          , // Counter bank indexed with history table
+      PREDICTOR_META            , // A meta_predictor choose between 2 predictor : the local or the global
+      PREDICTOR_CUSTOM            // Note predefined scheme
+    } Tpredictor_t;
 
   //----------------------------------------------[ spr_mode_access ]-----
@@ -56,22 +113,4 @@
     }
   };
-
-  inline Tcontext_t get_num_thread (Tcontext_t num_context_id   , uint32_t size_context_id   ,
-				    Tcontext_t num_front_end_id , uint32_t size_front_end_id ,
-				    Tcontext_t num_ooo_engine_id, uint32_t size_ooo_engine_id)
-  {
-    return ((num_ooo_engine_id << (size_context_id + size_front_end_id)) |
-	    (num_front_end_id  << (size_context_id)) |
-	    (num_context_id));
-  }
-
-  inline uint32_t get_nb_thread (uint32_t nb_context ,
-				 uint32_t nb_front_end ,
-				 uint32_t nb_ooo_engine )
-  {
-    return (nb_ooo_engine *
-	    nb_front_end  *
-	    nb_context) ;
-  }
 
 }; // end namespace behavioural
@@ -96,5 +135,132 @@
   };
 
+  template<> inline std::string toString<morpheo::behavioural::Tpriority_t>(const morpheo::behavioural::Tpriority_t& x)
+  {
+    switch (x)
+      {
+      case morpheo::behavioural::PRIORITY_STATIC      : return "priority_static"; break;
+      case morpheo::behavioural::PRIORITY_ROUND_ROBIN : return "priority_round_robin"; break;
+      default    : return ""      ; break;
+      }
+  };
+
+  template<> inline morpheo::behavioural::Tpriority_t fromString<morpheo::behavioural::Tpriority_t>(const std::string& x)
+  {
+    if ( (x.compare("0")                    == 0) or
+         (x.compare("priority_static")      == 0))
+      return morpheo::behavioural::PRIORITY_STATIC;
+    if ( (x.compare("1")                    == 0) or
+         (x.compare("priority_round_robin") == 0))
+      return morpheo::behavioural::PRIORITY_ROUND_ROBIN;
+    throw (ERRORMORPHEO ("fromString","Unknow string : \""+x+"\""));
+  };
+
+  template<> inline std::string toString<morpheo::behavioural::Tload_balancing_t>(const morpheo::behavioural::Tload_balancing_t& x)
+  {
+    switch (x)
+      {
+      case morpheo::behavioural::LOAD_BALANCING_BALANCE              : return "load_balancing_balance"; break;
+      case morpheo::behavioural::LOAD_BALANCING_MAXIMUM_FOR_PRIORITY : return "load_balancing_maximum_for_priority"; break;
+      default    : return ""      ; break;
+      }
+  };
+
+  template<> inline morpheo::behavioural::Tload_balancing_t fromString<morpheo::behavioural::Tload_balancing_t>(const std::string& x)
+  {
+    if ( (x.compare("0")                      == 0) or
+         (x.compare("load_balancing_balance") == 0))
+      return morpheo::behavioural::LOAD_BALANCING_BALANCE;
+    if ( (x.compare("1")                                   == 0) or
+         (x.compare("load_balancing_maximum_for_priority") == 0))
+      return morpheo::behavioural::LOAD_BALANCING_MAXIMUM_FOR_PRIORITY;
+    throw (ERRORMORPHEO ("fromString","Unknow string : \""+x+"\""));
+  };
+
+  template<> inline std::string toString<morpheo::behavioural::Tvictim_t>(const morpheo::behavioural::Tvictim_t& x)
+  {
+    switch (x)
+      {
+      case morpheo::behavioural::VICTIM_RANDOM      : return "victim_random"     ; break;
+      case morpheo::behavioural::VICTIM_ROUND_ROBIN : return "victim_round_robin"; break;
+      case morpheo::behavioural::VICTIM_NLU         : return "victim_nlu"        ; break;
+      case morpheo::behavioural::VICTIM_PSEUDO_LRU  : return "victim_pseudo_lru" ; break;
+      case morpheo::behavioural::VICTIM_LRU         : return "victim_lru"        ; break;
+      case morpheo::behavioural::VICTIM_FIFO        : return "victim_fifo"       ; break;
+      default    : return ""      ; break;
+      }
+  };
+
+  template<> inline morpheo::behavioural::Tvictim_t fromString<morpheo::behavioural::Tvictim_t>(const std::string& x)
+  {
+    if ( (x.compare("0")                  == 0) or
+         (x.compare("victim_random")      == 0))
+      return morpheo::behavioural::VICTIM_RANDOM;
+    if ( (x.compare("1")                  == 0) or
+         (x.compare("victim_round_robin") == 0))
+      return morpheo::behavioural::VICTIM_ROUND_ROBIN;
+    if ( (x.compare("2")                  == 0) or
+         (x.compare("victim_nlu")         == 0))
+      return morpheo::behavioural::VICTIM_NLU;
+    if ( (x.compare("3")                  == 0) or
+         (x.compare("victim_pseudo_lru")  == 0))
+      return morpheo::behavioural::VICTIM_PSEUDO_LRU;
+    if ( (x.compare("4")                  == 0) or
+         (x.compare("victim_lru")         == 0))
+      return morpheo::behavioural::VICTIM_LRU;
+    if ( (x.compare("5")                  == 0) or
+         (x.compare("victim_fifo")        == 0))
+      return morpheo::behavioural::VICTIM_FIFO;
+    throw (ERRORMORPHEO ("fromString","Unknow string : \""+x+"\""));
+  };
+
+  template<> inline std::string toString<morpheo::behavioural::Tpredictor_t>(const morpheo::behavioural::Tpredictor_t& x)
+  {
+    switch (x)
+      {
+      case morpheo::behavioural::PREDICTOR_NEVER_TAKE  : return "predictor_never_take" ; break;
+      case morpheo::behavioural::PREDICTOR_ALWAYS_TAKE : return "predictor_always_take"; break;
+      case morpheo::behavioural::PREDICTOR_STATIC      : return "predictor_static"     ; break;
+      case morpheo::behavioural::PREDICTOR_LAST_TAKE   : return "predictor_last_take"  ; break;
+      case morpheo::behavioural::PREDICTOR_COUNTER     : return "predictor_counter"    ; break;
+      case morpheo::behavioural::PREDICTOR_LOCAL       : return "predictor_local"      ; break;
+      case morpheo::behavioural::PREDICTOR_GLOBAL      : return "predictor_global"     ; break;
+      case morpheo::behavioural::PREDICTOR_META        : return "predictor_meta"       ; break;
+      case morpheo::behavioural::PREDICTOR_CUSTOM      : return "predictor_custom"     ; break;
+      default    : return ""      ; break;
+      }
+  };
+
+  template<> inline morpheo::behavioural::Tpredictor_t fromString<morpheo::behavioural::Tpredictor_t>(const std::string& x)
+  {
+    if ( (x.compare("0")                     == 0) or
+         (x.compare("predictor_never_take")  == 0))
+      return morpheo::behavioural::PREDICTOR_NEVER_TAKE;
+    if ( (x.compare("1")                     == 0) or
+         (x.compare("predictor_always_take") == 0))
+      return morpheo::behavioural::PREDICTOR_ALWAYS_TAKE;
+    if ( (x.compare("2")                     == 0) or
+         (x.compare("predictor_static")      == 0))
+      return morpheo::behavioural::PREDICTOR_STATIC;
+    if ( (x.compare("3")                     == 0) or
+         (x.compare("predictor_last_take")   == 0))
+      return morpheo::behavioural::PREDICTOR_LAST_TAKE;
+    if ( (x.compare("4")                     == 0) or
+         (x.compare("predictor_counter")     == 0))
+      return morpheo::behavioural::PREDICTOR_COUNTER;
+    if ( (x.compare("5")                     == 0) or
+         (x.compare("predictor_local")       == 0))
+      return morpheo::behavioural::PREDICTOR_LOCAL;
+    if ( (x.compare("6")                     == 0) or
+         (x.compare("predictor_global")      == 0))
+      return morpheo::behavioural::PREDICTOR_GLOBAL;
+    if ( (x.compare("7")                     == 0) or
+         (x.compare("predictor_meta")        == 0))
+      return morpheo::behavioural::PREDICTOR_META;
+    if ( (x.compare("8")                     == 0) or
+         (x.compare("predictor_custom")      == 0))
+      return morpheo::behavioural::PREDICTOR_CUSTOM;
+    throw (ERRORMORPHEO ("fromString","Unknow string : \""+x+"\""));
+  };
+
 }; // end namespace morpheo              
-
 #endif
