#ifdef VHDL

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

#include "Behavioural/include/Vhdl.h"
#include <sstream>
#include <fstream>
using namespace std;

namespace morpheo              {
namespace behavioural          {

  void Vhdl::generate_file_model(void)
  {
    log_printf(FUNC,Behavioural,"generate_file_model","Begin");

    string filename = _name + ".vhdl";
    
    log_printf(TRACE,Behavioural,"generate_file_model","print %s",filename.c_str());
    cout << "Generate file \""<< filename << "\"" << endl;

    log_printf(TRACE,Behavioural,"generate_file_model","declaration");
    ofstream file;

    log_printf(TRACE,Behavioural,"generate_file_model","open file");
    file.open(filename.c_str(),ios::out | ios::trunc);

    log_printf(TRACE,Behavioural,"generate_file_model","get model");
    file << get_model (0,filename,_name,"behavioural");
    file.close();

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

#endif
