forgot to add offset on GPR() get
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Sat, 8 Oct 2022 23:32:05 +0000 (00:32 +0100)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Sat, 8 Oct 2022 23:32:05 +0000 (00:32 +0100)
src/openpower/decoder/isa/caller.py

index 3822de35de643a2b921de0d1bce9a301bf71e386..35858b9d657db1eee799c45116423382afa063af 100644 (file)
@@ -126,7 +126,7 @@ class GPR(dict):
         if isinstance(ridx, SelectableInt):
             ridx = ridx.value
         if elwidth == 64:
-            return self[ridx]
+            return self[ridx+offs]
         # rrrright.  start by breaking down into row/col, based on elwidth
         gpr_offs = offs // (64//elwidth)
         gpr_col = offs % (64//elwidth)
@@ -168,8 +168,9 @@ class GPR(dict):
         val |= value << (gpr_col*elwidth)
         # finally put the damn value into the regfile
         log("GPR write", base, "isvec", is_vec, "offs", offs,
-             "elwid", elwidth, "offs/col", gpr_offs, gpr_col, "val", hex(val))
-        self[base+gpr_offs].value = val
+             "elwid", elwidth, "offs/col", gpr_offs, gpr_col, "val", hex(val),
+             "@", base+gpr_offs)
+        dict.__setitem__(self, base+gpr_offs, SelectableInt(val, 64))
 
     def __setitem__(self, rnum, value):
         # rnum = rnum.value # only SelectableInt allowed