/*
 * mysub.c
 * Submodule template file
 * [eichin:19880511.2039EST]
 */

#include <msimdecl.h>
#define FUNCTION or_func
#define OR(C,A,B) make_binop(or_func, C, A, B)
#define DONE
/*
 * or.c
 * z = and(a, b...): if (a==LOW) then or(b...) else HI
 */ 
#define OR_DELAY 10

or_func(dep)
     Generics dep;
{
  STATE result = LOGIC_LOW;
  Wire outwire;
  
  SAVEOUTWIRE(dep, outwire);
  
  while(MOREARGS(dep))
    {
      STATE nextinput;
      READNEXTSTATE(dep, nextinput);

      switch(nextinput)
	{
	case LOGIC_HI:
	  break;
	case LOGIC_LOW:
	  continue;		/* and skip the later break */
	  break;
	}
      result = LOGIC_HI;
      break;			/* not enough HI's... */
    }
  
  SETOUTPUT(outwire, result, globaltime+OR_DELAY);
}
