#ifdef VHDL

/*
 * $Id$
 *
 * [ Description ]
 * 
 */

#include "Behavioural/include/Vhdl.h"

#include <sstream>

namespace morpheo              {
namespace behavioural          {
  
#undef  FUNCTION
#define FUNCTION "Vhdl::get_entity"
  std::string Vhdl::get_entity(uint32_t depth,
			       std::string   name)
  {
    log_printf(FUNC,Behavioural,FUNCTION,"Begin");

    std::string        tab = std::string(depth,'\t');
    std::ostringstream text;

    text <<                                      std::endl
	 << tab << "entity " << name << " is" << std::endl;
    
    if (_list_port.empty() == false)
      text << tab << "\tport ("                 << std::endl
	   << tab << get_port(depth+1)          << std::endl
	   << tab << "\t     );"                << std::endl;
    
    text << tab << "end " << name << ";"      << std::endl;
    
    log_printf(FUNC,Behavioural,FUNCTION,"End");
      
    return text.str();
  };
  
}; // end namespace behavioural          
}; // end namespace morpheo              

#endif
