Commit 2d134a86 by Zachary Snow

fix verbose mode crash

parent c005e5c6
...@@ -31,7 +31,7 @@ convertStmt (For (Left inits) cc asgns stmt) = ...@@ -31,7 +31,7 @@ convertStmt (For (Left inits) cc asgns stmt) =
initAsgns ++ initAsgns ++
[For (Right [(lhs, expr)]) cc asgns stmt] [For (Right [(lhs, expr)]) cc asgns stmt]
where where
splitDecls = map splitDecl inits splitDecls = map splitDecl $ filter (not . isComment) inits
decls = map fst splitDecls decls = map fst splitDecls
initAsgns = map asgnStmt $ init $ map snd splitDecls initAsgns = map asgnStmt $ init $ map snd splitDecls
(lhs, expr) = snd $ last splitDecls (lhs, expr) = snd $ last splitDecls
...@@ -54,6 +54,10 @@ splitDecl (Variable d t ident a e) = ...@@ -54,6 +54,10 @@ splitDecl (Variable d t ident a e) =
splitDecl decl = splitDecl decl =
error $ "invalid for loop decl: " ++ show decl error $ "invalid for loop decl: " ++ show decl
isComment :: Decl -> Bool
isComment CommentDecl{} = True
isComment _ = False
asgnStmt :: (LHS, Expr) -> Stmt asgnStmt :: (LHS, Expr) -> Stmt
asgnStmt = uncurry $ Asgn AsgnOpEq Nothing asgnStmt = uncurry $ Asgn AsgnOpEq Nothing
......
...@@ -58,6 +58,8 @@ assertConverts() { ...@@ -58,6 +58,8 @@ assertConverts() {
diff $ac_tmpb $ac_tmpc > /dev/null diff $ac_tmpb $ac_tmpc > /dev/null
assertTrue "conversion of $ac_file not stable after the second iteration" $? assertTrue "conversion of $ac_file not stable after the second iteration" $?
fi fi
$SV2V -v $ac_file 2> /dev/null > /dev/null
assertTrue "verbose conversion of $ac_file failed" $?
# using sed to remove quoted strings # using sed to remove quoted strings
filtered=`sed -E 's/"([^"]|\")+"//g' $ac_tmpa` filtered=`sed -E 's/"([^"]|\")+"//g' $ac_tmpa`
# check for various things iverilog accepts which we don't want to output # check for various things iverilog accepts which we don't want to output
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment