No, I did mean that a1 is a variable name - an instance of a class handle if you prefer. The $display statement is inside the oo block, whose variable declaration of C a1 hides the scope name M a1. According the rules in 2217, since the first name in a1.num() is a variable, .num() is considered a member select of the variable a1, and the search does not continue beyond that. Dave ________________________________ From: Bresticker, Shalom [mailto:shalom.bresticker@intel.com] Sent: Thursday, February 07, 2008 7:52 PM To: Rich, Dave; danielm; sv-ec@server.eda.org Subject: RE: [sv-ec] Upward referencing rules question I think you mean, "Because a1 is visible as a scope name ...". Shalom ________________________________ From: owner-sv-ec@server.eda.org [mailto:owner-sv-ec@server.eda.org] On Behalf Of Rich, Dave Sent: Friday, February 08, 2008 1:12 AM To: danielm; sv-ec@server.eda.org Subject: RE: [sv-ec] Upward referencing rules question Daniel, It is an error as approved by mantis 2217. Because a1 is visible as a variable name where the reference occurs, the search does not continue beyond the block oo. Dave ________________________________ From: owner-sv-ec@server.eda.org [mailto:owner-sv-ec@server.eda.org] On Behalf Of danielm Sent: Wednesday, February 06, 2008 3:40 AM To: sv-ec@server.eda.org Subject: [sv-ec] Upward referencing rules question I cannot find rules for below reference in SV.I'm using reference to a1.num in named block "oo". In this block there is object variable named a1 but it has no "num" funcion The question is: Should seraching for matching function be stopped at this level or should the search be continued into module scope - where is "a1" instance which have "num" function. So below case should return error, or it should compile and return "5" in simulation? module M; function integer num(); num= 5; endfunction endmodule class C; reg r; endclass module top; M a1(); initial begin : oo C a1; $display(a1.num()); end endmodule DANiel -- This message has been scanned for viruses and dangerous content by MailScanner <http://www.mailscanner.info/> , and is believed to be clean. -- 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 Feb 7 23:51:23 2008
This archive was generated by hypermail 2.1.8 : Thu Feb 07 2008 - 23:52:04 PST