hwt/code.py
def connect(src, *destinations, exclude: set=None, fit=False):
    """
    Connect src (signals/interfaces/values) to all destinations

    :param exclude: interfaces on any level on src or destinations
        which should be excluded from connection process
    :param fit: auto fit source width to destination width
    """
    assignemnts = []

    if isinstance(src, HObjList):
        for dst in destinations:
            assert len(src) == len(dst), (src, dst)
        _destinations = [iter(d) for d in destinations]
        for _src in src:
            dsts = [next(d) for d in _destinations]
            assignemnts.append(connect(_src, *dsts, exclude=exclude, fit=fit))
    else:
        for dst in destinations:
            assignemnts.append(_connect(src, dst, exclude, fit))

    return assignemnts
def connect(src, *destinations, exclude: set=None, fit=False):
    """
    Connect src (signals/interfaces/values) to all destinations

    :param exclude: interfaces on any level on src or destinations
        which should be excluded from connection process
    :param fit: auto fit source width to destination width
    """
    assignemnts = []

    if isinstance(src, HObjList):
        for dst in destinations:
            assert len(src) == len(dst), (src, dst)
        _destinations = [iter(d) for d in destinations]
        for _src in src:
            dsts = [next(d) for d in _destinations]
            assignemnts.append(connect(_src, *dsts, exclude=exclude, fit=fit))
    else:
        for dst in destinations:
            assignemnts.append(_connect(src, dst, exclude, fit))

    return assignemnts
Connect src (signals/interfaces/values) to all destinations

    :param exclude: interfaces on any level on src or destinations
        which should be excluded from connection process
    :param fit: auto fit source width to destination width