Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Component.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Component.cpp	(revision 53)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Component.cpp	(revision 57)
@@ -11,12 +11,14 @@
 namespace behavioural          {
 
-  Component::Component  (void)
+  Component::Component  (Tusage_t usage):
+    _usage (usage)
   {
     log_printf(FUNC,Behavioural,"Component::Component","Begin");
-    _list_component = new list<Entity *>;
+    _list_component = new list<Tcomponent_t *>;
     log_printf(FUNC,Behavioural,"Component::Component","End");
   };
 
-  Component::Component  (const Component & component)
+  Component::Component  (const Component & component):
+    _usage (component._usage)
   {
     log_printf(FUNC,Behavioural,"Component::Component (copy)","Begin");
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Component_find_entity.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Component_find_entity.cpp	(revision 53)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Component_find_entity.cpp	(revision 57)
@@ -22,11 +22,13 @@
       if (_list_component->empty()== false)
 	{
-	  list<Entity *>::iterator i = _list_component->begin();
+	  list<Tcomponent_t *>::iterator i = _list_component->begin();
 	  
 	  while (i != _list_component->end())
 	    {
-	      if ((*i)->get_name() == name)
+	      Entity * entity = (*i)->_entity;
+
+	      if (entity->get_name() == name)
 		{
-		  _return = *i;
+		  _return = entity;
 		  break;
 		}
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Component_get_component.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Component_get_component.cpp	(revision 53)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Component_get_component.cpp	(revision 57)
@@ -22,5 +22,5 @@
     bool                   last_separator = false;
 
-    list<Entity *>::iterator  i  = _list_component->begin();
+    list<Tcomponent_t *>::iterator  i  = _list_component->begin();
     bool                   empty = _list_component->empty();
 
@@ -33,5 +33,5 @@
 	if (i != _list_component->end())
 	  {
-	    text << tab << **i;
+	    text << tab << *((*i)->_entity);
 	    ++i;
 	  }
@@ -40,5 +40,5 @@
 	  {
 	    text << separator;
-	    text << tab << **i;
+	    text << tab << *((*i)->_entity);
 	    ++i;
 	  }
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Component_set_component.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Component_set_component.cpp	(revision 53)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Component_set_component.cpp	(revision 57)
@@ -15,9 +15,10 @@
   void Component::set_component (Component * component
 #ifdef POSITION
-				,uint32_t   pos_x  
-				,uint32_t   pos_y  
-				,uint32_t   size_x 
-				,uint32_t   size_y 
+				 ,uint32_t   pos_x  
+				 ,uint32_t   pos_y  
+				 ,uint32_t   size_x 
+				 ,uint32_t   size_y 
 #endif
+				 ,Tinstance_t instance
 				 )
   {
@@ -26,8 +27,14 @@
     Entity * entity = component->_entity;
 
-    _list_component->push_back(entity);
+    Tcomponent_t * entry = new Tcomponent_t;
+    
+    entry->_instance = instance;
+    entry->_entity   = entity;
+
+    _list_component->push_back(entry);
 
 #ifdef POSITION
-    entity->mapping( pos_x, pos_y, size_x, size_y);
+    if (instance & INSTANCE_POSITION)
+      entity->mapping( pos_x, pos_y, size_x, size_y);
 #endif
 
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Component_set_entity.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Component_set_entity.cpp	(revision 53)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Component_set_entity.cpp	(revision 57)
@@ -27,4 +27,5 @@
 				  ,schema 
 #endif
+				  ,_usage
 				  );
     _entity = entity;
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Component_toXML.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Component_toXML.cpp	(revision 53)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Component_toXML.cpp	(revision 57)
@@ -27,9 +27,9 @@
     if (_list_component->empty()== false)
       {
-	list<Entity *>::iterator i = _list_component->begin();
+	list<Tcomponent_t *>::iterator i = _list_component->begin();
 
 	while (i != _list_component->end())
 	  {
-	    xml.insert_XML ((*i)->toXML_mapping());
+	    xml.insert_XML ((*i)->_entity->toXML_mapping());
 	    ++i;
 	  }
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Component_vhdl_instance.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Component_vhdl_instance.cpp	(revision 53)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Component_vhdl_instance.cpp	(revision 57)
@@ -75,59 +75,65 @@
 
     // for each entity
-    list<Entity *>         * list_component = _list_component;
-    list<Entity *>::iterator i              = list_component->begin();
+    list<Tcomponent_t *>         * list_component = _list_component;
+    list<Tcomponent_t *>::iterator i              = list_component->begin();
     if (not list_component->empty())
       {
 	while (i != list_component->end())
 	  {
-	    vhdl->set_library_work ((*i)->get_name() + "_Pack");
+	    Entity *    entity   = (*i)->_entity;
+	    Tinstance_t instance = (*i)->_instance;
+	    
+	    if (instance & INSTANCE_LIBRARY)
+	      vhdl->set_library_work (entity->get_name() + "_Pack");
 
-	    list<string> list_port_map;
-	    
-	    // for each interface
-	    list<Interface_fifo *>         * list_interface = (*i)->get_interfaces_list()->get_interface_list();
-	    list<Interface_fifo *>::iterator j              = list_interface->begin();
-	    if (not list_interface->empty())
-	      {
-		while (j != list_interface->end())
-		  {
-		    // for each signal
-		    list<Signal *>         * list_signal = (*j)->get_signal_list();
-		    list<Signal *>::iterator k           = list_signal->begin();
-		    if (not list_signal->empty())
-		      {
-			while (k != list_signal->end())
-			  {
-			    // test if is connect with external interface or with an another component.
-			    Signal * signal_src  = (*k);
-
-			    if (signal_src->presence_vhdl () == true)
-			      {
-				Signal * signal_dest = signal_src->get_connect_to_signal();
-				string   name_src    = signal_src->get_name();
-				string   name_dest;
-				
+	    if (instance & INSTANCE_COMPONENT)
+	    {
+	      list<string> list_port_map;
+	      
+	      // for each interface
+	      list<Interface_fifo *>         * list_interface = entity->get_interfaces_list()->get_interface_list();
+	      list<Interface_fifo *>::iterator j              = list_interface->begin();
+	      if (not list_interface->empty())
+		{
+		  while (j != list_interface->end())
+		    {
+		      // for each signal
+		      list<Signal *>         * list_signal = (*j)->get_signal_list();
+		      list<Signal *>::iterator k           = list_signal->begin();
+		      if (not list_signal->empty())
+			{
+			  while (k != list_signal->end())
+			    {
+			      // test if is connect with external interface or with an another component.
+			      Signal * signal_src  = (*k);
+			      
+			      if (signal_src->presence_vhdl () == true)
+				{
+				  Signal * signal_dest = signal_src->get_connect_to_signal();
+				  string   name_src    = signal_src->get_name();
+				  string   name_dest;
+				  
 // 				// Test if destination signal is a interface port ?
 // 				if (_entity->find_signal(signal_dest) == false)
 // 				  {
-				    // find if signal is already link
-				    map<Signal *,string>::iterator it = tab.find(signal_dest); 
-				    if (tab.find(signal_dest) == tab.end())
-				      {
-					// Create name
-					name_dest = "signal_"+toString(cpt++);
-					
-					tab [signal_src ] = name_dest;
-					tab [signal_dest] = name_dest;
-					
-					// Add a new signal
-					vhdl->set_signal (name_dest, signal_src->get_size());
-				      }
-				    else
-				      {
-					// find !!!!
-					name_dest = (*it).second;
-					tab [signal_src ] = name_dest;
-				      }
+				  // find if signal is already link
+				  map<Signal *,string>::iterator it = tab.find(signal_dest); 
+				  if (tab.find(signal_dest) == tab.end())
+				    {
+				      // Create name
+				      name_dest = "signal_"+toString(cpt++);
+				      
+				      tab [signal_src ] = name_dest;
+				      tab [signal_dest] = name_dest;
+				      
+				      // Add a new signal
+				      vhdl->set_signal (name_dest, signal_src->get_size());
+				    }
+				  else
+				    {
+				      // find !!!!
+				      name_dest = (*it).second;
+				      tab [signal_src ] = name_dest;
+				    }
 // 				  }
 // 				else
@@ -150,13 +156,15 @@
 // 				  }
 				
-				vhdl->set_body_component_port_map (list_port_map, name_src, name_dest);
-			      }
-			    ++k;
-			  }
-		      }
-		    ++j;
-		  }
-	      }
-	    vhdl->set_body_component ("instance_"+(*i)->get_name(),(*i)->get_name(),list_port_map);
+				  vhdl->set_body_component_port_map (list_port_map, name_src, name_dest);
+				}
+			      ++k;
+			    }
+			}
+		      ++j;
+		    }
+		}
+	      vhdl->set_body_component ("instance_"+entity->get_name(),entity->get_name(),list_port_map);
+	      
+	    }
 	    ++i;
 	  }
@@ -164,5 +172,5 @@
     log_printf(FUNC,Behavioural,FUNCTION,"End");
   };
-
+  
 }; // end namespace behavioural
 }; // end namespace morpheo
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Entity.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Entity.cpp	(revision 53)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Entity.cpp	(revision 57)
@@ -16,4 +16,5 @@
 		   ,schema_t     schema
 #endif
+		    ,Tusage_t      usage
 		    ):
      _name       (name      )
@@ -22,7 +23,8 @@
     ,_schema     (schema    )
 #endif
+     ,_usage      (usage     )
   {
     log_printf(FUNC,Behavioural,"Entity","Begin");
-    _interfaces = new Interfaces (name);
+    _interfaces = new Interfaces (name, usage);
 #ifdef POSITION
     _is_map     = false;
@@ -37,4 +39,5 @@
     ,_schema     (entity._schema    )
 #endif
+    ,_usage      (entity._usage     )
   {
     log_printf(FUNC,Behavioural,"Entity (copy)","Begin");
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Interface.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Interface.cpp	(revision 53)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Interface.cpp	(revision 57)
@@ -16,4 +16,5 @@
 			 ,localisation_t        localisation 
 #endif
+			 ,Tusage_t             usage
 			 ):
     _name         (name        )
@@ -22,4 +23,5 @@
     ,_localisation (localisation)
 #endif
+    ,_usage        (usage)
   {
     log_printf(FUNC,Behavioural,"Interface","Begin");
@@ -47,4 +49,5 @@
     ,_localisation (interface._localisation)
 #endif
+    ,_usage        (interface._usage)
   {
     log_printf(FUNC,Behavioural,"Interface (copy)","Begin");
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Interface_fifo.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Interface_fifo.cpp	(revision 53)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Interface_fifo.cpp	(revision 57)
@@ -16,4 +16,5 @@
 				   ,localisation_t localisation
 #endif
+				   ,Tusage_t       usage
 				   ):
     Interface (name         
@@ -22,4 +23,5 @@
 	       ,localisation
 #endif
+	       ,usage
 	       )
   {
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Interfaces.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Interfaces.cpp	(revision 53)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Interfaces.cpp	(revision 57)
@@ -11,6 +11,8 @@
 namespace behavioural          {
 
-  Interfaces::Interfaces  (string name):
-    _name (name)
+  Interfaces::Interfaces  (string   name,
+			   Tusage_t usage):
+    _name  (name),
+    _usage (usage)
   {
     log_printf(FUNC,Behavioural,"Interfaces","Begin");
@@ -20,5 +22,6 @@
 
   Interfaces::Interfaces  (const Interfaces & interfaces) :
-    _name (interfaces._name)
+    _name  (interfaces._name),
+    _usage (interfaces._usage)
   {
     log_printf(FUNC,Behavioural,"Interfaces (copy)","Begin");
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Interfaces_set_interface.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Interfaces_set_interface.cpp	(revision 53)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Interfaces_set_interface.cpp	(revision 57)
@@ -27,5 +27,5 @@
 						     ,localisation
 #endif
-						     );
+						     ,_usage);
     
     _list_interface->push_back (interface);
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_std_logic.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_std_logic.cpp	(revision 53)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_std_logic.cpp	(revision 57)
@@ -66,8 +66,11 @@
     string type;
 
-    if (max == min)
-      type = "("+toString(max)+")";
+    if (max == 0)
+      type = "";
     else
-      type = "("+toString(max)+" downto "+toString(min)+")";
+      if (max == min)
+	type = "("+toString(max)+")";
+      else
+	type = "("+toString(max)+" downto "+toString(min)+")";
 
     log_printf(FUNC,Behavioural,FUNCTION,"End");
