#ifdef VHDL

/*
 * $Id: Vhdl_set_body_component.cpp 113 2009-04-14 18:39:12Z rosiere $
 *
 * [ Description ]
 * 
 */

#include "Behavioural/include/Vhdl.h"

#include <sstream>

namespace morpheo              {
namespace behavioural          {
  
#undef  FUNCTION
#define FUNCTION "Vhdl::set_body_component"
  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");

    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(_architecture[name_architecture]._list_body, get_list(list_port_map, 1, ",", false));
    set_body(");");

    log_printf(FUNC,Behavioural,FUNCTION,"End");
  };
  
}; // end namespace behavioural          
}; // end namespace morpheo              

#endif
