RE: [sv-bc] typedefs in separate compilation units

From: Warmke, Doug <doug_warmke_at_.....>
Date: Fri Feb 18 2005 - 00:11:32 PST
Francoise,
 
From Clause 6.9.2 in Draft4:
   The scope of a type identifier includes the hierarchical instance
scope. This means that each instance with user
   defined types declared inside the instance creates a unique type. To
have type equivalence among multiple
   instances of the same module, interface, or program, a type must be
declared at higher level in the compilation
   unit scope than the declaration of the module, interface or program,
or imported from a package.

Separate compilation units are akin to separate hierarchical instance
scopes.
So type identifiers in those scopes, even if defined identically, should
not be equivalent.
There is no notion of "bringing the compilation units together" at any
point.
(I wouldn't mind seeing some language clarifying the above point added
to the LRM)
 
Clause 19 states that tools shall provide means by which users can
control
the definition of what a compilation unit is, ranging from each file is
its own
unit up to all the files in the design are a single unit.  But this is
orthogonal
to the question you ask, since in your question you are assuming that
the
compilation units are indeed different.
 
Regards,
Doug


________________________________

	From: owner-sv-bc@eda.org [mailto:owner-sv-bc@eda.org] On Behalf
Of Francoise Martinolle
	Sent: Thursday, February 17, 2005 7:25 PM
	To: sv-bc@eda.org
	Subject: [sv-bc] typedefs in separate compilation units
	
	
	It seems that the definition of type compatibility does not 
	consider the practical case of separate compilation units.
	 
	Consider a global typedef declared at the compilation unit
scope.
	 
	Consider the same exact global typedef declared in another
compilation unit.
	 
	The design brings these two compilation units together.
	 
	I think it is the user intent that these types be compatible
such that
	ports connecting objects of these types are legal and assignment
of values
	of objects of these types are also legal.
	Is that not the case?
	 
	Francoise
	       '
Received on Fri, 18 Feb 2005 00:11:32 -0800

This archive was generated by hypermail 2.1.8 : Fri Feb 18 2005 - 00:11:44 PST