Tag Engine Now Finished it seems #10

Merged
Yehowshua merged 12 commits from tag_engine_version_3 into main 2025-04-08 01:32:40 +00:00
2 changed files with 11 additions and 20 deletions
Showing only changes of commit e89254ebef - Show all commits

View file

@ -37,9 +37,10 @@ mkTagEngine =
methodRetireTagCalledValid :: RWire UIntLog2N(numTags) methodRetireTagCalledValid :: RWire UIntLog2N(numTags)
methodRetireTagCalledValid <- mkUnsafeRWire methodRetireTagCalledValid <- mkUnsafeRWire
debugOnce <- mkReg True -- computedTagResult :: BypassWire (Maybe UIntLog2N(numTags))
-- methodRetireTagCalledValid <- mkBypassWire
tt :: Reg Bool <- mkReg False debugOnce <- mkReg True
addRules $ addRules $
rules rules
@ -52,15 +53,15 @@ mkTagEngine =
"update stack pointer": when True ==> "update stack pointer": when True ==>
do do
stackPtr := stackPtr :=
case (methodRequestTagCalled, methodRetireTagCalledValid.wget) of case (methodRequestTagCalled, methodRetireTagCalledValid.wget) of
(True, Just tag) -> stackPtr (True, Just _) -> stackPtr
(True, Nothing) -> (True, Nothing) ->
case stackPtr of case stackPtr of
Just 0 -> Nothing Just 0 -> Nothing
Just sampledStackPtr -> Just |> sampledStackPtr - 1 Just sampledStackPtr -> Just |> sampledStackPtr - 1
Nothing -> Nothing Nothing -> Nothing
(False, Just tag) -> (False, Just _) ->
case stackPtr of case stackPtr of
Just sampledStackPtr -> Just |> sampledStackPtr + 1 Just sampledStackPtr -> Just |> sampledStackPtr + 1
Nothing -> Nothing Nothing -> Nothing
@ -69,7 +70,7 @@ mkTagEngine =
"update free stack": when True ==> "update free stack": when True ==>
do do
case (methodRequestTagCalled, methodRetireTagCalledValid.wget) of case (methodRequestTagCalled, methodRetireTagCalledValid.wget) of
(True, Just tag) -> do action {} (True, Just _) -> do action {}
(True, Nothing) -> do action {} (True, Nothing) -> do action {}
(False, Just tag) -> do (False, Just tag) -> do
case stackPtr of case stackPtr of
@ -82,7 +83,7 @@ mkTagEngine =
"update in use": when True ==> "update in use": when True ==>
do do
case (methodRequestTagCalled, methodRetireTagCalledValid.wget) of case (methodRequestTagCalled, methodRetireTagCalledValid.wget) of
(True, Just tag) -> do action {} (True, Just _) -> do action {}
(True, Nothing) -> (True, Nothing) ->
case stackPtr of case stackPtr of
Just sampledStackPtr -> do Just sampledStackPtr -> do
@ -92,7 +93,6 @@ mkTagEngine =
(select inUseVec tag) := False (select inUseVec tag) := False
(False, Nothing) -> do action {} (False, Nothing) -> do action {}
counter <- mkReg(0 :: UIntLog2N(numTags))
return $ return $
interface TagEngine interface TagEngine
@ -104,9 +104,9 @@ mkTagEngine =
Just tag -> do Just tag -> do
return |> Just tag return |> Just tag
Nothing -> do Nothing -> do
return |> return |>
case stackPtr of case stackPtr of
Just sampledStackPtr -> Just sampledStackPtr ->
Just |> readReg (select freeStackVec sampledStackPtr) Just |> readReg (select freeStackVec sampledStackPtr)
Nothing -> Nothing Nothing -> Nothing
@ -116,10 +116,6 @@ mkTagEngine =
let let
tagValid = tag < reifiedNumTags tagValid = tag < reifiedNumTags
tagInUse = readReg (select inUseVec tag) tagInUse = readReg (select inUseVec tag)
nextStackPtrUint =
case stackPtr of
Nothing -> 0
Just n -> n + 1
if (tagValid && tagInUse) if (tagValid && tagInUse)
then do then do
methodRetireTagCalledValid.wset tag methodRetireTagCalledValid.wset tag

View file

@ -68,8 +68,6 @@ mkTop = do
bus :: Bus <- mkBus bus :: Bus <- mkBus
busClient :: BusClient <- mkBusClient busClient :: BusClient <- mkBusClient
let a :: List Integer = 1 :> 2 :> Nil
b = length a
persistLed :: Reg (Bit 8) <- mkReg 0 persistLed :: Reg (Bit 8) <- mkReg 0
messageM $ "Hallo!!" + (realToString 5) messageM $ "Hallo!!" + (realToString 5)
@ -102,10 +100,7 @@ mkTop = do
mkSim :: Module Empty mkSim :: Module Empty
mkSim = do mkSim = do
let cfg :: BRAM_Configure = defaultValue _ :: Empty <- mkTagEngineTester
tagEngineTester :: Empty <- mkTagEngineTester
count :: Reg (UInt 4) <- mkReg 0;
initCFunctions :: Reg Bool <- mkReg False; initCFunctions :: Reg Bool <- mkReg False;
core :: Core FCLK <- mkCore; core :: Core FCLK <- mkCore;