Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Altera_Forum
Honored Contributor I
978 Views

task vs always

Hello, i know that always executes always when some parameter in the sensitivity list changes. 

in what cases task executes? 

if i have a task block and always block one after the other' which one executes first? 

 

Thanks
0 Kudos
4 Replies
Altera_Forum
Honored Contributor I
15 Views

A task has to be called. Hence it needs to be called from inside an always or initial block. 

A task block on it's own will be called as an implicit always. 

You cannot guarantee which will be called first, as it is down to what order the compiler decides to order them. So you shouldnt be assigning the same variable in both.
Altera_Forum
Honored Contributor I
15 Views

 

--- Quote Start ---  

A task has to be called. Hence it needs to be called from inside an always or initial block. 

A task block on it's own will be called as an implicit always. 

 

--- Quote End ---  

 

What do you mean by this? A task is a procedure that must be called by from a running process. 

 

An always block is a continuously running process.
Altera_Forum
Honored Contributor I
15 Views

 

--- Quote Start ---  

What do you mean by this? A task is a procedure that must be called by from a running process. 

 

An always block is a continuously running process. 

--- Quote End ---  

 

 

Maybe Im getting myself confused. In VHDL a procedure can be called outside of a process and in doing so you have an implicit process. I thought the same could be done in verilog - mistaken.
Altera_Forum
Honored Contributor I
15 Views

Thanks i understand :-)