Can one do recursive tasks/functions in verilog-95

M

Mike

Guest
I was under the impression that recursive tasks/functions cannot be
compiled in Verilog-95 because functions and tasks are not re-entrant
in V-95
 
On 20 Dec 2006 00:44:09 -0800, "Mike" <semi.dope@gmail.com> wrote:

I was under the impression that recursive tasks/functions cannot be
compiled in Verilog-95 because functions and tasks are not re-entrant
in V-95
They can be compiled, but it is unlikely that they will
work as you intended. "function automatic" in Verilog>=2001
fixes that.
--
Jonathan Bromley, Consultant

DOULOS - Developing Design Know-how
VHDL * Verilog * SystemC * e * Perl * Tcl/Tk * Project Services

Doulos Ltd., 22 Market Place, Ringwood, BH24 1AW, UK
jonathan.bromley@MYCOMPANY.com
http://www.MYCOMPANY.com

The contents of this message may contain personal views which
are not the views of Doulos Ltd., unless specifically stated.
 
Mike wrote:
I was under the impression that recursive tasks/functions cannot be
compiled in Verilog-95 because functions and tasks are not re-entrant
in V-95
They are not reentrant, but that does not prevent recursive calls from
being compiled. It just means that they do not behave in a reentrant
fashion when you do it. All their variables (including arguments and
return values) will be static and shared between all calls to the same
task/function instance. That makes it difficult to write recursive
calls that behave in a useful way.

Those same task declarations are not reentrant in Verilog-2001 either,
since that would not be backward compatible. What Verilog-2001 allows
is declaring them to be automatic, which then makes them reentrant.
 

Welcome to EDABoard.com

Sponsor

Back
Top