From 774991a32a404389de594ad1df0bcbc7e2d5aca7 Mon Sep 17 00:00:00 2001 From: Luke Kenneth Casson Leighton Date: Sun, 9 May 2021 15:57:09 +0100 Subject: [PATCH] add ld/st misalignment test case --- src/openpower/test/ldst/ldst_exc_cases.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 src/openpower/test/ldst/ldst_exc_cases.py diff --git a/src/openpower/test/ldst/ldst_exc_cases.py b/src/openpower/test/ldst/ldst_exc_cases.py new file mode 100644 index 00000000..5cd2086e --- /dev/null +++ b/src/openpower/test/ldst/ldst_exc_cases.py @@ -0,0 +1,19 @@ +from openpower.simulator.program import Program +from openpower.endian import bigendian +from openpower.test.common import TestAccumulatorBase + + +class LDSTExceptionTestCase(TestAccumulatorBase): + + def case_1_load_misalign(self): + lst = ["ldx 3, 1, 0"] + initial_regs = [0] * 32 + initial_regs[1] = 0xFFFFFFFFFFFFFFFF # deliberately misaligned + initial_regs[2] = 0x0008 + initial_mem = {0x0000: (0x5432123412345678, 8), + 0x0008: (0xabcdef0187654321, 8), + 0x0020: (0x1828384822324252, 8), + } + self.add_case(Program(lst, bigendian), initial_regs, + initial_mem=initial_mem) + -- 2.30.2