Re: [sv-ec] creating object in constant function call

From: Ajeetha Kumari <ajeetha_at_.....>
Date: Thu Mar 19 2009 - 02:37:51 PDT
From a user perspective I don't see a need for this, infact this is
likely a user error - so it is better to
error out.

Regards
Ajeetha, CVC
www.noveldv.com

On Thu, Mar 19, 2009 at 2:58 PM, Bresticker, Shalom
<shalom.bresticker@intel.com> wrote:
> Since constant functions are evaluated at elaboration time, I would assume
> that it is forbidden.
>
> Shalom
>
> ________________________________
> From: owner-sv-ec@server.eda.org [mailto:owner-sv-ec@server.eda.org] On
> Behalf Of Daniel Mlynek
> Sent: Thursday, March 19, 2009 10:54 AM
> To: sv-ec@server.eda.org
> Subject: [sv-ec] creating object in constant function call
>
> LRM is not explicit about creating an object in constant funcion call -
> should it be allowed? Should it be forbidden - see below example:
>
>
> module top;
>  parameter p=10;
>
>  int j;
>
>  class C;
>   int i;
>   function new;
>    $display("constructor");
>   endfunction
>  endclass
>
>  function int f7(int i);
>   C c = new;
>   return i;
>  endfunction
>
>
>  reg [f7(10):0] r7;
>
> endmodule
>
>
> DANiel
> --
-- 
Ajeetha Kumari
  * A Pragmatic Approach to VMM Adoption
  * SystemVerilog Assertions Handbook
  * Using PSL/SUGAR
Design Verification Consultant,
Contemporary Verification Consultants Private Limited,
Bangalore, India, http://www.noveldv.com

-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
Received on Thu, 19 Mar 2009 15:07:51 +0530

This archive was generated by hypermail 2.1.8 : Thu Mar 19 2009 - 02:38:50 PDT