autodetect ISA and default uarch for ISA

This commit is contained in:
JanLJL
2020-10-29 13:00:02 +01:00
parent a7918db145
commit 022598d94f
4 changed files with 61 additions and 6 deletions

View File

@@ -18,6 +18,12 @@ class TestBaseParser(unittest.TestCase):
pass
with open(self._find_file('triad_x86_iaca.s')) as f:
self.triad_code = f.read()
with open(self._find_file('triad_arm_iaca.s')) as f:
self.triad_code_arm = f.read()
with open(self._find_file('kernel_x86.s')) as f:
self.x86_code = f.read()
with open(self._find_file('kernel_aarch64.s')) as f:
self.aarch64_code = f.read()
##################
# Test
@@ -59,6 +65,12 @@ class TestBaseParser(unittest.TestCase):
with self.assertRaises(NotImplementedError):
self.parser.normalize_imd(imd_hex_1)
def test_detect_ISA(self):
self.assertEqual(BaseParser.detect_ISA(self.triad_code), 'x86')
self.assertEqual(BaseParser.detect_ISA(self.triad_code_arm), 'aarch64')
self.assertEqual(BaseParser.detect_ISA(self.x86_code), 'x86')
self.assertEqual(BaseParser.detect_ISA(self.aarch64_code), 'aarch64')
##################
# Helper functions
##################