enabling task from function in verilog

Status
Not open for further replies.

sagar.m

Newbie level 5
Joined
Mar 21, 2012
Messages
9
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Visit site
Activity points
1,340
why function cannot enable a task in verilog?

why it not allowed to enable/call task from function even if called task is not having any timing element(# , @)?
 

Because.

A function call is a guarantee to the user and the simulator that it will not block.

Even though a task has no timing elements, it could call another task, that calls another task, and that has a timing element. The callee task that enabled the called task is now blocking. Some simulators will let a function call a task, but you will get a run-time error if that task tries to block. It's much simpler to let the guarantee work for you and let you know at compile time that what you wrote does not make any sense.
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…