reverting as it seems we really cant condition rules on arguments safely
This commit is contained in:
parent
996febbff5
commit
35fc49382d
2 changed files with 47 additions and 26 deletions
35
bs/Top.bs
35
bs/Top.bs
|
@ -8,6 +8,7 @@ import CBindings
|
|||
import Bus
|
||||
import TagEngine
|
||||
import List
|
||||
import ActionSeq
|
||||
|
||||
type FCLK = 25000000
|
||||
type BAUD = 9600
|
||||
|
@ -102,12 +103,44 @@ mkSim = do
|
|||
let cfg :: BRAM_Configure = defaultValue
|
||||
|
||||
tagEngine :: TagEngine 5 <- mkTagEngine
|
||||
count :: Reg (UInt 3) <- mkReg 0;
|
||||
count :: Reg (UInt 4) <- mkReg 0;
|
||||
initCFunctions :: Reg Bool <- mkReg False;
|
||||
core :: Core FCLK <- mkCore;
|
||||
|
||||
s :: ActionSeq
|
||||
s <- actionSeq
|
||||
$ do
|
||||
$display "got tag : " tagEngine.requestTag
|
||||
|> do
|
||||
$display "got tag : " tagEngine.requestTag
|
||||
|> do
|
||||
$display "got tag : " tagEngine.requestTag
|
||||
|> do
|
||||
$display "retiring tag : 3"
|
||||
tagEngine.retireTag 3
|
||||
|> do
|
||||
$display "got tag : " tagEngine.requestTag
|
||||
|> do
|
||||
$display "got tag : " tagEngine.requestTag
|
||||
|> do
|
||||
$display "retiring tag : 4"
|
||||
tagEngine.retireTag 4
|
||||
|> do
|
||||
$display "got tag : " tagEngine.requestTag
|
||||
|> do
|
||||
$display "got tag : " tagEngine.requestTag
|
||||
|> do
|
||||
$display "retiring tag : 1"
|
||||
tagEngine.retireTag 1
|
||||
|> do
|
||||
$display "got tag : " tagEngine.requestTag
|
||||
|
||||
addRules $
|
||||
rules
|
||||
"testIncrement": when (count < 10) ==>
|
||||
do
|
||||
count := count + 1
|
||||
s.start
|
||||
"initCFunctionsOnce": when not initCFunctions ==>
|
||||
do
|
||||
initTerminal
|
||||
|
|
Reference in a new issue