def read(self, reg_name: str, from_hw: bool) -> int:
    reg = self.regs.get(reg_name)
    if (reg is None):
        raise ValueError('Unknown register name: {!r}.'.format(reg_name))
    return reg.read(from_hw)
def read(self, reg_name: str, from_hw: bool) -> int:
    reg = self.regs.get(reg_name)
    if (reg is None):
        raise ValueError('Unknown register name: {!r}.'.format(reg_name))
    return reg.read(from_hw)