import power_instruction_analyzer as pia
+
def log_rand(n, min_val=1):
logrange = random.randint(1, n)
return random.randint(min_val, (1 << logrange)-1)
class DivRunner(unittest.TestCase):
def __init__(self, test_data, div_pipe_kind=None):
- print ("DivRunner", test_data, div_pipe_kind)
+ print("DivRunner", test_data, div_pipe_kind)
super().__init__("run_all")
self.test_data = test_data
self.div_pipe_kind = div_pipe_kind
print("so, ov", so_ok, ov_ok)
self.assertEqual(ov_ok, False, code)
self.assertEqual(so_ok, False, code)
-
suite.addTest(DivRunner(DivTestLong().test_data, DivPipeKind.FSMDivCore))
suite.addTest(DivRunner(DivTestLong().test_data, DivPipeKind.SimOnly))
-
runner = unittest.TextTestRunner()
runner.run(suite)
-
with Program(lst, bigendian) as prog:
self.add_case(prog, initial_regs)
- def case_8_fsm_regression(self): # FSM result is "36" not 6
+ def case_8_fsm_regression(self): # FSM result is "36" not 6
lst = ["divwu. 3, 1, 2"]
initial_regs = [0] * 32
initial_regs[1] = 18
with Program(lst, bigendian) as prog:
self.add_case(prog, initial_regs)
- def case_9_regression(self): # CR0 fails: expected 0b10, actual 0b11
+ def case_9_regression(self): # CR0 fails: expected 0b10, actual 0b11
lst = ["divw. 3, 1, 2"]
initial_regs = [0] * 32
initial_regs[1] = 1
runner = unittest.TextTestRunner()
runner.run(suite)
-