optionally writing out CA/CA32 to XER
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Sun, 7 Jun 2020 13:04:09 +0000 (14:04 +0100)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Sun, 7 Jun 2020 13:04:09 +0000 (14:04 +0100)
src/soc/decoder/isa/caller.py

index bb24035ee2f425b9263763e52efff48fec38a766..63b2cf0abe477a230f10b9943a412793db4bfcdb 100644 (file)
@@ -372,8 +372,11 @@ class ISACaller:
                 if isinstance(output, int):
                     output = SelectableInt(output, 256)
                 if name in ['CA', 'CA32']:
-                    print ("writing %s to XER" % name, output)
-                    self.spr['XER'][XER_bits[name]].eq(output)
+                    if carry_en:
+                        print ("writing %s to XER" % name, output)
+                        self.spr['XER'][XER_bits[name]].eq(output)
+                    else:
+                        print ("NOT writing %s to XER" % name, output)
                 elif name in info.special_regs:
                     print('writing special %s' % name, output, special_sprs)
                     if name in special_sprs: