LogicalOutputData does not need XER.so
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Wed, 27 May 2020 16:12:03 +0000 (17:12 +0100)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Wed, 27 May 2020 16:12:03 +0000 (17:12 +0100)
src/soc/fu/alu/output_stage.py
src/soc/fu/logical/pipe_data.py

index e228e8719019a85c80f49cd1fdada045cd9d9a0f..1ee3a4a01e18cd70c8fe57d7517f57cbfbb3dbfe 100644 (file)
@@ -32,7 +32,10 @@ class ALUOutputStage(CommonOutputStage):
 
         # copy overflow and sticky-overflow
         comb += self.o.xer_so.data.eq(self.so)
-        comb += self.o.xer_so.ok.eq(op.oe.oe & op.oe.oe_ok) # SO is to be set
+        # SO is to be set - however to save regfile port requests, only set
+        # if the data actually changes. only possible due to pass-thru
+        with m.If(self.i.xer_so.data != self.so):
+            comb += self.o.xer_so.ok.eq(op.oe.oe & op.oe.oe_ok)
         comb += self.o.xer_ov.data.eq(ov)
         comb += self.o.xer_ov.ok.eq(op.oe.oe & op.oe.oe_ok) # OV/32 is to be set
 
index 35d637ae197789e3811fec8b9299b0b4b991cd8b..ccb6d95e7c4e660e08d68113bf16a9ddd03509d9 100644 (file)
@@ -30,27 +30,25 @@ class LogicalOutputData(IntegerData):
     regspec = [('INT', 'o', '0:63'),
                ('CR', 'cr0', '0:3'),
                ('XER', 'xer_ca', '34,45'),
-               ('XER', 'xer_so', '32')]
+               ]
     def __init__(self, pspec):
         super().__init__(pspec)
         self.o = Data(64, name="stage_o")  # RT
         self.cr0 = Data(4, name="cr0")
         self.xer_ca = Data(2, name="xer_co") # bit0: ca, bit1: ca32
-        self.xer_so = Data(1, name="xer_so")
 
     def __iter__(self):
         yield from super().__iter__()
         yield self.o
         yield self.xer_ca
         yield self.cr0
-        yield self.xer_so
 
     def eq(self, i):
         lst = super().eq(i)
         return lst + [self.o.eq(i.o),
                       self.xer_ca.eq(i.xer_ca),
                       self.cr0.eq(i.cr0),
-                      self.xer_so.eq(i.xer_so)]
+                      ]
 
 
 class LogicalPipeSpec(CommonPipeSpec):