add FU write-after-write hazard detection Signal (dummy so far)
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Tue, 23 Nov 2021 15:53:35 +0000 (15:53 +0000)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Tue, 23 Nov 2021 15:53:35 +0000 (15:53 +0000)
this has to be set up in the connect_write section but then
*used* in connect_rdport in order to stop reading from happening

strictly speaking it should actually stop issue, but we already
established that that way lies madness (combinatorial loops).

this may turn out to be a bit more complex than initially planned
due to some instructions potentially not having read at all
(only write)

src/soc/simple/core.py

index de1d2d68828a10d1788be569d5db26974e2d5323..18bacc596a0fd470f3e12eb46ac7db3ac1f451a5 100644 (file)
@@ -152,6 +152,12 @@ class NonProductionCore(ControlBase):
                                             regreduce_en=self.regreduce_en)
             self.des[funame] = self.decoders[funame].do
 
+        # create per-Function Unit write-after-write hazard signals
+        # yes, really, this should have been added in ReservationStations
+        # but hey.
+        for funame, fu in self.fus.fus.items():
+            fu._waw_hazard = Signal(name="waw_%s" % funame)
+
         # share the SPR decoder with the MMU if it exists
         if "mmu0" in self.decoders:
             self.decoders["mmu0"].mmu0_spr_dec = self.decoders["spr0"]
@@ -183,6 +189,10 @@ class NonProductionCore(ControlBase):
         regs = self.regs
         fus = self.fus.fus
 
+        # set FU hazards default to 1 (as a test)
+        for funame, fu in self.fus.fus.items():
+            comb += fu._waw_hazard.eq(1)
+
         # connect decoders
         self.connect_satellite_decoders(m)