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

#include "Behavioural/include/Interface.h"


namespace morpheo              {
namespace behavioural          {

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

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

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

    log_printf(FUNC,Behavioural,FUNCTION,"End");
    return clock;
  };

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