handled tag engine edge case

This commit is contained in:
Yehowshua Immanuel 2025-04-04 15:09:56 -04:00
parent 271148e538
commit ca59e6eaec
2 changed files with 57 additions and 23 deletions

View file

@ -6,23 +6,22 @@ import ActionSeq
mkTagEngineTester :: Module Empty
mkTagEngineTester = do
tagEngine :: TagEngine 5 <- mkTagEngine
count :: Reg (UInt 32) <- mkReg 0;
runOnce :: Reg Bool <- mkReg False
s :: ActionSeq
s <-
s <-
let
requestTagAction :: Action
requestTagAction =
do
tag <- tagEngine.requestTag
$display "got tag : " (fshow tag)
$display $time " got tag : " (fshow tag)
retireTagAction :: UInt 3 -> Action
retireTagAction tag =
do
res <- tagEngine.retireTag tag
$display "retiring tag : " (fshow tag) " " (fshow res)
$display $time " retiring tag : " (fshow tag) " " (fshow res)
action {}
in
@ -34,12 +33,12 @@ mkTagEngineTester = do
|> do requestTagAction
|> do retireTagAction 2
-- |> do $display "BEGIN TRY SIMULTANEOUS RETIRE and REQUEST"
|> do
|> do
retireTagAction 4
requestTagAction
-- |> do $display "END TRY SIMULTANEOUS RETIRE and REQUEST"
-- |> do $display "BEGIN TRY SIMULTANEOUS RETIRE and REQUEST"
|> do
|> do
retireTagAction 4
requestTagAction
-- |> do $display "END TRY SIMULTANEOUS RETIRE and REQUEST"
@ -55,11 +54,11 @@ mkTagEngineTester = do
addRules $
rules
"counter": when True ==>
do
count := count + 1
$display "count : " (fshow count)
-- "counter": when True ==>
-- do
-- count := count + 1
-- $display "count : " (fshow count)
"testIncrement": when (runOnce == False) ==>
do
s.start
runOnce := True
runOnce := True