Intel® Quartus® Prime Software
Intel® Quartus® Prime Design Software, Design Entry, Synthesis, Simulation, Verification, Timing Analysis, System Design (Platform Designer, formerly Qsys)

task vs always

Altera_Forum
Honored Contributor II
1,911 Views

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 II
948 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.
0 Kudos
Altera_Forum
Honored Contributor II
948 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.
0 Kudos
Altera_Forum
Honored Contributor II
948 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.
0 Kudos
Altera_Forum
Honored Contributor II
948 Views

Thanks i understand :-)

0 Kudos
Reply