Surya, I don't recall any deep reason for the restriction, but it's not an accident. Does anyone actually want to declare class constructors with the antique flair of Verilog-1995? For example, the restriction was not listed by Jamie in http://www.eda.org/sv-ec/hm/1687.html For the evolution of this part of the BNF see the attachments in the following http://www.eda.org/sv-ec/hm/1611.html http://www.eda.org/sv-ec/hm/1622.html http://www.eda.org/sv-ec/hm/1714.html I can see how, for consistency, enhancing the copy constructor to allow old-style port declarations makes sense, yet if that enhancement were made, I don't think it would change how people actually write class constructors. -- Brad ________________________________________ From: owner-sv-bc@eda.org [owner-sv-bc@eda.org] On Behalf Of Surya Pratik Saha [spsaha@cal.interrasystems.com] Sent: Saturday, April 25, 2009 4:10 AM To: sv-bc@eda.org Subject: [sv-bc] Class constructor with non-ANSI style port Hi, Current BNF does not allow non-ANSI style port declaration inside class constructor. Is there any reason not to allow it. For the following e.g. module top; class C; int x; function new; input y; int y; x = y; endfunction endclass C x = new(1); endmodule Different simulators behave differently (some pass, some fail). -- Regards Surya -- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean. -- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean.Received on Sat Apr 25 08:34:48 2009
This archive was generated by hypermail 2.1.8 : Sat Apr 25 2009 - 08:35:40 PDT