from soc.decoder.orderedset import OrderedSet
from soc.decoder.selectable_int import (FieldSelectableInt, SelectableInt,
selectconcat)
-from soc.decoder.power_enums import spr_dict
+from soc.decoder.power_enums import spr_dict, XER_bits
from soc.decoder.helpers import exts
from collections import namedtuple
import math
'LR': 8,
'CTR': 9,
'TAR': 815,
- 'XER': 0,
+ 'XER': 1,
'VRSAVE': 256}
'undefined': self.undefined,
'mode_is_64bit': True,
}
+ self.namespace.update(XER_bits)
# field-selectable versions of Condition Register TODO check bitranges?
self.crl = []
else:
sig = getattr(fields, name)
val = yield sig
- self.namespace[name] = SelectableInt(val, sig.width)
+ if name == 'BF':
+ self.namespace[name] = val
+ else:
+ self.namespace[name] = SelectableInt(val, sig.width)
+
+ self.namespace['XER'] = self.spr['XER']
def handle_carry(self, inputs, outputs):
inv_a = yield self.dec2.invert_a
# Verified with QEMU
self.assertEqual(sim.gpr(3), SelectableInt(0x80000000, 64))
- @unittest.skip("broken (XER)")
def test_cmp(self):
lst = ["addis 1, 0, 0xffff",
"addis 2, 0, 0xffff",
spr_dict[int(row['Idx'])] = info
fields = [(row['SPR'], int(row['Idx'])) for row in spr_csv]
SPR = Enum('SPR', fields)
+
+
+XER_bits = {
+ 'SO': 32,
+ 'OV': 33,
+ 'CA': 34,
+ 'OV32': 44,
+ 'CA32': 45
+ }