RE: [sv-bc] Function return values

From: Rich, Dave <Dave_Rich_at_.....>
Date: Thu Mar 01 2007 - 07:24:55 PST
Jonathon, (and any one else reading this)

I hope that I never see anyone depend on the static value of a function
name, or the static value of output arguments to tasks and functions. 

It too bad we can't switch the default lifetime to automatic. I've seen
countless experienced Verilog users get burned by multiple threads
executing the same static task and having their static arguments
clobbered. I hope that people are teaching users to avoid static tasks
and functions and always make them automatic.

Dave


> -----Original Message-----
> From: Jonathan Bromley [mailto:jonathan.bromley@doulos.com]
> Sent: Thursday, March 01, 2007 6:54 AM
> To: Rich, Dave; Arturo Salz; sv-bc@server.eda-stds.org
> Subject: RE: [sv-bc] Function return values
> 
> > It is already explicit in 12.3.1
> >
> > "The return statement shall override any value assigned to
> > the function name.
> 
> Sorry, that's not my idea of explicit.  I read that as saying
> that the *return value* is provided by the expression in the
> return statement, rather than by the contents of the function
> name.  It was precisely this sentence that led me to post
> the original query.
> 
> I fear this is (yet another) example of imprecise language
> subverting the LRM's intent.  "override" is quite inappropriate
> here; it certainly doesn't convey the notion "overwrite",
> which appears to be closer to the truth.
> 
> > When the return statement is used, nonvoid functions
> > must specify an expression with the return.
> 
> As I've already said, I don't really see why this restriction
> is necessary; but I suppose it might usefully protect users
> from certain kinds of folly :-)
> --
> Jonathan Bromley, Consultant
> 
> DOULOS - Developing Design Know-how
> VHDL * Verilog * SystemC * e * Perl * Tcl/Tk * Project Services
> 
> Doulos Ltd. Church Hatch, 22 Market Place, Ringwood, Hampshire, BH24
1AW,
> UK
> Tel: +44 (0)1425 471223                   Email:
> jonathan.bromley@doulos.com
> Fax: +44 (0)1425 471573                           Web:
> http://www.doulos.com
> 
> The contents of this message may contain personal views which
> are not the views of Doulos Ltd., unless specifically stated.

-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
Received on Thu Mar 1 07:25:47 2007

This archive was generated by hypermail 2.1.8 : Thu Mar 01 2007 - 07:27:19 PST