Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Verilog Function Vs Task

Status
Not open for further replies.

uditkumar1983

Advanced Member level 4
Joined
Dec 3, 2006
Messages
108
Helped
6
Reputation
12
Reaction score
2
Trophy points
1,298
Location
India
Activity points
2,019
Hi Friends,
There is a lot of difference between function and task and generally we will tell combinational circuit will be designed using function and sequential circuit using task, but task can also be used for combinational circuit ,So My dobut is if task can be used in place of Function so Why specially function required ??means what special features is in function which is not available in task??
as I know these two features in function signed and constant function is available in function but not in task ?? If I am wrong then Please correct me .....

Regards
 

no_mad

Full Member level 5
Joined
Dec 10, 2004
Messages
272
Helped
30
Reputation
60
Reaction score
11
Trophy points
1,298
Location
Naboo
Activity points
2,408
Hi,

In my opinion, I would say task n function is something like "assign" and "always" in verilog.

Why? For example, we can model combinational circuit using both statement (assign or always).

But why we still need assign then. I think it is still the same reason why we still have "function".

As for me, the rule of thumb is I always use "function" for modeling combinational logic. Most of the time I used "task" in my test bench.

Anyway, this is my personal opinion. Perhaps, other experts can share some thought.

Hope it helps.
 

smrjaved

Newbie level 5
Joined
Jun 15, 2007
Messages
9
Helped
3
Reputation
6
Reaction score
0
Trophy points
1,281
Activity points
1,331
One major difference in function and task is that function simulates in zero simulation time while task can include delays in simulation. thats why combinational block simulation is done using a function. The sequential circuit should also be capable of handling delays. so task is prefered. Remember these can only be used in simulation purposes and not in synthesis as tasks are not synthesizable.
 

ameed

Advanced Member level 4
Joined
Jun 28, 2007
Messages
107
Helped
6
Reputation
12
Reaction score
1
Trophy points
1,298
Location
INDIA
Activity points
1,931
hi

same as c language function and task:idea:



thanx.....
 

vizpal

Member level 2
Joined
Apr 26, 2007
Messages
44
Helped
1
Reputation
2
Reaction score
0
Trophy points
1,286
Activity points
1,519
Functions --> Consume no Time
Tasks --> Consume Time
 

yogini

Newbie level 3
Joined
Jul 6, 2010
Messages
3
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Location
PONDA
Activity points
1,298
Differences between Functions and Tasks....
 Functions
 Can enable (call) just another function (not task)
 Execute in 0 simulation time
 No timing control statements allowed
 At least one input
 Return only a single value
 Tasks
 Can enable other tasks and functions
 May execute in nonzero simulation time
 May contain any timing control statements
 May have arbitrary input, output, or Inout
 Do not return any value
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top