RE: [sv-ec] Upward referencing rules question

From: Rich, Dave <Dave_Rich_at_.....>
Date: Thu Feb 07 2008 - 15:11:54 PST
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, and is
believed to be clean.
Received on Thu Feb 7 15:30:19 2008

This archive was generated by hypermail 2.1.8 : Thu Feb 07 2008 - 15:31:22 PST