From 372bcb00204d225f4b89cfed33f99a519740dc8e Mon Sep 17 00:00:00 2001 From: Yann Herklotz Date: Tue, 2 Apr 2019 14:33:08 +0100 Subject: Add more configuration options and small fix --- src/VeriFuzz/Gen.hs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/VeriFuzz/Gen.hs') 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 -- cgit