mirror of https://github.com/zachjs/sv2v.git
conversion for function void (resolves #32)
This commit is contained in:
parent
6271e16b68
commit
f8a2bcbea0
|
|
@ -731,8 +731,9 @@ PackageItem :: { [PackageItem] }
|
|||
| NonDeclPackageItem { $1 }
|
||||
NonDeclPackageItem :: { [PackageItem] }
|
||||
: "typedef" Type Identifier ";" { [Typedef $2 $3] }
|
||||
| "function" opt(Lifetime) FuncRetAndName TFItems DeclsAndStmts "endfunction" opt(Tag) { [Function $2 (fst $3) (snd $3) (map defaultFuncInput $ (map makeInput $4) ++ fst $5) (snd $5)] }
|
||||
| "task" opt(Lifetime) Identifier TFItems DeclsAndStmts "endtask" opt(Tag) { [Task $2 $3 (map defaultFuncInput $ $4 ++ fst $5) (snd $5)] }
|
||||
| "function" opt(Lifetime) FuncRetAndName TFItems DeclsAndStmts "endfunction" opt(Tag) { [Function $2 (fst $3) (snd $3) (map defaultFuncInput $ (map makeInput $4) ++ fst $5) (snd $5)] }
|
||||
| "function" opt(Lifetime) "void" Identifier TFItems DeclsAndStmts "endfunction" opt(Tag) { [Task $2 $4 (map defaultFuncInput $ $5 ++ fst $6) (snd $6)] }
|
||||
| "task" opt(Lifetime) Identifier TFItems DeclsAndStmts "endtask" opt(Tag) { [Task $2 $3 (map defaultFuncInput $ $4 ++ fst $5) (snd $5)] }
|
||||
| "import" PackageImportItems ";" { map (uncurry Import) $2 }
|
||||
| "export" PackageImportItems ";" { map (Export . Just) $2 }
|
||||
| "export" "*" "::" "*" ";" { [Export Nothing] } -- "Nothing" being no restrictions
|
||||
|
|
|
|||
|
|
@ -0,0 +1,6 @@
|
|||
module top;
|
||||
function void foo;
|
||||
$display("foo called");
|
||||
endfunction
|
||||
initial foo;
|
||||
endmodule
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
module top;
|
||||
task foo;
|
||||
$display("foo called");
|
||||
endtask
|
||||
initial foo;
|
||||
endmodule
|
||||
Loading…
Reference in New Issue