Commit 96cfe18c by Zachary Snow

pass through support for functions with output ports

parent eb42042c
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
`'1`, `'x`) via `--exclude UnbasedUniszed` `'1`, `'x`) via `--exclude UnbasedUniszed`
* Added support for enumerated type ranges (e.g., `enum { X[3:5] }`) * Added support for enumerated type ranges (e.g., `enum { X[3:5] }`)
* Added support for passing through DPI imports and exports * Added support for passing through DPI imports and exports
* Added support for passing through functions with output ports
### Other Enhancements ### Other Enhancements
......
...@@ -1571,9 +1571,10 @@ combineDeclsAndStmts (a1, b1) (a2, b2) = ...@@ -1571,9 +1571,10 @@ combineDeclsAndStmts (a1, b1) (a2, b2) =
makeInput :: Decl -> Decl makeInput :: Decl -> Decl
makeInput (Variable Local t x a e) = Variable Input t x a e makeInput (Variable Local t x a e) = Variable Input t x a e
makeInput (Variable Input t x a e) = Variable Input t x a e makeInput (Variable Input t x a e) = Variable Input t x a e
makeInput (Variable Output t x a e) = Variable Output t x a e
makeInput (CommentDecl c) = CommentDecl c makeInput (CommentDecl c) = CommentDecl c
makeInput other = makeInput other =
error $ "unexpected non-var or non-input decl: " ++ (show other) error $ "unexpected non-var or non-port function decl: " ++ (show other)
checkTag :: String -> String -> a -> ParseState a checkTag :: String -> String -> a -> ParseState a
checkTag _ "" x = return x checkTag _ "" x = return x
......
module top;
function automatic integer f;
input integer x;
output integer y;
f = x * 3;
y = x * 5;
endfunction
integer x, y;
initial x = f(-1, y);
initial $display(x, y);
endmodule
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