unable to display fshow for tagVec
This commit is contained in:
parent
6359ab833d
commit
ac48f5a4ad
3 changed files with 33 additions and 14 deletions
|
@ -1,4 +1,4 @@
|
|||
package TagEngine() where
|
||||
package TagEngine(TagEngine(..), mkTagEngine) where
|
||||
|
||||
import Vector
|
||||
import Util
|
||||
|
@ -10,6 +10,10 @@ data Tag numTags
|
|||
| Tail
|
||||
deriving (Bits, Eq, FShow)
|
||||
|
||||
interface (TagEngine :: # -> *) numTags =
|
||||
requestTag :: ActionValue UIntLog2N(numTags)
|
||||
retireTag :: UIntLog2N(numTags) -> Action
|
||||
|
||||
initTagNext :: Integer -> Module(Reg (Tag numTags))
|
||||
initTagNext i = do
|
||||
t :: Reg (Tag numTags)
|
||||
|
@ -22,11 +26,6 @@ initTagTail = do
|
|||
t <- mkReg Tail
|
||||
return t
|
||||
|
||||
interface (TagEngine :: # -> *) numTags =
|
||||
requestTag :: ActionValue UIntLog2N(numTags)
|
||||
retireTag :: UIntLog2N(numTags) -> Action
|
||||
|
||||
|
||||
initTagVec :: Module(Vector numTags (Reg (Tag numTags)))
|
||||
initTagVec =
|
||||
do
|
||||
|
@ -44,6 +43,20 @@ mkTagEngine =
|
|||
tagVec :: Vector numTags (Reg (Tag numTags))
|
||||
tagVec <- initTagVec
|
||||
|
||||
fileHandle :: Handle <- openFile "compile.log" WriteMode
|
||||
|
||||
cycle <- mkReg 0
|
||||
end_cycle <- mkReg 4
|
||||
|
||||
addRules (simulate_for cycle end_cycle)
|
||||
|
||||
addRules $
|
||||
rules
|
||||
"display": when True ==>
|
||||
do
|
||||
$display (fshow (tagVec !! 0))
|
||||
$finish
|
||||
|
||||
counter <- mkReg(0 :: UIntLog2N(numTags))
|
||||
return $
|
||||
interface TagEngine
|
||||
|
@ -56,9 +69,3 @@ mkTagEngine =
|
|||
retireTag tag = do
|
||||
-- placeholder
|
||||
counter := 0
|
||||
where
|
||||
a = "Hello"
|
||||
idx_last :: Integer = (fromInteger |> valueOf numTags) - 1
|
||||
|
||||
a :: Integer
|
||||
a = 3
|
||||
|
|
Reference in a new issue