From: Luke Kenneth Casson Leighton Date: Wed, 17 Nov 2021 14:44:40 +0000 (+0000) Subject: detect the case in Core bitvector when the Function Unit says: X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=83bb5d4e731533c8881d74ee8c33f95eb3c5b267;p=soc.git detect the case in Core bitvector when the Function Unit says: "actually, although you said i *could* write to this regfile (and therefore have been reserving a write hazard protection for me) actually i'm not going to write to it." this situation occurs when: * at issue time a wrflag (from PowerDecoder decode_regspec_write) was HI * at ALU output time (alu.n.o_ready) the FU dest.data.ok flag is LOW under these unusual but perfectly valid circumstances the write hazard bitvector MUST still be cleared --- diff --git a/src/soc/simple/core.py b/src/soc/simple/core.py index e813d29b..a95a7fcd 100644 --- a/src/soc/simple/core.py +++ b/src/soc/simple/core.py @@ -31,7 +31,7 @@ from nmutil.picker import PriorityPicker from nmutil.util import treereduce from nmutil.singlepipe import ControlBase -from soc.fu.compunits.compunits import AllFunctionUnits +from soc.fu.compunits.compunits import AllFunctionUnits, LDSTFunctionUnit from soc.regfile.regfiles import RegFiles from openpower.decoder.power_decoder2 import get_rdflags from soc.experiment.l0_cache import TstL0CacheBuffer # test only @@ -478,7 +478,8 @@ class NonProductionCore(ControlBase): def make_hazards(self, m, regfile, rfile, wvclr, wvset, funame, regname, idx, - addr_en, wp, fu, fu_active, wrflag, write): + addr_en, wp, fu, fu_active, wrflag, write, + fu_wrok): """make_hazards: a setter and a clearer for the regfile write ports setter is at issue time (using PowerDecoder2 regfile write numbers) @@ -489,20 +490,10 @@ class NonProductionCore(ControlBase): (has its data.ok bit CLEARED). this is perfectly legitimate. and a royal pain. """ - comb = m.d.comb + comb, sync = m.d.comb, m.d.sync name = "%s_%s_%d" % (funame, regname, idx) - # deal with write vector clear: this kicks in when the regfile - # is written to, and clears the corresponding bitvector entry - print ("write vector", regfile, wvclr) - wvaddr_en = Signal(len(wvclr.wen), name="wvaddr_en_"+name) - if rfile.unary: - comb += wvaddr_en.eq(addr_en) - else: - with m.If(wp): - comb += wvaddr_en.eq(1< clear bit wvseten.append(wv_issue_en) # set data same as enable