Re: [sv-bc] Modport expression examples

From: Steven Sharp <sharp_at_.....>
Date: Mon Dec 01 2008 - 16:16:43 PST
>> In Draft 7a, 25.5.4 has the following examples of modport expressions:
>[...]
>> The first example is 
>>   const int x=1;
>>   modport A (output .P(r[3:0]), input .Q(x), R);
>> I question this for two reasons. First, x is of type int, which is a
>> 2-state type.
>> The rules state that "input int x" should not be legal because it 
>> defaults to a net type and 2-state types are not allowed to be nets,
>> so the keyword "var" should need to be added.

This is not a module port declaration, and definitely not an ANSI-C-style
module port declaration.  It is not declaring the object x.  The object x
is declared inside the interface, as a variable.  The "port" declaration
in the modport is giving access to that object x under the name Q, through
modport A.  The "port" direction 'input' presumably creates some kind of
restrictions on accesses to Q (i.e. x) through modport A, though the LRM
doesn't clearly specify what these restrictions are.

Steven Sharp
sharp@cadence.com


-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
Received on Mon Dec 1 16:17:20 2008

This archive was generated by hypermail 2.1.8 : Mon Dec 01 2008 - 16:18:16 PST