reduce noise in tag engine unit test as well as make results apparent
This commit is contained in:
parent
2d9bc945c5
commit
89664a01f6
3 changed files with 79 additions and 9 deletions
|
@ -40,18 +40,18 @@ mkTagEngine = do
|
|||
requestSignal <- mkRWire -- Signals a tag request
|
||||
|
||||
-- Debug
|
||||
debugOnce <- mkReg True
|
||||
debugOnce <- mkReg False
|
||||
|
||||
-- Rules
|
||||
addRules |>
|
||||
rules
|
||||
"debug_initial_state": when debugOnce ==> do
|
||||
$display "tagUsage: " (fshow (readVReg tagUsage))
|
||||
-- $display "tagUsage: " (fshow (readVReg tagUsage))
|
||||
debugOnce := False
|
||||
|
||||
"retire_tag": when True ==> do
|
||||
let tag = retireQueue.first
|
||||
$display "Retiring tag: " (fshow tag)
|
||||
-- $display "Retiring tag: " (fshow tag)
|
||||
retireQueue.deq
|
||||
freeTagQueue.enq tag
|
||||
retireSignal.wset tag
|
||||
|
@ -66,13 +66,13 @@ mkTagEngine = do
|
|||
usage' = update usage requestTag True
|
||||
usage'' = update usage' retireTag False
|
||||
writeVReg tagUsage usage''
|
||||
$display $time " Updated usage (request + retire): " (fshow |> readVReg tagUsage)
|
||||
-- $display $time " Updated usage (request + retire): " (fshow |> readVReg tagUsage)
|
||||
(Just retireTag, Nothing) -> do
|
||||
(select tagUsage retireTag) := False
|
||||
$display $time " Updated usage (retire): " (fshow (readVReg tagUsage))
|
||||
-- $display $time " Updated usage (retire): " (fshow (readVReg tagUsage))
|
||||
(Nothing, Just requestTag) -> do
|
||||
(select tagUsage requestTag) := True
|
||||
$display $time " Updated usage (request): " (fshow (readVReg tagUsage))
|
||||
-- $display $time " Updated usage (request): " (fshow (readVReg tagUsage))
|
||||
(Nothing, Nothing) -> action {}
|
||||
|
||||
-- Interface
|
||||
|
|
Reference in a new issue