- Use tasks and functions when you reuse the same code multiple times across a
design:
- Reduces the amount of code.
- Facilitates maintenance.
- In a module, tasks and functions must be declared and used. The heading
contains the following parameters:
- Input parameters (only) for functions.
- Input/output/inout parameters for tasks.
- The return value of a function is declared either signed or unsigned. The
content is similar to the content of the combinatorial
alwaysblock.