return SelectableInt(~self.value, self.bits)
def __neg__(self):
- return SelectableInt(~self.value + 1, self.bits)
+ res = SelectableInt((~self.value) + 1, self.bits)
+ print ("neg", hex(self.value), hex(res.value))
+ return res
def __lshift__(self, b):
b = check_extsign(self, b)
"""
- def __init__(self, pspec, pilist=None, div_fsm=False):
+ def __init__(self, pspec, pilist=None, div_fsm=True):
addrwid = pspec.addr_wid
units = pspec.units
if not isinstance(units, dict):
class DivTestCases(TestAccumulatorBase):
def case_divw_regression(self):
- # simulator is wrong, FSM and power-instruction-analyzer are both correct
+ # simulator is wrong, FSM and power-instruction-analyzer both correct
lst = [f"divw 0, 1, 2"]
initial_regs = [0] * 32
initial_regs[2] = 0x2