#ifdef VHDL_TESTBENCH

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

#include "Behavioural/include/Vhdl_Testbench.h"

#include <sstream>
using namespace std;

namespace morpheo              {
namespace behavioural          {
  
  uint32_t Vhdl_Testbench::get_output (void)
  {
    list<string>::iterator i   = _list_output.begin();
    
    uint32_t counter = 0;

    if (i != _list_output.end())
      {
	_vhdl->set_body ("");
	_vhdl->set_body ("with testbench_counter select");
	_vhdl->set_body ("\ttestbench_test <=");

	while (i != _list_output.end())
	  {
	    list<string>::iterator j = i;
	    ++i;

	    if (i != _list_output.end())
	      _vhdl->set_body ("\t\""+*j+"\" when "+toString(counter++)+",");
	    else
	      _vhdl->set_body ("\t\""+*j+"\" when others;");
	  }
      }

    return counter;
  };
  
}; // end namespace behavioural          
}; // end namespace morpheo              

#endif
