<s> from __future__ import absolute_import <EOL> from __future__ import print_function <EOL> import re <EOL> def isType ( termtype , matchtype ) : <EOL> for t in termtype : <EOL> if t == matchtype : return True <EOL> return False <EOL> def isInput ( termtype ) : <EOL> return isType ( termtype , '<STR_LIT>' ) <EOL> def isOutput ( termtype ) : <EOL> return isType ( termtype , '<STR_LIT>' ) <EOL> def isInout ( termtype ) : <EOL> return isType ( termtype , '<STR_LIT>' ) <EOL> def isWire ( termtype ) : <EOL> return isType ( termtype , '<STR_LIT>' ) <EOL> def isReg ( termtype ) : <EOL> return isType ( termtype , '<STR_LIT>' ) <EOL> def isWireArray ( termtype ) : <EOL> return isType ( termtype , '<STR_LIT>' ) <EOL> def isRegArray ( termtype ) : <EOL> return isType ( termtype , '<STR_LIT>' ) <EOL> def isInteger ( termtype ) : <EOL> return isType ( termtype , '<STR_LIT>' ) <EOL> def isGenvar ( termtype ) : <EOL> return isType ( termtype , '<STR_LIT>' ) <EOL> def isParameter ( termtype ) : <EOL> return isType ( termtype , '<STR_LIT>' ) <EOL> def isLocalparam ( termtype ) : <EOL> return isType ( termtype , '<STR_LIT>' ) <EOL> def isFunction ( termtype ) : <EOL> return isType ( termtype , '<STR_LIT>' ) <EOL> def isRename ( termtype ) : <EOL> return isType ( termtype , '<STR_LIT>' ) <EOL> def isArray ( termtype ) : <EOL> if isWireArray ( termtype ) : return True <EOL> if isRegArray ( termtype ) : return True <EOL> return False <EOL> regex_clock = [ '<STR_LIT>' , '<STR_LIT>' , ] <EOL> regex_reset = [ '<STR_LIT>' , '<STR_LIT>' , ] <EOL> def isClock ( search_str ) : <EOL> lower_str = search_str . lower ( ) <EOL> for rc in regex_clock : <EOL> if re . search ( rc , lower_str ) : <EOL> return True <EOL> return False <EOL> def isReset ( search_str ) : <EOL> lower_str = search_str . lower ( ) <EOL> for rr in regex_reset : <EOL> if re . search ( rr , lower_str ) : <EOL> return True <EOL> return False <EOL> compare_ops = ( '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ) <EOL> not_ops = ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> split_and_ops = ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> split_or_ops = ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> non_condition_ops = compare_ops + not_ops + split_and_ops + split_or_ops <EOL> def isCompare ( op ) : <EOL> if op in compare_ops : return True <EOL> return False <EOL> def isNot ( op ) : <EOL> if op in not_ops : return True <EOL> return False <EOL> def isAnd ( op ) : <EOL> if op in split_and_ops : return True <EOL> return False <EOL> def isOr ( op ) : <EOL> if op in split_or_ops : return True <EOL> return False <EOL> def isNonConditionOp ( op ) : <EOL> if op in non_condition_ops : return False <EOL> return True </s>
