RE: [sv-cc] Question on "rand" qualifer on struct elements

From: Rich, Dave <Dave_Rich_at_.....>
Date: Tue Dec 05 2006 - 14:09:27 PST
No that's not correct. The BNF allows you to declare rand or randc on a
member of any struct or typedef of a struct. It's just that it's only
treated as a random variable when declared rand as a member of a class.
That is, randomize() is a method of a class, not a method of a struct.

typedef struct { rand int A;} A_t;

A_t Av; // a regular struct;

class C;
rand A_t m_A;
endclass

C C_h = new; // a class with a random variable C_h.m_A.A

> -----Original Message-----
> From: owner-sv-cc@server.eda.org [mailto:owner-sv-cc@server.eda.org]
On
> Behalf Of Bresticker, Shalom
> Sent: Tuesday, December 05, 2006 8:52 AM
> To: Jim Vellenga; sv-cc@server.eda.org
> Subject: RE: [sv-cc] Question on "rand" qualifer on struct elements
> 
> Yes. See 13.3.
> 
> > Clarification:  Does a declaration with rand and randc
> > qualifiers have to appear only inside a class declaration?
> 
> Shalom
Received on Tue Dec 5 14:09:41 2006

This archive was generated by hypermail 2.1.8 : Tue Dec 05 2006 - 14:09:52 PST