RE: [sv-ec] Invalid example of srandom - mantis 1391

From: Rich, Dave <Dave_Rich_at_.....>
Date: Tue Mar 21 2006 - 21:33:59 PST
Mike,

That would be true if '.' was defined as an operator, but it's not in
SystemVerilog; it's a hierarchical identifier separator.

> -----Original Message-----
> From: owner-sv-ec@eda.org [mailto:owner-sv-ec@eda.org] On Behalf Of
> Michael Burns
> Sent: Tuesday, March 21, 2006 6:19 PM
> To: Ryan, Ray
> Cc: sv-ec@eda.org
> Subject: Re: [sv-ec] Invalid example of srandom - mantis 1391
> 
> 
> I believe the 1800-2005 spec says that self is a static function - I'd
> expect it to then be written like this:
> 
> process::self().srandom(100);
> 
> Is this right?
> 
> --Mike Burns
> 
> 
> Ryan, Ray wrote:
> > I entered mantis #1391 for the following
> >
> > In section 13.13.2 the example contains the statement:
> > process::self.srandom(100);
> >
> > This is not a valid call to srandom. In this statement, the prefix
of
> > srandom is "process::self". This is a reference to the scope of the
self
> > method - not a call to the self function. The scope of the self
method
> > does NOT include the srandom method.
> >
> > A correct example should read:
> > integer x, y, z;
> > fork //set a seed at the start of a thread
> > begin
> >   process pvar;
> >   pvar = process::self;
> >   pvar.srandom(100);
> >   x = $urandom;
> > end
> > //set a seed during a thread
> > begin
> >   process pvar;
> >   pvar = process::self;
> >   y = $urandom;
> >   pvar.srandom(200);
> > end
> > // draw 2 values from the thread RNG
> > begin z = $urandom + $urandom ; end
> > join
> >
> >
> > - Ray
> >
Received on Tue Mar 21 21:34:06 2006

This archive was generated by hypermail 2.1.8 : Tue Mar 21 2006 - 21:34:15 PST