Tag engine building

This commit is contained in:
Yehowshua Immanuel 2025-03-20 06:28:55 -04:00
parent ac48f5a4ad
commit 5f2d9456ae

View file

@ -14,6 +14,9 @@ interface (TagEngine :: # -> *) numTags =
requestTag :: ActionValue UIntLog2N(numTags) requestTag :: ActionValue UIntLog2N(numTags)
retireTag :: UIntLog2N(numTags) -> Action retireTag :: UIntLog2N(numTags) -> Action
instance FShow (Reg (Tag numTags)) where
fshow value = fshow (readReg value)
initTagNext :: Integer -> Module(Reg (Tag numTags)) initTagNext :: Integer -> Module(Reg (Tag numTags))
initTagNext i = do initTagNext i = do
t :: Reg (Tag numTags) t :: Reg (Tag numTags)
@ -45,17 +48,14 @@ mkTagEngine =
fileHandle :: Handle <- openFile "compile.log" WriteMode fileHandle :: Handle <- openFile "compile.log" WriteMode
cycle <- mkReg 0 debugOnce <- mkReg True
end_cycle <- mkReg 4
addRules (simulate_for cycle end_cycle)
addRules $ addRules $
rules rules
"display": when True ==> "display": when (debugOnce == True) ==>
do do
$display (fshow (tagVec !! 0)) $display (fshow tagVec)
$finish debugOnce := False
counter <- mkReg(0 :: UIntLog2N(numTags)) counter <- mkReg(0 :: UIntLog2N(numTags))
return $ return $