I didn't mean to say that the two issues were the same, but since it deals with the same paragraph, we ought to cover them at the same time in one proposal. ________________________________ From: Arturo Salz [mailto:Arturo.Salz@synopsys.com] Sent: Thursday, July 20, 2006 4:42 PM To: Rich, Dave; Ryan, Ray; William Paulsen; sv-ec@eda-stds.org Subject: RE: [sv-ec] Is "super" OK in constraint expressions? Dave, That is a completely separate issue. Allowing 'this' as a default method argument is complicated because it requires a context sensitive change to the existing rules. The LRM states: The default_value is an expression. The expression is evaluated in the scope containing the subroutine declaration each time a call using the default is made. If the default_value is not used, the expression is not evaluated. The complication (as I see it) is that a method call from a different class would require changes to the above rule. For example: class X; function void F( X q = this ); ... endfunction function void G(); X other = new(); other.F(); // Is this the same as other.F(other) or other.F(this) ? endfunction endclass I believe that the LRM currently requires the "other.F(this)" interpretation. This is most likely not the intention since in this case 'this' is different from 'other', that is, within method F(), 'this' and 'q' would be different. This is probably not an insurmountable obstacle but it does require some additional thought. Arturo -----Original Message----- From: owner-sv-ec@eda-stds.org [mailto:owner-sv-ec@eda-stds.org] On Behalf Of Rich, Dave Sent: Thursday, July 20, 2006 12:02 PM To: Ryan, Ray; William Paulsen; Arturo Salz; sv-ec@eda-stds.org Subject: RE: [sv-ec] Is "super" OK in constraint expressions? I had an action item to enter a proposal on allowing the use of the 'this' keyword in the default for method argument. I thought there was already a mantis on this issue, but I can't find it. Dave > -----Original Message----- > From: owner-sv-ec@server.eda-stds.org [mailto:owner-sv-ec@server.eda- > stds.org] On Behalf Of Ryan, Ray > Sent: Thursday, July 20, 2006 11:41 AM > To: William Paulsen; Arturo Salz; sv-ec@server.eda-stds.org > Subject: RE: [sv-ec] Is "super" OK in constraint expressions? > > Bill, Arturo, > > I agree with Arturo that both "this" and "super" should be allowed > in a constraint within a class scope. > > The restriction (in section 7) about the usage of "this" is likely > due to separate development of the sections on classes (7) and > random constraints (13). Although it could be argued that a constraint > is only 'used' within the randomize method of the class, I would > support modifying the paragraph in section 7 to explictly mention > constraints. > > The usage of "super" should be OK as is - it can also be used in > other declarations (eg. in an initializer). > > Ray > > > -----Original Message----- > > From: owner-sv-ec@server.eda-stds.org > > [mailto:owner-sv-ec@server.eda-stds.org] On Behalf Of William Paulsen > > Sent: Thursday, July 20, 2006 10:54 AM > > To: Arturo Salz; sv-ec@server.eda-stds.org > > Subject: RE: [sv-ec] Is "super" OK in constraint expressions? > > > > Thanks Arturo & Ray, > > > > But for "this", the LRM 7.10 says: > > > > "The this keyword shall only be used within non-static class > > methods, otherwise an error shall be issued." > > > > It would seem that "this" can only be used in a scope > > randomize constraint expression - it's not legal to use > > "this" in a constraint expression that's in a constraint block. > > > > Bill > > > > > > > > -----Original Message----- > > From: Arturo Salz [mailto:Arturo.Salz@synopsys.com] > > Sent: Thursday, July 20, 2006 1:43 PM > > To: William Paulsen; sv-ec@eda-stds.org > > Subject: RE: [sv-ec] Is "super" OK in constraint expressions? > > > > Bill, > > > > Both "this" and "super" should be allowed in constraint > > expressions within a class scope (of course). Randomize is > > not a static method. > > > > Arturo > > > > -----Original Message----- > > From: owner-sv-ec@eda-stds.org > > [mailto:owner-sv-ec@eda-stds.org] On Behalf Of William Paulsen > > Sent: Thursday, July 20, 2006 9:22 AM > > To: sv-ec@eda-stds.org > > Subject: [sv-ec] Is "super" OK in constraint expressions? > > > > A quick question, > > > > Is using "super" OK in constraint expressions? The LRM is > > clear that "this" is OK only in non-static methods, but it's > > not clear if "super" > > is OK outside methods. "this" and "super" share the same bnf > > "implicit_class_handle" production. > > > > Thanks, > > Bill > > > > > >Received on Fri Jul 21 10:50:27 2006
This archive was generated by hypermail 2.1.8 : Fri Jul 21 2006 - 10:50:50 PDT