def write(self, reg_name: str, value: int, from_hw: bool) -> None:
    'Stage the effects of writing a value to a register'
    assert (value >= 0)
    self._get_reg(reg_name).write(value, from_hw)
    self._dirty = 2
Stage the effects of writing a value to a register
def write(self, reg_name: str, value: int, from_hw: bool) -> None:
    
    assert (value >= 0)
    self._get_reg(reg_name).write(value, from_hw)
    self._dirty = 2