mirror of https://github.com/zachjs/sv2v.git
fix verbose mode crash
This commit is contained in:
parent
c005e5c6ae
commit
2d134a8640
|
|
@ -31,7 +31,7 @@ convertStmt (For (Left inits) cc asgns stmt) =
|
|||
initAsgns ++
|
||||
[For (Right [(lhs, expr)]) cc asgns stmt]
|
||||
where
|
||||
splitDecls = map splitDecl inits
|
||||
splitDecls = map splitDecl $ filter (not . isComment) inits
|
||||
decls = map fst splitDecls
|
||||
initAsgns = map asgnStmt $ init $ map snd splitDecls
|
||||
(lhs, expr) = snd $ last splitDecls
|
||||
|
|
@ -54,6 +54,10 @@ splitDecl (Variable d t ident a e) =
|
|||
splitDecl decl =
|
||||
error $ "invalid for loop decl: " ++ show decl
|
||||
|
||||
isComment :: Decl -> Bool
|
||||
isComment CommentDecl{} = True
|
||||
isComment _ = False
|
||||
|
||||
asgnStmt :: (LHS, Expr) -> Stmt
|
||||
asgnStmt = uncurry $ Asgn AsgnOpEq Nothing
|
||||
|
||||
|
|
|
|||
|
|
@ -58,6 +58,8 @@ assertConverts() {
|
|||
diff $ac_tmpb $ac_tmpc > /dev/null
|
||||
assertTrue "conversion of $ac_file not stable after the second iteration" $?
|
||||
fi
|
||||
$SV2V -v $ac_file 2> /dev/null > /dev/null
|
||||
assertTrue "verbose conversion of $ac_file failed" $?
|
||||
# using sed to remove quoted strings
|
||||
filtered=`sed -E 's/"([^"]|\")+"//g' $ac_tmpa`
|
||||
# check for various things iverilog accepts which we don't want to output
|
||||
|
|
|
|||
Loading…
Reference in New Issue