Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Component.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Component.cpp	(revision 112)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Component.cpp	(revision 113)
@@ -15,4 +15,5 @@
   {
     log_printf(FUNC,Behavioural,"Component::Component","Begin");
+    _entity = NULL;
     _list_component = new std::list<Tcomponent_t *>;
     log_printf(FUNC,Behavioural,"Component::Component","End");
@@ -31,5 +32,11 @@
   {
     log_printf(FUNC,Behavioural,"Component::~Component","Begin");
-    delete _entity;
+    if (_entity != NULL)
+      delete _entity;
+    while (not _list_component->empty())
+      {
+        delete _list_component->front();
+        _list_component->pop_front();
+      }
     delete _list_component;
     log_printf(FUNC,Behavioural,"Component::~Component","End");
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Component_get_sc_signal.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Component_get_sc_signal.cpp	(revision 113)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Component_get_sc_signal.cpp	(revision 113)
@@ -0,0 +1,40 @@
+/*
+ * $Id$
+ *
+ * [ Description ]
+ * 
+ */
+
+#include "Behavioural/include/Component.h"
+
+namespace morpheo              {
+namespace behavioural          {
+
+#undef  FUNCTION
+#define FUNCTION "Component::get_sc_signal"
+  void * Component::get_sc_signal (std::string component,
+                                   std::string port     )
+  {
+    log_begin(Behavioural,FUNCTION);
+
+    std::string name_entity = _entity->get_name();
+
+    Entity * entity = find_entity(component);
+
+    if (entity == NULL)
+      throw (ERRORMORPHEO (FUNCTION,"In component \""+name_entity+"\", the component \""+component+"\" is unknow.\n"));
+
+    Signal * signal = entity->find_signal (port);
+
+    if (signal == NULL)
+      throw (ERRORMORPHEO (FUNCTION,"In component \""+name_entity+"\", the component \""+component+"\" have not the signal \""+port+"\".\n"));
+
+    void * _return = signal->get_sc_signal();
+
+    log_end(Behavioural,FUNCTION);
+
+    return _return;
+  };
+
+}; // end namespace behavioural          
+}; // end namespace morpheo              
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Component_port_map.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Component_port_map.cpp	(revision 112)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Component_port_map.cpp	(revision 113)
@@ -80,4 +80,6 @@
 	Signal * signal_productor;
 	Entity * entity_productor;
+	Signal * signal_consumer ;
+	Entity * entity_consumer ;
 
 	bool     src_is_productor = (signal_src->get_direction() == OUT);
@@ -85,6 +87,8 @@
 	if (src_is_productor == true)
 	  {
-	    signal_productor = signal_src;
-	    entity_productor = entity_src;
+	    signal_productor = signal_src ;
+	    entity_productor = entity_src ;
+	    signal_consumer  = signal_dest;
+	    entity_consumer  = entity_dest;
 	  }
 	else
@@ -92,8 +96,13 @@
 	    signal_productor = signal_dest;
 	    entity_productor = entity_dest;
+	    signal_consumer  = signal_src ;
+	    entity_consumer  = entity_src ;
 	  }
 
 	// Create internal signal
-	signal_dest= signal_internal (entity_productor, signal_productor);
+	signal_dest= signal_internal (entity_productor,
+                                      signal_productor,
+                                      entity_consumer ,
+                                      signal_consumer );
 	signal_dest->set_size_max(signal_src->get_size());
       }
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Component_set_component.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Component_set_component.cpp	(revision 112)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Component_set_component.cpp	(revision 113)
@@ -2,5 +2,5 @@
  * $Id$
  *
- * [ Description ]
+ * [ Description ]
  * 
  */
@@ -21,4 +21,5 @@
 #endif
 				 ,Tinstance_t instance
+                                 ,std::string architecture
 				 )
   {
@@ -29,7 +30,8 @@
     Tcomponent_t * entry = new Tcomponent_t;
     
-    entry->_component= component;
-    entry->_instance = instance;
-    entry->_entity   = entity;
+    entry->_component    = component;
+    entry->_instance     = instance;
+    entry->_architecture = architecture;
+    entry->_entity       = entity;
 
     _list_component->push_back(entry);
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Component_set_entity.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Component_set_entity.cpp	(revision 112)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Component_set_entity.cpp	(revision 113)
@@ -13,12 +13,15 @@
 #undef  FUNCTION
 #define FUNCTION "Component::set_entity"
-  Entity * Component::set_entity (std::string        name   
-				  ,std::string        type   
+  Entity * Component::set_entity (std::string  name
+				  ,std::string type
 #ifdef POSITION
-				  ,schema_t      schema
+				  ,schema_t    schema
 #endif
 				  )
   {
     log_printf(FUNC,Behavioural,FUNCTION,"Begin");
+
+    if (_entity != NULL)
+      throw ERRORMORPHEO(FUNCTION,_("Entity is already allocated.\n"));
     
     Entity * entity = new Entity (name   
@@ -29,4 +32,5 @@
 				  ,_usage
 				  );
+
     _entity = entity;
     
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Component_signal_internal.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Component_signal_internal.cpp	(revision 112)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Component_signal_internal.cpp	(revision 113)
@@ -2,5 +2,5 @@
  * $Id$
  *
- * [ Description ]
+ * [ Description ]
  * 
  */
@@ -14,16 +14,27 @@
 #define FUNCTION "Component::signal_internal"
   Signal * Component::signal_internal (Entity * entity_productor,
-				       Signal * signal_productor)
+				       Signal * signal_productor,
+                                       Entity * entity_consumer,
+				       Signal * signal_consumer)
   {
     log_printf(FUNC,Behavioural,FUNCTION,"Begin");
 
+    bool productor_is_cosimulation = usage_is_set(entity_productor->get_usage(),USE_COSIMULATION);
+    bool consumer_is_cosimulation  = usage_is_set(entity_consumer ->get_usage(),USE_COSIMULATION);
+    bool is_cosimulation           = consumer_is_cosimulation or productor_is_cosimulation;
+    if (productor_is_cosimulation and consumer_is_cosimulation)
+      throw ERRORMORPHEO (FUNCTION,toString(_("Entity \"%s\" and Entity \"%s\" use both cosimulation. It's not supported.\n"),entity_productor->get_name().c_str(),entity_consumer->get_name().c_str()));
+    
     // create name of internal's signal
-    std::string str_entity = entity_productor->get_name();
-    std::string str_signal = signal_productor->get_name();
+    Entity * entity = (consumer_is_cosimulation)?entity_consumer:entity_productor;
+    Signal * signal = (consumer_is_cosimulation)?signal_consumer:signal_productor;
+
+    std::string str_entity = entity->get_name();
+    std::string str_signal = signal->get_name();
     
-    UpperCase (str_entity);
-    UpperCase (str_signal);
+//     UpperCase (str_entity);
+//     UpperCase (str_signal);
     
-    std::string name_internal = "internal_"+str_entity+"_"+str_signal;
+    std::string name_internal = (is_cosimulation)?str_signal:("internal_"+str_entity+"_"+str_signal);
     
     // test if internal's signal exist ... else, create
@@ -38,38 +49,19 @@
 	
 	if (interface == NULL)
-	  throw (ErrorMorpheo ("<Component::port_map> Component \""+_entity->get_name()+"\", doesn't have an interface \"\"."));
-	
-	std::string signame = entity_productor->get_name()+"_"+signal_productor->get_name();
-	
+	  throw ERRORMORPHEO (FUNCTION,toString(_("Component \"%s\", doesn't have an interface \"\".\n"),_entity->get_name().c_str()));
+
+// 	std::string signame   = entity->get_name()+"_"+signal->get_name();
+        std::string signame   = name_internal;
+        type_info_t type_info = signal->get_type_info();
+
 	// Signal's creation
-	switch (signal_productor->get_type_info())
+	switch (type_info)
 	  {
-	  case BOOL     : 
-	    {
-	      interface->set_signal_internal<bool    >(signame, signal_productor->get_size());
-	      break;
-	    }
-	  case UINT8_T  :
-	    {
-	      interface->set_signal_internal<uint8_t >(signame, signal_productor->get_size());
-	      break;
-	    }
-	  case UINT16_T :
-	    {
-	      interface->set_signal_internal<uint16_t>(signame, signal_productor->get_size());
-	      break;
-	    }
-	  case UINT32_T :
-	    {
-	      interface->set_signal_internal<uint32_t>(signame, signal_productor->get_size());
-	      break;
-	    }
-	  case UINT64_T :
-	    {
-	      interface->set_signal_internal<uint64_t>(signame, signal_productor->get_size());
-	      break;
-	    }
-	  default       :
-	    throw (ErrorMorpheo ("Signal \""+name_internal+"\" : type unknow."));
+	  case BOOL     : interface->set_signal_internal<bool    >(signame, signal->get_size()); break;
+	  case UINT8_T  : interface->set_signal_internal<uint8_t >(signame, signal->get_size()); break;
+	  case UINT16_T : interface->set_signal_internal<uint16_t>(signame, signal->get_size()); break;
+	  case UINT32_T : interface->set_signal_internal<uint32_t>(signame, signal->get_size()); break;
+	  case UINT64_T : interface->set_signal_internal<uint64_t>(signame, signal->get_size()); break;
+	  default       :throw (ErrorMorpheo ("Signal \""+name_internal+"\" : type unknow."));
 	  }
 	
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Component_vhdl_instance.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Component_vhdl_instance.cpp	(revision 112)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Component_vhdl_instance.cpp	(revision 113)
@@ -92,6 +92,8 @@
 	while (i != list_component->end())
 	  {
-	    Entity *    entity   = (*i)->_entity;
-	    Tinstance_t instance = (*i)->_instance;
+	    Entity *    entity       = (*i)->_entity;
+	    Tinstance_t instance     = (*i)->_instance;
+            std::string architecture = (*i)->_architecture;
+            std::string package      = "work";
 	    
 	    if (instance & INSTANCE_LIBRARY)
@@ -176,5 +178,9 @@
 		    }
 		}
-	      vhdl->set_body_component ("instance_"+entity->get_name(),entity->get_name(),list_port_map);
+	      vhdl->set_body_component ("instance_"+entity->get_name(),
+                                        entity->get_name(),
+                                        architecture,
+                                        package,
+                                        list_port_map);
 	      
 	    }
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Entity_usage.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Entity_usage.cpp	(revision 113)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Entity_usage.cpp	(revision 113)
@@ -0,0 +1,26 @@
+/*
+ * $Id$
+ *
+ * [ Description ]
+ * 
+ */
+
+#include "Behavioural/include/Entity.h"
+
+
+namespace morpheo              {
+namespace behavioural          {
+
+#undef  FUNCTION
+#define FUNCTION "Entity::get_usage"
+  Tusage_t Entity::get_usage (void)
+  {
+    log_begin(Behavioural,FUNCTION);
+    Tusage_t _return = _usage;
+    log_end(Behavioural,FUNCTION);
+
+    return _return;
+  };
+
+}; // end namespace behavioural          
+}; // end namespace morpheo
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Interface.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Interface.cpp	(revision 112)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Interface.cpp	(revision 113)
@@ -73,5 +73,10 @@
          it != _list_signal->end();
          ++it)
-      delete (*it);
+      {
+        if ((_usage & USE_SYSTEMC) and 
+            ((*it)->get_direction() == INTERNAL))
+          delete (*it)->get_sc_signal();
+        delete (*it);
+      }
     
     delete _list_signal;
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Interface_fifo_testbench_assert.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Interface_fifo_testbench_assert.cpp	(revision 112)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Interface_fifo_testbench_assert.cpp	(revision 113)
@@ -34,6 +34,6 @@
           while (i != _list_cycle->end())
             {
-              vhdl->set_body("assert not (("+counter_name+" = "+toString(*i)+" and "+test_name+" = '1')) report \"***** <"+_name+"> Test number "+toString(j)+" is OK     *****\" severity NOTE;");
-              vhdl->set_body("assert not (("+counter_name+" = "+toString(*i)+" and "+test_name+" = '0')) report \"@@@@@ <"+_name+"> Test number "+toString(j)+" is KO !!! @@@@@\" severity NOTE;");
+              vhdl->set_body("assert not (("+counter_name+" = "+toString(*i)+" and "+test_name+" = '1')) report \"***** <"+_name+"> Test number "+toString(j)+" is OK     *****\" severity "+toString(VHDL_SEVERITY_NOTE)+";");
+              vhdl->set_body("assert not (("+counter_name+" = "+toString(*i)+" and "+test_name+" = '0')) report \"@@@@@ <"+_name+"> Test number "+toString(j)+" is KO !!! @@@@@\" severity "+toString(VHDL_SEVERITY_NOTE)+";");
               j++;
               ++i;
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Interface_fifo_testbench_cycle.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Interface_fifo_testbench_cycle.cpp	(revision 112)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Interface_fifo_testbench_cycle.cpp	(revision 113)
@@ -9,4 +9,5 @@
 #include "Behavioural/include/Interface_fifo.h"
 #include "Behavioural/include/Entity.h"
+#include "Common/include/Systemc.h"
 
 namespace morpheo              {
@@ -18,5 +19,5 @@
 
     // note : if defined(VHDL_TESTBENCH) then defined(SYSTEMC)
-    _list_cycle->push_back(static_cast<uint32_t>(sc_simulation_time()));
+    _list_cycle->push_back(static_cast<uint32_t>(simulation_cycle()));
 
     log_printf(FUNC,Behavioural,"testbench_cycle","End");
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Interface_find_signal.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Interface_find_signal.cpp	(revision 112)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Interface_find_signal.cpp	(revision 113)
@@ -15,4 +15,6 @@
   {
     log_printf(FUNC,Behavioural,"find_signal","Begin");
+
+    LowerCase(name);
 
     std::list<Signal*>::iterator i   = _list_signal->begin();
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Interface_set_port.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Interface_set_port.cpp	(revision 112)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Interface_set_port.cpp	(revision 113)
@@ -26,4 +26,5 @@
 	  }
       }
+
     log_printf(FUNC,Behavioural,"set_port (Vhdl)","End");
   };
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Interface_set_signal.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Interface_set_signal.cpp	(revision 112)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Interface_set_signal.cpp	(revision 113)
@@ -11,4 +11,6 @@
 namespace behavioural          {
 
+#undef  FUNCTION
+#define FUNCTION "Interface::set_signal"
   Signal * Interface::set_signal (std::string     name     ,
 				  direction_t     direction,
@@ -16,5 +18,5 @@
 				  presence_port_t presence_port)
   {
-    log_printf(FUNC,Behavioural,"set_signal","Begin");
+    log_begin(Behavioural,FUNCTION);
 
     std::string signame = signal_name(_name, name, direction);
@@ -24,5 +26,5 @@
     _list_signal->push_back (sig);
 
-    log_printf(FUNC,Behavioural,"set_signal","End");
+    log_end(Behavioural,FUNCTION);
 
     return sig;
@@ -36,5 +38,5 @@
   void Interface::set_signal (Vhdl * & vhdl)
   {
-    log_printf(FUNC,Behavioural,FUNCTION,"Begin");
+    log_begin(Behavioural,FUNCTION);
     if (not _list_signal->empty())
       {
@@ -47,5 +49,5 @@
 	  }
       }
-    log_printf(FUNC,Behavioural,FUNCTION,"End");
+    log_end(Behavioural,FUNCTION);
   };
 #  endif
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Interface_signal_name.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Interface_signal_name.cpp	(revision 112)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Interface_signal_name.cpp	(revision 113)
@@ -17,17 +17,30 @@
     log_printf(FUNC,Behavioural,"signal_name","Begin");
 
-    std::string str_direction = toString(direction);
+    std::string str_direction = (direction==INTERNAL)?"":toString(direction);
     std::string str_interface = name_interface;
     std::string str_signal    = name_signal;
 
-    LowerCase(str_direction);    
-    UpperCase(str_interface);
-    UpperCase(str_signal   );
+//     LowerCase(str_direction);    
+//     LowerCase(str_interface);
+//     LowerCase(str_signal   );
     
-    std::string signame = str_direction;
+    std::string signame = "";
+    bool need_underscore = false;
+
+    if (str_direction != "")
+      {
+        signame +=                            str_direction;
+        need_underscore = true;
+      }
     if (str_interface != "")
-      signame += "_"+str_interface;
-    if (str_signal    != "")
-      signame += "_"+str_signal;
+      {
+        signame += ((need_underscore)?"_":"")+str_interface;
+        need_underscore = true;
+      }
+    if (str_signal != "")
+      {
+        signame += ((need_underscore)?"_":"")+str_signal;
+//      need_underscore = true;
+      }
 
     log_printf(FUNC,Behavioural,"signal_name","End");
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Interfaces.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Interfaces.cpp	(revision 112)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Interfaces.cpp	(revision 113)
@@ -11,5 +11,5 @@
 namespace behavioural          {
 
-  Interfaces::Interfaces  (std::string   name,
+  Interfaces::Interfaces  (std::string name,
 			   Tusage_t usage):
     _name  (name),
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Interfaces_set_port.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Interfaces_set_port.cpp	(revision 112)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Interfaces_set_port.cpp	(revision 113)
@@ -27,5 +27,10 @@
 	    ++i;
 	  }
+
+//         Signal * clock = get_clock();
+//         if (clock != NULL)
+//           vhdl->set_port_clock (clock->get_name());
       }
+
     log_printf(FUNC,Behavioural,FUNCTION,"End");
   };
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Interfaces_testbench_generate_file.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Interfaces_testbench_generate_file.cpp	(revision 112)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Interfaces_testbench_generate_file.cpp	(revision 113)
@@ -66,5 +66,5 @@
     vhdl->set_body("");
     vhdl->set_body("-- if the systemC simulate have multiple reset, we make the last");
-    vhdl->set_body(reset_name+" <= '1' after 150 ns;");    
+    vhdl->set_body(reset_name+" <= '1' after "+toString(2.*VHDL_TIME_PERIOD)+" "+toString(VHDL_TIME_UNIT)+";");    
 
     vhdl->set_body("");
@@ -73,5 +73,5 @@
     vhdl->set_body("------------------------------------------------------");
     vhdl->set_body("");
-    vhdl->set_body(clock_name+" <= not "+clock_name+" after 50 ns;");
+    vhdl->set_body(clock_name+" <= not "+clock_name+" after "+toString(VHDL_TIME_PERIOD/2.)+" "+toString(VHDL_TIME_UNIT)+";");
     vhdl->set_body("");
     vhdl->set_body("process ("+clock_name+")");
@@ -89,5 +89,5 @@
 #ifdef VHDL_TESTBENCH_ASSERT
     for (uint32_t cpt=0; cpt<=cycle; cpt++)
-      vhdl->set_body("\t\t\tassert not ("+counter+" = "+toString(cpt)+") report \"===== Test number "+toString(cpt)+" =====\" severity NOTE;");
+      vhdl->set_body("\t\t\tassert not ("+counter+" = "+toString(cpt)+") report \"===== Test number "+toString(cpt)+" =====\" severity "+toString(VHDL_SEVERITY_NOTE)+";");
 
     for (std::list<Interface_fifo*>::iterator it=_list_interface->begin();
@@ -106,6 +106,6 @@
 
     vhdl->set_body("");
-    vhdl->set_body("\t\t\tassert not ("+counter+" >= "+toString(cycle)+") report \"Test OK\" severity FAILURE;");
-    vhdl->set_body("\t\t\tassert not ("+test_name+" = '0') report \"Test KO\" severity FAILURE;");
+    vhdl->set_body("\t\t\tassert not ("+counter+" >= "+toString(cycle)+") report \"Test OK\" severity "+toString(VHDL_SEVERITY_FAILURE)+";");
+    vhdl->set_body("\t\t\tassert not ("+test_name+" = '0') report \"Test KO\" severity "+toString(VHDL_SEVERITY_FAILURE)+";");
     vhdl->set_body("\t\tend if;");
     vhdl->set_body("\tend if;");
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Model_print.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Model_print.cpp	(revision 113)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Model_print.cpp	(revision 113)
@@ -0,0 +1,29 @@
+/*
+ * $Id$
+ *
+ * [ Description ]
+ * 
+ */
+
+#include "Behavioural/include/Model.h"
+
+namespace morpheo              {
+namespace behavioural          {
+
+#undef  FUNCTION
+#define FUNCTION "Model::print"
+  void Model::print (void)
+  {
+    log_begin(Behavioural,FUNCTION);
+
+    msgInformation("Model Information [type, model simulation, debug verbosity]\n");
+    for (std::map<std::string,model_t>::iterator it=models.begin();
+         it!=models.end();
+         ++it)
+      msgInformation("  * %s\t%s\t%s\n",(it->first).c_str(), toString(it->second.type).c_str(), toString(it->second.debug).c_str());
+
+    log_end(Behavioural,FUNCTION);
+  }
+
+}; // end namespace behavioural          
+}; // end namespace morpheo              
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Model_set_model.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Model_set_model.cpp	(revision 112)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Model_set_model.cpp	(revision 113)
@@ -12,5 +12,5 @@
 
 #undef  FUNCTION
-#define FUNCTION "Model::get_type"
+#define FUNCTION "Model::set_model"
   void Model::set_model (std::string component, model_type_t type, debug_verbosity_t debug)
   {
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Parameters.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Parameters.cpp	(revision 112)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Parameters.cpp	(revision 113)
@@ -13,5 +13,15 @@
 #undef  FUNCTION
 #define FUNCTION "Parameters::Parameters"
-  Parameters::Parameters  (void)
+  Parameters::Parameters  (void) :
+    _type ("")
+  {
+    log_printf(FUNC,Behavioural,FUNCTION,"Begin");
+    log_printf(FUNC,Behavioural,FUNCTION,"End");
+  };
+
+#undef  FUNCTION
+#define FUNCTION "Parameters::Parameters"
+  Parameters::Parameters  (std::string type) :
+    _type (type)
   {
     log_printf(FUNC,Behavioural,FUNCTION,"Begin");
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Parameters_test.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Parameters_test.cpp	(revision 112)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Parameters_test.cpp	(revision 113)
@@ -20,5 +20,5 @@
     Parameters_test x = msg_error();
     
-    std::cerr << x.print();
+    msg("%s",x.print().c_str());
 
     if (x.have_error())
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Signal.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Signal.cpp	(revision 112)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Signal.cpp	(revision 113)
@@ -11,5 +11,5 @@
 namespace behavioural          {
 
-  Signal::Signal  (std::string          name         ,
+  Signal::Signal  (std::string     name         ,
 		   direction_t     direction    ,
 		   uint32_t        size         ,
@@ -20,5 +20,5 @@
   {
     log_printf(FUNC,Behavioural,"Signal","Begin");
-    _size                     = size;
+
     _is_allocate              = false;
     _is_map_as_component_src  = false;
@@ -33,8 +33,8 @@
     _list_value          = new std::list<std::string>;
 #endif
+    set_size(size);
     
     if (_size == 0)
       throw ERRORMORPHEO(FUNCTION,"Size of signal '"+_name+"' is nul");
-
 
     log_printf(FUNC,Behavioural,"Signal","End");
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Signal_get_sc_signal.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Signal_get_sc_signal.cpp	(revision 113)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Signal_get_sc_signal.cpp	(revision 113)
@@ -0,0 +1,26 @@
+/*
+ * $Id$
+ *
+ * [ Description ]
+ * 
+ */
+
+#include "Behavioural/include/Signal.h"
+
+
+namespace morpheo              {
+namespace behavioural          {
+
+#undef  FUNCTION
+#define FUNCTION "Signal::get_sc_signal"
+  void * Signal::get_sc_signal (void)
+  {
+    log_printf(FUNC,Behavioural,FUNCTION,"Begin");
+    void * _return = _sc_signal;
+    log_printf(FUNC,Behavioural,FUNCTION,"End");
+
+    return _return;
+  };
+
+}; // end namespace behavioural          
+}; // end namespace morpheo              
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Signal_get_size.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Signal_get_size.cpp	(revision 112)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Signal_get_size.cpp	(revision 113)
@@ -7,5 +7,5 @@
 
 #include "Behavioural/include/Signal.h"
-
+#include "Common/include/Environment.h"
 
 namespace morpheo              {
@@ -18,4 +18,17 @@
     log_printf(FUNC,Behavioural,FUNCTION,"Begin");
     uint32_t _return = _size;
+
+#ifdef MODELSIM_COSIMULATION
+    switch (_type_info)
+      {
+      case BOOL     : _return =  1; break;
+      case UINT8_T  : _return =  8; break;
+      case UINT16_T : _return = 16; break;
+      case UINT32_T : _return = 32; break;
+      case UINT64_T : _return = 64; break;
+      default       : break;
+      }
+#endif
+
     log_printf(FUNC,Behavioural,FUNCTION,"End");
 
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Signal_link.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Signal_link.cpp	(revision 112)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Signal_link.cpp	(revision 113)
@@ -2,5 +2,5 @@
  * $Id$
  *
- * [ Description ]
+ * [ Description ]
  * 
  */
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Signal_presence_testbench.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Signal_presence_testbench.cpp	(revision 112)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Signal_presence_testbench.cpp	(revision 113)
@@ -13,6 +13,6 @@
 
 #undef  FUNCTION
-#define FUNCTION "Signal::presence_vhdl"
-  bool Signal::presence_vhdl (void)
+#define FUNCTION "Signal::presence_testbench"
+  bool Signal::presence_testbench (void)
   {
     log_printf(FUNC,Behavioural,FUNCTION,"Begin");
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Signal_set_port.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Signal_set_port.cpp	(revision 112)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Signal_set_port.cpp	(revision 113)
@@ -21,5 +21,5 @@
 	(_presence_port == CLOCK_VHDL_YES)              or
 	(_presence_port == RESET_VHDL_YES))
-      vhdl->set_port (_name,_direction,_size);
+      vhdl->set_port (_name,_direction,get_size());
 
     log_printf(FUNC,Behavioural,"set_port (Vhdl)","End");
@@ -38,8 +38,8 @@
 // 	or (_presence_port == RESET_VHDL_NO ) 
 	)
-      vhdl->set_signal (_name        ,_size);
+      vhdl->set_signal (_name        ,get_size());
 
     if (_direction == OUT)
-      vhdl->set_signal (_name+"_test",_size);
+      vhdl->set_signal (_name+"_test",get_size());
 
     log_printf(FUNC,Behavioural,"set_signal (Vhdl)","End");
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Signal_set_size.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Signal_set_size.cpp	(revision 112)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Signal_set_size.cpp	(revision 113)
@@ -18,4 +18,5 @@
     log_printf(FUNC,Behavioural,FUNCTION,"Begin");
     _size = size;
+
     log_printf(FUNC,Behavioural,FUNCTION,"End");
   };
@@ -27,5 +28,5 @@
     log_printf(FUNC,Behavioural,FUNCTION,"Begin");
     if (size > _size)
-      _size = size;
+      set_size(size);
     log_printf(FUNC,Behavioural,FUNCTION,"End");
   };
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Signal_testbench.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Signal_testbench.cpp	(revision 112)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Signal_testbench.cpp	(revision 113)
@@ -44,6 +44,6 @@
 	      switch (_direction)
 		{
-		case IN    : {str =             toBase2 (value,_size); break;}
-		case OUT   : {str =             toBase2 (value,_size); break;}
+		case IN    : {str =             toBase2 (value,get_size()); break;}
+		case OUT   : {str =             toBase2 (value,get_size()); break;}
    		default    : {break;}
 		}
@@ -56,6 +56,6 @@
 	      switch (_direction)
 		{
-		case IN    : {str =             toBase2 (value,_size); break;}
-		case OUT   : {str =             toBase2 (value,_size); break;}
+		case IN    : {str =             toBase2 (value,get_size()); break;}
+		case OUT   : {str =             toBase2 (value,get_size()); break;}
    		default    : {break;}		
 		}
@@ -68,6 +68,6 @@
 	      switch (_direction)
 		{
-		case IN    : {str =             toBase2 (value,_size); break;}
-		case OUT   : {str =             toBase2 (value,_size); break;}
+		case IN    : {str =             toBase2 (value,get_size()); break;}
+		case OUT   : {str =             toBase2 (value,get_size()); break;}
    		default    : {break;}
 		}
@@ -80,6 +80,6 @@
 	      switch (_direction)
 		{
-		case IN    : {str =             toBase2 (value,_size); break;}
-		case OUT   : {str =             toBase2 (value,_size); break;}
+		case IN    : {str =             toBase2 (value,get_size()); break;}
+		case OUT   : {str =             toBase2 (value,get_size()); break;}
    		default    : {break;}
 		}
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Signal_testbench_body.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Signal_testbench_body.cpp	(revision 112)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Signal_testbench_body.cpp	(revision 113)
@@ -25,5 +25,5 @@
 	{
 	  std::string separator;
-	  if (_size == 1)
+	  if (get_size() == 1)
 	    separator = "\'";
 	  else
@@ -48,5 +48,5 @@
 	    }
 	  
-	  if (_size == 1)
+	  if (get_size() == 1)
 	    vhdl->set_body ("\t'0' when others;");
 	  else
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Simulation_test_end.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Simulation_test_end.cpp	(revision 112)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Simulation_test_end.cpp	(revision 113)
@@ -8,4 +8,5 @@
 
 #include "Behavioural/include/Simulation.h"
+#include "Common/include/Systemc.h"
 
 namespace morpheo              {
@@ -14,5 +15,5 @@
   bool simulation_test_end (void)
   {
-    msg("##########[ cycle %d ]\n",static_cast<uint32_t>(sc_simulation_time()));
+    msg("##########[ cycle %d ]\n",static_cast<uint32_t>(simulation_cycle()));
 
     // Test if a stop condition is activate
@@ -26,5 +27,5 @@
 
     if (_simulation_nb_cycle != 0)
-      end_cycle = (_simulation_nb_cycle <= sc_simulation_time());
+      end_cycle = (_simulation_nb_cycle <= simulation_cycle());
     else
       end_cycle = true;
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Stat_end_cycle.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Stat_end_cycle.cpp	(revision 112)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Stat_end_cycle.cpp	(revision 113)
@@ -1,4 +1,5 @@
 #ifdef STATISTICS
 #include "Behavioural/include/Stat.h"
+#include "Common/include/Systemc.h"
 
 namespace morpheo {
@@ -6,5 +7,5 @@
   void Stat::end_cycle (void)
   {
-    cycle_t _cycle_sum = sc_simulation_time();
+    cycle_t _cycle_sum = simulation_cycle();
 
     if (_cycle_sum >= _nb_cycle_before_begin)
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Stat_generate_file.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Stat_generate_file.cpp	(revision 112)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Stat_generate_file.cpp	(revision 113)
@@ -3,4 +3,5 @@
 #include "Behavioural/include/Version.h"
 #include "Common/include/Environment.h"
+#include "Common/include/Systemc.h"
 
 namespace morpheo {
@@ -13,5 +14,5 @@
     std::string body = print(1);
 
-    cycle_t _cycle_sum = sc_simulation_time();
+    cycle_t _cycle_sum = simulation_cycle();
 
     morpheo::behavioural::XML * xml = new morpheo::behavioural::XML (_name_instance);
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Stat_print.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Stat_print.cpp	(revision 112)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Stat_print.cpp	(revision 113)
@@ -1,4 +1,5 @@
 #ifdef STATISTICS
 #include "Behavioural/include/Stat.h"
+#include "Common/include/Systemc.h"
 
 namespace morpheo {
@@ -12,5 +13,5 @@
     end_simulation(); 
 
-    cycle_t _cycle_sum = sc_simulation_time();
+    cycle_t _cycle_sum = simulation_cycle();
 
     morpheo::behavioural::XML xml (_name_instance);
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Usage.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Usage.cpp	(revision 112)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Usage.cpp	(revision 113)
@@ -5,4 +5,24 @@
 namespace morpheo {
 namespace behavioural {
+
+#ifdef MODELSIM_COSIMULATION
+  Tusage_t usage_cosimulation(Tusage_t usage)
+  {
+    Tusage_t _return = usage;
+//  _return = usage_unset(_return,USE_SYSTEMC              );
+    _return = usage_unset(_return,USE_SYSTEMC_INTERFACE    );
+    _return = usage_unset(_return,USE_SYSTEMC_BODY         );
+    _return = usage_unset(_return,USE_VHDL                 );
+    _return = usage_unset(_return,USE_VHDL_TESTBENCH       );
+    _return = usage_unset(_return,USE_VHDL_TESTBENCH_ASSERT);
+//  _return = usage_unset(_return,USE_POSITION             );
+    _return = usage_unset(_return,USE_STATISTICS           );
+//  _return = usage_unset(_return,USE_INFORMATION          );
+//  _return = usage_unset(_return,USE_HEADER               );
+    _return = usage_set  (_return,USE_COSIMULATION         );
+    
+    return _return;
+  }
+#endif
 
   Tusage_t usage_set         (Tusage_t usage, Tusage_t flag)
@@ -22,9 +42,11 @@
 #undef  FUNCTION
 #define FUNCTION "usage_environment"
-  void     usage_environment (Tusage_t usage)
+  Tusage_t usage_environment (Tusage_t usage)
   {
 #ifndef SYSTEMC
-    if (usage_is_set(usage,USE_SYSTEMC))
-      throw ERRORMORPHEO(FUNCTION,_("Component use the flag \"USE_SYSTEMC\", but the macro's compiler \"SYSTEMC\" is unset.\n"));
+    if (usage_is_set(usage,USE_SYSTEMC_INTERFACE))
+      throw ERRORMORPHEO(FUNCTION,_("Component use the flag \"USE_SYSTEMC_INTERFACE\", but the macro's compiler \"SYSTEMC\" is unset.\n"));
+    if (usage_is_set(usage,USE_SYSTEMC_BODY))
+      throw ERRORMORPHEO(FUNCTION,_("Component use the flag \"USE_SYSTEMC_BODY\", but the macro's compiler \"SYSTEMC\" is unset.\n"));
 #endif
 #ifndef VHDL
@@ -48,20 +70,20 @@
       throw ERRORMORPHEO(FUNCTION,_("Component use the flag \"USE_STATISTICS\", but the macro's compiler \"STATISTICS\" is unset.\n"));
 #endif
-#ifndef INFORMATION
-    if (usage_is_set(usage,USE_INFORMATION))
-      throw ERRORMORPHEO(FUNCTION,_("Component use the flag \"USE_INFORMATION\", but the macro's compiler \"INFORMATION\" is unset.\n"));
-#endif
+// #ifndef INFORMATION
+//     if (usage_is_set(usage,USE_INFORMATION))
+//       throw ERRORMORPHEO(FUNCTION,_("Component use the flag \"USE_INFORMATION\", but the macro's compiler \"INFORMATION\" is unset.\n"));
+// #endif
 
 #ifndef DEBUG
 #endif
 
-    if (usage_is_set(usage,USE_STATISTICS) and not usage_is_set(usage,USE_SYSTEMC))
-      throw ERRORMORPHEO(FUNCTION,_("Usage flags conflit : to use the statistics, you must set flag USE_SYSTEMC\n"));
+    if (usage_is_set(usage,USE_STATISTICS) and not usage_is_set(usage,USE_SYSTEMC_BODY))
+      throw ERRORMORPHEO(FUNCTION,_("Usage flags conflit : to use the statistics, you must set flag USE_SYSTEMC_BODY\n"));
     
-    if (usage_is_set(usage,USE_INFORMATION) and not usage_is_set(usage,USE_STATISTICS))
-      throw ERRORMORPHEO(FUNCTION,_("Usage flags conflit : to use the information, you must set flag USE_STATISTICS\n"));
+//     if (usage_is_set(usage,USE_INFORMATION) and not usage_is_set(usage,USE_STATISTICS))
+//       throw ERRORMORPHEO(FUNCTION,_("Usage flags conflit : to use the information, you must set flag USE_STATISTICS\n"));
     
-    if (usage_is_set(usage,USE_VHDL_TESTBENCH) and not usage_is_set(usage,USE_SYSTEMC))
-      throw ERRORMORPHEO(FUNCTION,_("Usage flags conflit : to use the vhdl's test bench, you must set flag USE_SYSTEMC\n"));
+    if (usage_is_set(usage,USE_VHDL_TESTBENCH) and not usage_is_set(usage,USE_SYSTEMC_BODY))
+      throw ERRORMORPHEO(FUNCTION,_("Usage flags conflit : to use the vhdl's test bench, you must set flag USE_SYSTEMC_BODY\n"));
     
     if (usage_is_set(usage,USE_VHDL_TESTBENCH) and not usage_is_set(usage,USE_VHDL))
@@ -70,4 +92,6 @@
     if (usage_is_set(usage,USE_VHDL_TESTBENCH_ASSERT) and not usage_is_set(usage,USE_VHDL_TESTBENCH))
       throw ERRORMORPHEO(FUNCTION,_("Usage flags conflit : to use an assert in vhdl's test bench, you must set flag USE_VHDL_TESTBENCH\n"));
+
+    return usage;
   }
 
@@ -77,5 +101,6 @@
 
 #ifdef SYSTEMC
-    usage = usage_set(usage,USE_SYSTEMC);
+    usage = usage_set(usage,USE_SYSTEMC_INTERFACE);
+    usage = usage_set(usage,USE_SYSTEMC_BODY);
 #endif
 #ifdef VHDL
@@ -94,7 +119,7 @@
     usage = usage_set(usage,USE_STATISTICS);
 #endif
-#ifdef INFORMATION
-    usage = usage_set(usage,USE_INFORMATION);
-#endif
+// #ifdef INFORMATION
+//     usage = usage_set(usage,USE_INFORMATION);
+// #endif
     usage = usage_set(usage,USE_HEADER);
 #ifdef DEBUG
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl.cpp	(revision 112)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl.cpp	(revision 113)
@@ -15,8 +15,17 @@
 #undef  FUNCTION
 #define FUNCTION "Vhdl::Vhdl"
-  Vhdl::Vhdl  (std::string name):
-    _name   (name)
+  Vhdl::Vhdl  (std::string name,
+               std::string id):
+    _name                      (name),
+    _id                        (id),
+    _name_architecture_default ("morpheo_behavioural")
   {
     log_printf(FUNC,Behavioural,FUNCTION,"Begin");
+
+    _name_architecture = _name_architecture_default;
+//  _port_clock        = "";
+
+    set_library_default();
+
     log_printf(FUNC,Behavioural,FUNCTION,"End");
   };
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_generate_file_model.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_generate_file_model.cpp	(revision 112)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_generate_file_model.cpp	(revision 113)
@@ -22,5 +22,5 @@
     directory();
 
-    std::string filename = MORPHEO_VHDL + "/" + _name + ".vhdl";
+    std::string filename = MORPHEO_VHDL + "/" + _name + VHDL_EXTENSION;
     
     msg_printf(INFORMATION,_("Generate file \"%s\"."),filename.c_str());
@@ -30,5 +30,5 @@
     file.open(filename.c_str(),std::ios::out | std::ios::trunc);
 
-    file << get_model (0,filename,_name,"behavioural");
+    file << get_model (0,filename,_name);
     file.close();
 
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_generate_file_package.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_generate_file_package.cpp	(revision 112)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_generate_file_package.cpp	(revision 113)
@@ -4,5 +4,5 @@
  * $Id$
  *
- * [ Description ]
+ * [ Description ]
  * 
  */
@@ -23,5 +23,5 @@
 
     std::string name     = _name + "_Pack";
-    std::string filename = MORPHEO_VHDL + "/" + name + ".vhdl";
+    std::string filename = MORPHEO_VHDL + "/" + name + VHDL_EXTENSION;
 
     msg_printf(INFORMATION,_("Generate file \"%s\"."),filename.c_str());
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_get_alias.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_get_alias.cpp	(revision 112)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_get_alias.cpp	(revision 113)
@@ -20,5 +20,8 @@
   {
     log_printf(FUNC,Behavioural,FUNCTION,"Begin");
-    std::string _return = get_list(_list_alias, depth, ";", true);
+
+    test_architecture();
+    
+    std::string _return = get_list(_architecture[_name_architecture]._list_alias, depth, ";", true);
     log_printf(FUNC,Behavioural,FUNCTION,"End");
 
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_get_architecture.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_get_architecture.cpp	(revision 112)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_get_architecture.cpp	(revision 113)
@@ -11,6 +11,4 @@
 #include "Common/include/Tabulation.h"
 
-#include <sstream>
-
 namespace morpheo              {
 namespace behavioural          {
@@ -18,20 +16,30 @@
 #undef  FUNCTION
 #define FUNCTION "Vhdl::get_architecture"
-  std::string Vhdl::get_architecture (uint32_t depth      ,
-				 std::string   name       ,
-				 std::string   entity_name)
+  std::string Vhdl::get_architecture (uint32_t    depth      ,
+                                      std::string entity_name)
   {
     log_printf(FUNC,Behavioural,FUNCTION,"Begin");
 
-    std::string        tab = morpheo::tab(depth);
     std::ostringstream text;
+    std::string name_architecture_old = _name_architecture;
+    std::string tab=morpheo::tab(depth);
 
-    text << tab << "architecture " << name << " of " << entity_name << " is" << std::endl
-	 << tab << get_type     (depth+1)                                    << std::endl
-	 << tab << get_signal   (depth+1)                                    << std::endl
-	 << tab << get_alias    (depth+1)                                    << std::endl
-	 << tab << "begin"                                                   << std::endl
-	 << tab << get_body     (depth+1)                                    << std::endl
-	 << tab << "end " << name << ";"                                     << std::endl;
+    for (std::map<std::string,vhdl_architecture_t>::iterator it = _architecture.begin();
+         it!=_architecture.end();
+         ++it)
+      {
+        std::string name = it->first;
+        set_architecture(name);
+
+        text << tab << "architecture " << name << " of " << entity_name << " is" << std::endl
+             << tab << get_type     (depth+1)                                    << std::endl
+             << tab << get_signal   (depth+1)                                    << std::endl
+             << tab << get_alias    (depth+1)                                    << std::endl
+             << tab << "begin"                                                   << std::endl
+             << tab << get_body     (depth+1)                                    << std::endl
+             << tab << "end " << name << ";"                                     << std::endl;
+      }
+
+    set_architecture (name_architecture_old);
 
     log_printf(FUNC,Behavioural,FUNCTION,"End");
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_get_body.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_get_body.cpp	(revision 112)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_get_body.cpp	(revision 113)
@@ -20,5 +20,10 @@
   {
     log_printf(FUNC,Behavioural,FUNCTION,"Begin");
-    std::string _return = get_list(_list_body,depth,"",true);
+
+    test_architecture();
+    std::string _return = get_list(_architecture[_name_architecture]._list_body,depth,"",true);
+
+    _return = _return + get_debug(depth);
+    
     log_printf(FUNC,Behavioural,FUNCTION,"End");
 
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_get_configuration.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_get_configuration.cpp	(revision 113)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_get_configuration.cpp	(revision 113)
@@ -0,0 +1,57 @@
+#ifdef VHDL
+
+/*
+ * $Id$
+ *
+ * [ Description ]
+ * 
+ */
+
+#include "Behavioural/include/Vhdl.h"
+#include "Common/include/Tabulation.h"
+
+namespace morpheo              {
+namespace behavioural          {
+  
+#undef  FUNCTION
+#define FUNCTION "Vhdl::get_configuration"
+  std::string Vhdl::get_configuration (uint32_t    depth             ,
+                                       std::string entity_name       ,
+                                       std::string configuration_name)
+  {
+    log_printf(FUNC,Behavioural,FUNCTION,"Begin");
+
+    std::ostringstream text;
+
+    text << "";
+
+//     std::string tab0=morpheo::tab(depth);
+//     std::string tab1=morpheo::tab(depth+1);
+//     std::string tab2=morpheo::tab(depth+2);
+//     std::string name_architecture_old = _name_architecture;
+
+//     text << tab0 << "configuration " << configuration_name << " of " << entity_name << " is" << std::endl;
+//     for (std::map<std::string,vhdl_architecture_t>::iterator it = _architecture.begin();
+//          it!=_architecture.end();
+//          ++it)
+//       {
+//         std::string name = it->first;
+//         set_architecture(name);
+        
+//         text << tab1 << "for " << name << std::endl;
+        
+//         text << tab1 << "end for;" << std::endl;
+//       }
+//     text << tab0 << "end configuration " << configuration_name << ";" << std::endl;
+
+//     set_architecture (name_architecture_old);
+
+    log_printf(FUNC,Behavioural,FUNCTION,"End");
+
+    return text.str();
+  };
+  
+}; // end namespace behavioural          
+}; // end namespace morpheo              
+
+#endif
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_get_debug.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_get_debug.cpp	(revision 113)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_get_debug.cpp	(revision 113)
@@ -0,0 +1,54 @@
+#ifdef VHDL
+
+/*
+ * $Id$
+ *
+ * [ Description ]
+ * 
+ */
+
+#include "Behavioural/include/Vhdl.h"
+#include "Common/include/Tabulation.h"
+#include <sstream>
+
+namespace morpheo              {
+namespace behavioural          {
+  
+#undef  FUNCTION
+#define FUNCTION "Vhdl::get_debug"
+  std::string Vhdl::get_debug (uint32_t depth)
+  {
+    log_printf(FUNC,Behavioural,FUNCTION,"Begin");
+
+    test_architecture();
+
+    std::string _return = "";
+
+    if (_architecture[_name_architecture]._list_debug.size()>0)
+      {
+//         if (_port_clock == "")
+//           throw ERRORMORPHEO(FUNCTION,_("Clock port is not define.\n"));
+        
+        std::string tab0=morpheo::tab(depth);
+        std::string tab1=morpheo::tab(depth+1);
+        
+        _return += "\n";
+        _return += tab0+"debug: process\n";
+        _return += tab0+"begin  -- process debug\n";
+        _return += get_list(_architecture[_name_architecture]._list_debug,depth+1,"",true);
+        _return += "\n";
+        _return += tab1+"-- wait one period\n";
+        _return += tab1+"wait for "+toString(VHDL_TIME_PERIOD)+" "+toString(VHDL_TIME_UNIT)+";\n";
+        _return += tab0+"end process debug;\n";
+      }
+
+    log_printf(FUNC,Behavioural,FUNCTION,"End");
+
+    return _return;
+  };
+  
+  
+}; // end namespace behavioural          
+}; // end namespace morpheo              
+
+#endif
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_get_header.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_get_header.cpp	(revision 112)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_get_header.cpp	(revision 113)
@@ -12,4 +12,5 @@
 #include <time.h>
 #include <sstream>
+#include <fstream>
 
 namespace morpheo              {
@@ -21,5 +22,5 @@
 			       std::string   filename)
   {
-    log_printf(FUNC,Behavioural,FUNCTION,"Begin");
+    log_begin(Behavioural,FUNCTION);
 
     std::string text;
@@ -32,10 +33,62 @@
     text += "-- "+toString(_("Date    : ")) + ctime (&current_time );
     text += "-- "+toString(_("Version : ")) + MORPHEO_HEADER +"\n";
+    text += "-- "+toString(_("Id      : ")) + _id +"  \n";
     text += "-- "+toString(_("Comment : ")) + _("it's a autogenerated file, don't modify") +"\n";
     text += "-------------------------------------------------------------------------------\n";
     
-    log_printf(FUNC,Behavioural,FUNCTION,"End");
+    log_end(Behavioural,FUNCTION);
 
     return text;
+  };
+
+#undef  FUNCTION
+#define FUNCTION "vhdl_get_id"
+  std::string vhdl_get_id(std::string model_name)
+  {
+    log_begin(Behavioural,FUNCTION);
+
+    std::string id="";
+
+    directory();
+
+    std::string filename = MORPHEO_VHDL + "/" + model_name + VHDL_EXTENSION;
+    std::ifstream file;
+
+    file.open(filename.c_str(),std::ios::in);
+
+    // open file
+    if (!file)
+      {
+        log_printf(INFO,Behavioural,FUNCTION,_("Can't open file : \"%s\""),filename.c_str());
+      }
+    else
+      {
+        // get line with Id
+        do
+          {
+            std::getline(file,id,'\n'); // comment
+          } while ((id.find("Id      :") == std::string::npos) and
+                   (not file.eof()));
+
+        if (file.eof())
+          log_printf(INFO,Behavioural,FUNCTION,_("\"Id\" not find in file : \"%s\""),filename.c_str());
+        else
+          {
+            // get id
+            id = id.substr(id.find_first_of(':',0)+1,std::string::npos);
+
+            // Erase all ' '
+            size_t i=id.find_first_of(' ',0);
+            while (i!=std::string::npos)
+              {
+                id.erase(i,i+1);
+                i=id.find_first_of(' ',i);
+              }
+          }
+      }
+
+    log_end(Behavioural,FUNCTION);
+
+    return id;
   };
   
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_get_library.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_get_library.cpp	(revision 113)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_get_library.cpp	(revision 113)
@@ -0,0 +1,38 @@
+#ifdef VHDL
+
+/*
+ * $Id$
+ *
+ * [ Description ]
+ * 
+ */
+
+#include "Behavioural/include/Vhdl.h"
+#include "Common/include/Tabulation.h"
+#include <sstream>
+
+namespace morpheo              {
+namespace behavioural          {
+  
+#undef  FUNCTION
+#define FUNCTION "Vhdl::get_library"
+  std::string Vhdl::get_library (uint32_t depth)
+  {
+    log_printf(FUNC,Behavioural,FUNCTION,"Begin");
+
+    std::list<std::string>::iterator i   = _list_library.begin();
+    std::string                 tab = morpheo::tab(depth);
+    std::ostringstream          text;
+
+    if (i != _list_library.end())
+      text << get_list(_list_library,depth,";",true);
+
+    log_printf(FUNC,Behavioural,FUNCTION,"End");
+
+    return text.str();
+  };
+  
+}; // end namespace behavioural          
+}; // end namespace morpheo              
+
+#endif
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_get_library_default.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_get_library_default.cpp	(revision 113)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_get_library_default.cpp	(revision 113)
@@ -0,0 +1,45 @@
+#ifdef VHDL
+
+/*
+ * $Id$
+ *
+ * [ Description ]
+ * 
+ */
+
+#include "Behavioural/include/Vhdl.h"
+#include "Common/include/Tabulation.h"
+
+#include <sstream>
+
+namespace morpheo              {
+namespace behavioural          {
+  
+#undef  FUNCTION
+#define FUNCTION "Vhdl::get_library_default"
+  std::string Vhdl::get_library_default (uint32_t depth)
+  {
+    log_begin(Behavioural,FUNCTION);
+    
+    std::string text;
+    std::string str;
+    
+    std::stringstream it;
+
+    it << get_library(depth);
+
+    while (getline(it,str))
+      {
+        if (str.find( "ieee") != std::string::npos)
+          text += str+"\n";
+      }
+
+    log_end(Behavioural,FUNCTION);
+
+    return text;
+  };
+  
+}; // end namespace behavioural          
+}; // end namespace morpheo              
+
+#endif
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_get_library_ieee.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_get_library_ieee.cpp	(revision 112)
+++ 	(revision )
@@ -1,46 +1,0 @@
-#ifdef VHDL
-
-/*
- * $Id$
- *
- * [ Description ]
- * 
- */
-
-#include "Behavioural/include/Vhdl.h"
-#include "Common/include/Tabulation.h"
-
-#include <sstream>
-
-namespace morpheo              {
-namespace behavioural          {
-  
-#undef  FUNCTION
-#define FUNCTION "Vhdl::get_library_ieee"
-  std::string Vhdl::get_library_ieee (uint32_t depth)
-  {
-    log_printf(FUNC,Behavioural,FUNCTION,"Begin");
-
-    std::string        tab = morpheo::tab(depth);
-    std::ostringstream text;
-
-    text << tab                                         << std::endl
-	 << tab << "library ieee;"                      << std::endl
-         << tab << "  use ieee.numeric_bit.all;       " << std::endl
-         << tab << "  use ieee.numeric_std.all;       " << std::endl
-	 << tab << "  use ieee.std_logic_1164.all;    " << std::endl
-         << tab << "  use ieee.std_logic_arith.all;   " << std::endl
-         << tab << "  use ieee.std_logic_misc.all;    " << std::endl
-         << tab << "--use ieee.std_logic_signed.all;  " << std::endl
-         << tab << "  use ieee.std_logic_unsigned.all;" << std::endl
-         << tab << "--use ieee.std_logic_textio.all;  " << std::endl;
-      
-    log_printf(FUNC,Behavioural,FUNCTION,"End");
-
-    return text.str();
-  };
-  
-}; // end namespace behavioural          
-}; // end namespace morpheo              
-
-#endif
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_get_library_work.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_get_library_work.cpp	(revision 112)
+++ 	(revision )
@@ -1,40 +1,0 @@
-#ifdef VHDL
-
-/*
- * $Id$
- *
- * [ Description ]
- * 
- */
-
-#include "Behavioural/include/Vhdl.h"
-#include "Common/include/Tabulation.h"
-#include <sstream>
-
-namespace morpheo              {
-namespace behavioural          {
-  
-#undef  FUNCTION
-#define FUNCTION "Vhdl::get_library_work"
-  std::string Vhdl::get_library_work (uint32_t depth)
-  {
-    log_printf(FUNC,Behavioural,FUNCTION,"Begin");
-
-    std::list<std::string>::iterator i   = _list_library_work.begin();
-    std::string                 tab = morpheo::tab(depth);
-    std::ostringstream          text;
-
-    if (i != _list_library_work.end())
-      text << tab                    << std::endl
-	   << tab << "library work;" << std::endl
-	   << get_list(_list_library_work,depth,";",true);
-
-    log_printf(FUNC,Behavioural,FUNCTION,"End");
-
-    return text.str();
-  };
-  
-}; // end namespace behavioural          
-}; // end namespace morpheo              
-
-#endif
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_get_list.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_get_list.cpp	(revision 112)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_get_list.cpp	(revision 113)
@@ -17,8 +17,8 @@
 #undef  FUNCTION
 #define FUNCTION "Vhdl::get_list"
-  std::string Vhdl::get_list (std::list<std::string> liste                ,
-			      uint32_t     depth                ,
-			      std::string       separator            ,
-			      bool         last_separator       )
+  std::string Vhdl::get_list (std::list<std::string> liste         ,
+			      uint32_t               depth         ,
+			      std::string            separator     ,
+			      bool                   last_separator)
   {
     log_printf(FUNC,Behavioural,FUNCTION,"Begin");
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_get_model.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_get_model.cpp	(revision 112)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_get_model.cpp	(revision 113)
@@ -15,8 +15,7 @@
 namespace behavioural          {
   
-  std::string Vhdl::get_model(uint32_t depth            ,
-			 std::string   filename         ,
-			 std::string   entity_name      ,
-			 std::string   architecture_name)
+  std::string Vhdl::get_model(uint32_t depth                 ,
+                              std::string   filename         ,
+                              std::string   entity_name      )
   {
     log_printf(FUNC,Behavioural,"get_model","Begin");
@@ -25,9 +24,12 @@
     std::ostringstream text;
 
-    text << tab << get_header       (depth,filename)                      << std::endl
-	 << tab << get_library_ieee (depth)                               << std::endl
-	 << tab << get_library_work (depth)                               << std::endl
-	 << tab << get_entity       (depth,entity_name)                   << std::endl
-	 << tab << get_architecture (depth,architecture_name,entity_name) << std::endl;
+    std::string configuration_name = "configuration_"+entity_name;
+
+    text << tab << get_header       (depth,filename)    << std::endl
+	 << tab << get_library      (depth)             << std::endl
+	 << tab << get_entity       (depth,entity_name) << std::endl
+	 << tab << get_architecture (depth,entity_name) << std::endl
+         << tab << get_configuration(depth,entity_name,configuration_name) << std::endl
+      ;
     
     log_printf(FUNC,Behavioural,"get_model","End");
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_get_package.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_get_package.cpp	(revision 112)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_get_package.cpp	(revision 113)
@@ -27,9 +27,9 @@
     std::ostringstream text;
 
-    text << tab << get_header       (depth,filename)                      << std::endl
-	 << tab << get_library_ieee (depth)                               << std::endl
-	 << tab << "package " << package_name << " is"                    << std::endl
-	 << tab << get_component    (depth+1,entity_name)                 << std::endl
-	 << tab << "end " << package_name << ";"                          << std::endl;
+    text << tab << get_header          (depth,filename)     << std::endl
+ 	 << tab << get_library_default (depth)              << std::endl
+	 << tab << "package " << package_name << " is"      << std::endl
+	 << tab << get_component    (depth+1,entity_name)   << std::endl
+	 << tab << "end " << package_name << ";"            << std::endl;
 
     log_printf(FUNC,Behavioural,FUNCTION,"End");
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_get_signal.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_get_signal.cpp	(revision 112)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_get_signal.cpp	(revision 113)
@@ -20,5 +20,9 @@
   {
     log_printf(FUNC,Behavioural,FUNCTION,"Begin");
-    std::string _return = get_list (_list_signal, depth, ";", true);
+
+    test_architecture();
+
+    std::string _return = get_list (_architecture[_name_architecture]._list_signal, depth, ";", true);
+
     log_printf(FUNC,Behavioural,FUNCTION,"End");
 
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_get_type.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_get_type.cpp	(revision 112)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_get_type.cpp	(revision 113)
@@ -20,5 +20,8 @@
   {
     log_printf(FUNC,Behavioural,FUNCTION,"Begin");
-    std::string _return = get_list (_list_type, depth, ";", true);
+
+    test_architecture();
+    std::string _return = get_list (_architecture[_name_architecture]._list_type, depth, ";", true);
+
     log_printf(FUNC,Behavioural,FUNCTION,"End");
 
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_set_alias.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_set_alias.cpp	(revision 112)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_set_alias.cpp	(revision 113)
@@ -23,5 +23,9 @@
   {
     log_printf(FUNC,Behavioural,FUNCTION,"Begin");
-    set_list(_list_alias, "alias "+ name1+"\t: "+type1+"\tis "+name2+"\t"+range2);
+    
+    test_architecture();
+    
+    set_list(_architecture[_name_architecture]._list_alias, "alias "+ name1+"\t: "+type1+"\tis "+name2+"\t"+range2);
+
     log_printf(FUNC,Behavioural,FUNCTION,"End");
   };
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_set_architecture.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_set_architecture.cpp	(revision 113)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_set_architecture.cpp	(revision 113)
@@ -0,0 +1,37 @@
+#ifdef VHDL
+
+/*
+ * $Id$
+ *
+ * [ Description ]
+ * 
+ */
+
+#include "Behavioural/include/Vhdl.h"
+
+namespace morpheo              {
+namespace behavioural          {
+  
+#undef  FUNCTION
+#define FUNCTION "Vhdl::set_architecture"
+  std::string Vhdl::set_architecture (std::string name)
+  {
+    log_printf(FUNC,Behavioural,FUNCTION,"Begin");
+
+    std::string _return = _name_architecture;
+//     vhdl_architecture_t arch;
+
+//     if (_architecture.find(name) == _architecture.end())
+//       _architecture[name] = arch;
+
+    _name_architecture = name;
+
+    log_printf(FUNC,Behavioural,FUNCTION,"End");
+
+    return _return;
+  };
+  
+}; // end namespace behavioural          
+}; // end namespace morpheo              
+
+#endif
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_set_body.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_set_body.cpp	(revision 112)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_set_body.cpp	(revision 113)
@@ -30,5 +30,8 @@
   {
     log_printf(FUNC,Behavioural,FUNCTION,"Begin");
-    set_list(_list_body, morpheo::tab(depth)+text);
+
+    test_architecture();
+
+    set_list(_architecture[_name_architecture]._list_body, morpheo::tab(depth)+text);
     log_printf(FUNC,Behavioural,FUNCTION,"End");
   };
@@ -40,11 +43,13 @@
   {
     log_printf(FUNC,Behavioural,FUNCTION,"Begin");
+
+    test_architecture();
     
     std::string tab=morpheo::tab(depth);
 
-    for (std::list<std::string>::iterator it=vhdl->_list_body.begin();
-         it!=vhdl->_list_body.end();
+    for (std::list<std::string>::iterator it=vhdl->_architecture[_name_architecture]._list_body.begin();
+         it!=vhdl->_architecture[_name_architecture]._list_body.end();
          ++it)
-      set_list(_list_body,tab+*it);
+      set_list(_architecture[_name_architecture]._list_body,tab+*it);
 
     log_printf(FUNC,Behavioural,FUNCTION,"End");
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_set_body_component.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_set_body_component.cpp	(revision 112)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_set_body_component.cpp	(revision 113)
@@ -17,13 +17,18 @@
 #undef  FUNCTION
 #define FUNCTION "Vhdl::set_body_component"
-  void Vhdl::set_body_component (std::string         name_instance      ,
-				 std::string         name_component     ,
-				 std::list<std::string>   list_port_map      )
+  void Vhdl::set_body_component (std::string            name_instance    ,
+				 std::string            name_component   ,
+                                 std::string            name_architecture,
+                                 std::string            name_package     ,
+				 std::list<std::string> list_port_map )
   {
     log_printf(FUNC,Behavioural,FUNCTION,"Begin");
 
-    set_body(name_instance + " : " + name_component);
+    name_architecture = test_architecture(name_architecture);
+
+    set_body(name_instance + " : entity " + name_package + "." + name_component + " (" + name_architecture + ")");
+//  set_body(name_instance + " : " + name_component);
     set_body("port map (");
-    set_list(_list_body, get_list(list_port_map, 1, ",", false));
+    set_list(_architecture[name_architecture]._list_body, get_list(list_port_map, 1, ",", false));
     set_body(");");
 
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_set_constant.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_set_constant.cpp	(revision 112)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_set_constant.cpp	(revision 113)
@@ -22,5 +22,9 @@
   {
     log_printf(FUNC,Behavioural,FUNCTION,"Begin");
-    set_list(_list_type, "constant "+ name+"\t: "+type+"\t:= "+init);
+
+    test_architecture();
+    
+    set_list(_architecture[_name_architecture]._list_type, "constant "+ name+"\t: "+type+"\t:= "+init);
+    
     log_printf(FUNC,Behavioural,FUNCTION,"End");
   };
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_set_debug.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_set_debug.cpp	(revision 113)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_set_debug.cpp	(revision 113)
@@ -0,0 +1,38 @@
+#ifdef VHDL
+
+/*
+ * $Id$
+ *
+ * [ Description ]
+ * 
+ */
+
+#include "Behavioural/include/Vhdl.h"
+#include "Common/include/Tabulation.h"
+#include <sstream>
+
+namespace morpheo              {
+namespace behavioural          {
+  
+#undef  FUNCTION
+#define FUNCTION "Vhdl::set_debug"
+  void Vhdl::set_debug (std::string     condition,
+                        std::string     text,
+                        vhdl_severity_t severity)
+  {
+    log_printf(FUNC,Behavioural,FUNCTION,"Begin");
+
+    std::string msg = "assert not ("+condition+") report \""+MSG_VHDL+" "+text+"\" severity "+toString(severity)+";";
+
+    test_architecture();
+
+    set_list(_architecture[_name_architecture]._list_debug, msg);
+
+    log_printf(FUNC,Behavioural,FUNCTION,"End");
+  };
+  
+  
+}; // end namespace behavioural          
+}; // end namespace morpheo              
+
+#endif
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_set_library.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_set_library.cpp	(revision 113)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_set_library.cpp	(revision 113)
@@ -0,0 +1,42 @@
+#ifdef VHDL
+
+/*
+ * $Id$
+ *
+ * [ Description ]
+ * 
+ */
+
+#include "Behavioural/include/Vhdl.h"
+
+#include <sstream>
+
+namespace morpheo              {
+namespace behavioural          {
+  
+#undef  FUNCTION
+#define FUNCTION "Vhdl::set_library"
+  void Vhdl::set_library (std::string library_name,
+                          std::string package_name,
+                          std::string declarative_unit)
+  {
+    log_begin(Behavioural,FUNCTION);
+
+    std::string library = "library "+library_name;
+
+    std::list<std::string>::iterator it = _list_library.begin();
+    while ((it != _list_library.end()) and
+           (*it != library))
+      ++it;
+    if (it == _list_library.end())
+      set_list(_list_library, library);
+
+    set_list(_list_library, "use "+library_name+"."+ package_name + "."+declarative_unit);
+
+    log_end(Behavioural,FUNCTION);
+  };
+  
+}; // end namespace behavioural          
+}; // end namespace morpheo              
+
+#endif
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_set_library_default.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_set_library_default.cpp	(revision 113)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_set_library_default.cpp	(revision 113)
@@ -0,0 +1,39 @@
+#ifdef VHDL
+
+/*
+ * $Id$
+ *
+ * [ Description ]
+ * 
+ */
+
+#include "Behavioural/include/Vhdl.h"
+#include "Common/include/Tabulation.h"
+
+#include <sstream>
+
+namespace morpheo              {
+namespace behavioural          {
+  
+#undef  FUNCTION
+#define FUNCTION "Vhdl::set_library_default"
+  void Vhdl::set_library_default (void)
+  {
+    log_begin(Behavioural,FUNCTION);
+    
+    set_library("ieee","numeric_bit"       ,"all");
+    set_library("ieee","numeric_std"       ,"all");
+    set_library("ieee","std_logic_1164"    ,"all");
+    set_library("ieee","std_logic_arith"   ,"all");
+    set_library("ieee","std_logic_misc"    ,"all");
+//  set_library("ieee","std_logic_signed"  ,"all");
+    set_library("ieee","std_logic_unsigned","all");
+//  set_library("ieee","std_logic_textio"  ,"all");
+      
+    log_end(Behavioural,FUNCTION);
+  };
+  
+}; // end namespace behavioural          
+}; // end namespace morpheo              
+
+#endif
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_set_library_work.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_set_library_work.cpp	(revision 112)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_set_library_work.cpp	(revision 113)
@@ -19,7 +19,9 @@
   void Vhdl::set_library_work (std::string      package_name)
   {
-    log_printf(FUNC,Behavioural,FUNCTION,"Begin");
-    set_list(_list_library_work, "use work."+ package_name + ".all");
-    log_printf(FUNC,Behavioural,FUNCTION,"End");
+    log_begin(Behavioural,FUNCTION);
+    
+    set_library("work",package_name,"all");
+
+    log_end(Behavioural,FUNCTION);
   };
   
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_set_port.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_set_port.cpp	(revision 112)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_set_port.cpp	(revision 113)
@@ -34,4 +34,15 @@
     log_printf(FUNC,Behavioural,FUNCTION,"End");
   };
+
+// #undef  FUNCTION
+// #define FUNCTION "Vhdl::set_port_clock"
+//   void Vhdl::set_port_clock (std::string name)
+//   {
+//     log_printf(FUNC,Behavioural,FUNCTION,"Begin");
+
+//     _port_clock = name;
+
+//     log_printf(FUNC,Behavioural,FUNCTION,"End");
+//   };
     
 }; // end namespace behavioural          
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_set_signal.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_set_signal.cpp	(revision 112)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_set_signal.cpp	(revision 113)
@@ -22,5 +22,9 @@
   {
     log_printf(FUNC,Behavioural,FUNCTION,"Begin");
-    set_list(_list_signal, "signal "+ name + "\t: " + type);
+
+    test_architecture();
+
+    set_list(_architecture[_name_architecture]._list_signal, "signal "+ name + "\t: " + type);
+    
     log_printf(FUNC,Behavioural,FUNCTION,"End");
   };
@@ -39,5 +43,9 @@
   {
     log_printf(FUNC,Behavioural,FUNCTION,"Begin");
-    _list_signal.push_back ("signal "+ name+"\t: "+type+"\t:= "+init);
+
+    test_architecture();
+    
+    _architecture[_name_architecture]._list_signal.push_back ("signal "+ name+"\t: "+type+"\t:= "+init);
+
     log_printf(FUNC,Behavioural,FUNCTION,"End");
   };
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_set_type.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_set_type.cpp	(revision 112)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_set_type.cpp	(revision 113)
@@ -21,5 +21,9 @@
   {
     log_printf(FUNC,Behavioural,FUNCTION,"Begin");
-    set_list(_list_type, "type "+ name + "\tis " + type);
+
+    test_architecture();
+
+    set_list(_architecture[_name_architecture]._list_type, "type "+ name + "\tis " + type);
+
     log_printf(FUNC,Behavioural,FUNCTION,"End");
   };
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_test_architecture.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_test_architecture.cpp	(revision 113)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_test_architecture.cpp	(revision 113)
@@ -0,0 +1,51 @@
+#ifdef VHDL
+
+/*
+ * $Id$
+ *
+ * [ Description ]
+ * 
+ */
+
+#include "Behavioural/include/Vhdl.h"
+
+namespace morpheo              {
+namespace behavioural          {
+
+// _architecture[_name_architecture].
+// test_architecture();
+  
+#undef  FUNCTION
+#define FUNCTION "Vhdl::test_architecture"
+  void Vhdl::test_architecture (void)
+  {
+    log_printf(FUNC,Behavioural,FUNCTION,"Begin");
+
+    if (_name_architecture == "")
+      _name_architecture = _name_architecture_default;
+
+    log_printf(FUNC,Behavioural,FUNCTION,"End");
+  };
+
+#undef  FUNCTION
+#define FUNCTION "Vhdl::test_architecture"
+  std::string Vhdl::test_architecture (std::string name)
+  {
+    log_printf(FUNC,Behavioural,FUNCTION,"Begin");
+
+    std::string _return;
+
+    if (name == "")
+      _return = _name_architecture_default;
+    else
+      _return = name;
+    
+    log_printf(FUNC,Behavioural,FUNCTION,"End");
+
+    return _return;
+  };
+  
+}; // end namespace behavioural          
+}; // end namespace morpheo              
+
+#endif
