From ba63ee6dfb063e0e6b1c8da51071a85dea9f934b Mon Sep 17 00:00:00 2001 From: Dolu1990 Date: Fri, 12 Jul 2024 16:15:12 +0200 Subject: [PATCH] DependencyStorage status busy is now implemented in registers instead of Mem --- .../frontend/RfDependencyPlugin.scala | 23 ++++--------------- 1 file changed, 5 insertions(+), 18 deletions(-) diff --git a/src/main/scala/naxriscv/frontend/RfDependencyPlugin.scala b/src/main/scala/naxriscv/frontend/RfDependencyPlugin.scala index 1e6c214e..f664a034 100644 --- a/src/main/scala/naxriscv/frontend/RfDependencyPlugin.scala +++ b/src/main/scala/naxriscv/frontend/RfDependencyPlugin.scala @@ -64,28 +64,15 @@ class DependencyStorage(physDepth : Int, } val status = new Area{ - val busy = Mem.fill(physDepth)(Bool()) - val write = for(p <- io.writes){ - busy.write( - address = p.physical, - data = True, - enable = p.valid - ) - } - val commit = for(p <- io.commits) yield new Area{ - when(p.valid){ - busy.write( - address = p.physical, - data = False, - enable = p.valid - ) - } - } + val busy = Reg(Bits(physDepth bits)) + val sets = io.writes.map(e => UIntToOh(e.physical).andMask(e.valid)).reduceBalancedTree(_ | _) + val clears = io.commits.map(e => UIntToOh(e.physical).andMask(e.valid)).reduceBalancedTree(_ | _) + busy := (busy & ~clears) | sets } val read = for(p <- io.reads) yield new Area{ val robId = translation.physToRob.readAsync(p.cmd.payload) - val enabled = status.busy.readAsync(p.cmd.payload) //TODO as it was optimize, maybe we do not need the [dispatch] stage anymore in the frontend plugin + val enabled = status.busy(p.cmd.payload) //TODO as it was optimize, maybe we do not need the [dispatch] stage anymore in the frontend plugin p.rsp.valid := p.cmd.valid p.rsp.enable := enabled p.rsp.rob := robId