From: Luke Kenneth Casson Leighton Date: Fri, 24 Jun 2022 14:51:30 +0000 (+0100) Subject: add first bmask unit test X-Git-Tag: sv_maxu_works-initial~345 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=c642f6cbdba0c5eeb2e327735f3f58f145c6363a;p=openpower-isa.git add first bmask unit test --- diff --git a/src/openpower/test/bitmanip/av_cases.py b/src/openpower/test/bitmanip/av_cases.py index 926a7527..b02bd5b2 100644 --- a/src/openpower/test/bitmanip/av_cases.py +++ b/src/openpower/test/bitmanip/av_cases.py @@ -449,3 +449,28 @@ class AVTestCase(TestAccumulatorBase): e.intregs[3] = reg_t self.add_case(Program(lst, bigendian), initial_regs, expected=e) + def case_0_bmask(self): + """ + https://git.libre-soc.org/?p=libreriscv.git;a=blob;f=openpower/sv/bmask.py + https://git.libre-soc.org/?p=libreriscv.git;a=blob;f=openpower/sv/test_bmask.py + https://git.libre-soc.org/?p=openpower-isa.git;a=blob;f=openpower/isa/av.mdwn;hb=HEAD + SBF = 0b01010 # set before first + SOF = 0b01001 # set only first + SIF = 0b10000 # set including first 10011 also works no idea why yet + """ + lst = ["bmask 3, 1, 2, 10, 0" ] + lst = list(SVP64Asm(lst, bigendian)) + last_pc = len(lst)*4 + reg_a = 0b10010100 + reg_b = 0b11000011 + reg_t = 0b01000011 + + initial_regs = [0] * 32 + initial_regs[1] = reg_a + initial_regs[2] = reg_b + e = ExpectedState(pc=last_pc) + e.intregs[1] = reg_a + e.intregs[2] = reg_b + e.intregs[3] = reg_t + self.add_case(Program(lst, bigendian), initial_regs, expected=e) +