Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/include/AbstractXMLLight.h
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/include/AbstractXMLLight.h	(revision 88)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/include/AbstractXMLLight.h	(revision 88)
@@ -0,0 +1,242 @@
+#ifndef _ABSTRACT_XMLLIGHT_H
+#define _ABSTRACT_XMLLIGHT_H
+
+// WORK IN PROGRESS THERE MUST BE SYNTAX ERROR AND OTHER BOGUS THING 
+
+#include "Behavioural/include/IXMLLight.h"
+#include "Behavioural/include/XMLLightVector.h"
+#include "Behavioural/include/XMLLightFunctors.h"
+#include <sstream>
+#include <iterator>
+#include <string>
+#include <iostream>
+
+using std::basic_stringstream ;
+using std::basic_string;
+using std::basic_ostream;
+using std::basic_istream;
+
+namespace morpheo {
+	namespace XMLUtils {
+
+	
+	//******************************************Class Declaration***************************************//
+	
+		template< typename char_type, typename ReferenceCounter = ClassicReferenceCounter >
+			 class AbstractXMLLight : public IXMLLight<char_type,ReferenceCounter> {
+		protected : 
+			basic_string<char_type>  m_internalString;
+		public :
+			inline basic_string<char_type> getInternalString(void) const; 
+		protected :		
+			inline explicit AbstractXMLLight ( const basic_string<char_type> & str);
+			inline explicit AbstractXMLLight( const basic_istream<char_type> & s ,IXMLLight<char_type,ReferenceCounter> *parent = NULL);
+			inline ~AbstractXMLLight(void); 
+
+			XMLLightVector<IXMLLight<char_type, ReferenceCounter> > getNodes ( const basic_string<char_type> & pattern );
+			
+			//vector<XMLLight *>  getNodes ( const string & pattern ); 
+			//XMLLight & getFirstNode ( const string & pattern = ""); 
+
+ 	
+			//IXMLLightImpl & getRoot ( void ); 
+                        basic_string<char_type>  getName ( void ) ; 
+                        //string &   getValue ( void )  ;
+                        //string & getValue ( const string & firstNodeName ) ; 
+                        bool containsAttribute ( const basic_string<char_type> & attributeName );
+                        map<basic_string<char_type> , basic_string<char_type> > getAttributes ( void ); 
+                        basic_string<char_type>  getAttributeValue ( const basic_string<char_type> & attributeName );
+					                                
+			friend basic_ostream<char_type> & operator<<
+				( basic_ostream<char_type> & os, const AbstractXMLLight<char_type, ReferenceCounter> * xl) {
+				return os << endl << "\t\t" << xl->m_internalString << endl; 
+			}
+
+		private:
+			inline basic_string<char_type> extractEndRootTag(void);
+			inline void trim(void) ;
+			
+		};
+
+	//******************************************Inline implementation***********************************//
+	
+	// implementation of constructors and destructors	
+	template < typename char_type, typename ReferenceCounter> 
+	AbstractXMLLight<char_type,ReferenceCounter>::AbstractXMLLight ( const basic_string<char_type> & str) 
+		: m_internalString(str) { 
+		trim();
+	} 
+	// CHANGE HERE 
+	
+	template< typename char_type, typename ReferenceCounter>			
+	AbstractXMLLight<char_type,ReferenceCounter>::AbstractXMLLight
+ 	( const basic_istream<char_type> & str, IXMLLight<char_type, ReferenceCounter> * parent) {
+		basic_stringstream<char_type> st ;
+		st << str.rdbuf() ; 
+		m_internalString = st.str(); 
+		trim();
+		if ( parent == NULL ) {
+			typename basic_string<char_type>::iterator iterator = m_internalString.begin();
+			while ( *(++iterator) != BEGIN_TAG );
+			m_internalString = basic_string<char_type>(iterator, m_internalString.end() );
+		}
+	}
+
+	template< typename char_type, typename ReferenceCounter>	
+	AbstractXMLLight<char_type,ReferenceCounter>::~AbstractXMLLight( void ) {} 
+	//
+	// implementation of getter.
+	template< typename char_type, typename ReferenceCounter> 
+	basic_string<char_type> AbstractXMLLight<char_type,ReferenceCounter>::getInternalString(void) const {
+		return m_internalString;
+	}
+	
+	// implementation of helper method.
+	template < typename char_type, typename ReferenceCounter>
+	void AbstractXMLLight<char_type,ReferenceCounter>::trim(void) {
+				
+		int index = m_internalString.find_first_of(BEGIN_TAG); 
+		int lastIndex = m_internalString.find_last_of(END_TAG);
+		basic_string<char_type> reducedString = m_internalString.substr(index,lastIndex - index + 1 );
+		m_internalString = reducedString; 
+	}
+
+	template < typename char_type, typename ReferenceCounter>
+	basic_string<char_type> AbstractXMLLight<char_type, ReferenceCounter>::extractEndRootTag(void) {
+		basic_string<char_type> internal = m_internalString.substr(0,m_internalString.find_last_of(BEGIN_TAG));
+		return internal.substr(0, m_internalString.find_last_of(END_TAG) + 1 );
+	}
+
+	template < typename char_type, typename ReferenceCounter>
+	XMLLightVector<IXMLLight<char_type,ReferenceCounter> > AbstractXMLLight<char_type, ReferenceCounter>::getNodes ( const basic_string<char_type> & pattern ) 
+	{
+		XMLLightVector<IXMLLight<char_type,ReferenceCounter> > returnedNodesVector; 
+		basic_string<char_type> reduceString = extractEndRootTag();
+		if ( reduceString.empty() )
+		{
+			return returnedNodesVector; 
+		}
+		typename basic_string<char_type>::iterator iterator = reduceString.begin();
+		typename basic_string<char_type>::iterator endStringIterator = reduceString.end();
+		typename basic_string<char_type>::iterator tempIterator = iterator;
+		bool first = true;
+	
+		while ( iterator != endStringIterator )
+		{
+			if ( first ) 
+			{
+				while ( *(++iterator) != END_TAG ) ;
+				if ( ++iterator == endStringIterator ) 
+				{	
+					return returnedNodesVector; 
+				}
+				first = false; 		
+			}
+			tempIterator = iterator; 
+			iterator  = adjacent_find(iterator, endStringIterator, XMLLightComparator());
+			if ( iterator != endStringIterator )
+			{
+				iterator+=2;
+			}
+	
+			basic_string<char_type> s ( tempIterator, iterator );
+			if ( s.empty() || s.find_first_of(BEGIN_TAG) == basic_string<char_type>::npos )
+			{
+				return returnedNodesVector;
+			}
+			AbstractXMLLight<char_type, ReferenceCounter> * abstractXMLLight = new AbstractXMLLight<char_type, ReferenceCounter>(s);
+			if ( pattern.empty() || abstractXMLLight->getName() == pattern )
+			{
+				returnedNodesVector.push_back(abstractXMLLight);
+			}
+			else 
+			{
+				delete abstractXMLLight;
+			}
+			if ( iterator != endStringIterator )
+			{
+				iterator++;
+			}
+		}
+		return returnedNodesVector; 
+	}
+
+	
+	template < typename char_type, typename ReferenceCounter>
+	basic_string<char_type> AbstractXMLLight<char_type,ReferenceCounter>::getName( void ) 
+	{
+		if ( m_internalString.empty() ) {
+                  std::cout << " oups chaine non copie " << std::endl ; 
+		}
+		typename basic_string<char_type>::iterator iterator = m_internalString.begin();
+		basic_string<char_type> resultString ;
+		while ( *( ++ iterator ) != END_TAG && *iterator != ' ' && *iterator != '\n' && *iterator != '\t' && *iterator != SECOND_TAG ) 
+	
+		{
+			resultString.append(1,*( iterator) ); 
+		}
+		return resultString; 
+	}
+	
+	
+	template < typename char_type, typename ReferenceCounter>
+	map< basic_string<char_type>, basic_string<char_type> > AbstractXMLLight<char_type,ReferenceCounter>::getAttributes(void)
+	{
+		char equalSeparator = '=';
+		basic_string<char_type> separator(" \a\b\n\t\f\r\v");
+		basic_string<char_type> key; 
+		basic_string<char_type> value; 
+	
+		map<basic_string<char_type>, basic_string<char_type> > returnedMap; 
+		size_t last_position = 0;
+		size_t previous_position = 0; 
+		size_t begin_position = 0; 
+		size_t end_position = m_internalString.find_first_of(END_TAG);
+		basic_string<char_type> nodeString = m_internalString.substr(0,end_position);
+	
+		while ( last_position = nodeString.find_first_of(equalSeparator,last_position) , last_position != basic_string<char_type>::npos )
+		{
+			begin_position = last_position; 
+			last_position = nodeString.find_last_not_of(separator,begin_position-1); 	
+			previous_position = nodeString.find_last_of(separator,last_position);
+			key = nodeString.substr(previous_position+1, last_position-previous_position );
+			last_position = nodeString.find_first_not_of(separator, begin_position +1) ; 
+			previous_position = last_position; 
+			last_position = nodeString.find_first_of(nodeString[previous_position] , previous_position +1 ); 
+			value = nodeString.substr(previous_position +1 ,last_position - previous_position - 1);
+			returnedMap.insert(make_pair(key,value));
+			// test d'erreur pour l'insertion a ajouter 
+	
+		}
+		
+		return returnedMap;
+	}
+	
+	
+	template < typename char_type, typename ReferenceCounter>
+	bool AbstractXMLLight<char_type,ReferenceCounter>::containsAttribute ( const basic_string<char_type> & attributeName ) 
+	{
+		map<basic_string<char_type>,basic_string<char_type> > attributeMap = getAttributes();
+		if ( ! attributeMap.empty() && attributeMap.count(attributeName) == 1 ) 
+		{
+			return true; 
+		}
+			
+		return false; 
+	}
+	
+	template < typename char_type, typename ReferenceCounter>
+	basic_string<char_type>  AbstractXMLLight<char_type,ReferenceCounter>::getAttributeValue ( const basic_string<char_type> & attributeName ) 
+	{
+ 		map<basic_string<char_type>, basic_string<char_type> > attributeMap  =  getAttributes() ;
+		typename map<basic_string<char_type>,basic_string<char_type> >::iterator it = attributeMap.find(attributeName);
+		if ( it == attributeMap.end() )
+		{
+			return basic_string<char_type>(""); 
+		}
+		return (*it).second;
+	}
+	}
+	}
+	#endif
+	
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Allocation.h
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Allocation.h	(revision 87)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Allocation.h	(revision 88)
@@ -11,6 +11,89 @@
 #include "Common/include/Debug.h"
 
+// ======================================================================
+// =====[ ALLOCATION / DELETE of ARRAY ]=================================
+// ======================================================================
+
+#define ALLOC1(var,type,s1)                      \
+  var = new type [s1]
+  
+#define ALLOC2(var,type,s1,s2)                   \
+  var = new type * [s1];                         \
+  for (uint32_t it1=0; it1<s1; ++it1)            \
+    {                                            \
+      var [it1] = new type [s2];                 \
+    }
+
+#define ALLOC3(var,type,s1,s2,s3)                \
+  var = new type ** [s1];                        \
+  for (uint32_t it1=0; it1<s1; ++it1)            \
+    {                                            \
+      var [it1] = new type * [s2];               \
+      for (uint32_t it2=0; it2<s2; ++it2)        \
+        {                                        \
+          var [it1][it2] = new type [s3];        \
+        }                                        \
+    }
+  
+#define ALLOC4(var,type,s1,s2,s3,s4)                    \
+  var = new type *** [s1];                              \
+  for (uint32_t it1=0; it1<s1; ++it1)                   \
+    {                                                   \
+      var [it1] = new type ** [s2];                     \
+      for (uint32_t it2=0; it2<s2; ++it2)               \
+        {                                               \
+          var [it1][it2] = new type * [s3];             \
+          for (uint32_t it3=0; it3<s3; ++it3)           \
+            {                                           \
+              var [it1][it2][it3] = new type [s4];      \
+            }                                           \
+        }                                               \
+    }
+  
+#define DELETE1(var,s1)                          \
+  delete [] var;
+
+#define DELETE2(var,s1,s2)                       \
+  for (uint32_t it1=0; it1<s1; ++it1)            \
+    {                                            \
+      delete [] var [it1];                       \
+    }                                            \
+  delete [] var;                         
+  
+#define DELETE3(var,s1,s2,s3)                    \
+  for (uint32_t it1=0; it1<s1; ++it1)            \
+    {                                            \
+      for (uint32_t it2=0; it2<s2; ++it2)        \
+        {                                        \
+          delete [] var [it1][it2];              \
+        }                                        \
+      delete [] var [it1];                       \
+    }                                            \
+  delete [] var;
+  
+#define DELETE4(var,s1,s2,s3,s4)                 \
+  for (uint32_t it1=0; it1<s1; ++it1)            \
+    {                                            \
+      for (uint32_t it2=0; it2<s2; ++it2)        \
+        {                                        \
+          for (uint32_t it3=0; it3<s3; ++it3)    \
+            {                                    \
+              delete [] var [it1][it2][it3];     \
+            }                                    \
+          delete [] var [it1][it2];              \
+        }                                        \
+      delete [] var [it1];                       \
+    }                                            \
+  delete [] var;                                        
+
+// ======================================================================
+// =====[ ALLOCATION / DELETE of SIGNAL]=================================
+// ======================================================================
+
 // Help to allocate interface
-#define INTERFACE_PRINT(name) log_printf(TRACE,true,"allocation","Interface's creation : %s (%s, %d)",name,__FILE__,__LINE__);
+#define INTERFACE_PRINT(name) log_printf(TRACE,Allocation,FUNCTION,"<%s> : Interface's creation : %s (%s, %d)",_name.c_str(),name,__FILE__,__LINE__);
+#define PRINT_SIGNAL_ADDRESS(name,address) log_printf(TRACE,Allocation,FUNCTION,"Signal : %s 0x%.8x(%s, %d)",name,(uint32_t)((uint64_t)(address)),__FILE__,__LINE__);
+#define PRINT_SIZE_NUL(component,interface,signal) log_printf(TRACE,Allocation,FUNCTION,_("<%s> %s.%s.%s : size is nul."),_name.c_str(),component->get_name().c_str(),interface->get_name().c_str(),signal);
+#define TEST_SIGNAL(name,address) PRINT_SIGNAL_ADDRESS(name,address); TEST_PTR(address)
 
 // ----------------------------------------------------------------------
@@ -18,75 +101,101 @@
 // ----------------------------------------------------------------------
 
-#define __ALLOC_SIGNAL(sig, name, type)		\
-  {						\
-    sig = new type (name);			\
+#define __ALLOC_SIGNAL(sig, name, type)         \
+  {                                             \
+    sig = new type (name);                      \
   }
 
 #ifdef POSITION
-#define ALLOC_INTERFACE( name, direction, localisation, str)		\
-  INTERFACE_PRINT(name);						\
-  Interface_fifo * interface = _interfaces->set_interface( name, direction, localisation, str);
+#define ALLOC_INTERFACE( name, direction, localisation, str)            \
+  INTERFACE_PRINT(name);                                                \
+  morpheo::behavioural::Interface_fifo * interface = _interfaces->set_interface( name, direction, localisation, str);
 #else
-#define ALLOC_INTERFACE( name, direction, localisation, str)		\
-  INTERFACE_PRINT(name);						\
-  Interface_fifo * interface = _interfaces->set_interface( name);
+#define ALLOC_INTERFACE( name, direction, localisation, str)            \
+  INTERFACE_PRINT(name);                                                \
+  morpheo::behavioural::Interface_fifo * interface = _interfaces->set_interface( name);
 #endif
 
-#define ALLOC_VAL_ACK_IN(  sig, name, type)				\
-  {									\
-    sig = interface->set_signal_valack_in (name, type);			\
-  }									
-#define ALLOC_VAL_ACK_OUT( sig, name, type)				\
-  {									\
-    sig = interface->set_signal_valack_out(name, type);			\
-  }									
-#define ALLOC_VALACK_IN(     sig, type)					\
-  {									\
-    sig = interface->set_signal_valack_in (type);			\
-  }									
-#define ALLOC_VALACK_OUT(    sig, type)					\
-  {									\
-    sig = interface->set_signal_valack_out(type);			\
-  }									
-#define ALLOC_SIGNAL_IN(  sig, name, type, size)			\
-  if (size > 0)								\
-    {									\
-      sig = interface->set_signal_in <type> (name, size);		\
-    }									\
-  else									\
-    {									\
-      log_printf(INFO,true,FUNCTION,_("%s %s.%s.%s : size is nul."),MSG_INFORMATION,_component->get_name().c_str(),interface->get_name().c_str(),name); \
+#define ALLOC_VAL_ACK_IN(  sig, name, type)                             \
+  {                                                                     \
+    sig = interface->set_signal_valack_in (name, type);                 \
+  }                                                                     
+#define ALLOC_VAL_ACK_OUT( sig, name, type)                             \
+  {                                                                     \
+    sig = interface->set_signal_valack_out(name, type);                 \
+  }                                                                     
+#define ALLOC_VALACK_IN(     sig, type)                                 \
+  {                                                                     \
+    sig = interface->set_signal_valack_in (type);                       \
+  }                                                                     
+#define ALLOC_VALACK_OUT(    sig, type)                                 \
+  {                                                                     \
+    sig = interface->set_signal_valack_out(type);                       \
+  }                                                                     
+#define ALLOC_SIGNAL_IN(  sig, name, type, size)                        \
+  if (size > 0)                                                         \
+    {                                                                   \
+      sig = interface->set_signal_in <type> (name, size);               \
+    }                                                                   \
+  else                                                                  \
+    {                                                                   \
+      PRINT_SIZE_NUL(_component,interface,name);                        \
     }
   
-#define ALLOC_SIGNAL_OUT( sig, name, type, size)			\
-  if (size > 0)								\
-    {									\
-      sig = interface->set_signal_out<type> (name, size);		\
-    }									\
-  else									\
-    {									\
-      log_printf(INFO,true,FUNCTION,_("%s %s.%s.%s : size is nul."),MSG_INFORMATION,_component->get_name().c_str(),interface->get_name().c_str(),name); \
+#define ALLOC_SIGNAL_OUT( sig, name, type, size)                        \
+  if (size > 0)                                                         \
+    {                                                                   \
+      sig = interface->set_signal_out<type> (name, size);               \
+    }                                                                   \
+  else                                                                  \
+    {                                                                   \
+      PRINT_SIZE_NUL(_component,interface,name); \
     }
 
-#define DELETE_SIGNAL( sig, size)					\
-  if (size > 0)								\
-    {									\
-      delete sig;							\
+#define DELETE_SIGNAL( sig, size)                                       \
+  if (size > 0)                                                         \
+    {                                                                   \
+      delete sig;                                                       \
     }
 
-#define ALLOC_SC_SIGNAL(  sig, name, type)		                \
-  sc_signal<type> * sig = new sc_signal<type> (name);
-
-#define INSTANCE_SC_SIGNAL(component, sig)	\
-  {						\
-    TEST_PTR(component->sig);			\
-    TEST_PTR(sig);				\
-    (*(component->sig)) (*(sig));		\
-  }
-
-#define DELETE_SC_SIGNAL( sig)			\
-  {						\
-    delete sig;					\
-  }
+#define ALLOC_SC_SIGNAL(  sig, name, type)                              \
+  sc_signal<type> * sig = new sc_signal<type> (name);                   \
+  PRINT_SIGNAL_ADDRESS(name,sig);
+
+#define INSTANCE_SC_SIGNAL(component, sig)                     \
+  {                                                            \
+    TEST_SIGNAL(component->sig->name(),component->sig);        \
+    TEST_SIGNAL(sig           ->name(),sig);                   \
+    (*(component->sig)) (*(sig));                              \
+  }
+
+#define _INSTANCE_SC_SIGNAL(component, sig1,sig2)                       \
+  {                                                                     \
+    TEST_SIGNAL(component->sig1->name(),component->sig1);               \
+    TEST_SIGNAL(sig2           ->name(),sig2);                          \
+    (*(component->sig1)) (*(sig2));                                     \
+  }
+
+#define DELETE_SC_SIGNAL( sig)                  \
+  {                                             \
+    delete sig;                                 \
+  }
+
+
+#define __ALLOC0_SIGNAL(sig, name, type)                      __ALLOC_SIGNAL(sig, name, type)
+
+#define ALLOC0_INTERFACE( name, direction, localisation, str) ALLOC_INTERFACE( name, direction, localisation, str)
+
+#define ALLOC0_VAL_ACK_IN(  sig, name, type)                  ALLOC_VAL_ACK_IN(  sig, name, type)
+#define ALLOC0_VAL_ACK_OUT( sig, name, type)                  ALLOC_VAL_ACK_OUT( sig, name, type)
+#define ALLOC0_VALACK_IN(     sig, type)                      ALLOC_VALACK_IN(     sig, type)
+#define ALLOC0_VALACK_OUT(    sig, type)                      ALLOC_VALACK_OUT(    sig, type)
+#define ALLOC0_SIGNAL_IN(  sig, name, type, size)             ALLOC_SIGNAL_IN(  sig, name, type, size)
+#define ALLOC0_SIGNAL_OUT( sig, name, type, size)             ALLOC_SIGNAL_OUT( sig, name, type, size)
+#define DELETE0_SIGNAL( sig, size)                            DELETE_SIGNAL( sig, size)
+
+#define ALLOC0_SC_SIGNAL(  sig, name, type)                   ALLOC_SC_SIGNAL(  sig, name, type)
+#define INSTANCE0_SC_SIGNAL(component, sig)                   INSTANCE_SC_SIGNAL(component, sig)
+#define _INSTANCE0_SC_SIGNAL(component, sig)                  _INSTANCE_SC_SIGNAL(component, sig)
+#define DELETE0_SC_SIGNAL( sig)                               DELETE_SC_SIGNAL( sig)
 
 // ----------------------------------------------------------------------
@@ -94,160 +203,169 @@
 // ----------------------------------------------------------------------
 
-#define __ALLOC1_INTERFACE(name, it1)					\
-  INTERFACE_PRINT(name);						\
-  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());		\
-      }									\
+#define __ALLOC1_INTERFACE(name, x1)                                    \
+  INTERFACE_PRINT(name);                                                \
+  const std::string interface_name = name;                              \
+  const uint32_t iterator_1 = x1;
+
+#define __ALLOC1_SIGNAL_IN( sig, name, type)                            \
+  {                                                                     \
+    sig = new SC_IN(type) * [iterator_1];                               \
+    std::string separator="_";                                          \
+    for (uint32_t it1=0; it1<iterator_1; it1++)                         \
+      {                                                                 \
+        std::string str = "in_"+interface_name+separator+toString(it1)+separator+name; \
+        sig [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 it1=0; it1<iterator_1; it1++)                         \
+      {                                                                 \
+        std::string str = "out_"+interface_name+separator+toString(it1)+separator+name; \
+        sig [it1] = new SC_OUT(type) (str.c_str());                     \
+      }                                                                 \
   }
 
 #ifdef POSITION
-#define ALLOC1_INTERFACE( name, direction, localisation, str, it1)	\
-  INTERFACE_PRINT(name);						\
-  const uint32_t iterator_1 = it1;					\
-  Interface_fifo * interface [iterator_1];				\
-  {									\
-    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); \
-      }									\
+#define ALLOC1_INTERFACE( name, direction, localisation, str, x1)       \
+  INTERFACE_PRINT(name);                                                \
+  const uint32_t iterator_1 = x1;                                       \
+  morpheo::behavioural::Interface_fifo * interface [iterator_1];        \
+  {                                                                     \
+    std::string separator="_";                                          \
+    for (uint32_t it1=0; it1<iterator_1; it1++)                         \
+      {                                                                 \
+        interface [it1] = _interfaces->set_interface( name+separator+toString(it1), direction, localisation, str); \
+      }                                                                 \
   }
 #else
-#define ALLOC1_INTERFACE( name, direction, localisation, str, it1)	\
-  INTERFACE_PRINT(name);						\
-  const uint32_t iterator_1 = it1;					\
-  Interface_fifo * interface [iterator_1];				\
-  {									\
-    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)); \
-      }									\
+#define ALLOC1_INTERFACE( name, direction, localisation, str, x1)       \
+  INTERFACE_PRINT(name);                                                \
+  const uint32_t iterator_1 = x1;                                       \
+  morpheo::behavioural::Interface_fifo * interface [iterator_1];        \
+  {                                                                     \
+    std::string separator="_";                                          \
+    for (uint32_t it1=0; it1<iterator_1; it1++)                         \
+      {                                                                 \
+        interface [it1] = _interfaces->set_interface( name+separator+toString(it1)); \
+      }                                                                 \
   }
 #endif
 
-#define ALLOC1_VAL_ACK_IN( sig, name, type)				\
-  {									\
-    sig = new SC_IN (Tcontrol_t) * [iterator_1];			\
-    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 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 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 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); \
-      }									\
-  }
-#define ALLOC1_SIGNAL_IN( sig, name, type, size)			\
-  {									\
-    sig = new SC_IN (type) * [iterator_1];				\
-    for (uint32_t alloc_signal_it1=0; alloc_signal_it1<iterator_1; alloc_signal_it1++) \
-      {									\
-	if (size > 0)							\
-	  {								\
-	    sig [alloc_signal_it1] = interface[alloc_signal_it1]->set_signal_in <type> (name, size); \
-	  }								\
-	else								\
-	  {								\
-	    log_printf(INFO,true,FUNCTION,_("%s %s.%s.%s : size is nul."),MSG_INFORMATION,_component->get_name().c_str(),interface[alloc_signal_it1]->get_name().c_str(),name); \
-	  }								\
-      }									\
-  }
-
-#define ALLOC1_SIGNAL_OUT(sig, name, type, size)			\
-  {									\
-    sig = new SC_OUT(type) * [iterator_1];				\
-    for (uint32_t alloc_signal_it1=0; alloc_signal_it1<iterator_1; alloc_signal_it1++) \
-      {									\
-	if (size > 0)							\
-	  {								\
-	    sig [alloc_signal_it1] = interface[alloc_signal_it1]->set_signal_out<type> (name, size); \
-	  }								\
-	else								\
-	  {								\
-	    log_printf(INFO,true,FUNCTION,_("%s %s.%s.%s : size is nul."),MSG_INFORMATION,_component->get_name().c_str(),interface[alloc_signal_it1]->get_name().c_str(),name); \
-	  }								\
-      }									\
-  }
-
-#define DELETE1_SIGNAL(sig, it1, size)					\
-  {									\
-    for (uint32_t alloc_signal_it1=0; alloc_signal_it1<it1; alloc_signal_it1++) \
-      {									\
-	if (size > 0)							\
-	  {								\
-	    delete sig[alloc_signal_it1];				\
-	  }								\
-      }									\
-    delete [] sig;							\
-  }
-
-#define ALLOC1_SC_SIGNAL( sig, name, type, it1)				\
-  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++)	\
-      {									\
-	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++) \
-    {									\
-      TEST_PTR(component->sig [alloc_signal_it1]);			\
-      TEST_PTR(sig            [alloc_signal_it1]);			\
-      (*(component->sig[alloc_signal_it1])) (*(sig[alloc_signal_it1]));	\
+#define ALLOC1_VAL_ACK_IN( sig, name, type)                             \
+  {                                                                     \
+    sig = new SC_IN (Tcontrol_t) * [iterator_1];                        \
+    for (uint32_t it1=0; it1<iterator_1; it1++)                         \
+      {                                                                 \
+        sig [it1] = interface[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 it1=0; it1<iterator_1; it1++)                         \
+      {                                                                 \
+        sig [it1] = interface[it1]->set_signal_valack_out(name, type);  \
+      }                                                                 \
+  }
+#define ALLOC1_VALACK_IN(    sig, type)                                 \
+  {                                                                     \
+    sig = new SC_IN (Tcontrol_t) * [iterator_1];                        \
+    for (uint32_t it1=0; it1<iterator_1; it1++)                         \
+      {                                                                 \
+        sig [it1] = interface[it1]->set_signal_valack_in (type);        \
+      }                                                                 \
+  }
+#define ALLOC1_VALACK_OUT(   sig, type)                                 \
+  {                                                                     \
+    sig = new SC_OUT(Tcontrol_t) * [iterator_1];                        \
+    for (uint32_t it1=0; it1<iterator_1; it1++)                         \
+      {                                                                 \
+        sig [it1] = interface[it1]->set_signal_valack_out(type);        \
+      }                                                                 \
+  }
+#define ALLOC1_SIGNAL_IN( sig, name, type, size)                        \
+  {                                                                     \
+    sig = new SC_IN (type) * [iterator_1];                              \
+    for (uint32_t it1=0; it1<iterator_1; it1++)                         \
+      {                                                                 \
+        if (size > 0)                                                   \
+          {                                                             \
+            sig [it1] = interface[it1]->set_signal_in <type> (name, size); \
+          }                                                             \
+        else                                                            \
+          {                                                             \
+            PRINT_SIZE_NUL(_component,interface[it1],name);             \
+          }                                                             \
+      }                                                                 \
+  }
+
+#define ALLOC1_SIGNAL_OUT(sig, name, type, size)                        \
+  {                                                                     \
+    sig = new SC_OUT(type) * [iterator_1];                              \
+    for (uint32_t it1=0; it1<iterator_1; it1++)                         \
+      {                                                                 \
+        if (size > 0)                                                   \
+          {                                                             \
+            sig [it1] = interface[it1]->set_signal_out<type> (name, size); \
+          }                                                             \
+        else                                                            \
+          {                                                             \
+            PRINT_SIZE_NUL(_component,interface[it1],name);             \
+          }                                                             \
+      }                                                                 \
+  }
+
+#define DELETE1_SIGNAL(sig, x1, size)                                   \
+  {                                                                     \
+    for (uint32_t it1=0; it1<x1; it1++)                                 \
+      {                                                                 \
+        if (size > 0)                                                   \
+          {                                                             \
+            delete sig[it1];                                            \
+          }                                                             \
+      }                                                                 \
+    delete [] sig;                                                      \
+  }
+
+#define ALLOC1_SC_SIGNAL( sig, name, type, x1)                          \
+  sc_signal<type> ** sig = new sc_signal<type> * [x1];                  \
+  {                                                                     \
+    std::string separator="_";                                          \
+    std::string str;                                                    \
+    for (uint32_t it1=0; it1<x1; it1++)                                 \
+      {                                                                 \
+        str = name+separator+toString(it1);                             \
+        sig [it1] = new sc_signal<type> (str.c_str());                  \
+        PRINT_SIGNAL_ADDRESS(str.c_str(),sig[it1]);                     \
+      }                                                                 \
+  }
+
+#define INSTANCE1_SC_SIGNAL(component, sig, x1) \
+  for (uint32_t it1=0; it1<x1; it1++)                                   \
+    {                                                                   \
+      TEST_SIGNAL(component->sig [it1]->name(),component->sig [it1]);   \
+      TEST_SIGNAL(sig            [it1]->name(),sig            [it1]);   \
+      (*(component->sig[it1])) (*(sig[it1]));                           \
     }
 
-#define DELETE1_SC_SIGNAL(sig, it1)					\
-  {									\
-    for (uint32_t alloc_signal_it1=0; alloc_signal_it1<it1; alloc_signal_it1++) \
-      {									\
-	delete sig[alloc_signal_it1];					\
-      }									\
-    delete [] sig;							\
+#define _INSTANCE1_SC_SIGNAL(component, sig1, sig2, x1) \
+  for (uint32_t it1=0; it1<x1; it1++)                                   \
+    {                                                                   \
+      TEST_SIGNAL(component->sig1 [it1]->name(),component->sig1 [it1]); \
+      TEST_SIGNAL(sig2            [it1]->name(),sig2            [it1]); \
+      (*(component->sig1[it1])) (*(sig2[it1]));                         \
+    }
+
+#define DELETE1_SC_SIGNAL(sig, x1)                                      \
+  {                                                                     \
+    for (uint32_t it1=0; it1<x1; it1++)                                 \
+      {                                                                 \
+        delete sig[it1];                                                \
+      }                                                                 \
+    delete [] sig;                                                      \
   }
 
@@ -257,135 +375,135 @@
 
 #ifdef POSITION
-#define ALLOC2_INTERFACE( name, direction, localisation, str, it1, it2)	\
-  INTERFACE_PRINT(name);						\
-  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); \
-	  }								\
-      }									\
+#define ALLOC2_INTERFACE( name, direction, localisation, str, x1, x2)   \
+  INTERFACE_PRINT(name);                                                \
+  uint32_t iterator_1 = 0;                                              \
+  uint32_t iterator_2 = 0;                                              \
+  morpheo::behavioural::Interface_fifo *** interface;                   \
+  {                                                                     \
+    std::string separator="_";                                          \
+    iterator_1 = x1;                                                    \
+    interface = new morpheo::behavioural::Interface_fifo ** [iterator_1]; \
+    for (uint32_t it1=0; it1<iterator_1; it1++)                         \
+      {                                                                 \
+        iterator_2 = x2;                                                \
+        interface [it1] = new morpheo::behavioural::Interface_fifo * [iterator_2]; \
+        for (uint32_t it2=0; it2<iterator_2; it2++)                     \
+          {                                                             \
+            interface [it1][it2] = _interfaces->set_interface( name+separator+toString(it1)+separator+toString(it2), direction, localisation, str); \
+          }                                                             \
+      }                                                                 \
   }
 #else
-#define ALLOC2_INTERFACE( name, direction, localisation, str, it1, it2)	\
-  INTERFACE_PRINT(name);						\
-  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)); \
-	  }								\
-      }									\
+#define ALLOC2_INTERFACE( name, direction, localisation, str, x1, x2)   \
+  INTERFACE_PRINT(name);                                                \
+  uint32_t iterator_1 = 0;                                              \
+  uint32_t iterator_2 = 0;                                              \
+  morpheo::behavioural::Interface_fifo *** interface;                   \
+  {                                                                     \
+    std::string separator="_";                                          \
+    iterator_1 = x1;                                                    \
+    interface = new morpheo::behavioural::Interface_fifo ** [iterator_1]; \
+    for (uint32_t it1=0; it1<iterator_1; it1++)                         \
+      {                                                                 \
+        iterator_2 = x2;                                                \
+        interface [it1] = new morpheo::behavioural::Interface_fifo * [iterator_2]; \
+        for (uint32_t it2=0; it2<iterator_2; it2++)                     \
+          {                                                             \
+            interface [it1][it2] = _interfaces->set_interface( name+separator+toString(it1)+separator+toString(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)		\
-  {									\
-    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++) \
-	  {								\
-	    if (size > 0)						\
-	      {								\
-		sig [alloc_signal_it1][alloc_signal_it2] = interface[alloc_signal_it1][alloc_signal_it2]->set_signal_in <type> (name, size); \
-	      }								\
-	    else							\
-	      {								\
-		log_printf(INFO,true,FUNCTION,_("%s %s.%s.%s : size is nul."),MSG_INFORMATION,_component->get_name().c_str(),interface[alloc_signal_it1][alloc_signal_it2]->get_name().c_str(),name); \
-	      }								\
-	  }								\
-      }									\
-  }
-
-#define _ALLOC2_SIGNAL_OUT( sig, name, type, size, it1, it2)		\
-  {									\
-    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++) \
-	  {								\
-	    if (size > 0)						\
-	      {								\
-		sig [alloc_signal_it1][alloc_signal_it2] = interface[alloc_signal_it1][alloc_signal_it2]->set_signal_out <type> (name, size); \
-	      }								\
-	    else							\
-	      {								\
-		log_printf(INFO,true,FUNCTION,_("%s %s.%s.%s : size is nul."),MSG_INFORMATION,_component->get_name().c_str(),interface[alloc_signal_it1][alloc_signal_it2]->get_name().c_str(),name); \
-	      }								\
-	  }								\
-      }									\
+#define _ALLOC2_VAL_ACK_IN( sig, name, type, x1, x2)                    \
+  {                                                                     \
+    sig = new SC_IN (Tcontrol_t) ** [x1];                               \
+    for (uint32_t it1=0; it1<x1; it1++)                                 \
+      {                                                                 \
+        sig [it1] = new SC_IN (Tcontrol_t) * [x2];                      \
+        for (uint32_t it2=0; it2<x2; it2++)                             \
+          {                                                             \
+            sig [it1][it2] = interface[it1][it2]->set_signal_valack_in (name, type); \
+          }                                                             \
+      }                                                                 \
+  }
+
+#define _ALLOC2_VAL_ACK_OUT( sig, name, type, x1, x2)                   \
+  {                                                                     \
+    sig = new SC_OUT (Tcontrol_t) ** [x1];                              \
+    for (uint32_t it1=0; it1<x1; it1++)                                 \
+      {                                                                 \
+        sig [it1] = new SC_OUT (Tcontrol_t) * [x2];                     \
+        for (uint32_t it2=0; it2<x2; it2++)                             \
+          {                                                             \
+            sig [it1][it2] = interface[it1][it2]->set_signal_valack_out (name, type); \
+          }                                                             \
+      }                                                                 \
+  }
+
+#define _ALLOC2_VALACK_IN(    sig,type, x1, x2)                         \
+  {                                                                     \
+    sig = new SC_IN (Tcontrol_t) ** [x1];                               \
+    for (uint32_t it1=0; it1<x1; it1++)                                 \
+      {                                                                 \
+        sig [it1] = new SC_IN (Tcontrol_t) * [x2];                      \
+        for (uint32_t it2=0; it2<x2; it2++)                             \
+          {                                                             \
+            sig [it1][it2] = interface[it1][it2]->set_signal_valack_in (type); \
+          }                                                             \
+      }                                                                 \
+  }
+
+#define _ALLOC2_VALACK_OUT(    sig,type, x1, x2)                        \
+  {                                                                     \
+    sig = new SC_OUT (Tcontrol_t) ** [x1];                              \
+    for (uint32_t it1=0; it1<x1; it1++)                                 \
+      {                                                                 \
+        sig [it1] = new SC_OUT (Tcontrol_t) * [x2];                     \
+        for (uint32_t it2=0; it2<x2; it2++)                             \
+          {                                                             \
+            sig [it1][it2] = interface[it1][it2]->set_signal_valack_out (type); \
+          }                                                             \
+      }                                                                 \
+  }
+
+#define _ALLOC2_SIGNAL_IN( sig, name, type, size, x1, x2)               \
+  {                                                                     \
+    sig = new SC_IN (type) ** [x1];                                     \
+    for (uint32_t it1=0; it1<x1; it1++)                                 \
+      {                                                                 \
+        sig [it1] = new SC_IN (type) * [x2];                            \
+        for (uint32_t it2=0; it2<x2; it2++)                             \
+          {                                                             \
+            if (size > 0)                                               \
+              {                                                         \
+                sig [it1][it2] = interface[it1][it2]->set_signal_in <type> (name, size); \
+              }                                                         \
+            else                                                        \
+              {                                                         \
+                PRINT_SIZE_NUL(_component,interface[it1][it2],name);    \
+              }                                                         \
+          }                                                             \
+      }                                                                 \
+  }
+
+#define _ALLOC2_SIGNAL_OUT( sig, name, type, size, x1, x2)              \
+  {                                                                     \
+    sig = new SC_OUT (type) ** [x1];                                    \
+    for (uint32_t it1=0; it1<x1; it1++)                                 \
+      {                                                                 \
+        sig [it1] = new SC_OUT (type) * [x2];                           \
+        for (uint32_t it2=0; it2<x2; it2++)                             \
+          {                                                             \
+            if (size > 0)                                               \
+              {                                                         \
+                sig [it1][it2] = interface[it1][it2]->set_signal_out <type> (name, size); \
+              }                                                         \
+            else                                                        \
+              {                                                         \
+                PRINT_SIZE_NUL(_component,interface[it1][it2],name);    \
+              }                                                         \
+          }                                                             \
+      }                                                                 \
   }
 
@@ -397,57 +515,296 @@
 #define ALLOC2_SIGNAL_OUT( sig, name, type, size) _ALLOC2_SIGNAL_OUT( sig, name, type, size, iterator_1, iterator_2) 
 
-#define DELETE2_SIGNAL(sig, it1,it2, size)				\
-  {									\
-    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++) \
-	  {								\
-	    if (size > 0)						\
-	      {								\
-		delete sig[alloc_signal_it1][alloc_signal_it2];		\
-	      }								\
-	  }								\
-	delete [] sig[alloc_signal_it1];				\
-      }									\
-    delete [] sig;							\
-  }
-
-#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++)	\
-      {									\
-	TEST_PTR(component->sig [alloc_signal_it1][alloc_signal_it2]);	\
-	TEST_PTR(sig            [alloc_signal_it1][alloc_signal_it2]);	\
-	(*(component->sig[alloc_signal_it1][alloc_signal_it2])) (*(sig[alloc_signal_it1][alloc_signal_it2])); \
+#define DELETE2_SIGNAL(sig, x1,x2, size)                                \
+  {                                                                     \
+    for (uint32_t it1=0; it1<x1; it1++)                                 \
+      {                                                                 \
+        for (uint32_t it2=0; it2<x2; it2++)                             \
+          {                                                             \
+            if (size > 0)                                               \
+              {                                                         \
+                delete sig[it1][it2];                                   \
+              }                                                         \
+          }                                                             \
+        delete [] sig[it1];                                             \
+      }                                                                 \
+    delete [] sig;                                                      \
+  }
+
+#define ALLOC2_SC_SIGNAL( sig, name, type, x1, x2)                      \
+  sc_signal<type> *** sig = new sc_signal<type> ** [x1];                \
+  {                                                                     \
+    std::string separator="_";                                          \
+    std::string str;                                                    \
+    for (uint32_t it1=0; it1<x1; it1++)                                 \
+      {                                                                 \
+        sig [it1] = new sc_signal<type> * [x2];                         \
+        for (uint32_t it2=0; it2<x2; it2++)                             \
+          {                                                             \
+            str = name+separator+toString(it1)+separator+toString(it2); \
+            sig [it1][it2] = new sc_signal<type> (str.c_str());         \
+            PRINT_SIGNAL_ADDRESS(str.c_str(),sig[it1][it2]);            \
+          }                                                             \
+      }                                                                 \
+  }
+
+#define INSTANCE2_SC_SIGNAL(component, sig, x1, x2)                     \
+  for (uint32_t it1=0; it1<x1; it1++)                                   \
+    for (uint32_t it2=0; it2<x2; it2++)                                 \
+      {                                                                 \
+        TEST_SIGNAL(component->sig  [it1][it2]->name(),component->sig  [it1][it2]); \
+        TEST_SIGNAL(sig             [it1][it2]->name(),sig             [it1][it2]); \
+        (*(component->sig[it1][it2])) (*(sig[it1][it2]));               \
       }
 
-#define DELETE2_SC_SIGNAL(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++) \
-	  {								\
-	    delete sig[alloc_signal_it1][alloc_signal_it2];		\
-	  }								\
-	delete [] sig[alloc_signal_it1];				\
-      }									\
-    delete [] sig;							\
-  }
-
+#define _INSTANCE2_SC_SIGNAL(component, sig1, sig2, x1, x2)             \
+  for (uint32_t it1=0; it1<x1; it1++)                                   \
+    for (uint32_t it2=0; it2<x2; it2++)                                 \
+      {                                                                 \
+        TEST_SIGNAL(component->sig1 [it1][it2]->name(),component->sig1 [it1][it2]); \
+        TEST_SIGNAL(sig2            [it1][it2]->name(),sig2            [it1][it2]); \
+        (*(component->sig1[it1][it2])) (*(sig2[it1][it2]));             \
+      }
+
+#define DELETE2_SC_SIGNAL(sig,x1,x2)                                    \
+  {                                                                     \
+    for (uint32_t it1=0; it1<x1; it1++)                                 \
+      {                                                                 \
+        for (uint32_t it2=0; it2<x2; it2++)                             \
+          {                                                             \
+            delete sig[it1][it2];                                       \
+          }                                                             \
+        delete [] sig[it1];                                             \
+      }                                                                 \
+    delete [] sig;                                                      \
+  }
+
+// ----------------------------------------------------------------------
+// -----[ ITERATION 3 ]--------------------------------------------------
+// ----------------------------------------------------------------------
+
+#ifdef POSITION
+#define ALLOC3_INTERFACE( name, direction, localisation, str, x1, x2, x3) \
+  INTERFACE_PRINT(name);                                                \
+  uint32_t iterator_1 = 0;                                              \
+  uint32_t iterator_2 = 0;                                              \
+  uint32_t iterator_3 = 0;                                              \
+  morpheo::behavioural::Interface_fifo **** interface;                  \
+  {                                                                     \
+    std::string separator="_";                                          \
+    iterator_1 = x1;                                                    \
+    interface = new morpheo::behavioural::Interface_fifo *** [iterator_1]; \
+    for (uint32_t it1=0; it1<iterator_1; it1++)                         \
+      {                                                                 \
+        iterator_2 = x2;                                                \
+        interface [it1] = new morpheo::behavioural::Interface_fifo ** [iterator_2]; \
+        for (uint32_t it2=0; it2<iterator_2; it2++)                     \
+          {                                                             \
+            iterator_3 = x3;                                            \
+            interface [it1][it2] = new morpheo::behavioural::Interface_fifo * [iterator_3]; \
+            for (uint32_t it3=0; it3<iterator_3; it3++)                 \
+              {                                                         \
+                interface [it1][it2][it3] = _interfaces->set_interface( name+separator+toString(it1)+separator+toString(it2)+separator+toString(it3), direction, localisation, str); \
+              }                                                         \
+          }                                                             \
+      }                                                                 \
+  }
+#else
+#define ALLOC3_INTERFACE( name, direction, localisation, str, x1, x2, x3) \
+  INTERFACE_PRINT(name);                                                \
+  uint32_t iterator_1 = 0;                                              \
+  uint32_t iterator_2 = 0;                                              \
+  uint32_t iterator_3 = 0;                                              \
+  morpheo::behavioural::Interface_fifo **** interface;                  \
+  {                                                                     \
+    std::string separator="_";                                          \
+    iterator_1 = x1;                                                    \
+    interface = new morpheo::behavioural::Interface_fifo *** [iterator_1]; \
+    for (uint32_t it1=0; it1<iterator_1; it1++)                         \
+      {                                                                 \
+        iterator_2 = x2;                                                \
+        interface [it1] = new morpheo::behavioural::Interface_fifo ** [iterator_2]; \
+        for (uint32_t it2=0; it2<iterator_2; it2++)                     \
+          {                                                             \
+            iterator_3 = x3;                                            \
+            interface [it1][it2] = new morpheo::behavioural::Interface_fifo * [iterator_3]; \
+            for (uint32_t it3=0; it3<iterator_3; it3++)                 \
+              {                                                         \
+                interface [it1][it2][it3] = _interfaces->set_interface( name+separator+toString(it1)+separator+toString(it2)+separator+toString(it3)); \
+              }                                                         \
+          }                                                             \
+      }                                                                 \
+  }
 #endif
+
+// #define _ALLOC3_VAL_ACK_IN( sig, name, type, x1, x2, x3)
+// #define _ALLOC3_VAL_ACK_OUT( sig, name, type, x1, x2, x3)
+
+#define _ALLOC3_VALACK_IN(    sig,type, x1, x2, x3)                     \
+  {                                                                     \
+    sig = new SC_IN (Tcontrol_t) *** [x1];                              \
+    for (uint32_t it1=0; it1<x1; it1++)                                 \
+      {                                                                 \
+        sig [it1] = new SC_IN (Tcontrol_t) ** [x2];                     \
+        for (uint32_t it2=0; it2<x2; it2++)                             \
+          {                                                             \
+            sig [it1][it2] = new SC_IN (Tcontrol_t) * [x3];             \
+            for (uint32_t it3=0; it3<x3; it3++)                         \
+              {                                                         \
+                sig [it1][it2][it3] = interface[it1][it2][it3]->set_signal_valack_in (type); \
+              }                                                         \
+          }                                                             \
+      }                                                                 \
+  }
+
+#define _ALLOC3_VALACK_OUT(    sig,type, x1, x2, x3)                    \
+  {                                                                     \
+    sig = new SC_OUT (Tcontrol_t) *** [x1];                             \
+    for (uint32_t it1=0; it1<x1; it1++)                                 \
+      {                                                                 \
+        sig [it1] = new SC_OUT (Tcontrol_t) ** [x2];                    \
+        for (uint32_t it2=0; it2<x2; it2++)                             \
+          {                                                             \
+            sig [it1][it2] = new SC_OUT (Tcontrol_t) * [x3];            \
+            for (uint32_t it3=0; it3<x3; it3++)                         \
+              {                                                         \
+                sig [it1][it2][it3] = interface[it1][it2][it3]->set_signal_valack_out (type); \
+              }                                                         \
+          }                                                             \
+      }                                                                 \
+  }
+
+
+#define _ALLOC3_SIGNAL_IN( sig, name, type, size, x1, x2,x3)            \
+  {                                                                     \
+    sig = new SC_IN (type) *** [x1];                                    \
+    for (uint32_t it1=0; it1<x1; it1++)                                 \
+      {                                                                 \
+        sig [it1] = new SC_IN (type) ** [x2];                           \
+        for (uint32_t it2=0; it2<x2; it2++)                             \
+          {                                                             \
+            sig [it1][it2] = new SC_IN (type) * [x3];                   \
+            for (uint32_t it3=0; it3<x3; it3++)                         \
+              {                                                         \
+                if (size > 0)                                           \
+                  {                                                     \
+                    sig [it1][it2][it3] = interface[it1][it2][it3]->set_signal_in <type> (name, size); \
+                  }                                                     \
+                else                                                    \
+                  {                                                     \
+                    PRINT_SIZE_NUL(_component,interface[it1][it2][it3],name); \
+                  }                                                     \
+              }                                                         \
+          }                                                             \
+      }                                                                 \
+  }
+
+#define _ALLOC3_SIGNAL_OUT( sig, name, type, size, x1, x2,x3)           \
+  {                                                                     \
+    sig = new SC_OUT (type) *** [x1];                                   \
+    for (uint32_t it1=0; it1<x1; it1++)                                 \
+      {                                                                 \
+        sig [it1] = new SC_OUT (type) ** [x2];                          \
+        for (uint32_t it2=0; it2<x2; it2++)                             \
+          {                                                             \
+            sig [it1][it2] = new SC_OUT (type) * [x3];                  \
+            for (uint32_t it3=0; it3<x3; it3++)                         \
+              {                                                         \
+                if (size > 0)                                           \
+                  {                                                     \
+                    sig [it1][it2][it3] = interface[it1][it2][it3]->set_signal_out <type> (name, size); \
+                  }                                                     \
+                else                                                    \
+                  {                                                     \
+                    PRINT_SIZE_NUL(_component,interface[it1][it2][it3],name); \
+                  }                                                     \
+              }                                                         \
+          }                                                             \
+      }                                                                 \
+  }
+
+// #define ALLOC3_VAL_ACK_IN( sig, name, type      ) _ALLOC3_VAL_ACK_IN( sig, name, type      , iterator_1, iterator_2, iterator_3) 
+// #define ALLOC3_VAL_ACK_OUT(sig, name, type      ) _ALLOC3_VAL_ACK_OUT(sig, name, type      , iterator_1, iterator_2, iterator_3) 
+#define ALLOC3_VALACK_IN(  sig,       type      ) _ALLOC3_VALACK_IN(  sig,       type      , iterator_1, iterator_2, iterator_3) 
+#define ALLOC3_VALACK_OUT( sig,       type      ) _ALLOC3_VALACK_OUT( sig,       type      , iterator_1, iterator_2, iterator_3) 
+#define ALLOC3_SIGNAL_IN(  sig, name, type, size) _ALLOC3_SIGNAL_IN(  sig, name, type, size, iterator_1, iterator_2, iterator_3) 
+#define ALLOC3_SIGNAL_OUT( sig, name, type, size) _ALLOC3_SIGNAL_OUT( sig, name, type, size, iterator_1, iterator_2, iterator_3) 
+
+#define DELETE3_SIGNAL(sig, x1, x2, x3, size)                           \
+  {                                                                     \
+    for (uint32_t it1=0; it1<x1; it1++)                                 \
+      {                                                                 \
+        for (uint32_t it2=0; it2<x2; it2++)                             \
+          {                                                             \
+            for (uint32_t it3=0; it3<x3; it3++)                         \
+              {                                                         \
+                if (size > 0)                                           \
+                  {                                                     \
+                    delete sig[it1][it2][it3];                          \
+                  }                                                     \
+              }                                                         \
+            delete [] sig[it1][it2];                                    \
+          }                                                             \
+        delete [] sig[it1];                                             \
+      }                                                                 \
+    delete [] sig;                                                      \
+  }
+
+#define ALLOC3_SC_SIGNAL( sig, name, type, x1, x2, x3)                  \
+  sc_signal<type> **** sig = new sc_signal<type> *** [x1];              \
+  {                                                                     \
+    std::string separator="_";                                          \
+    std::string str;                                                    \
+    for (uint32_t it1=0; it1<x1; it1++)                                 \
+      {                                                                 \
+         sig [it1] = new sc_signal<type> ** [x2];                       \
+         for (uint32_t it2=0; it2<x2; it2++)                            \
+           {                                                            \
+              sig [it1][it2] = new sc_signal<type> * [x3];              \
+              for (uint32_t it3=0; it3<x3; it3++)                       \
+                {                                                       \
+                  str = name+separator+toString(it1)+separator+toString(it2)+separator+toString(it3); \
+                  sig [it1][it2][it3] = new sc_signal<type> (str.c_str()); \
+                  PRINT_SIGNAL_ADDRESS(str.c_str(),sig[it1][it2][it3]); \
+                }                                                       \
+           }                                                            \
+      }                                                                 \
+  }
+
+#define INSTANCE3_SC_SIGNAL(component, sig, x1, x2, x3)                 \
+  for (uint32_t it1=0; it1<x1; it1++)                                   \
+    for (uint32_t it2=0; it2<x2; it2++)                                 \
+      for (uint32_t it3=0; it3<x3; it3++)                               \
+        {                                                               \
+          TEST_SIGNAL(component->sig  [it1][it2][it3]->name(),component->sig  [it1][it2][it3]); \
+          TEST_SIGNAL(sig             [it1][it2][it3]->name(),sig             [it1][it2][it3]); \
+          (*(component->sig[it1][it2][it3])) (*(sig[it1][it2][it3]));   \
+        }
+
+#define _INSTANCE3_SC_SIGNAL(component, sig1, sig2, x1, x2, x3)         \
+  for (uint32_t it1=0; it1<x1; it1++)                                   \
+    for (uint32_t it2=0; it2<x2; it2++)                                 \
+      for (uint32_t it3=0; it3<x3; it3++)                               \
+        {                                                               \
+          TEST_SIGNAL(component->sig1 [it1][it2][it3]->name(),component->sig1 [it1][it2][it3]); \
+          TEST_SIGNAL(sig2            [it1][it2][it3]->name(),sig2            [it1][it2][it3]); \
+          (*(component->sig1[it1][it2][it3])) (*(sig2[it1][it2][it3])); \
+        }
+
+#define DELETE3_SC_SIGNAL(sig,x1,x2,x3)                                 \
+  {                                                                     \
+    for (uint32_t it1=0; it1<x1; it1++)                                 \
+      {                                                                 \
+        for (uint32_t it2=0; it2<x2; it2++)                             \
+          {                                                             \
+            for (uint32_t it3=0; it3<x3; it3++)                         \
+              {                                                         \
+                delete sig[it1][it2][it3];                              \
+              }                                                         \
+            delete [] sig[it1][it2];                                    \
+          }                                                             \
+        delete [] sig[it1];                                             \
+      }                                                                 \
+    delete [] sig;                                                      \
+  }
+
+#endif
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/include/ClassicReferenceCounter.h
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/include/ClassicReferenceCounter.h	(revision 88)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/include/ClassicReferenceCounter.h	(revision 88)
@@ -0,0 +1,51 @@
+#ifndef _CLASSIC_REF_COUNTER_
+#define _CLASSIC_REF_COUNTER_
+
+#include "Behavioural/include/IReferenceCounters.h"
+#include <cassert>
+
+namespace morpheo {
+	namespace ReferenceCountersUtils {
+	
+	//*****************************************Class declaration*****************************************//
+	
+	class ClassicReferenceCounter : virtual public IReferenceCounter<unsigned long> {
+	private:
+		unsigned long m_ulReferenceCounter; 
+	protected:
+		inline explicit ClassicReferenceCounter(void); 
+		inline ~ClassicReferenceCounter(void); 
+	public:	
+		inline unsigned long getReferenceCount(void) const;
+		
+		inline unsigned long attach(void); 
+		
+		inline unsigned long detach(void); 
+	};	
+
+	//**********************************Inline definition************************************************//
+	
+	ClassicReferenceCounter::ClassicReferenceCounter(void) : m_ulReferenceCounter(1) {}
+
+	ClassicReferenceCounter::~ClassicReferenceCounter(void) { 
+		assert( m_ulReferenceCounter == 0 || m_ulReferenceCounter == 1 );
+	}
+	
+	unsigned long ClassicReferenceCounter::attach(void) {
+		return ++m_ulReferenceCounter; 
+	}
+	
+	unsigned long ClassicReferenceCounter::detach(void) {
+		return --m_ulReferenceCounter ? m_ulReferenceCounter : (delete this , 0 ) ; 
+	}
+
+	
+	unsigned long ClassicReferenceCounter::getReferenceCount(void) const {
+		return m_ulReferenceCounter;
+	}
+
+	} //end of namespace ReferenceCountersUtils.
+}// end of namespace morpheo.
+
+#endif // _CLASSIC_REF_COUNTER_
+ 
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Configuration_Parameters.h
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Configuration_Parameters.h	(revision 87)
+++ 	(revision )
@@ -1,56 +1,0 @@
-#ifndef morpheo_behavioural_Configuration_Parameters_h
-#define morpheo_behavioural_Configuration_Parameters_h
-#ifdef CONFIGURATION
-
-/*
- * $Id$
- *
- * [ Description ]
- * 
- */
-
-#include <stdint.h>
-#include <iostream>
-#include "Behavioural/include/XML.h"
-#include "Behavioural/include/Environment.h"
-#include "Common/include/ErrorMorpheo.h"
-#include "Common/include/ToString.h"
-
-namespace morpheo     {
-namespace behavioural {
-
-  class Configuration_Parameters
-  {
-    // -----[ fields ]----------------------------------------------------
-    // Constant
-  public   : const std::string _name   ;
-  public   : const uint32_t    _value  ;
-  public   : const uint32_t    _min    ;
-  public   : const uint32_t    _max    ;
-  public   : const std::string _step   ;
-  public   : const uint32_t    _default;
-  public   : const uint32_t    _level  ;
-  public   : const std::string _comment;
-
-    // -----[ methods ]---------------------------------------------------
-  public   :                 Configuration_Parameters  (std::string name   ,
-							uint32_t    value  ,
-							uint32_t    min    ,
-							uint32_t    max    ,
-							std::string step   ,
-							uint32_t    value_default,
-							uint32_t    level  ,
-							std::string comment);
-  public   :                 ~Configuration_Parameters ();
-
-    // methods to print and test parameters_configuration
-  public   : std::string          print                      (uint32_t depth);
-  public   : friend std::ostream& operator<<                 (std::ostream& output_stream,
-							      morpheo::behavioural::Configuration_Parameters & x);
-  };
-
-}; // end namespace behavioural          
-}; // end namespace morpheo              
-
-#endif
-#endif
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Constants.h
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Constants.h	(revision 87)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Constants.h	(revision 88)
@@ -2,6 +2,33 @@
 #define morpheo_behavioural_Constants_h
 
+/*
+  WARNING : 
+  
+  I Use reserved exception : 
+
+  0x10 - EXCEPTION_MEMORY_MISS_SPECULATION   - Load miss speculation
+  0x11 - EXCEPTION_MEMORY_LOAD_SPECULATIVE   - The load is speculative : write in register file, but don't commit
+  0x12 - EXCEPTION_ALU_SPR_ACCESS_INVALID    - SPR     present in ALU but not compatible privilege
+  0x13 - EXCEPTION_ALU_SPR_ACCESS_MUST_READ  - SPR not present in ALU
+  0x14 - EXCEPTION_ALU_SPR_ACCESS_MUST_WRITE - SPR not present in ALU
+
+  I Use reserved SPR :
+  [0][19] - SPR_CID
+*/
+
 namespace morpheo {
 namespace behavioural {
+
+#  define SET_FLAG(     x,pos)  {(x) |=  (1<<(pos));} while (0)
+#  define UNSET_FLAG(   x,pos)  {(x) &= ~(1<<(pos));} while (0)
+#  define IS_SET_FLAG(  x,pos) (((x) &   (1<<(pos))) != 0)
+#  define IS_UNSET_FLAG(x,pos) (((x) &   (1<<(pos))) == 0)
+#  define CHANGE_FLAG(  x,pos,f) \
+   {                        \
+     if (f)                 \
+       {SET_FLAG(x,pos);}   \
+     else                   \
+       {UNSET_FLAG(x,pos);} \
+   } while (0)
 
   //=========================================================[ Type ]=====
@@ -10,14 +37,30 @@
 #  define TYPE_MOVE                                0x2        // 00000 - unit multiple
 #  define TYPE_TEST                                0x3        // 00000 - unit multiple
-#  define TYPE_MUL_DIV                             0x4        // 00000 - unit multiple
-#  define TYPE_EXTEND                              0x5        // 00000 - unit multiple, type optionnal
-#  define TYPE_FIND                                0x6        // 00000 - unit multiple, type optionnal
-#  define TYPE_SPECIAL                             0x7        // 00000 - unit uniq
-#  define TYPE_CUSTOM                              0x8        // 00000 - unit uniq    , type optionnal
-#  define TYPE_BRANCH                              0x9        // 00000 - unit multiple
-#  define TYPE_MEMORY                              0xa        // 00000 - unit uniq
-
+#  define TYPE_MUL                                 0x4        // 00000 - unit multiple
+#  define TYPE_DIV                                 0x5        // 00000 - unit multiple, type optionnal
+#  define TYPE_EXTEND                              0x6        // 00000 - unit multiple, type optionnal
+#  define TYPE_FIND                                0x7        // 00000 - unit multiple, type optionnal
+#  define TYPE_SPECIAL                             0x8        // 00000 - unit uniq
+#  define TYPE_CUSTOM                              0x9        // 00000 - unit uniq    , type optionnal
+#  define TYPE_BRANCH                              0xa        // 00000 - unit multiple
+#  define TYPE_MEMORY                              0xb        // 00000 - unit uniq
+
+//#define NB_TYPE                                  11
 #  define SIZE_TYPE                                5
 #  define MAX_TYPE                                 (1<<SIZE_TYPE)
+
+#  define is_type_valid(x) \
+  (( x == TYPE_ALU    ) or \
+   ( x == TYPE_SHIFT  ) or \
+   ( x == TYPE_MOVE   ) or \
+   ( x == TYPE_TEST   ) or \
+   ( x == TYPE_MUL    ) or \
+   ( x == TYPE_DIV    ) or \
+   ( x == TYPE_EXTEND ) or \
+   ( x == TYPE_FIND   ) or \
+   ( x == TYPE_SPECIAL) or \
+   ( x == TYPE_CUSTOM ) or \
+   ( x == TYPE_BRANCH ) or \
+   ( x == TYPE_MEMORY ))
 
   //====================================================[ Operation ]=====
@@ -149,8 +192,9 @@
 #  define OPERATION_TEST_L_SFNE                    0x20       // 000_0000 l.sfne  , l.sfnei
 
-#  define OPERATION_MUL_DIV_L_MUL                  0x1        // 000_0000 l.mul   , l.muli
-#  define OPERATION_MUL_DIV_L_MULU                 0x2        // 000_0000 l.mulu
-#  define OPERATION_MUL_DIV_L_DIV                  0x4        // 000_0000 l.div
-#  define OPERATION_MUL_DIV_L_DIVU                 0x8        // 000_0000 l.divu
+#  define OPERATION_MUL_L_MUL                      0x1        // 000_0000 l.mul   , l.muli
+#  define OPERATION_MUL_L_MULU                     0x2        // 000_0000 l.mulu
+
+#  define OPERATION_DIV_L_DIV                      0x1        // 000_0000 l.div
+#  define OPERATION_DIV_L_DIVU                     0x2        // 000_0000 l.divu
 
 #  define OPERATION_EXTEND_L_EXTEND_Z              0x1        // 000_0000 l.extbz , l.exthz, l.extwz
@@ -204,9 +248,9 @@
 #  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 SIZE_EXCEPTION_MEMORY                    5
+#  define SIZE_EXCEPTION_CUSTOM                    5
+#  define SIZE_EXCEPTION_ALU                       5
+#  define SIZE_EXCEPTION_DECOD                     5
+#  define SIZE_EXCEPTION_IFETCH                    5
 
 #  define EXCEPTION_NONE                           0x00       // none exception
@@ -243,54 +287,67 @@
 #  define EXCEPTION_CUSTOM_6                       0x1f       // Reserved for custom exceptions
 
-
-#define exception_to_address(x) (x<<8)
+  //SR[14].EPH : Exception Prefix High
+  // EPH = 0 Exceptions vectors are located in memory area starting at 0x0
+  // EPH = 1 Exception vectors are located in memory area starting at 0xF0000000
+
+#define exception_to_address(eph,x) (((eph==0)?0x0:0xF0000000)+(x<<8))
 
   // Exception Execution
-#  define EXCEPTION_MEMORY_NONE                    0x0        // Load/Store generate none exception
-#  define EXCEPTION_MEMORY_ALIGNMENT               0x1        // Load/Store access is not aligned
-#  define EXCEPTION_MEMORY_DATA_TLB                0x2        // DTLB miss
-#  define EXCEPTION_MEMORY_DATA_PAGE               0x3        // No matching or page violation protection in pages tables
-#  define EXCEPTION_MEMORY_BUS_ERROR               0x4        // Access at a invalid physical address
-#  define EXCEPTION_MEMORY_MISS_SPECULATION        0x5        // Load miss speculation
-#  define EXCEPTION_MEMORY_LOAD_SPECULATIVE        0x6        // The load is speculative : write in register file, but don't commit
-
-#  define EXCEPTION_CUSTOM_NONE                    0x1        // Custom unit generate none exception
-#  define EXCEPTION_CUSTOM_CUST_0                  0x1        // Reserved for custom exceptions
-#  define EXCEPTION_CUSTOM_CUST_1                  0x2        // Reserved for custom exceptions
-#  define EXCEPTION_CUSTOM_CUST_2                  0x3        // Reserved for custom exceptions
-#  define EXCEPTION_CUSTOM_CUST_3                  0x4        // Reserved for custom exceptions
-#  define EXCEPTION_CUSTOM_CUST_4                  0x5        // Reserved for custom exceptions
-#  define EXCEPTION_CUSTOM_CUST_5                  0x6        // Reserved for custom exceptions
-#  define EXCEPTION_CUSTOM_CUST_6                  0x7        // Reserved for custom exceptions
-
-#  define EXCEPTION_ALU_NONE                       0x0        // Functionnal unit generate none exception
-#  define EXCEPTION_ALU_RANGE                      0x1        // 
-#  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        // 
+#  define EXCEPTION_IFETCH_NONE                    0x00       // Fetch Unit generate none exception
+#  define EXCEPTION_IFETCH_INSTRUCTION_TLB         0x0a       // ITLB miss
+#  define EXCEPTION_IFETCH_INSTRUCTION_PAGE        0x04       // No matching or page violation protection in pages tables
+#  define EXCEPTION_IFETCH_BUS_ERROR               0x02       // Access at a invalid physical address
+
+#  define EXCEPTION_DECOD_NONE                     0x00       // none exception
+#  define EXCEPTION_DECOD_ILLEGAL_INSTRUCTION      0x01       // Instruction is illegal (no implemented)
+#  define EXCEPTION_DECOD_SYSCALL                  0x02       // System Call
+//#define EXCEPTION_DECOD_TRAP                     0x0e       // L.trap or debug unit (note : must read SR !)
+#  define EXCEPTION_DECOD_INSTRUCTION_TLB          0x0a       // ITLB miss
+#  define EXCEPTION_DECOD_INSTRUCTION_PAGE         0x04       // No matching or page violation protection in pages tables
+#  define EXCEPTION_DECOD_BUS_ERROR                0x02       // Access at a invalid physical address
+
+#  define EXCEPTION_ALU_NONE                       0x00       // Functionnal unit generate none exception
+#  define EXCEPTION_ALU_RANGE                      0x0b       // 
+#  define EXCEPTION_ALU_SPR_ACCESS_INVALID         0x12       // SPR     present in ALU but not compatible privilege
+#  define EXCEPTION_ALU_SPR_ACCESS_MUST_READ       0x13       // SPR not present in ALU
+#  define EXCEPTION_ALU_SPR_ACCESS_MUST_WRITE      0x14       // SPR not present in ALU
+
+#  define EXCEPTION_MEMORY_NONE                    0x00       // Load/Store generate none exception
+#  define EXCEPTION_MEMORY_ALIGNMENT               0x06       // Load/Store access is not aligned
+#  define EXCEPTION_MEMORY_DATA_TLB                0x09       // DTLB miss
+#  define EXCEPTION_MEMORY_DATA_PAGE               0x03       // No matching or page violation protection in pages tables
+#  define EXCEPTION_MEMORY_BUS_ERROR               0x02       // Access at a invalid physical address
+#  define EXCEPTION_MEMORY_MISS_SPECULATION        0x10       // Load miss speculation
+#  define EXCEPTION_MEMORY_LOAD_SPECULATIVE        0x11       // The load is speculative : write in register file, but don't commit
+
+#  define EXCEPTION_CUSTOM_NONE                    0x00       // Custom unit generate none exception
+#  define EXCEPTION_CUSTOM_CUST_0                  0x19       // Reserved for custom exceptions
+#  define EXCEPTION_CUSTOM_CUST_1                  0x1a       // Reserved for custom exceptions
+#  define EXCEPTION_CUSTOM_CUST_2                  0x1b       // Reserved for custom exceptions
+#  define EXCEPTION_CUSTOM_CUST_3                  0x1c       // Reserved for custom exceptions
+#  define EXCEPTION_CUSTOM_CUST_4                  0x1d       // Reserved for custom exceptions
+#  define EXCEPTION_CUSTOM_CUST_5                  0x1e       // Reserved for custom exceptions
+#  define EXCEPTION_CUSTOM_CUST_6                  0x1f       // Reserved for custom exceptions
+
+#  define EXCEPTION_USE_NONE                       0x00       // 
+#  define EXCEPTION_USE_ILLEGAL_INSTRUCTION        0x01       // illegal_instruction
+#  define EXCEPTION_USE_RANGE                      0x02       // range
+#  define EXCEPTION_USE_MEMORY_WITH_ALIGNMENT      0x03       // TLB miss, page fault, bus error, alignment
+#  define EXCEPTION_USE_MEMORY_WITHOUT_ALIGNMENT   0x04       // TLB miss, page fault, bus error
+#  define EXCEPTION_USE_SYSCALL                    0x05       // syscall
+#  define EXCEPTION_USE_TRAP                       0x06       // trap
+#  define EXCEPTION_USE_CUSTOM_0                   0x07       // 
+#  define EXCEPTION_USE_CUSTOM_1                   0x08       // 
+#  define EXCEPTION_USE_CUSTOM_2                   0x09       // 
+#  define EXCEPTION_USE_CUSTOM_3                   0x0a       // 
+#  define EXCEPTION_USE_CUSTOM_4                   0x0b       // 
+#  define EXCEPTION_USE_CUSTOM_5                   0x0c       // 
+#  define EXCEPTION_USE_CUSTOM_6                   0x0d       // 
+
+#  define exception_ifetch_to_exception_decod(x) x
+#  define exception_decod_to_exception(x)        x
+#  define exception_alu_to_exception(x)          x
+#  define exception_memory_to_exception(x)       x
+#  define exception_custom_to_exception(x)       x
 
   //=======================================================[ icache ]=====
@@ -298,10 +355,10 @@
   //--------------------------------------------------[ 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
+#  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.
@@ -310,8 +367,8 @@
   //-------------------------------------------------[ icache_error ]-----
 
-#  define SIZE_ICACHE_ERROR                             1
-
-#  define ICACHE_ERROR_NONE                             0x0
-#  define ICACHE_ERROR_BUS_ERROR                        0x1
+#  define SIZE_ICACHE_ERROR                        1
+
+#  define ICACHE_ERROR_NONE                        0x0
+#  define ICACHE_ERROR_BUS_ERROR                   0x1
 
   //=======================================================[ dcache ]=====
@@ -319,22 +376,22 @@
   //--------------------------------------------------[ dcache_type ]-----
 
-#  define SIZE_DCACHE_TYPE                              4
-
-//#define DCACHE_TYPE_                                  0x0        // 0000
-#  define DCACHE_TYPE_LOCK                              0x1        // 0001
-#  define DCACHE_TYPE_INVALIDATE                        0x2        // 0010
-#  define DCACHE_TYPE_PREFETCH                          0x3        // 0011
-//#define DCACHE_TYPE_                                  0x4        // 0100
-//#define DCACHE_TYPE_                                  0x5        // 0101
-#  define DCACHE_TYPE_FLUSH                             0x6        // 0110
-#  define DCACHE_TYPE_SYNCHRONIZATION                   0x7        // 0111
-#  define DCACHE_TYPE_LOAD_8                            0x8        // 1000
-#  define DCACHE_TYPE_LOAD_16                           0x9        // 1001
-#  define DCACHE_TYPE_LOAD_32                           0xa        // 1010
-#  define DCACHE_TYPE_LOAD_64                           0xb        // 1011
-#  define DCACHE_TYPE_STORE_8                           0xc        // 1100
-#  define DCACHE_TYPE_STORE_16                          0xd        // 1101
-#  define DCACHE_TYPE_STORE_32                          0xe        // 1110
-#  define DCACHE_TYPE_STORE_64                          0xf        // 1111
+#  define SIZE_DCACHE_TYPE                         4
+
+//#define DCACHE_TYPE_                             0x0        // 0000
+#  define DCACHE_TYPE_LOCK                         0x1        // 0001
+#  define DCACHE_TYPE_INVALIDATE                   0x2        // 0010
+#  define DCACHE_TYPE_PREFETCH                     0x3        // 0011
+//#define DCACHE_TYPE_                             0x4        // 0100
+//#define DCACHE_TYPE_                             0x5        // 0101
+#  define DCACHE_TYPE_FLUSH                        0x6        // 0110
+#  define DCACHE_TYPE_SYNCHRONIZATION              0x7        // 0111
+#  define DCACHE_TYPE_LOAD_8                       0x8        // 1000
+#  define DCACHE_TYPE_LOAD_16                      0x9        // 1001
+#  define DCACHE_TYPE_LOAD_32                      0xa        // 1010
+#  define DCACHE_TYPE_LOAD_64                      0xb        // 1011
+#  define DCACHE_TYPE_STORE_8                      0xc        // 1100
+#  define DCACHE_TYPE_STORE_16                     0xd        // 1101
+#  define DCACHE_TYPE_STORE_32                     0xe        // 1110
+#  define DCACHE_TYPE_STORE_64                     0xf        // 1111
 
 // just take the 4 less significative bits.
@@ -343,21 +400,21 @@
   //-------------------------------------------------[ dcache_error ]-----
 
-#  define SIZE_DCACHE_ERROR                             1
-
-#  define DCACHE_ERROR_NONE                             0x0
-#  define DCACHE_ERROR_BUS_ERROR                        0x1
+#  define SIZE_DCACHE_ERROR                        1
+
+#  define DCACHE_ERROR_NONE                        0x0
+#  define DCACHE_ERROR_BUS_ERROR                   0x1
 
   //=================================================[ special_data ]=====
 
-#  define SIZE_SPECIAL_DATA                             2
+#  define SIZE_SPECIAL_DATA                        2
 
 // Position of flag in "rename register SR" (NOT IN "SR")
-#  define FLAG_POSITION_F                               0x0         // Conditionnal branch flag
-#  define FLAG_POSITION_CY                              0x1         // Carry was produced by last arithmetic operation
-#  define FLAG_POSITION_OV                              0x0         // Overflow occured during last arithmetic operation
-
-#  define FLAG_F                                        (1<<FLAG_POSITION_F ) // Conditionnal branch flag
-#  define FLAG_CY                                       (1<<FLAG_POSITION_CY) // Carry was produced by last arithmetic operation
-#  define FLAG_OV                                       (1<<FLAG_POSITION_OV) // Overflow occured during last arithmetic operation
+#  define FLAG_POSITION_F                          0x0         // Conditionnal branch flag
+#  define FLAG_POSITION_CY                         0x1         // Carry was produced by last arithmetic operation
+#  define FLAG_POSITION_OV                         0x0         // Overflow occured during last arithmetic operation
+
+#  define FLAG_F                                   (1<<FLAG_POSITION_F ) // Conditionnal branch flag
+#  define FLAG_CY                                  (1<<FLAG_POSITION_CY) // Carry was produced by last arithmetic operation
+#  define FLAG_OV                                  (1<<FLAG_POSITION_OV) // Overflow occured during last arithmetic operation
 
   //==========================================================[ spr ]=====
@@ -396,8 +453,8 @@
       GROUP_CUSTOM_6,            // 29     
       GROUP_CUSTOM_7,            // 30     
-      GROUP_CUSTOM_8             // 31     
+      GROUP_CUSTOM_8,            // 31     
+      NB_GROUP
     };
 
-#  define NB_GROUP                                 32
 #  define NB_REG_GROUP_SYSTEM_AND_CONTROL          1536
 #  define NB_REG_GROUP_DMMU                        1536
@@ -432,5 +489,72 @@
 #  define NB_REG_GROUP_CUSTOM_7                    0
 #  define NB_REG_GROUP_CUSTOM_8                    0
-					           
+
+  static const uint32_t NB_REG_GROUP [] =
+    {NB_REG_GROUP_SYSTEM_AND_CONTROL  ,
+     NB_REG_GROUP_DMMU                ,
+     NB_REG_GROUP_IMMU                ,
+     NB_REG_GROUP_DCACHE              ,
+     NB_REG_GROUP_ICACHE              ,
+     NB_REG_GROUP_MAC                 ,
+     NB_REG_GROUP_DEBUG               ,
+     NB_REG_GROUP_PERFORMANCE_COUNTER ,
+     NB_REG_GROUP_POWER_MANAGEMENT    ,
+     NB_REG_GROUP_PIC                 ,
+     NB_REG_GROUP_TICK_TIMER          ,
+     NB_REG_GROUP_FLOATING_POINT      ,
+     NB_REG_GROUP_RESERVED_1          ,
+     NB_REG_GROUP_RESERVED_2          ,
+     NB_REG_GROUP_RESERVED_3          ,
+     NB_REG_GROUP_RESERVED_4          ,
+     NB_REG_GROUP_RESERVED_5          ,
+     NB_REG_GROUP_RESERVED_6          ,
+     NB_REG_GROUP_RESERVED_7          ,
+     NB_REG_GROUP_RESERVED_8          ,
+     NB_REG_GROUP_RESERVED_9          ,
+     NB_REG_GROUP_RESERVED_10         ,
+     NB_REG_GROUP_RESERVED_11         ,
+     NB_REG_GROUP_RESERVED_12         ,
+     NB_REG_GROUP_CUSTOM_1            ,
+     NB_REG_GROUP_CUSTOM_2            ,
+     NB_REG_GROUP_CUSTOM_3            ,
+     NB_REG_GROUP_CUSTOM_4            ,
+     NB_REG_GROUP_CUSTOM_5            ,
+     NB_REG_GROUP_CUSTOM_6            ,
+     NB_REG_GROUP_CUSTOM_7            ,
+     NB_REG_GROUP_CUSTOM_8            };
+  
+  // GROUP_SYSTEM_AND_CONTROL
+#  define SPR_VR                                   0          // Version register
+#  define SPR_UPR                                  1          // Unit Present register
+#  define SPR_CPUCFGR                              2          // CPU Configuration register
+#  define SPR_DMMUCFGR                             3          // Data MMU Configuration register
+#  define SPR_IMMUCFGR                             4          // Instruction MMU Configuration register
+#  define SPR_DCCFGR                               5          // Data Cache Configuration register
+#  define SPR_ICCFGR                               6          // Instruction Cache Configuration register
+#  define SPR_DCFGR                                7          // Debug Configuration register
+#  define SPR_PCCFGR                               8          // Performance Counters Configuration register
+#  define SPR_NPC                                  16         // PC mapped to SPR space (next PC)
+#  define SPR_SR                                   17         // Supervision register
+#  define SPR_PPC                                  18         // PC mapped to SPR space (previous PC)
+#  define SPR_CID                                  19         // Context Id
+#  define SPR_FPCSR                                20         // FP Control Status register
+#  define SPR_EPCR                                 32         // Exception PC register
+#  define SPR_EEAR                                 48         // Exception EA register
+#  define SPR_ESR                                  64         // Exception SR register
+#  define SPR_GPR                                  1024       // GPRs mappted to SPR space
+  
+  // GROUP_DCACHE
+#  define SPR_DCCR                                 0          // DC Control register
+#  define SPR_DCBPR                                1          // DC Block Prefetch register
+#  define SPR_DCBFR                                2          // DC Block Flush register
+#  define SPR_DCBIR                                3          // DC Block Invalidate register
+#  define SPR_DCBWR                                4          // DC Block Write-back register
+#  define SPR_DCBLR                                5          // DC Block Lock register
+
+  // GROUP_ICACHE
+#  define SPR_ICCR                                 0          // IC Control register
+#  define SPR_ICBPR                                1          // IC Block Prefetch register
+#  define SPR_ICBIR                                2          // IC Block Invalidate register
+#  define SPR_ICBLR                                3          // IC Block Lock register
 					           
   // GROUP_MAC				           
@@ -438,4 +562,7 @@
 #  define SPR_MACHI                                2          // MAC High
 
+
+
+  // SR RENAME
 #  define NB_SPR_LOGIC                             2
 #  define LOG2_NB_SPR_LOGIC                        1
@@ -863,197 +990,4 @@
 #  define OPCOD_L_EXTWZ                            0x1           // 0001
 
-  /*
-
-  //--------------------------------------------------[ destination ]-----
-#define                 _size_destination1            4
-
-#define                  cst_DESTINATION1_NONE        0x0
-#define                 mask_DESTINATION1_GPR         0x1
-#define                 mask_DESTINATION1_MEMORY      0x2
-#define                 mask_DESTINATION1_SPR         0x4
-#define                 mask_DESTINATION1_MAC_UNIT    0x8
-  
-#define                 _size_destination2  3
-
-#define                  cst_DESTINATION2_NONE        0x0
-#define                 mask_DESTINATION2_COMMIT      0x1
-#define                 mask_DESTINATION2_MEMORY      0x2
-#define                 mask_DESTINATION2_SPR         0x4
-  
-  //----------------------------------------------------[ exec_flag ]-----
-#define                 _size_exec_flag               2
-
-#define                 mask_EXEC_FLAG_NONE           0x1
-#define                 mask_EXEC_FLAG_CARRY          0x1
-#define                 mask_EXEC_FLAG_FLAG           0x1
-#define                 mask_EXEC_FLAG_OVERFLOW       0x2
-
-  //---------------------------------------------------[ exec_excep ]-----
-#define                  _size_exec_excep             1
-
-#define                 mask_EXEC_EXCEP_NONE          0x0
-#define                 mask_EXEC_EXCEP_RANGE         0x1
-  
-  //----------------------------------------------------[ Condition ]-----
-#define                 _size_condition               3
-    
-#define                  cst_CONDITION_UNCONDITIONAL  0x0           // None condition (jump)
-#define                 mask_CONDITION_CONDITIONAL    0x2           
-#define                 mask_CONDITION_CONDITIONAL_NF 0x0           // Branch if Flag is clear 
-#define                 mask_CONDITION_CONDITIONAL_F  0x1           // Branch if Flag is set   
-#define                 mask_CONDITION_REG            0x4           // Branch if a register is read
-#define                 mask_CONDITION_STACK          0x8           // Branch with pop  in stack pointer
-
-  */
-
-  /*
-#define M_CPU_SIZE_INST       32
-
-//----------------------------------------------------
-// Exception type
-//----------------------------------------------------
-
-#define M_CPU_LOG2_NB_EXCP    5
-#define M_CPU_NB_EXCP         32
-
-#define EXCP_NO               0x00          // none exception
-#define EXCP_RESET            0x01          // software or hardware reset
-#define EXCP_BERR             0x02          // Access at a invalid physical adress
-#define EXCP_D_PAGE           0x03          // No matching or page violation protection in pages tables
-#define EXCP_I_PAGE           0x04          // No matching or page violation protection in pages tables
-#define EXCP_TICK_TIMER       0x05          // Tick timer interruption
-#define EXCP_ALIGNMENT        0x06          // Load/Store access is not aligned
-#define EXCP_ILL_INST         0x07          // Instruction is illegal (no implemented)
-#define EXCP_IRQ              0x08          // External interruption 
-#define EXCP_D_TLB            0x09          // DTLB miss
-#define EXCP_I_TLB            0x0a          // ITLB miss
-#define EXCP_RANGE            0x0b          // Overflow or access at a unimplemented register or context
-#define EXCP_SYSCALL          0x0c          // System Call
-#define EXCP_FP               0x0d          // Caused by a floating instruction
-#define EXCP_TRAP             0x0e          // L.trap or debug unit
-#define EXCP_RES0             0x0f          // Reserved for a futur usage
-#define EXCP_RES1             0x10          // Reserved for a futur usage
-#define EXCP_RES2             0x11          // Reserved for a futur usage
-#define EXCP_RES3             0x12          // Reserved for a futur usage
-#define EXCP_RES4             0x13          // Reserved for a futur usage
-#define EXCP_RES5             0x14          // Reserved for a futur usage
-#define EXCP_RES6             0x15          // Reserved for implemented specific exceptions
-#define EXCP_RES7             0x16          // Reserved for implemented specific exceptions
-#define EXCP_RES8             0x17          // Reserved for implemented specific exceptions
-#define EXCP_RES9             0x18          // Reserved for implemented specific exceptions
-#define EXCP_CUST0            0x19          // Reserved for custom exceptions
-#define EXCP_CUST1            0x1a          // Reserved for custom exceptions
-#define EXCP_CUST2            0x1b          // Reserved for custom exceptions
-#define EXCP_CUST3            0x1c          // Reserved for custom exceptions
-#define EXCP_CUST4            0x1d          // Reserved for custom exceptions
-#define EXCP_CUST5            0x1e          // Reserved for custom exceptions
-#define EXCP_CUST6            0x1f          // Reserved for custom exceptions
-
-//----------------------------------------------------
-// Flags
-//----------------------------------------------------
-
-#define M_CPU_NB_FLAG         3
-
-// Integer flags
-#define FLAG_F                0x1           // Conditionnal branch flag
-#define FLAG_CY               0x2           // Carry was produced by last arithmétic operation
-#define FLAG_OV               0x4           // Overflow occured during last arithmetic operation
-
-// Floating flags
-#define FLAG_OVF              0x004         // Overflow occured during last arithmetic operation
-#define FLAG_UNF              0x008         // Underflow flags
-#define FLAG_SNF              0x010         // Result SNAN
-#define FLAG_QNF              0x020         // Result QNAN
-#define FLAG_ZF               0x040         // Result is nul
-#define FLAG_IXF              0x080         // Result is inexact
-#define FLAG_IVF              0x100         // Result is invalid
-#define FLAG_INF              0x200         // Result is infinite
-#define FLAG_DZF              0x400         // Division by zero
-
-// Position of flag in "rename register SR" (NOT IN "SR")
-#define FLAG_POS_F            0x0           // Conditionnal branch flag
-#define FLAG_POS_CY           0x1           // Carry was produced by last arithmétic operation
-#define FLAG_POS_OV           0x0           // Overflow occured during last arithmetic operation
-
-//----------------------------------------------------
-// Instruction type
-//----------------------------------------------------
-
-#define M_CPU_LOG2_NB_TYPE    4
-
-#define TYPE_NOP              0x0
-#define TYPE_ALU_F            0x1           // Instruction ALU with    flag using (ADD, SUB, ADDC ...)
-#define TYPE_ALU_NF           0x2           // Instruction ALU without flag using (AND, OR ...)
-#define TYPE_MAC              0x3           // Instruction ALU with    utilisation of register HI/LO
-#define TYPE_J                0x4           // Branch instruction
-#define TYPE_SPR_READ         0x5           // Instruction special : l.mfspr
-#define TYPE_SPR_WRITE        0x6           // Instruction special : l.mtspr
-#define TYPE_SPECIAL          0x7           // Instruction execute in decode stage
-#define TYPE_CUSTOM           0x8           // Instruction Custom
-
-#define TYPE_LOAD_Z           0x9           // Load  access (extended by zero)
-#define TYPE_LOAD_S           0xa           // Load  access (sign extended)
-#define TYPE_STORE            0xc           // Store access
-
-//----------------------------------------------------
-// Condition to branch
-//----------------------------------------------------
-
-#define M_CPU_LOG2_NB_COND    4
-
-#define COND_NONE             0x0           // None condition (jump)
-#define COND_F                0x2           // Branch if Flag is set
-#define COND_NF               0x3           // Branch if Flag is clear
-#define COND_REG              0x4           // Branch if a register is read
-#define COND_STACK            0x8           // Branch with pop  in stack pointer
-
-//----------------------------------------------------
-// Event : State and Type
-//----------------------------------------------------
-
-#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 EVENT_TYPE_MISS       0             // miss of speculation
-#define EVENT_TYPE_EXCP       1             // exception or interruption occure
-
-// SPEC? TAKE?
-#define BRANCH_STATE_NONE         0  // 0     0
-#define BRANCH_STATE_NSPEC_TAKE   1  // 0     1  -> incondionnal
-#define BRANCH_STATE_SPEC_NTAKE   2  // 1     0
-#define BRANCH_STATE_SPEC_TAKE    3  // 1     1
-
-//----------------------------------------------------
-// Name to particular register
-//----------------------------------------------------
-
-//~~~~~~~~~~~~~~~~~~~~~~~~~~
-// GENERAL PURPOSE REGISTER
-//~~~~~~~~~~~~~~~~~~~~~~~~~~
-#define M_CPU_LOG2_NB_GPR_LOG 5
-#define M_CPU_NB_GPR_LOG      (1<<M_CPU_LOG2_NB_GPR_LOG)
-
-#define GPR_LOG_LR            0x09          // Link register
-#define REG_PHY_SR            0x00          // Status register
-
-//~~~~~~~~~~~~~~~~~~~~~~~~~~
-// SPECIAL PURPOSE REGISTER
-//~~~~~~~~~~~~~~~~~~~~~~~~~~
-#define M_CPU_LOG2_NB_SPR_LOG 1
-#define M_CPU_NB_SPR_LOG      (1<<M_CPU_LOG2_NB_SPR_LOG)
-#define M_CPU_SPR_SIZE_DATA   2             // Size of the most great register 
-
-#define SPR_LOG_SR_F          0x00          // Status register bit F                   (size = 1)
-#define SPR_LOG_SR_CY_OV      0x01          // Status register bit overflow and carry  (size = 2)
-//#define SPR_LOG_SR_LO         0x02          // MAC LSB                                 (size = 32)
-//#define SPR_LOG_SR_HI         0x03          // MAC MSB                                 (size = 32)
-  */
-
-  /*
-  */
-
 }; // end namespace behavioural
 }; // end namespace morpheo              
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Debug_component.h
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Debug_component.h	(revision 87)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Debug_component.h	(revision 88)
@@ -2,77 +2,96 @@
 #define Debug_component_H
 
-#  define DEBUG_true                                                true 
-#  define DEBUG_false                                               false
+// Boolean
+#  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_Context_State                               false
-#  define         DEBUG_Decod_unit                                  true
-#  define           DEBUG_Decod                                     true
-#  define           DEBUG_Decod_queue                               true
-#  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_Prediction_unit_Glue                      false 
-#  define           DEBUG_Return_Address_Stack                      false
-#  define           DEBUG_Update_Prediction_Table                   false
-#  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                              false
-#  define           DEBUG_Rename_select                             false
+// Component
+#  define DEBUG_Morpheo                                           true
+#  define   DEBUG_Behavioural                                     true
+#  define   DEBUG_Configuration                                   true
+#  define     DEBUG_Generic                                       true
+#  define       DEBUG_Counter                                     true 
+#  define       DEBUG_Priority                                    true
+#  define       DEBUG_Queue                                       true 
+#  define       DEBUG_Queue_Control                               true 
+#  define       DEBUG_RegisterFile                                true
+#  define         DEBUG_RegisterFile_Monolithic                   true 
+#  define         DEBUG_RegisterFile_Multi_Banked                 true
+#  define       DEBUG_Select                                      true
+#  define         DEBUG_Select_Priority_Fixed                     true 
+#  define       DEBUG_Shifter                                     true
+#  define       DEBUG_Sort                                        true
+#  define       DEBUG_Victim                                      true
+#  define         DEBUG_Victim_Pseudo_LRU                         true
+#  define     DEBUG_Core                                          true
+#  define       DEBUG_Core_Glue                                   true
+#  define       DEBUG_Dcache_Access                               true
+#  define       DEBUG_Icache_Access                               true 
+#  define       DEBUG_Multi_Front_end                             true
+#  define         DEBUG_Front_end                                 true
+#  define           DEBUG_Context_State                           true
+#  define           DEBUG_Decod_unit                              true
+#  define             DEBUG_Decod                                 true
+#  define             DEBUG_Decod_queue                           true
+#  define           DEBUG_Front_end_Glue                          true
+#  define           DEBUG_Ifetch_unit                             true
+#  define             DEBUG_Address_management                    true
+#  define             DEBUG_Ifetch_queue                          true
+#  define             DEBUG_Ifetch_unit_Glue                      true
+#  define           DEBUG_Prediction_unit                         true
+#  define             DEBUG_Branch_Target_Buffer                  true
+#  define               DEBUG_Branch_Target_Buffer_Glue           true
+#  define               DEBUG_Branch_Target_Buffer_Register       true
+#  define             DEBUG_Direction                             true
+#  define               DEBUG_Direction_Glue                      true
+#  define               DEBUG_Meta_Predictor                      true
+#  define                 DEBUG_Meta_Predictor_Glue               true
+#  define                 DEBUG_Two_Level_Branch_Predictor        true
+#  define                   DEBUG_Two_Level_Branch_Predictor_Glue true
+#  define                   DEBUG_Branch_History_Table            true
+#  define                   DEBUG_Pattern_History_Table           true
+#  define             DEBUG_Prediction_unit_Glue                  true
+#  define             DEBUG_Return_Address_Stack                  true
+#  define             DEBUG_Update_Prediction_Table               true
+#  define       DEBUG_Multi_OOO_Engine                            true
+#  define         DEBUG_OOO_Engine                                true
+#  define           DEBUG_Commit_unit                             true
+#  define           DEBUG_Issue_queue                             true 
+#  define           DEBUG_OOO_Engine_Glue                         true
+#  define           DEBUG_Reexecute_unit                          true
+#  define           DEBUG_Rename_unit                             true
+#  define             DEBUG_Load_Store_pointer_unit               true
+#  define             DEBUG_Register_translation_unit             true
+#  define               DEBUG_Dependency_checking_unit            true
+#  define               DEBUG_Free_List_unit                      true
+#  define               DEBUG_Register_Address_Translation_unit   true
+#  define               DEBUG_Register_translation_unit_Glue      true
+#  define               DEBUG_Stat_List_unit                      true
+#  define             DEBUG_Rename_select                         true
+#  define             DEBUG_Rename_unit_Glue                      true 
+#  define           DEBUG_Special_Register_unit                   true
+#  define       DEBUG_Multi_Execute_loop                          true
+#  define         DEBUG_Execute_loop                              true
+#  define           DEBUG_Execute_loop_Glue                       true 
+#  define           DEBUG_Multi_Execute_unit                      true
+#  define             DEBUG_Execute_unit                          true
+#  define               DEBUG_Functionnal_unit                    true
+#  define               DEBUG_Load_store_unit                     true
+#  define           DEBUG_Multi_Read_unit                         true
+#  define             DEBUG_Read_unit                             true
+#  define               DEBUG_Read_queue                          true
+#  define               DEBUG_Reservation_station                 true
+#  define           DEBUG_Multi_Write_unit                        true
+#  define             DEBUG_Write_unit                            true
+#  define               DEBUG_Execute_queue                       true
+#  define               DEBUG_Write_queue                         true
+#  define           DEBUG_Network                                 true
+#  define             DEBUG_Execution_unit_to_Write_unit          true
+#  define             DEBUG_Read_unit_to_Execution_unit           true
+#  define           DEBUG_Register_unit                           true
+#  define             DEBUG_Register_unit_Glue                    true
+
+// Others
+#  define DEBUG_Allocation                                        true
+#  define DEBUG_Interface                                         true
 #endif
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Environment.h
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Environment.h	(revision 87)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Environment.h	(revision 88)
@@ -2,34 +2,5 @@
 #define morpheo_behavioural_Environment_h
 
-#if (defined(STATISTICS) and not defined(SYSTEMC))
-#  error "To have the statistics, you must set flags SYSTEMC"
-#endif
-
-#if (defined(INFORMATION) and not defined(STATISTICS))
-#  error "To have the information, you must set flags STATISTICS"
-#endif
-
-#if (defined(VHDL_TESTBENCH) and not defined(SYSTEMC))
-#  error "To have the vhdl's test bench, you must set flags SYSTEMC"
-#endif
-
-#if (defined(VHDL_TESTBENCH) and not defined(VHDL))
-#  error "To have the vhdl's test bench, you must set flags VHDL"
-#endif
-
-#if (defined(VHDL_TESTBENCH_ASSERT) and not defined(VHDL_TESTBENCH))
-#  error "To have an assert in vhdl's test bench, you must set flags VHDL_TESTBENCH"
-#endif
-
-#if (defined(VHDL_TESTBENCH) and defined(SYSTEMC))
-#  define SYSTEMC_VHDL_COMPATIBILITY
-#endif
-
-#if (defined(DEBUG))
-#  define DEBUG_TEST
-#endif
-
-// Environment variable
-#define MORPHEO_HOME          "MORPHEO_HOME"
+//#include "Common/include/Environment.h"
 
 #endif
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/include/FileXMLLight.h
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/include/FileXMLLight.h	(revision 88)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/include/FileXMLLight.h	(revision 88)
@@ -0,0 +1,28 @@
+#ifndef _FILE_XMLLIGHT_H
+#define _FILE_XMLLIGHT_H
+
+#include "Behavioural/include/AbstractXMLLight.h"
+#include <fstream>
+
+using std::basic_ifstream;
+
+namespace morpheo {
+	namespace XMLUtils {
+	//**************************************Class Declaration*******************************************//
+	
+		template<typename char_type, typename reference_counter_type = ClassicReferenceCounter>
+		class FileXMLLight : public AbstractXMLLight<char_type, reference_counter_type> {
+		public:
+			inline explicit FileXMLLight(const basic_ifstream<char_type> & inputFileStream, 
+				IXMLLight<char_type,reference_counter_type> * parent = NULL );
+		};
+	
+	//*****************************************Inline Implementation*************************************//
+		template < typename char_type, typename ref_counter_type>
+		FileXMLLight<char_type,ref_counter_type>::FileXMLLight
+		(const basic_ifstream<char_type> & inputFileStream, IXMLLight<char_type,ref_counter_type> * parent) 
+			: AbstractXMLLight<char_type, ref_counter_type>(inputFileStream, parent) {}
+		
+	}
+}
+#endif //_FILE_XMLLIGHT_H
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/include/IReferenceCounters.h
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/include/IReferenceCounters.h	(revision 88)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/include/IReferenceCounters.h	(revision 88)
@@ -0,0 +1,25 @@
+#ifndef _REFERENCE_COUNTER_
+#define _REFERENCE_COUNTER_
+
+namespace morpheo {
+	namespace ReferenceCountersUtils {
+	
+	//**********************************Class Declaration********************************************//
+	
+	template< typename reference_counter_type> class IReferenceCounter {
+	public:
+		virtual inline ~IReferenceCounter(void) = 0;
+		
+		virtual reference_counter_type attach(void) = 0; 
+		virtual reference_counter_type detach(void) = 0; 
+	};
+
+	//**********************************Inline implementation*****************************************//
+	
+	template < typename reference_counter_type> 
+	IReferenceCounter<reference_counter_type>::~IReferenceCounter(void) {}
+
+	} // end of ReferenceCountersUtils namespace.
+} // end of morpheo namespace.
+
+#endif // end of _REFERENCE_COUNTER_ 	
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/include/IXMLLight.h
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/include/IXMLLight.h	(revision 88)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/include/IXMLLight.h	(revision 88)
@@ -0,0 +1,79 @@
+#ifndef _XMLLIGHT_H
+#define _XMLLIGHT_H
+
+#include <string>
+#include <map>
+#include "Behavioural/include/ClassicReferenceCounter.h"
+#include "Behavioural/include/XMLLightVector.h"
+
+using std::map;
+using std::basic_string;
+using morpheo::ReferenceCountersUtils::ClassicReferenceCounter;
+
+namespace morpheo {
+	namespace XMLUtils {
+	
+	//*******************************Class Declaration***************************************************//
+
+		enum ETEXT_ENCODING {
+			ASCII, 
+			UTF8,
+			UTF16,
+			// UTF16_LE,
+			// UTF16_BE,
+			UTF32
+		};
+
+
+		// the main interface for XML parsing used a reference counter class to implement ref counting
+
+		template< typename char_type, typename ReferenceCounter = ClassicReferenceCounter> class IXMLLight 
+			: virtual public ReferenceCounter {
+		protected :
+			typedef IXMLLight<char_type, ReferenceCounter> XMLLight;
+			typedef basic_string<char_type> string;
+		public :
+			// used to fetch XML Nodes contains inside a XMLLight object with the pattern name 	
+			virtual XMLLightVector<XMLLight> getNodes( const string & pattern = "") = 0;
+			//virtual XMLLight & getFirstNode ( const string & pattern ) = 0 ; 
+			//virtual XMLLight & getRoot ( void ) = 0 ; 
+			
+			// fetch the name of tne node selected 
+			virtual basic_string<char_type> getName ( void ) = 0 ; 
+			// fetch the encoding used inside the XML document.
+			//virtual ETEXT_ENCODING getEncodingForm ( void ) = 0;
+
+			/*	
+			virtual string &   getValue ( void ) = 0 ;
+			virtual string & getValue ( const string & firstNodeName ) = 0 ; 
+			*/
+			virtual bool containsAttribute ( const basic_string<char_type> & attributeName ) = 0 ;
+			
+			virtual map<basic_string<char_type>, basic_string<char_type> > getAttributes ( void ) = 0 ; 
+
+			virtual basic_string<char_type> getAttributeValue ( const basic_string<char_type> & attributeName ) = 0;
+			virtual basic_string<char_type> getInternalString(void) const = 0 ; 						
+			// only instanciated to bring a virtual destructor.
+			virtual inline ~IXMLLight( void ) = 0 ; 
+			
+		};
+
+	//*************************************Inline implementation*****************************************//	
+
+		// implementation of XMLLight virtual destructor.
+		template<typename char_type,typename ReferenceCounter> IXMLLight<char_type, ReferenceCounter>::~IXMLLight(void) {}  
+
+	//******************************** Typedef of multiple XMLLight Interface**********************//
+
+	// valid with 32 bits computer only . don't forget use of widen to widening string 
+
+	typedef IXMLLight<char   , ClassicReferenceCounter> IXMLLightASCII;
+	typedef IXMLLight<wchar_t, ClassicReferenceCounter> IXMLLightUTF8;
+	typedef IXMLLight<wchar_t, ClassicReferenceCounter> IXMLLightUTF16;
+	typedef IXMLLight<wchar_t, ClassicReferenceCounter> IXMLLightUTF32;
+
+
+	} // end of XMLUtils namespace.
+} // end of morpheo namespace.
+
+#endif // _XMLLIGHT_H
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Interface.h
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Interface.h	(revision 87)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Interface.h	(revision 88)
@@ -34,5 +34,5 @@
   {
     // -----[ fields ]----------------------------------------------------
-  protected : const std::string          _name         ;
+  protected : const std::string     _name         ;
 #ifdef POSITION
   protected : const direction_t     _direction    ;
@@ -42,8 +42,8 @@
 
 #ifdef POSITION
-  protected :       std::string          _comment      ;
-#endif
-
-  protected : std::list<Signal *>      * _list_signal  ;
+  protected :       std::string     _comment      ;
+#endif
+
+  protected : std::list<Signal *> * _list_signal  ;
 
 #ifdef POSITION
@@ -69,13 +69,13 @@
   public    :                       ~Interface           ();
 
-  public    : std::string                get_name             ();
+  public    : std::string           get_name             ();
 
 #ifdef POSITION
   public    : void                  set_comment          (std::string comment);
-  protected : std::string                get_comment          (void          );
-#endif
-
-  protected : std::string                signal_name          (std::string      name_interface,
-							  std::string      name_signal   ,
+  protected : std::string           get_comment          (void);
+#endif
+
+  protected : std::string           signal_name          (std::string name_interface,
+							  std::string name_signal   ,
 							  direction_t direction     );
 
@@ -83,13 +83,13 @@
   public    : bool                  find_signal          (Signal * signal);
 
-  protected : std::string                get_signal           (void);
-  public    : Signal *              set_signal           (std::string          name     ,
+  protected : std::string           get_signal           (void);
+  public    : Signal *              set_signal           (std::string     name     ,
 							  direction_t     direction,
 							  uint32_t        size     ,
 							  presence_port_t presence_port = PORT_VHDL_YES_TESTBENCH_YES);
-  public    : std::list<Signal *>      * get_signal_list      (void);
+  public    : std::list<Signal *> * get_signal_list      (void);
 
 #ifdef SYSTEMC
-  public    : sc_in_clk *           set_signal_clk       (std::string          name     ,
+  public    : sc_in_clk *           set_signal_clk       (std::string     name     ,
 							  uint32_t        size     ,
 							  presence_port_t presence_port=CLOCK_VHDL_YES)
@@ -120,5 +120,5 @@
 
   public    : template <typename T>
-              sc_in <T> *           set_signal_in       (std::string          name     ,
+              sc_in <T> *           set_signal_in       (std::string     name     ,
 							 uint32_t        size     ,
 							 presence_port_t presence_port=PORT_VHDL_YES_TESTBENCH_YES)
@@ -149,5 +149,5 @@
 
   public    : template <typename T>
-              sc_out <T> *          set_signal_out      (std::string          name     ,
+              sc_out <T> *          set_signal_out      (std::string     name     ,
 							 uint32_t        size     ,
 							 presence_port_t presence_port=PORT_VHDL_YES_TESTBENCH_YES)
@@ -218,17 +218,17 @@
   public    : void                  testbench_cycle      (void);
   public    : void                  testbench_body       (Vhdl           * & vhdl          ,
-							  std::string             counter_name  ,
-							  std::string             reset_name    );
+							  std::string        counter_name  ,
+							  std::string        reset_name    );
   public    : std::string           testbench_test       (Vhdl           * & vhdl        ,
-							  std::string             counter_name,
-							  std::string             reset_name);
-  public    : std::string           testbench_test_ok    (Vhdl           * & vhdl        );
-  protected : std::string           testbench_test_name   (Vhdl           * & vhdl);
-  protected : std::string           testbench_test_ok_name(Vhdl           * & vhdl);
-  protected : std::string           testbench_test_transaction_name(Vhdl           * & vhdl);
+							  std::string        counter_name,
+							  std::string        reset_name);
+  public    : std::string           testbench_test_ok               (Vhdl * & vhdl);
+  protected : std::string           testbench_test_name             (Vhdl * & vhdl);
+  protected : std::string           testbench_test_ok_name          (Vhdl * & vhdl);
+  protected : std::string           testbench_test_transaction_name (Vhdl * & vhdl);
 #endif
 
   public    : bool                  test_map             (uint32_t depth, bool top_level, bool is_behavioural);
-//   public    : bool                  test_equi            (uint32_t depth);
+//public    : bool                  test_equi            (uint32_t depth);
 
 #ifdef POSITION
@@ -238,6 +238,6 @@
   public    : XML                   toXML_mapping        (void);
 #endif
-  public    : friend std::ostream&       operator<<           (std::ostream& output_stream,
-							       morpheo::behavioural::Interface & x);
+  public    : friend std::ostream&  operator<<           (std::ostream& output_stream,
+                                                          morpheo::behavioural::Interface & x);
 
   };
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Interface_fifo.h
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Interface_fifo.h	(revision 87)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Interface_fifo.h	(revision 88)
@@ -5,5 +5,5 @@
  * $Id$
  *
- * [ Description ]
+ * [ Description ]
  * 
  */
@@ -35,9 +35,9 @@
 
 #ifdef VHDL_TESTBENCH
-  private   : bool                  _test_exhaustive;
+  private   : bool                       _test_exhaustive;
   private   : std::list<uint32_t>      * _list_cycle   ;
 #endif
 
-   // -----[ methods ]---------------------------------------------------
+   // -----[ methods ]---------------------------------------------------
   public    :                       Interface_fifo       (std::string         name        
 #ifdef POSITION
@@ -107,7 +107,11 @@
   public    : bool                  testbench_transaction(void);
   public    : void                  testbench_cycle      (void);
-  public    : std::string           testbench_test       (Vhdl   * & vhdl        ,
-							  std::string     counter_name,
-							  std::string     reset_name  );
+  public    : std::string           testbench_test       (Vhdl    * & vhdl        ,
+							  std::string counter_name,
+							  std::string reset_name  );
+#ifdef VHDL_TESTBENCH_ASSERT
+  public    : void                  testbench_assert     (Vhdl    * & vhdl        ,
+							  std::string counter_name);
+#endif
 
   public    : std::string           testbench_test_transaction (Vhdl * & vhdl);
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Interfaces.h
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Interfaces.h	(revision 87)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Interfaces.h	(revision 88)
@@ -27,7 +27,7 @@
   {
     // -----[ fields ]----------------------------------------------------
-  private   : const std::string               _name;
-  private   : const Tusage_t             _usage;
-  private   : std::list<Interface_fifo*>    * _list_interface;
+  private   : const std::string            _name;
+  private   : const Tusage_t               _usage;
+  private   : std::list<Interface_fifo*> * _list_interface;
 
     // -----[ methods ]---------------------------------------------------
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Operation.h
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Operation.h	(revision 88)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Operation.h	(revision 88)
@@ -0,0 +1,26 @@
+#ifndef Morpheo_Behavioural_Operation_h
+#define Morpheo_Behavioural_Operation_h
+
+/*
+ * $Id$
+ *
+ * [ Description ]
+ * 
+ */
+
+namespace morpheo {
+namespace behavioural {
+
+#define neg(size,data)             (~(data)+1)
+#define sign(size,data)            ((data)>>(size-1))
+#define unsigned(size,data)        (data)
+#define signed(size,data)          ((sign(size,data)==0)?(data):neg(size,data))
+#define ovf(size,op1, op2, res)    ((sign(size,op1) == sign(size,op2))?(sign(size,op1) xor sign(size,res)):0)
+#define carry(size,op1, op2, res)  (((res)<(op1)) or ((res)<(op2)))
+#define set_flag(data,flag,is_set) (((is_set)==1)?((data)|(flag)):((data)&~(flag)))
+#define get_flag(data,flag)	   (((data)&(flag))!=0)
+#define concatenation_bool(a,b)    (((a)<<1) | (b))
+
+}; // end namespace behavioural
+}; // end namespace morpheo              
+#endif
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Parameters.h
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Parameters.h	(revision 87)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Parameters.h	(revision 88)
@@ -9,8 +9,6 @@
  */
 
-#include <stdint.h>
-#include <iostream>
-#include <math.h>
-#include "Behavioural/include/Environment.h"
+#include "Common/include/Environment.h"
+#include "Behavioural/include/Parameters_test.h"
 #include "Behavioural/include/Constants.h"
 #include "Behavioural/include/Test.h"
@@ -19,34 +17,16 @@
 #include "Common/include/Log2.h"
 #include "Common/include/Debug.h"
+#include <stdint.h>
+#include <iostream>
+#include <math.h>
 
 namespace morpheo     {
 namespace behavioural {
+  
+#ifdef COPY
+#error "Need COPY macro"
+#endif
 
-  template <typename T> bool test (uint32_t size) 
-  {
-    return (size <= (8*sizeof(T)));
-  };
-
-  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       += MSG_ERROR      ; _error       += " <" + _component + "> " + str + "\n";}
-  public    : void        warning     (std::string str) { _warning     += MSG_WARNING    ; _warning     += " <" + _component + "> " + str + "\n";}
-  public    : void        information (std::string str) { _information += MSG_INFORMATION; _information += " <" + _component + "> " + str + "\n";}
-  public    : std::string print       (void)            { return _error + _warning + _information;};
-  };
+#define COPY(param) do {duplicate(param); param->copy();} while (0)
 
   // Virtual Class - Interface of each component
@@ -54,28 +34,94 @@
   {
     // -----[ fields ]----------------------------------------------------
-  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;
+  public   : static const uint32_t   _size_instruction              = 32;
+  public   : static const uint32_t   _size_spr                      = 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_special_address_group    = 5;
+  public   : static const uint32_t   _size_special_address_register = 11;
+  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;
+
+  public   : static const uint32_t   _shift_spr_num_group           = _size_special_address_register;
+  public   : static const uint32_t   _mask_spr_num_group            = 0x1f ; //        1_1111
+  public   : static const uint32_t   _mask_spr_num_reg              = 0x7ff; // 111_1111_1111
+
+    // simulation
+  public  :               uint64_t   _simulation_nb_cyle                    ;
+  public  :               uint64_t   _simulation_nb_instruction             ;
+
+    // parameters depends
+  public   :              uint32_t   _size_context_id                       ;
+  public   :              bool       _have_port_context_id                  ;
+
+  public   :              uint32_t   _size_front_end_id                     ;
+  public   :              bool       _have_port_front_end_id                ;
+
+  public   :              uint32_t   _size_ooo_engine_id                    ;
+  public   :              bool       _have_port_ooo_engine_id               ;
+                         
+  public   :              uint32_t   _size_instruction_address              ;
+//public   :              bool       _have_port_instruction_address         ; // always true
+
+  public   :              uint32_t   _size_data_address                     ;
+//public   :              bool       _have_port_data_address                ; // always true
+
+  public   :              uint32_t   _size_nb_inst_decod                    ;
+//public   :              bool       _have_port_nb_inst_decod               ; // always true
+
+  public   :              uint32_t   _size_nb_inst_commit                   ;
+//public   :              bool       _have_port_nb_inst_commit              ; // always true
+                         
+  public   :              uint32_t   _size_depth                            ;
+  public   :              bool       _have_port_depth                       ;
+                         
+  public   :              uint32_t   _size_ifetch_queue_ptr                 ;
+  public   :              bool       _have_port_ifetch_queue_ptr            ;
+                         
+  public   :              uint32_t   _size_inst_ifetch_ptr                  ; // nb_inst_fetch
+  public   :              bool       _have_port_inst_ifetch_ptr             ;
+                         
+//public   :              uint32_t   _size_branch_update_prediction_id      ; // = size_depth
+//public   :              bool       _have_port_branch_update_prediction_id ; // = size_depth
+
+  public   :              uint32_t   _size_rob_ptr                          ;
+  public   :              bool       _have_port_rob_ptr                     ;
+
+  public   :              uint32_t   _size_load_queue_ptr                   ;
+  public   :              bool       _have_port_load_queue_ptr              ;
+
+  public   :              uint32_t   _size_store_queue_ptr                  ;
+//public   :              bool       _have_port_store_queue_ptr             ; // always true (min = 1)
+
+  public   :              uint32_t   _size_general_data                     ;
+//public   :              bool       _have_port_general_data                ; // always true
+                         
+  public   :              uint32_t   _size_special_data                     ;
+//public   :              bool       _have_port_special_data                ; // always true
+ 
+  public   :              uint32_t   _size_general_register                 ;
+//public   :              bool       _have_port_general_register            ; // always true
+
+  public   :              uint32_t   _size_special_register                 ;
+//public   :              bool       _have_port_special_register            ; // always true
 
     // -----[ methods ]---------------------------------------------------
@@ -87,6 +133,10 @@
   public   : virtual Parameters_test    msg_error   (void) = 0;
 
-    // methods to generate configuration file
-    
+    // methods to copy depends parameters
+    // (these parameters can't be static : because can have multi instance of toplevel)
+  public   : virtual void               copy        (void) = 0; 
+//public   :         void               copy        (Parameters * param);
+  public   :         void               duplicate   (Parameters * param);
+
     // methods to test
   public   :         void               test        (void);
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Parameters_test.h
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Parameters_test.h	(revision 88)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Parameters_test.h	(revision 88)
@@ -0,0 +1,46 @@
+#ifndef morpheo_behavioural_Parameters_test_h
+#define morpheo_behavioural_Parameters_test_h
+
+/*
+ * $Id$
+ *
+ * [ Description ]
+ * 
+ */
+
+#include "Common/include/Debug.h"
+
+namespace morpheo     {
+namespace behavioural {
+
+  template <typename T> bool test (uint32_t size) 
+  {
+    return (size <= (8*sizeof(T)));
+  };
+
+  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       += MSG_ERROR      ; _error       += " <" + _component + "> " + str;}
+  public    : void        warning     (std::string str) { _warning     += MSG_WARNING    ; _warning     += " <" + _component + "> " + str;}
+  public    : void        information (std::string str) { _information += MSG_INFORMATION; _information += " <" + _component + "> " + str;}
+  public    : std::string print       (void)            { return _error + _warning + _information;};
+  };
+
+}; // end namespace behavioural          
+}; // end namespace morpheo              
+
+#endif
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/include/SPR.h
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/include/SPR.h	(revision 88)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/include/SPR.h	(revision 88)
@@ -0,0 +1,19 @@
+#ifndef morpheo_behavioural_SPR_h
+#define morpheo_behavioural_SPR_h
+
+#include "Behavioural/include/SPR_access_mode.h"
+
+namespace morpheo {
+namespace behavioural {
+
+  class SPR
+  {
+  public : virtual       ~SPR   (void  ) {};
+  public : virtual void   reset (void  ) = 0;
+  public : virtual Tspr_t read  (void  ) = 0;
+  public : virtual void   write (Tspr_t) = 0;
+  };
+
+}  // end namespace behavioural
+}  // end namespace morpheo              
+#endif
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/include/SPR_access_mode.h
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/include/SPR_access_mode.h	(revision 87)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/include/SPR_access_mode.h	(revision 88)
@@ -10,15 +10,22 @@
 namespace behavioural {
 
-  typedef struct
+  class spr_address_t
   {
-    Tgeneral_data_t _group;
-    Tgeneral_data_t _register;
-  } spr_address_t;
+  public : Tgeneral_data_t _group;
+  public : Tgeneral_data_t _register;
 
+  public : spr_address_t (void) {};
+  public : spr_address_t (Tgeneral_data_t grp,
+			  Tgeneral_data_t reg)
+    {
+      _group    = grp;
+      _register = reg;
+    };
+  };
 
   class SPR_access_mode
   {
-  private : spr_access_mode_t   ** _spr_generic;
-  private : uint32_t             * _max_register_by_group;
+  private : spr_access_mode_t   ** _spr_generic          ; //[NB_GROUP][NB_REG_GROUP]
+  private : uint32_t             * _max_register_by_group; //[NB_GROUP]
 
   public  : SPR_access_mode();
@@ -29,4 +36,6 @@
   public  : bool          valid (uint32_t num_group, uint32_t num_reg);
   public  : bool          valid (spr_address_t address);
+  public  : bool          exist (uint32_t num_group, uint32_t num_reg);
+  public  : bool          exist (spr_address_t address);
   public  : bool          read  (spr_address_t address, Tcontrol_t SM, Tcontrol_t SUMRA);
   public  : bool          write (spr_address_t address, Tcontrol_t SM, Tcontrol_t SUMRA);
@@ -35,4 +44,6 @@
   public  : uint32_t      implement_group (uint32_t num_group);
   public  : void          change_mode     (uint32_t num_group, uint32_t num_reg, spr_access_mode_t new_mode);
+  public  : void          invalid_register(uint32_t num_group, uint32_t num_reg);
+
   };
   
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Selftest.h
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Selftest.h	(revision 88)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Selftest.h	(revision 88)
@@ -0,0 +1,72 @@
+#ifndef morpheo_behavioural_Selftest_h
+#define morpheo_behavioural_Selftest_h
+
+/*
+ * $Id$
+ *
+ * [ Description ]
+ * 
+ */
+
+#include "Behavioural/include/Allocation.h"
+#include "Common/include/FromString.h"
+#include "Common/include/Debug.h"
+
+// ======================================================================
+// =====[ ALLOCATION / DELETE of ARRAY ]=================================
+// ======================================================================
+
+#define AFFECT0(var,type,argv,x)                  \
+  var = morpheo::fromString<type>(argv[x++]);
+
+#define AFFECT1(var,type,argv,x,s1)               \
+  for (uint32_t it1=0; it1<s1; ++it1)                     \
+    {                                                     \
+      var [it1] = morpheo::fromString<type>(argv[x++]);   \
+    }
+
+#define AFFECT2(var,type,argv,x,s1,s2)                  \
+  for (uint32_t it1=0; it1<s1; ++it1)                           \
+    for (uint32_t it2=0; it2<s2; ++it2)                         \
+      {                                                         \
+        var [it1][it2] = morpheo::fromString<type>(argv[x++]);  \
+      }
+
+#define AFFECT3(var,type,argv,x,s1,s2,s3)                       \
+  for (uint32_t it1=0; it1<s1; ++it1)                                   \
+    for (uint32_t it2=0; it2<s2; ++it2)                                 \
+      for (uint32_t it3=0; it3<s3; ++it3)                               \
+        {                                                               \
+          var [it1][it2][it3] = morpheo::fromString<type>(argv[x++]);   \
+        }
+
+#define AFFECT4(var,type,argv,x,s1,s2,s3,s4)                    \
+  for (uint32_t it1=0; it1<s1; ++it1)                                   \
+    for (uint32_t it2=0; it2<s2; ++it2)                                 \
+      for (uint32_t it3=0; it3<s3; ++it3)                               \
+        for (uint32_t it4=0; it4<s4; ++it4)                             \
+          {                                                             \
+            var [it1][it2][it3][it4] = morpheo::fromString<type>(argv[x++]); \
+          }
+
+
+#define SELFTEST0(var,type,argv,x)              \
+  AFFECT0(var,type,argv,x);                     \
+  
+#define SELFTEST1(var,type,argv,x,s1)           \
+  ALLOC1(var,type,s1);                          \
+  AFFECT1(var,type,argv,x,s1);
+
+#define SELFTEST2(var,type,argv,x,s1,s2)                \
+  ALLOC2(var,type,s1,s2);                               \
+  AFFECT2(var,type,argv,x,s1,s2);
+
+#define SELFTEST3(var,type,argv,x,s1,s2,s3)             \
+  ALLOC3(var,type,s1,s2,s3);                            \
+  AFFECT3(var,type,argv,x,s1,s2,s3);
+
+#define SELFTEST4(var,type,argv,x,s1,s2,s3,s4)          \
+  ALLOC4(var,type,s1,s2,s3,s4);                         \
+  AFFECT4(var,type,argv,x,s1,s2,s3,s4);
+
+#endif
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Signal.h
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Signal.h	(revision 87)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Signal.h	(revision 88)
@@ -38,5 +38,6 @@
 		UINT64_T                   } type_info_t;
 
-  typedef enum {PORT_VHDL_YES_TESTBENCH_YES,
+  typedef enum {PORT_SYSTEMC_NO            , // also, vhdl_no and testbench_no
+                PORT_VHDL_YES_TESTBENCH_YES,
 		PORT_VHDL_YES_TESTBENCH_NO ,
 		PORT_VHDL_NO_TESTBENCH_YES ,
@@ -72,10 +73,10 @@
 
     // -----[ methods ]---------------------------------------------------
-  public    :                   Signal          (std::string          name          ,
-						 direction_t     direction     ,
-						 uint32_t        size          ,
-						 presence_port_t presence_port = PORT_VHDL_YES_TESTBENCH_YES);
-  public    :                   Signal          (const Signal &);
-  public    :                   ~Signal         ();
+  public    :                   Signal                  (std::string     name          ,
+						         direction_t     direction     ,
+						         uint32_t        size          ,
+						         presence_port_t presence_port = PORT_VHDL_YES_TESTBENCH_YES);
+  public    :                   Signal                  (const Signal &);
+  public    :                   ~Signal                 ();
 
   public    : std::string       get_name                (void);
@@ -93,5 +94,5 @@
 
   public    : bool              test_map                (uint32_t depth, bool top_level, bool is_behavioural);
-//   public    : bool              test_equi               (uint32_t depth);
+//public    : bool              test_equi               (uint32_t depth);
 
   public    : void              link                    (Signal * signal_dest,
@@ -108,5 +109,5 @@
 	case IN  : {return read_in  <T>();}
 	case OUT : {return read_out <T>();}
-	default  : throw (ErrorMorpheo ("Signal \""+_name+"\" : direction unknow."));
+	default  : throw (ErrorMorpheo ("Signal \""+_name+"\" : direction unknow.\n"));
 	}
     }
@@ -122,5 +123,5 @@
 	case UINT32_T : return (static_cast<sc_in  <uint32_t> *>(_sc_signal_map)->read()); 
 	case UINT64_T : return (static_cast<sc_in  <uint64_t> *>(_sc_signal_map)->read()); 
-	default       : throw (ErrorMorpheo ("Signal \""+_name+"\" : type unknow."));
+	default       : throw (ErrorMorpheo ("Signal \""+_name+"\" : type unknow.\n"));
 	}
     }
@@ -136,5 +137,5 @@
 	case UINT32_T : return (static_cast<sc_out <uint32_t> *>(_sc_signal_map)->read()); 
 	case UINT64_T : return (static_cast<sc_out <uint64_t> *>(_sc_signal_map)->read()); 
-	default       : throw (ErrorMorpheo ("Signal \""+_name+"\" : type unknow."));
+	default       : throw (ErrorMorpheo ("Signal \""+_name+"\" : type unknow.\n"));
 	}
     }
@@ -148,8 +149,8 @@
 
       if (_type_info != UNKNOW)
-	throw (ErrorMorpheo ("Signal \""+_name+"\" : already allocate."));
+	throw (ErrorMorpheo (toString(_("Signal \"%s\" : already allocate.\n"),_name.c_str())));
 
       if (test<T>(_size) == false)
-	throw (ErrorMorpheo ("Signal \""+_name+"\" : size is too small to the associate type."));
+	throw (ErrorMorpheo (toString(_("Signal \"%s\" : size is too small (%d bits) to the associate type (%d bits).\n"),_name.c_str(),_size,8*sizeof(T))));
 
       _is_allocate    = true;
@@ -157,6 +158,4 @@
       _sc_signal_map  = sc_signal;
 
-      log_printf(TRACE,Behavioural,FUNCTION, "Allocation of %s - %.8x", _name.c_str(), (uint32_t)(_sc_signal_map));
-
       if (typeid(T) == typeid(bool    ))
 	_type_info = BOOL;
@@ -175,4 +174,6 @@
       else
 	_type_info = UNKNOW;
+
+      log_printf(TRACE,Behavioural,FUNCTION, "Allocation of %s (%s, 0x%.8x)", _name.c_str(),toString(_type_info).c_str(), static_cast<uint32_t>(reinterpret_cast<uint64_t>(_sc_signal_map)));
 
       log_printf(FUNC,Behavioural,FUNCTION,"End");
@@ -204,4 +205,7 @@
   };
 }; // end namespace behavioural          
+
+
+
 
   template<>           inline std::string toString<morpheo::behavioural::presence_port_t>(const morpheo::behavioural::presence_port_t& x)
@@ -221,4 +225,25 @@
   }
 
+  typedef enum {UNKNOW                     ,
+		BOOL                       ,
+		UINT8_T                    ,
+		UINT16_T                   ,
+		UINT32_T                   ,
+		UINT64_T                   } type_info_t;
+
+  template<>           inline std::string toString<morpheo::behavioural::type_info_t>(const morpheo::behavioural::type_info_t& x)
+  {
+    switch (x)
+      {
+      case morpheo::behavioural::BOOL     : return "bool"    ; break;
+      case morpheo::behavioural::UINT8_T  : return "uint8_t" ; break;
+      case morpheo::behavioural::UINT16_T : return "uint16_t"; break;
+      case morpheo::behavioural::UINT32_T : return "uint32_t"; break;
+      case morpheo::behavioural::UINT64_T : return "uint64_t"; break;
+      case morpheo::behavioural::UNKNOW   :
+      default                             : return "unknow"  ; break;
+      }
+  }
+
 }; // end namespace morpheo              
 
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Simulation.h
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Simulation.h	(revision 88)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Simulation.h	(revision 88)
@@ -0,0 +1,44 @@
+#ifdef SYSTEMC
+#ifndef morpheo_behavioural_Simulation_h
+#define morpheo_behavioural_Simulation_h
+
+/*
+ * $Id$
+ *
+ * [ Description ]
+ * 
+ */
+
+#include "Common/include/Debug.h"
+
+#include <stdint.h>
+#include <systemc.h>
+#include <vector>
+
+namespace morpheo              {
+namespace behavioural          {
+
+extern double                _simulation_nb_cycle;
+// extern double                _simulation_nb_instruction;
+// extern std::vector<double> * _simulation_nb_instruction_commited;
+
+  // Warning, now no mutek to protect this variable
+
+//   class Simulation
+//   {
+//   private : const  uint32_t _num_context;
+
+//   public  :  Simulation (void);
+//   public  : ~Simulation (void);
+//   public  : void end_cycle (double nb_instruction_commited);
+//   };
+
+  bool simulation_test_end (void);
+  void simulation_init     (double nb_cycle,
+                            double nb_instruction);
+
+}; // end namespace behavioural          
+}; // end namespace morpheo              
+
+#endif
+#endif
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Stat.h
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Stat.h	(revision 87)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Stat.h	(revision 88)
@@ -44,19 +44,19 @@
     class Stat
     {
-      const std::string              _name_instance;
-      const std::string              _name_component;
-      const cycle_t                  _nb_cycle_before_begin;
-      const cycle_t                  _period;
-      const bool                     _save_periodic;
+    private: const std::string              _name_instance;
+    private: const std::string              _name_component;
+    private: const cycle_t                  _nb_cycle_before_begin;
+    private: const cycle_t                  _period;
+    private: const bool                     _save_periodic;
       // Tableau des variables
-      std::map<std::string, var_t> * _list_operand;
+    private: std::map<std::string, var_t> * _list_operand;
       // Liste chaîné des expressions
-      std::list<expr_t>            * _list_expr;
+    private: std::list<expr_t>            * _list_expr;
 
-      counter_t                    * _cycle;
+    private: counter_t                    * _cycle;
 
-      std::list<Stat *>            * _list_stat;
+    private: std::list<Stat *>            * _list_stat;
 
-      bool                           _generate_file;
+    private: bool                           _generate_file;
 
     public :                     Stat                         (std::string name_instance,
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Stat_binary_tree.h
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Stat_binary_tree.h	(revision 87)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Stat_binary_tree.h	(revision 88)
@@ -14,5 +14,5 @@
 namespace behavioural {
 
-  typedef enum {VARIABLE, CONSTANT, OPERATOR_UNARY, OPERATOR_BINARY} data_type_t;
+  typedef enum {NONE, VARIABLE, CONSTANT, OPERATOR_UNARY, OPERATOR_BINARY} data_type_t;
 
   typedef union 
@@ -26,32 +26,44 @@
   {
     // arbre binaire
-    private : Stat_binary_tree * _root;
-    private : Stat_binary_tree * _left;
-    private : Stat_binary_tree * _right;
-    private : data_type_t        _data_type;
-    private : data_t             _data;
+  private : Stat_binary_tree * _root;
+  private : Stat_binary_tree * _left;
+  private : Stat_binary_tree * _right;
+  private : data_type_t        _data_type;
+  private : data_t             _data;
     
     /*     private :  Stat_binary_tree (data_type_t data_type, data_t data); */
-    public  :  Stat_binary_tree (counter_t   cst);
-    public  :  Stat_binary_tree (counter_t * var);
-    public  :  Stat_binary_tree (operator_t  op );
-  
-    public  : ~Stat_binary_tree (void);
+  public  :  Stat_binary_tree (std::string expr,
+                               std::map<std::string, counter_t*> * operand);
+  public  :  Stat_binary_tree (counter_t   cst);
+  public  :  Stat_binary_tree (counter_t * var);
+  public  :  Stat_binary_tree (operator_t  op );
     
-    private : void               insert_tree (Stat_binary_tree * tree);
-    public  : Stat_binary_tree * insert_tree (counter_t   cst);
-    public  : Stat_binary_tree * insert_tree (counter_t * var);
-    public  : Stat_binary_tree * insert_tree (operator_t  op );
+  public  : ~Stat_binary_tree (void);
+    
+  private : void               insert_tree (Stat_binary_tree * tree);
+  public  : Stat_binary_tree * insert_tree (counter_t   cst);
+  public  : Stat_binary_tree * insert_tree (counter_t * var);
+  public  : Stat_binary_tree * insert_tree (operator_t  op );
 
-    public  : Stat_binary_tree * goto_top_level (void);
-    public  : Stat_binary_tree * goto_next_root (void);
+  private : void               change_type (counter_t   cst);
+  private : void               change_type (counter_t * var);
+  private : void               change_type (operator_t  op );
+    
+  public  : Stat_binary_tree * goto_top_level (void);
+  public  : Stat_binary_tree * goto_next_root (void);
 
-    public  : bool      valid    (void);
+  public  : bool               valid    (void);
 
-    public  : counter_t eval     (void);
+  public  : counter_t          eval     (void);
 
-    private : counter_t val_tree (void);
-    private : counter_t val_leaf (void);
-    private : bool      is_leaf  (void);
+  private : counter_t          val_tree (void);
+  private : counter_t          val_leaf (void);
+  private : bool               is_leaf  (void);
+
+  public  : void               import   (std::string expr,
+                                         std::map<std::string, counter_t*> * operand);
+
+
+  public  : void               print    (uint32_t depth=0);
 
 //     public  : friend std::ostream& operator<< (std::ostream&, const morpheo::Stat_binary_tree &);
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Types.h
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Types.h	(revision 87)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Types.h	(revision 88)
@@ -25,5 +25,7 @@
   typedef uint8_t            Tcounter_t; // universal counter
   typedef uint8_t            Tptr_t;     // universal pointer
-			     
+  typedef uint32_t           Tspr_t;
+  typedef uint16_t           Tspr_address_t;
+
 //typedef uint32_t           Tdestination1_t;
 //typedef uint32_t           Tdestination2_t;
@@ -69,4 +71,13 @@
   typedef enum
     {
+      ORBIS32,
+      ORBIS64,
+      ORFPX32,
+      ORFPX64,
+      ORVDX64
+    } ISA;
+
+  typedef enum
+    {
       PRIORITY_STATIC,
       PRIORITY_ROUND_ROBIN
@@ -93,5 +104,5 @@
       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_STATIC          , // If the address 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
@@ -99,6 +110,30 @@
       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
+      PREDICTOR_CUSTOM            // Not predefined scheme
     } Tpredictor_t;
+
+  //--------------------------------------------------[ instruction ]-----
+  class instruction_t
+  {
+  public :
+    Ttype_t      _type      ;
+    Toperation_t _operation ;
+    ISA          _isa_subset;
+    uint8_t      _isa_class ;
+
+    instruction_t (Ttype_t      type      ,
+                   Toperation_t operation ,
+                   ISA          isa_subset,
+                   uint8_t      isa_class )
+    {
+      _type       = type      ;
+      _operation  = operation ;
+      _isa_subset = isa_subset;
+      _isa_class  = isa_class ;
+    }
+  };
+
+  instruction_t instruction_information (uint32_t instruction);
+  uint32_t      instruction_size_data   (uint32_t instruction);
 
   //----------------------------------------------[ spr_mode_access ]-----
@@ -122,16 +157,17 @@
     switch (x)
       {
-      case TYPE_ALU     : return "ALU"    ; break;
-      case TYPE_SHIFT   : return "SHIFT"  ; break;
-      case TYPE_MOVE    : return "MOVE"   ; break;
-      case TYPE_TEST    : return "TEST"   ; break;
-      case TYPE_MUL_DIV : return "MUL_DIV"; break;
-      case TYPE_EXTEND  : return "EXTEND" ; break;
-      case TYPE_FIND    : return "FIND"   ; break;
-      case TYPE_SPECIAL : return "SPECIAL"; break;
-      case TYPE_CUSTOM  : return "CUSTOM" ; break;
-      case TYPE_BRANCH  : return "BRANCH" ; break;
-      case TYPE_MEMORY  : return "MEMORY" ; break;
-      default           : return ""       ; break;
+      case TYPE_ALU     : return "ALU"        ; break;
+      case TYPE_SHIFT   : return "SHIFT"      ; break;
+      case TYPE_MOVE    : return "MOVE"       ; break;
+      case TYPE_TEST    : return "TEST"       ; break;
+      case TYPE_MUL     : return "MUL"        ; break;
+      case TYPE_DIV     : return "DIV"        ; break;
+      case TYPE_EXTEND  : return "EXTEND"     ; break;
+      case TYPE_FIND    : return "FIND"       ; break;
+      case TYPE_SPECIAL : return "SPECIAL"    ; break;
+      case TYPE_CUSTOM  : return "CUSTOM"     ; break;
+      case TYPE_BRANCH  : return "BRANCH"     ; break;
+      case TYPE_MEMORY  : return "MEMORY"     ; break;
+      default           : return "Unknow type"; break;
       }
   };
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Usage.h
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Usage.h	(revision 87)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Usage.h	(revision 88)
@@ -16,4 +16,5 @@
 #  define USE_STATISTICS            0x20
 #  define USE_INFORMATION           0x40
+#  define USE_HEADER                0x80
 //#define USE_                      0x80
 
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Version.h
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Version.h	(revision 87)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Version.h	(revision 88)
@@ -10,10 +10,16 @@
 #define MORPHEO_MAJOR_VERSION 0
 #define MORPHEO_MINOR_VERSION 2
-#define MORPHEO_REVISION      87
+#define MORPHEO_REVISION      @REVISION
+#define MORPHEO_CODENAME      "Castor"
+
+#define MORPHEO_DATE_DAY      @DATE_DAY  
+#define MORPHEO_DATE_MONTH    @DATE_MONTH
+#define MORPHEO_DATE_YEAR     @DATE_YEAR 
 
 #define MORPHEO_VERSION       morpheo::toString(MORPHEO_MAJOR_VERSION)+"."+morpheo::toString(MORPHEO_MINOR_VERSION)+"."+morpheo::toString(MORPHEO_REVISION)
+#define MORPHEO_HEADER        morpheo::toString(MORPHEO_VERSION)+" - "+morpheo::toString(MORPHEO_CODENAME)
+#define MORPHEO_DATE          morpheo::toString(MORPHEO_DATE_YEAR)+"/"+morpheo::toString(MORPHEO_DATE_MONTH)+"/"+morpheo::toString(MORPHEO_DATE_DAY)
 
 /*
-  
  [ Change Log ]
  |
@@ -22,5 +28,5 @@
    | SystemC Only
    |
-   +-[ Minor Version 1 ]
+   +-[ Minor Version 1 ] - Castor
    | |
    | | Second Architecture, change the load_store_unit and implement exception
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Version.h.sed
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Version.h.sed	(revision 87)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Version.h.sed	(revision 88)
@@ -11,9 +11,15 @@
 #define MORPHEO_MINOR_VERSION 2
 #define MORPHEO_REVISION      @REVISION
+#define MORPHEO_CODENAME      "Castor"
+
+#define MORPHEO_DATE_DAY      @DATE_DAY  
+#define MORPHEO_DATE_MONTH    @DATE_MONTH
+#define MORPHEO_DATE_YEAR     @DATE_YEAR 
 
 #define MORPHEO_VERSION       morpheo::toString(MORPHEO_MAJOR_VERSION)+"."+morpheo::toString(MORPHEO_MINOR_VERSION)+"."+morpheo::toString(MORPHEO_REVISION)
+#define MORPHEO_HEADER        morpheo::toString(MORPHEO_VERSION)+" - "+morpheo::toString(MORPHEO_CODENAME)
+#define MORPHEO_DATE          morpheo::toString(MORPHEO_DATE_YEAR)+"/"+morpheo::toString(MORPHEO_DATE_MONTH)+"/"+morpheo::toString(MORPHEO_DATE_DAY)
 
 /*
-  
  [ Change Log ]
  |
@@ -22,5 +28,5 @@
    | SystemC Only
    |
-   +-[ Minor Version 1 ]
+   +-[ Minor Version 1 ] - Castor
    | |
    | | Second Architecture, change the load_store_unit and implement exception
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Vhdl.h
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Vhdl.h	(revision 87)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Vhdl.h	(revision 88)
@@ -14,5 +14,5 @@
 #include <iostream>
 #include <list>
-#include "Behavioural/include/Environment.h"
+#include "Common/include/Environment.h"
 #include "Behavioural/include/Direction.h"
 #include "Common/include/ToString.h"
@@ -53,91 +53,93 @@
     private   : void             generate_file_package       (void);
     private   : void             generate_file_model         (void);
-
-    private   : std::string           get_package                 (uint32_t    depth                 ,
-								   std::string      filename              ,
-								   std::string      package_name          ,
-								   std::string      entity_name           );
-    private   : std::string           get_model                   (uint32_t    depth                 ,
-								   std::string      filename              ,
-								   std::string      entity_name           ,
-								   std::string      architecture_name     );
-    private   : std::string           get_header                  (uint32_t    depth                 ,
-								   std::string      filename              );
-    private   : std::string           get_entity                  (uint32_t    depth                 ,
-								   std::string      name                  );
-    private   : std::string           get_architecture            (uint32_t    depth                 , 
-								   std::string      name                  ,
-								   std::string      entity_name           );
-    private   : std::string           get_component               (uint32_t    depth                 ,
-								   std::string      name                  );
-
-    private   : std::string           get_port                    (uint32_t    depth                 );
-    public    : void             set_port                    (std::string      name                  ,
+      
+    private   : std::string      get_package                 (uint32_t    depth                 ,
+                                                              std::string filename              ,
+                                                              std::string package_name          ,
+                                                              std::string entity_name           );
+    private   : std::string      get_model                   (uint32_t    depth                 ,
+                                                              std::string filename              ,
+                                                              std::string entity_name           ,
+                                                              std::string architecture_name     );
+    private   : std::string      get_header                  (uint32_t    depth                 ,
+                                                              std::string filename              );
+    private   : std::string      get_entity                  (uint32_t    depth                 ,
+                                                              std::string name                  );
+    private   : std::string      get_architecture            (uint32_t    depth                 , 
+                                                              std::string name                  ,
+                                                              std::string entity_name           );
+    private   : std::string      get_component               (uint32_t    depth                 ,
+                                                              std::string name                  );
+      
+    private   : std::string      get_port                    (uint32_t    depth                 );
+    public    : void             set_port                    (std::string name                  ,
 							      direction_t direction             ,
-							      std::string      type                  );
-    public    : void             set_port                    (std::string      name                  ,
+							      std::string type                  );
+    public    : void             set_port                    (std::string name                  ,
 							      direction_t direction             ,
 							      uint32_t    size                  );
-    private   : std::string           get_signal                  (uint32_t    depth                 );
-    public    : void             set_signal                  (std::string      name                  ,
-							      std::string      type                  );
-    public    : void             set_signal                  (std::string      name                  ,
+    private   : std::string      get_signal                  (uint32_t    depth                 );
+    public    : void             set_signal                  (std::string name                  ,
+							      std::string type                  );
+    public    : void             set_signal                  (std::string name                  ,
 							      uint32_t    signal                );
-    public    : void             set_signal                  (std::string      name                  ,
-							      std::string      type                  ,
-							      std::string      init                  );
-    public    : void             set_signal                  (std::string      name                  ,
+    public    : void             set_signal                  (std::string name                  ,
+							      std::string type                  ,
+							      std::string init                  );
+    public    : void             set_signal                  (std::string name                  ,
 							      uint32_t    size                  ,
-							      std::string      init                  );
-    public    : void             set_signal                  (std::string      name                  ,
+							      std::string init                  );
+    public    : void             set_signal                  (std::string name                  ,
 							      uint32_t    size                  ,
 							      uint32_t    init                  );
-    public    : void             set_constant                (std::string      name                  ,
-							      std::string      type                  ,
-							      std::string      init                  );
-    public    : void             set_constant                (std::string      name                  ,
+    public    : void             set_constant                (std::string name                  ,
+							      std::string type                  ,
+							      std::string init                  );
+    public    : void             set_constant                (std::string name                  ,
 							      uint32_t    size                  ,
-							      std::string      init                  );
-    public    : void             set_constant                (std::string      name                  ,
+							      std::string init                  );
+    public    : void             set_constant                (std::string name                  ,
 							      uint32_t    size                  ,
 							      uint32_t    init                  );
 
-    private   : std::string           get_type                    (uint32_t    depth                 );
-    public    : void             set_type                    (std::string      name                  ,
-							      std::string      type                  );
-    private   : std::string           get_alias                   (uint32_t    depth                 );
-    public    : void             set_alias                   (std::string      name1                 ,
-							      std::string      type1                 ,
-							      std::string      name2                 ,
-							      std::string      range2                );
-    public    : void             set_alias                   (std::string      name1                 ,
+    private   : std::string      get_type                    (uint32_t    depth                 );
+    public    : void             set_type                    (std::string name                  ,
+							      std::string type                  );
+    private   : std::string      get_alias                   (uint32_t    depth                 );
+    public    : void             set_alias                   (std::string name1                 ,
+							      std::string type1                 ,
+							      std::string name2                 ,
+							      std::string range2                );
+    public    : void             set_alias                   (std::string name1                 ,
 							      uint32_t    size1                 ,
-							      std::string      name2                 ,
-							      std::string      range2                );
+							      std::string name2                 ,
+							      std::string range2                );
+      
+    public    : std::string      get_list                    (std::list<std::string> liste      ,
+                                                              uint32_t     depth                ,
+                                                              std::string  separator            ,
+                                                              bool         last_separator       );
+    public    : void             set_list                    (std::list<std::string> & liste    ,
+							      std::string  text                 );
 
-    public    : std::string           get_list                    (std::list<std::string> liste                ,
-								   uint32_t     depth                ,
-								   std::string       separator            ,
-								   bool         last_separator       );
-    public    : void             set_list                    (std::list<std::string> & liste              ,
-							      std::string         text               );
+    private   : std::string      get_body                    (uint32_t     depth                );
+    public    : void             set_body                    (std::string  text                 );
+                                                                                                
+    public    : void             set_body                    (Vhdl *       vhdl                 );
+                                                                                                
+    public    : void             set_body_component          (std::string  name_instance        ,
+                                                              std::string  name_component       ,
+                                                              std::list<std::string>   list_port_map);
+    public    : void             set_body_component_port_map (std::list<std::string> & list_port_map,
+                                                              std::string  name_port            ,
+                                                              uint32_t     size_port            ,
+                                                              std::string  name_signal          ,
+                                                              uint32_t     size_signal          );
 
-    private   : std::string           get_body                    (uint32_t       depth              );
-    public    : void             set_body                    (std::string         text               );
+    private   : std::string      get_library_ieee            (uint32_t     depth                );
+    private   : std::string      get_library_work            (uint32_t     depth                );
+    public    : void             set_library_work            (std::string  package_name         );
 
-    public    : void        set_body_component          (std::string         name_instance      ,
-							 std::string         name_component     ,
-							 std::list<std::string>   list_port_map      );
-    public    : void        set_body_component_port_map (std::list<std::string> & list_port_map      ,
-							 std::string         name_port          ,
-							 uint32_t       size_port          ,
-							 std::string         name_signal        ,
-							 uint32_t       size_signal        );
-
-    private   : std::string get_library_ieee            (uint32_t    depth                 );
-    private   : std::string get_library_work            (uint32_t    depth                 );
-    public    : void        set_library_work            (std::string      package_name          );
-
-    private   : std::string direction_toString          (direction_t direction);
+    private   : std::string      direction_toString          (direction_t  direction            );
     };
 
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/include/XML.h
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/include/XML.h	(revision 87)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/include/XML.h	(revision 88)
@@ -40,17 +40,17 @@
   public   : bool             singleton_end       (void);
   public   : bool             attribut            (std::string name, std::string value);
-  public   : bool             insert_XML          (XML    xml );
+  public   : bool             insert_XML          (XML    xml, uint32_t offset_depth=0);
 
   public   : void             filename_extension  (std::string extension);
-  public   : void             generate_file       (void);
-  public   : void             generate_file       (std::string encoding);
-  public   : std::string           get_body            (void);
-  public   : std::string           get_body            (uint32_t depth);
+  public   : void             generate_file       (std::string dirname, std::string encoding);
+  public   : void             generate_file       (std::string dirname=".");
+  public   : std::string      get_body            (void);
+  public   : std::string      get_body            (uint32_t depth);
 
   public   : bool             comment             (std::string text);
   public   : bool             text                (std::string text);
 					          
-  private  : std::string           indent              (uint32_t depth );
-  private  : std::string           indent              (void);
+  private  : std::string      indent              (uint32_t depth );
+  private  : std::string      indent              (void);
   private  : uint32_t         depth               (void);
 					          
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/include/XMLLightFunctors.h
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/include/XMLLightFunctors.h	(revision 88)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/include/XMLLightFunctors.h	(revision 88)
@@ -0,0 +1,46 @@
+#ifndef _XMLLIGHT_FUNCTORS
+#define _XMLLIGHT_FUNCTORS
+
+#include "Behavioural/include/IXMLLight.h"
+
+namespace morpheo {
+	namespace XMLUtils {
+		
+	//******************************************CLASS DECLARATION**************************************//
+	
+		// enum to enumerate some XML tags playing a part within parsing process.
+		enum EXML_DELIMITOR {
+			BEGIN_TAG = '<', 
+			SECOND_TAG = '/',
+			END_TAG = '>'
+		};
+
+		// functor class used inside XML parsing algorithm 
+		class XMLLightComparator {
+		public:
+			bool operator () ( char firstChar, char secondChar ) ; 
+		
+		};
+		
+		// Deleter is a functor to handle deletion algorithm of XMLLightVector
+					
+		template<typename T> class XMLLightDeleter {
+		public: 
+			inline T * operator() ( T *);
+		};
+		
+	//*********************************** INLINE DEFINITION*********************************************//
+	
+		//definition of Deleter functor
+		template <typename T> T* XMLLightDeleter<T>::operator() ( T * xmlLightPointer )
+		{
+			xmlLightPointer -> detach();
+			//delete xmlLightPointer ; 
+			return NULL; 
+		}
+
+	} // end of namespace XMLUtils.
+} // end of morpheo's namespace.
+
+#endif // _XMLLIGHT_FUNCTORS 
+
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/include/XMLLightVector.h
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/include/XMLLightVector.h	(revision 88)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/include/XMLLightVector.h	(revision 88)
@@ -0,0 +1,95 @@
+#ifndef _XMLLIGHT_VECTOR_
+#define _XMLLIGHT_VECTOR_
+
+#include "Behavioural/include/XMLLightFunctors.h"
+#include <vector>
+#include <algorithm>
+#include <iostream>
+
+using std::basic_ostream;
+using std::basic_ios;
+using std::endl;
+
+namespace morpheo {
+	namespace XMLUtils {
+	
+	//********************************************Class Declaration***************************************//
+	
+		// an helper class to handle XMLLight * vector 
+		template < typename XMLLightImpl>
+		class XMLLightVector : public std::vector<XMLLightImpl *> {
+		public : 
+			inline explicit XMLLightVector(void); 
+			inline ~XMLLightVector(void); 
+			
+			XMLLightVector(const XMLLightVector & xmlLightVectorCopied); 
+			XMLLightVector & operator= ( const XMLLightVector & copy ); 
+
+			// must be defined inside template class declaration 
+			template < typename charT, typename traits> friend 
+			basic_ostream<charT, traits> & operator<< 
+			( basic_ostream<charT, traits> & os , const XMLLightVector<XMLLightImpl> & vect) {
+				if ( vect.size() == 0 ) {
+					os << "There's no Child Nodes " << endl ; 
+				} else {
+					for (  unsigned int i = 0 ; i < vect.size() ; ++i ) {
+						os <<"Nodes "<< i << ": \n\t" <<  vect[i] ->getInternalString()  << endl; 
+					}
+				}
+				return os;   
+			}
+			
+		};
+		
+	//******************************************Inline implementation************************************//
+
+		template< typename T > class XMLLightDeleter;
+
+		template < typename XMLLightImpl > 
+		XMLLightVector<XMLLightImpl>::XMLLightVector() {
+		}				
+	
+		template < typename  XMLLightImpl >
+		XMLLightVector< XMLLightImpl>::~XMLLightVector(void) {
+			transform ( this -> begin(), this -> end(), this -> begin(), XMLLightDeleter<XMLLightImpl>() );
+		}
+
+	//**************************************** template implementation*******************************//
+
+		template < typename XMLLightImpl >
+		XMLLightVector<XMLLightImpl>::XMLLightVector(const XMLLightVector<XMLLightImpl> & copy ) {
+			for ( unsigned int i = 0 ; i < copy.size() ; ++i ) {
+				this -> push_back(copy[i]);
+				copy[i] -> attach(); 
+			}
+		}	
+
+		template < typename XMLLightImpl >
+		XMLLightVector<XMLLightImpl> & XMLLightVector<XMLLightImpl>::operator= ( const XMLLightVector<XMLLightImpl> & vector ) {
+			if ( &vector != this ) {
+				unsigned int this_size = this -> size();
+				unsigned int copy_max_size = vector.size();
+				unsigned int max_size = copy_max_size < this_size ? this_size : copy_max_size;
+				for ( unsigned int i = 0 ; i < max_size ; ++i ) {
+					if (  this_size ) {
+						(*this)[i] -> detach();
+					}
+					if ( i < copy_max_size ) {
+					 	if ( this_size == 0 ) {
+							this -> push_back(vector[i]);
+						} else {
+							(*this)[i] = vector[i]; 
+						}
+						(*this)[i] -> attach();
+					} else {
+						(*this)[i] = NULL; 
+					}
+				}
+			}	
+			return *this;
+		}
+
+	}// end of XMLUtils namespace 
+} // end of morpheo namespace 
+
+#endif // _XMLLIGHT_VECTOR_
