RE: [sv-ec] scope of external constraints unspecified

From: Arturo Salz <Arturo.Salz_at_.....>
Date: Fri Dec 16 2005 - 14:21:13 PST
Francoise,

 

External constraints should be declared in the same scope as the
declaration.

This is indirectly stated in the LRM. Section 13.4.1 says:

 

    Constraint block bodies can be declared outside a class declaration,
just like external task and function bodies:

 

And section 7.22, which describes external task/function declaration
states:

 

    Out-of-block declarations must be declared in the same scope as the
class declaration.

 

This should probably be more explicitly stated in section 13.4.1.

 

            Arturo

 

________________________________

From: owner-sv-ec@eda.org [mailto:owner-sv-ec@eda.org] On Behalf Of
francoise martinolle
Sent: Friday, December 16, 2005 12:50 PM
To: sv-ec@eda.org
Subject: [sv-ec] scope of external constraints unspecified

 

 

Is it legal to have the external constraint declared in the module which
is importing the class type from a

package? Or do external constraints need to be in the same design unit
scope as where the constraint declaration

appears?

I do not see anything specified regarding this in section 13.4.1 of the
LRM which describes external constraints.

 

Ex:

 

package p;
class A;
 rand bit [3:0] a_bit;
constraint c1; 
endclass 
endpackage 


module top ();
import p::*;

 

constraint A::c1 {a_bit inside {[1: 4]};}

endmodule

 

 

Now if we do allow this, what happens if different modules importing the
package have a different constraint

definition?

 

Francoise

       '
Received on Fri Dec 16 14:21:23 2005

This archive was generated by hypermail 2.1.8 : Fri Dec 16 2005 - 14:21:34 PST