From 0452f44fbd866b31271505ea5d730992221f3265 Mon Sep 17 00:00:00 2001 From: Yehowshua Immanuel Date: Tue, 25 Mar 2025 08:35:17 -0400 Subject: [PATCH] alternate approach not so successful --- bs/TagEngine.bs | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/bs/TagEngine.bs b/bs/TagEngine.bs index edca9fa..06104ef 100644 --- a/bs/TagEngine.bs +++ b/bs/TagEngine.bs @@ -36,9 +36,10 @@ mkTagEngine = methodRetireTagCalledValid :: RWire UIntLog2N(numTags) methodRetireTagCalledValid <- mkUnsafeRWire + -- methodRetireTagCalledValid <- mkRWireSBR - -- computedTagResult :: BypassWire (Maybe UIntLog2N(numTags)) - -- methodRetireTagCalledValid <- mkBypassWire + computedTagResult :: Wire (Maybe UIntLog2N(numTags)) + computedTagResult <- mkBypassWire debugOnce <- mkReg True @@ -93,6 +94,16 @@ mkTagEngine = (select inUseVec tag) := False (False, Nothing) -> do action {} + "compute tag": when True ==> + computedTagResult := + case methodRetireTagCalledValid.wget of + Just tag -> Just tag + Nothing -> + case stackPtr of + Just sampledStackPtr -> + Just |> readReg (select freeStackVec sampledStackPtr) + Nothing -> Nothing + return $ interface TagEngine @@ -100,15 +111,7 @@ mkTagEngine = requestTag = do methodRequestTagCalled.send - case methodRetireTagCalledValid.wget of - Just tag -> do - return |> Just tag - Nothing -> do - return |> - case stackPtr of - Just sampledStackPtr -> - Just |> readReg (select freeStackVec sampledStackPtr) - Nothing -> Nothing + return computedTagResult retireTag :: UIntLog2N(numTags) -> ActionValue BasicResult retireTag tag =