class ISACallerHelper:
- def __init__(self, XLEN):
+ def __init__(self, XLEN, FPSCR):
self.__XLEN = XLEN
+ if FPSCR is None:
+ FPSCR = FPSCRState()
+ self.__FPSCR = FPSCR
@property
def XLEN(self):
@property
def FPSCR(self):
- # fallback for when not used through ISACaller
- # needed for tests that use DOUBLE2SINGLE without using ISACaller
- self.__dict__["FPSCR"] = retval = FPSCRState()
- return retval
+ return self.__FPSCR
def EXTZXL(self, value, bits=None):
if bits is None:
class HelperTests(unittest.TestCase, ISACallerHelper):
def __init__(self, *args, **kwargs):
- ISACallerHelper.__init__(self, 64) # TODO: dynamic (64/32/16/8)
+ # TODO: dynamic (64/32/16/8)
+ ISACallerHelper.__init__(self, 64, FPSCR=None)
unittest.TestCase.__init__(self, *args, **kwargs)
def test_MASK(self):
# really bad hack. need to access the DOUBLE2SINGLE function auto-generated
# from pseudo-code.
-fph = ISACallerFnHelper(XLEN=64)
+fph = ISACallerFnHelper(XLEN=64, FPSCR=None)
def transform_inner_radix2_dct(vec, ctable):
# really bad hack. need to access the DOUBLE2SINGLE function auto-generated
# from pseudo-code.
-fph = ISACallerFnHelper(XLEN=64)
+fph = ISACallerFnHelper(XLEN=64, FPSCR=None)
def transform_radix2(vec, exptable, reverse=False):
# really bad hack. need to access the DOUBLE2SINGLE function auto-generated
# from pseudo-code.
-fph = ISACallerFnHelper(XLEN=64)
+fph = ISACallerFnHelper(XLEN=64, FPSCR=None)
class FPTranscendentalsTestCase(FHDLTestCase):