mirror of https://github.com/zachjs/sv2v.git
explicitly default function input types to
This commit is contained in:
parent
4c49bd1138
commit
64a2610b76
|
|
@ -322,7 +322,7 @@ ModuleItem :: { [ModuleItem] }
|
|||
| "genvar" Identifiers ";" { map Genvar $2 }
|
||||
| "generate" GenItems "endgenerate" { [Generate $2] }
|
||||
| "modport" ModportItems ";" { map (uncurry Modport) $2 }
|
||||
| "function" opt(Lifetime) FuncRetAndName FunctionItems DeclsAndStmts "endfunction" opt(Tag) { [Function $2 (fst $3) (snd $3) ($4 ++ fst $5) (snd $5)] }
|
||||
| "function" opt(Lifetime) FuncRetAndName FunctionItems DeclsAndStmts "endfunction" opt(Tag) { [Function $2 (fst $3) (snd $3) (map defaultFuncInput $ $4 ++ fst $5) (snd $5)] }
|
||||
|
||||
FuncRetAndName :: { (Type, Identifier) }
|
||||
: {- empty -} Identifier { (Implicit [], $1) }
|
||||
|
|
@ -616,4 +616,9 @@ makeInput :: Decl -> Decl
|
|||
makeInput (Variable _ t x a me) = Variable Input t x a me
|
||||
makeInput other = error $ "unexpected non-var decl: " ++ (show other)
|
||||
|
||||
defaultFuncInput :: Decl -> Decl
|
||||
defaultFuncInput (Variable Input (Implicit rs) x a me) =
|
||||
Variable Input (Logic rs) x a me
|
||||
defaultFuncInput other = other
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue