#ifdef VHDL_TESTBENCH
/*
 * $Id$
 *
 * [ Description ]
 * 
 */

#include "Behavioural/include/Interface.h"


namespace morpheo              {
namespace behavioural          {

#undef  FUNCTION
#define FUNCTION "Interface::get_reset"
  Signal * Interface::get_reset (void)
  {
    log_printf(FUNC,Behavioural,FUNCTION,"Begin");

    Signal * reset = NULL;
    
    if (not _list_signal->empty())
      {
	std::list<Signal*>::iterator i = _list_signal->begin();
	
	while (i != _list_signal->end())
	  {
	    Signal * sig = (*i)->get_reset ();

	    if (sig != NULL)
	      {
		if (reset != NULL)
		  throw ErrorMorpheo ("<Interface.get_reset> : find too many reset.");
		reset = sig;
	      }
	    ++i;
	  }
      }

    log_printf(FUNC,Behavioural,FUNCTION,"End");

    return reset;
  };

}; // end namespace behavioural          
}; // end namespace morpheo              
#endif
