hwt/simulator/simModel.py
def mkArrayUpdater(nextItemVal: Value, indexes: Tuple[Value],
                   invalidate: bool):
    """
    Create value updater for simulation for value of array type

    :param nextVal: instance of Value which will be asssiggned to signal
    :param indexes: tuple on indexes where value should be updated
        in target array

    :return: function(value) -> tuple(valueHasChangedFlag, nextVal)
    """
    def updater(currentVal):
        if len(indexes) > 1:
            raise NotImplementedError("[TODO] implement for more indexes")

        _nextItemVal = nextItemVal.clone()
        if invalidate:
            _nextItemVal.vldMask = 0

        index = indexes[0]
        change = valueHasChanged(currentVal._getitem__val(index), _nextItemVal)
        currentVal._setitem__val(index, _nextItemVal)
        return (change, currentVal)

    return updater
def mkArrayUpdater(nextItemVal: Value, indexes: Tuple[Value],
                   invalidate: bool):
    def updater(currentVal):
        if len(indexes) > 1:
            raise NotImplementedError("[TODO] implement for more indexes")

        _nextItemVal = nextItemVal.clone()
        if invalidate:
            _nextItemVal.vldMask = 0

        index = indexes[0]
        change = valueHasChanged(currentVal._getitem__val(index), _nextItemVal)
        currentVal._setitem__val(index, _nextItemVal)
        return (change, currentVal)

    return updater
def mkArrayUpdater ( nextItemVal : Value , indexes : Tuple [ Value ] , invalidate : bool ) : def updater ( currentVal ) : if len ( indexes ) > 1 : raise NotImplementedError ( "[TODO] implement for more indexes" ) _nextItemVal = nextItemVal . clone ( ) if invalidate : _nextItemVal . vldMask = 0 index = indexes [ 0 ] change = valueHasChanged ( currentVal . _getitem__val ( index ) , _nextItemVal ) currentVal . _setitem__val ( index , _nextItemVal ) return ( change , currentVal ) return updater
Create value updater for simulation for value of array type

    :param nextVal: instance of Value which will be asssiggned to signal
    :param indexes: tuple on indexes where value should be updated
        in target array

    :return: function(value) -> tuple(valueHasChangedFlag, nextVal)
Create value updater for simulation for value of array type