#ifdef VHDL

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

#include "Behavioural/include/Vhdl.h"

#include <sstream>
using namespace std;

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

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

    text <<                                      endl
	 << tab << "entity " << name << " is" << endl;

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

#endif
