def __setitem__(this, key, val):
    """
        note: by default this only caches updates locally
        """
    this.log.debug('MemWr: ' + str(key) + ':' + str(val))
    addr = key[0]
    size = key[1]
    assert isinstance(addr, int)
    assert isinstance(val, int)
    if this.writeback:
        this.mbus.write_mem(addr, val, size)
    else:
        this.local[key] = val
