def write(self, value: int, from_hw: bool) -> int:
    'Stage the effects of writing a value (see RGReg.write)'
    assert (value >= 0)
    masked = (value & ((1 << self.width) - 1))
    if (self.read_only and (not from_hw)):
        pass
    elif (self.w1c and (not from_hw)):
        self.next_value &= (~ masked)
    else:
        self.next_value = masked
    return self._next_sw_read()
Stage the effects of writing a value (see RGReg.write)
def write(self, value: int, from_hw: bool) -> int:
    
    assert (value >= 0)
    masked = (value & ((1 << self.width) - 1))
    if (self.read_only and (not from_hw)):
        pass
    elif (self.w1c and (not from_hw)):
        self.next_value &= (~ masked)
    else:
        self.next_value = masked
    return self._next_sw_read()