ENGINEERING.com has updated it's forum.  To post a question please visit the new Ask@ Forum.   

With a database of over 10000 questions the library will remain available for an extended period.

Q&A


Spider Pig
What is the difference between a Verilog task and a Verilog function in Electrical Eng? View All


16 years ago - 3 months left to answer. - 2 responses - Report Abuse
Respond to question
    0      [lnkReport]        0       0       
Share |
  Responses


Homer simpson
A function shall execute in one simulation time unit;
a task can contain time-controlling statements.

A function cannot enable a task;
a task can enable other tasks or functions.

A function shall have at least one input type argument
and shall not have an output or inout type argument;
a task can have zero or more arguments of any type.

A function shall return a single value;
a task shall not return a value.


16 years ago

Source:


  1     0         

shilpi goenka
Verilog is a hardware description language, meaning that various
blocks of code directly map into hardware. Therefore, the designers must always have in mind the circuit they want to implement, not the program they want to write.

Task and function enhancements. SystemVerilog adds several enhancements to the Verilog task and function constructs. Only a few of the enhancements are highlighted in this article.

* Function return values can have a "void" return type. Void functions can be called the same as a Verilog task. The difference between a void function and a task is that Verilog functions have several semantic restrictions, such as no time controls.
* Functions can have any number of inputs, outputs and inouts, including none.
* Values can be passed to a task or function in any order, using the task/function argument names. The syntax is the same as named module port connections.
* Task and function input arguments can be assigned a default value as part o


16 years ago

Source:


  0     0         

ENGINEERING.com does not provide engineering advice. The Ask@ service is a forum for members to exchange ideas relating to the world of engineering. We caution users not to accept any responses that they receive without further validation, and not to rely on any engineering advice that they may get from other members of the Ask@ forum. ENGINEERING.com specifically disclaims any obligation to validate or verify any information posted within the Ask@ service. ENGINEERING.com encourages users to seek the services of a professional engineer for any engineering advice they may require.