Forum Discussion
Altera_Forum
Honored Contributor
13 years agoI should have taken my own advice! From "Summary of Verilog Syntax" pdf
"6. Tasks & Functions Tasks and functions in Verilog closely resemble the procedures and functions in programming languages. Both tasks and functions are defined locally in the module in which the tasks and functions will be invoked. No initial or always statement may be defined within either tasks or functions." It would also be nice if the compiler told us we were not being clever! For this example a function would probably be the way to go. ++Simon