RE: [sv-bc] Query related with default value to ref port.

From: Steven Sharp <sharp_at_.....>
Date: Mon Jul 13 2009 - 10:17:59 PDT
>From: "Rich, Dave" <Dave_Rich@mentor.com>

>Although I cannot find it in the LRM, I believe the intention of a ref
>argument is that it cannot be left unspecified. This probably needs to
>be explicitly stated.

The LRM says that defaults are allowed for ref arguments, so they can
definitely be left unspecified.  However, the default must be a legal
value to use as the actual argument.


>> When the subroutine is called, arguments with default values can be
>> omitted from the call, and the compiler
>> shall insert their corresponding values.".

Therefore, anything that is illegal to insert would also be illegal as
a default value.

 
>> So is the following testcase is valid
>> 
>> task automatic TASK1(ref bit signed [6:0] in1 = -16, input signed
>[5:0] in2,

The actual passed to a ref argument must be a variable.  You cannot
pass -16 to a ref argument, so you cannot use it as a default.


>> As most of the standard simulators are showing error for this.

As they should.


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 Jul 13 10:22:11 2009

This archive was generated by hypermail 2.1.8 : Mon Jul 13 2009 - 10:23:07 PDT