hwt/synthesizer/rtlLevel/signalUtils/walkers.py
def discoverEventDependency(sig):
    """
    :return: generator of tuples (event operator, signal)
    """

    try:
        drivers = sig.drivers
    except AttributeError:
        return

    if len(drivers) == 1:
        d = drivers[0]
        if isinstance(d, Operator):
            if isEventDependentOp(d.operator):
                yield (d.operator, d.operands[0])
            else:
                for op in d.operands:
                    yield from discoverEventDependency(op)
def discoverEventDependency(sig):
    """
    :return: generator of tuples (event operator, signal)
    """

    try:
        drivers = sig.drivers
    except AttributeError:
        return

    if len(drivers) == 1:
        d = drivers[0]
        if isinstance(d, Operator):
            if isEventDependentOp(d.operator):
                yield (d.operator, d.operands[0])
            else:
                for op in d.operands:
                    yield from discoverEventDependency(op)
:return: generator of tuples (event operator, signal)