From 7607147095be0498eb50427d0e6dca35650bdc5f Mon Sep 17 00:00:00 2001 From: Luke Kenneth Casson Leighton Date: Tue, 23 Nov 2021 15:53:35 +0000 Subject: [PATCH] add FU write-after-write hazard detection Signal (dummy so far) 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 | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/soc/simple/core.py b/src/soc/simple/core.py index de1d2d68..18bacc59 100644 --- a/src/soc/simple/core.py +++ b/src/soc/simple/core.py @@ -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) -- 2.30.2