Re: [sv-bc] What type of return stmt allowed in class constructor?

From: Gordon Vreugdenhil <gordonv_at_.....>
Date: Thu Jan 03 2008 - 07:16:15 PST
No return value is permitted from the user code -- the return value is
determined by the implementation.

I agree that it isn't clear from the LRM but that is the way that
things must currently behave.  At some point it would be conceivable
to allow C++ style user defined memory allocators and then allow
user-determined return values but we're a long way from having
enough language infrastructure to allow that.

Gord.

Surya Pratik Saha wrote:
> Hi,
> As per LRM:
> *The new operation is defined as a function with no return type, and 
> like any other function, it must be non-blocking.
> Even though new does not specify a return type, the left-hand side of 
> the assignment determines
> the return type.*
> 
> It is not clear from the text, which type of return statement is 
> allowed. Consider the following cases:
> program class20;
> 
> class A;
> bit b;
> reg r;
> 
> A a;
> function new(bit i, reg j);
> b = i;
> r = j;
> return a;
> endfunction
> 
> endclass
> 
> A a;
> 
> endprogram
> Is the above case valid.
> Also what will happen if only 'return;' is used?
> 
> -- 
> Regards
> Surya
> 
> 
> -- 
> This message has been scanned for viruses and
> dangerous content by *MailScanner* <http://www.mailscanner.info/>, 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 Thu Jan 3 07:57:54 2008

This archive was generated by hypermail 2.1.8 : Thu Jan 03 2008 - 07:58:11 PST