from openpower.decoder.power_enums import find_wiki_dir
from openpower.sv import sv_binutils_fptrans
import unittest
+import itertools
import sys
class SVSTATETestCase(unittest.TestCase):
def test_16_bc(self):
# hilarious. this should be autogenerated from a sequence
# of lists of options. it's a lot of frickin options.
+ lists = [[None, 'all'],
+ [None, 'm=r3/sz', 'm=r3/snz'],
+ #[None, 'vs', 'vsi', 'vsb', 'vsbi'],
+ [None, 'ctr', 'cti'],
+ #[None, 'sl'],
+ #[None, 'slu'],
+ #[None, 'lru'],
+ ]
+ expected = []
+ for options in itertools.product(*lists):
+ options = list(filter(lambda x:x, options))
+ options.sort() # otherwise chaos!
+ if len(options) != 0:
+ options = [''] + options # trick to make a "/" at the front
+ print ("option", options)
+ option = "sv.bc%s 12,*1,0xc" % "/".join(options)
+ expected.append(option)
+ #_old_handcrafted_expected = [
expected = [
"sv.bc/all 12,*1,0xc",
"sv.bc/snz 12,*1,0xc",
+ "sv.bc/m=r3/snz 12,*1,0xc",
+ "sv.bc/m=r3/sz 12,*1,0xc",
"sv.bc/all/sl/slu 12,*1,0xc",
"sv.bc/all/snz/sl/slu/lru 12,*1,0xc",
"sv.bc/vs/all/snz/sl/slu/lru 12,*1,0xc",