aboutsummaryrefslogtreecommitdiffstats
path: root/src/VeriFuzz/Gen.hs
diff options
context:
space:
mode:
Diffstat (limited to 'src/VeriFuzz/Gen.hs')
-rw-r--r--src/VeriFuzz/Gen.hs7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/VeriFuzz/Gen.hs b/src/VeriFuzz/Gen.hs
index 5396701..b9545a8 100644
--- a/src/VeriFuzz/Gen.hs
+++ b/src/VeriFuzz/Gen.hs
@@ -150,14 +150,15 @@ askProbability = lift $ asks probability
assignment :: StateGen Assign
assignment = do
+ expr <- scopedExpr
lval <- lvalFromPort <$> newPort Reg
- Assign lval Nothing <$> scopedExpr
+ return $ Assign lval Nothing expr
conditional :: StateGen Statement
conditional = do
expr <- scopedExpr
stmntDepth -= 1
- tstat <- fold <$> some statement
+ tstat <- SeqBlock <$> some statement
stmntDepth += 1
return $ CondStmnt expr (Just tstat) Nothing
@@ -210,5 +211,5 @@ procedural config = VerilogSrc . (: []) . Description <$> Hog.resize
num
(runReaderT (evalStateT (moduleDef True) context) config)
where
- context = Context [] 0 5
+ context = Context [] 0 $ config ^. configProperty . propDepth
num = fromIntegral $ config ^. configProperty . propSize