aboutsummaryrefslogtreecommitdiffstats
path: root/src/Verismith/Reduce.hs
diff options
context:
space:
mode:
authorYann Herklotz <git@yannherklotz.com>2021-04-26 11:38:55 +0100
committerYann Herklotz <git@yannherklotz.com>2021-04-26 11:38:55 +0100
commit326048aeac6f846d8ad52c2a66f73219426f8bea (patch)
treea86c5a045e47900d9d78be680cf3e43a0454131b /src/Verismith/Reduce.hs
parent773acb06f15d49b810b76508505f5df5a84f8172 (diff)
downloadverismith-326048aeac6f846d8ad52c2a66f73219426f8bea.tar.gz
verismith-326048aeac6f846d8ad52c2a66f73219426f8bea.zip
Fix parser for a larger set of inputs
- Added support for parameter parsing - Added support for parameter declaration for instantiations - Fix parsing of @(*) - Fix parsing of `timescale - Add parsing for case statements with default
Diffstat (limited to 'src/Verismith/Reduce.hs')
-rw-r--r--src/Verismith/Reduce.hs8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/Verismith/Reduce.hs b/src/Verismith/Reduce.hs
index 267dddb..cc7d60b 100644
--- a/src/Verismith/Reduce.hs
+++ b/src/Verismith/Reduce.hs
@@ -294,7 +294,7 @@ isModule :: Identifier -> (ModDecl ReduceAnn) -> Bool
isModule i (ModDecl n _ _ _ _) = i == n
modInstActive :: [(ModDecl ReduceAnn)] -> (ModItem ReduceAnn) -> [Identifier]
-modInstActive decl (ModInst n _ i) = case m of
+modInstActive decl (ModInst n _ _ i) = case m of
Nothing -> []
Just m' -> concat $ calcActive m' <$> zip i [0 ..]
where
@@ -308,9 +308,9 @@ modInstActive decl (ModInst n _ i) = case m of
modInstActive _ _ = []
fixModInst :: (SourceInfo ReduceAnn) -> (ModItem ReduceAnn) -> (ModItem ReduceAnn)
-fixModInst (SourceInfo _ (Verilog decl)) (ModInst n g i) = case m of
+fixModInst (SourceInfo _ (Verilog decl)) (ModInst n p g i) = case m of
Nothing -> error "Moditem not found"
- Just m' -> ModInst n g . mapMaybe (fixModInst' m') $ zip i [0 ..]
+ Just m' -> ModInst n p g . mapMaybe (fixModInst' m') $ zip i [0 ..]
where
m = safe head $ filter (isModule n) decl
fixModInst' (ModDecl _ o i' _ _) (ModConn e, n')
@@ -391,7 +391,7 @@ halveAlways a = Single a
-- | Check if a mod instance is in the current context.
validModInst :: [Identifier] -> (ModItem ReduceAnn) -> Bool
-validModInst ids (ModInst i _ _) = i `elem` ids
+validModInst ids (ModInst i _ _ _) = i `elem` ids
validModInst _ _ = True
-- | Clean all the undefined module instances in a specific module using a