test_caller_bcd: make bit changes more VHDL-like
authorDmitry Selyutin <dmitry.selyutin@3mdeb.com>
Thu, 19 Aug 2021 17:50:17 +0000 (17:50 +0000)
committerDmitry Selyutin <dmitry.selyutin@3mdeb.com>
Thu, 19 Aug 2021 17:50:17 +0000 (17:50 +0000)
src/openpower/decoder/isa/test_caller_bcd.py

index 6ce0a06596aa7d1367541c2660ff67c3cdd36bcd..50141cbee9993b7969063baff0449f7fb266d748 100644 (file)
@@ -330,15 +330,9 @@ class BCDTestCase(FHDLTestCase):
                 lo = i * 4
                 hi = (i + 1) * 4
                 if (a_in[hi] ^ b_in[hi] ^ (sum_with_carry[hi] == 0)):
-                    addg6s[lo + 3] = 0
-                    addg6s[lo + 2] = 1
-                    addg6s[lo + 1] = 1
-                    addg6s[lo + 0] = 0
+                    addg6s[lo:lo + 3 + 1] = [0, 1, 1, 0]
             if sum_with_carry[64] == 0:
-                addg6s[63] = 0
-                addg6s[62] = 1
-                addg6s[61] = 1
-                addg6s[60] = 0
+                addg6s[60:63] = [0, 1, 1, 0]
             return int("".join(map(str, reversed(addg6s))), 2)
 
         bcd = [f"{digit:04b}" for digit in range(10)]