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

From: Bresticker, Shalom <shalom.bresticker_at_.....>
Date: Thu Mar 19 2009 - 02:28:47 PDT
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

--
This message has been scanned for viruses and
dangerous content by MailScanner<http://www.mailscanner.info/>, and is
believed to be clean.
---------------------------------------------------------------------
Intel Israel (74) Limited

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.

-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
Received on Thu Mar 19 02:30:34 2009

This archive was generated by hypermail 2.1.8 : Thu Mar 19 2009 - 02:33:03 PDT