From: colepoirier Date: Sun, 7 Jun 2020 01:50:42 +0000 (-0700) Subject: Add back test cases to cookie-cut from for fu/trap/test/test_pipe_caller X-Git-Tag: div_pipeline~491 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=90640c79452d2f9e8aa531d903009a5b6823b4e0;p=soc.git Add back test cases to cookie-cut from for fu/trap/test/test_pipe_caller --- diff --git a/src/soc/fu/trap/test/test_pipe_caller.py b/src/soc/fu/trap/test/test_pipe_caller.py index a6c5aecc..82dc4573 100644 --- a/src/soc/fu/trap/test/test_pipe_caller.py +++ b/src/soc/fu/trap/test/test_pipe_caller.py @@ -44,6 +44,45 @@ class TrapTestCase(FHDLTestCase): super().__init__(name) self.test_name = name +# def run_tst_program(self, prog, initial_regs=None, initial_sprs=None, +# initial_cr=0): +# tc = TestCase(prog, self.test_name, +# regs=initial_regs, sprs=initial_sprs, cr=initial_cr) +# self.test_data.append(tc) +# +# def test_crop(self): +# insns = ["crand", "cror", "crnand", "crnor", "crxor", "creqv", +# "crandc", "crorc"] +# for i in range(40): +# choice = random.choice(insns) +# ba = random.randint(0, 31) +# bb = random.randint(0, 31) +# bt = random.randint(0, 31) +# lst = [f"{choice} {ba}, {bb}, {bt}"] +# cr = random.randint(0, (1<<32)-1) +# self.run_tst_program(Program(lst), initial_cr=cr) +# +# def test_crand(self): +# for i in range(20): +# lst = ["crand 0, 11, 13"] +# cr = random.randint(0, (1<<32)-1) +# self.run_tst_program(Program(lst), initial_cr=cr) +# +# def test_mcrf(self): +# lst = ["mcrf 5, 1"] +# cr = 0xfeff0000 +# self.run_tst_program(Program(lst), initial_cr=cr) +# +# def test_mtcrf(self): +# for i in range(20): +# mask = random.randint(0, 255) +# lst = [f"mtcrf {mask}, 2"] +# cr = random.randint(0, (1<<32)-1) +# initial_regs = [0] * 32 +# initial_regs[2] = random.randint(0, (1<<32)-1) +# self.run_tst_program(Program(lst), initial_regs=initial_regs, +# initial_cr=cr) + # def get_cu_inputs(dec2, sim): # """naming (res) must conform to CRFunctionUnit input regspec