Can you read a task output argument?

P

Paul Jansen

Guest
I can't find anything on this in the 2001 LRM (apart from the note on
p190 on coercing an output to an inout, but that's only for module
ports). If I want to read an output, do I instead have to declare it
as an inout?

Thanks -

/PJ
 
On Thu, 11 Jan 2007 10:11:59 +0000, Paul Jansen
<pj30145@yahoo.com> wrote:

I can't find anything on this in the 2001 LRM (apart from the note on
p190 on coercing an output to an inout, but that's only for module
ports). If I want to read an output, do I instead have to declare it
as an inout?
No, this is Verilog not VHDL :)

A task's output argument is a local variable of the task. Within
the task you can do anything you like with it, just as you could
with a local variable of the task. The only special property of
output arguments is that they are automatically copied into
the actual argument (the variable supplied in the task call)
at the time the task exits.
--
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.
 
On Thu, 11 Jan 2007 14:51:52 +0000, Jonathan Bromley
<jonathan.bromley@MYCOMPANY.com> wrote:

No, this is Verilog not VHDL :)
Ah, I was getting confused there... :)

Thanks -

/PJ
 
On Thu, 11 Jan 2007 14:51:52 +0000, Jonathan Bromley
jonathan.bromley@MYCOMPANY.com> wrote:

No, this is Verilog not VHDL :)
You can also write to input arguments if you like. As Jonathan says,
arguments are just variables local to the task, whose only special
property is the copying of values in/out from/to the actuals when the
task is called or returns.

If the task is not automatic, you can even reference the argument
variables from outside the task, though few people realize it.
 

Welcome to EDABoard.com

Sponsor

Back
Top