From afc1f15882857f9dac2da0b85cdd6553709f219d Mon Sep 17 00:00:00 2001 From: Luke Kenneth Casson Leighton Date: Wed, 17 Nov 2021 16:15:01 +0000 Subject: [PATCH] code-comments --- src/openpower/test/general/overlap_hazards.py | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 src/openpower/test/general/overlap_hazards.py diff --git a/src/openpower/test/general/overlap_hazards.py b/src/openpower/test/general/overlap_hazards.py new file mode 100644 index 00000000..fa186e0f --- /dev/null +++ b/src/openpower/test/general/overlap_hazards.py @@ -0,0 +1,27 @@ +import random +from openpower.test.common import TestAccumulatorBase +from openpower.endian import bigendian +from openpower.simulator.program import Program +from openpower.decoder.selectable_int import SelectableInt +from openpower.decoder.power_enums import XER_bits +from openpower.decoder.isa.caller import special_sprs +from openpower.test.state import ExpectedState +import unittest + + +class HazardTestCase(TestAccumulatorBase): + + def case_div_add_overlap(self): + lst = ["divd 3, 1, 2", + "add 5, 3, 4"] + initial_regs = [0] * 32 + initial_regs[1] = 6 + initial_regs[2] = 2 + initial_regs[4] = 4 + e = ExpectedState(pc=8) + e.intregs[1] = 6 + e.intregs[2] = 2 + e.intregs[3] = 3 # 6 divided by 2 == 3 + e.intregs[4] = 4 + e.intregs[5] = 7 # 3 plus 4 == 7 + self.add_case(Program(lst, bigendian), initial_regs, expected=e) -- 2.30.2