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

#include "Behavioural/include/Signal.h"


namespace morpheo              {
namespace behavioural          {

#undef  FUNCTION
#define FUNCTION "Signal::get_reset_cycle"
  uint32_t Signal::get_reset_cycle (bool active_low)
  {
    log_printf(FUNC,Behavioural,FUNCTION,"Begin");
 
    uint32_t num = 0;
    uint32_t cpt = 0;
    string   cmp = (active_low==true)?"0":"1";

    if ((_presence_port == RESET_VHDL_YES) or
	(_presence_port == RESET_VHDL_NO ))
      {
	if (_list_value->empty()== false)
	  {
	    list<string>::iterator i = _list_value->begin();
	    
	    while (i != _list_value->end())
	      {
		if ((*i) == cmp)
		  num = cpt;
		cpt ++;
		++i;
	      }
	  }
      }

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

    return num;
  };

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