[sv-bc] Re: [sv-ec] Query Related to package instantiation

From: Gordon Vreugdenhil <gordonv_at_.....>
Date: Wed Jul 25 2007 - 09:43:25 PDT
That doesn't matter.  File boundaries have nothing to do with
the kind of design unit item a name refers to.

For example:

   package p;
   endpackage

   module top;
     p inst();
   endmodule

   module p;
   endmodule

You might get a warning if this was all in the same compile
(likely due to an overwrite of the design unit in the same compile)
but there is no requirement regarding ordering of compilation
and/or existence of modules, interfaces, etc.  Only package
use (import or ::) requires packages to exist.

Even if, for example, one had:

   package p;
       int x;
   endpackage

   module top;
     import p::*;
     int y = x;
     p inst();
   endmodule

I wouldn't assume that you'd get an error.  In the presence
of configurations it isn't clear that an implementation should
cause an error since an instance specific configuration
could change the design unit in play for "inst" and it isn't
at all obvious to me that *any* checking should be in
play for the instance name at compile time.

Basically, I don't think there is really a strong argument
for ever getting a compile error on an instantiation due
to the kind of design unit that might exist at the time,
even if there are incompatible uses of the same design unit
name.

Gord.




Bresticker, Shalom wrote:
> And if the two are in the same file?
> 
> Shalom
>  
> 
>> -----Original Message-----
>> From: owner-sv-ec@server.eda.org 
>> [mailto:owner-sv-ec@server.eda.org] On Behalf Of Gordon Vreugdenhil
>> Sent: Wednesday, July 25, 2007 5:09 PM
>> To: Moumita
>> Cc: sv-bc; sv-ec; sv-ac
>> Subject: Re: [sv-ec] Query Related to package instantiation
>>
>>
>> This would be valid at compile time since the system could 
>> not guarantee that the user would not subsequently compile 
>> "bottom" as a module and there is no requirement that 
>> *modules* exist at compile time.
>>
>> However, if this is the entire design, it should produce 
>> errors on elaboration.
>>
>> Gord.
>>
>>
>> Moumita wrote:
>>> Hello,
>>>
>>> Accroding to LRM package can not be instantiated but most of the 
>>> simulator passing package instantiation.
>>>
>>> So plesae let me know whether following testcase is  valid or not?
>>>
>>> Example::
>>>
>>> package bottom;
>>> endpackage
>>>
>>> module top;
>>> bottom M1(); // package  instantiation  is correct ?
>>> endmodule
>>>
>>> Thanks ,
>>>
>>> Moumita
>>>
>>>
>>>
>> --
>> --------------------------------------------------------------------
>> Gordon Vreugdenhil                                503-685-0808
>> Model Technology (Mentor Graphics)                gordonv@model.com
>>
>>
>> -- 
>> This message has been scanned for viruses and
>> dangerous content by MailScanner, and is
>> believed to be clean.
>>

-- 
--------------------------------------------------------------------
Gordon Vreugdenhil                                503-685-0808
Model Technology (Mentor Graphics)                gordonv@model.com


-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
Received on Wed Jul 25 09:43:48 2007

This archive was generated by hypermail 2.1.8 : Wed Jul 25 2007 - 09:43:56 PDT