RE: [sv-ec] virtual methods issues - disable on virtual, virtual method with static life time

From: Steven Sharp <sharp_at_.....>
Date: Wed May 28 2008 - 14:18:31 PDT
>From: "Mirek Forczek" <mirekf@aldec.com.pl>

>
>What if we rewrite the code to:
>
>module top;
>        B b;A a=new;
>        initial  begin
>            b=a;
>            disable top.b.t; //which method would be disabled, does disable
>take polimorphism into account?

The "top.b" is a hierarchical reference to a handle.  The ".t" is not
part of a valid hierarchical reference.  If it was used in the statement

	top.b.t(i,j);
	
then the ".t" would be the method body following a method root.  If t
were a property and this was used in something like

	top.b.t = 0;
	
then the ".t" would be a select of a member.

In neither case is the ".t" part of a hierarchical name.  The fact that
a dot is used in hierarchical names, and that dot is used here, does not
make these hierarchical names.  The overloading of dot makes this
confusing, but the cases can be distinguished by what the identifiers
mean in each case.

>            top.b.t.i=10; //which method port would be assigned - does such
>assignment take polimorphism into account? ()
>            top.b.t.y=10; //which method port would be assigned - does such
>assignment take polimorphism into account? ()

Again, "top.b" is a hierarchical name for the class handle b.  The ".t"
could be used after it in a call to the method t, but this is not such
a call.

>The Hierarchical references starts with top-level instance (static
>hierarchy) now.
>
>Does this make the code legal ?

No.  The start of each of these dotted names is now a hierarchical
reference, but the entire thing is not.  The hierarchical path ends when
it reaches something that is not the name of a static scope (instance,
task, function, generate block, named begin-end or fork).  In this case
it stops when it reaches a variable, the handle b.  In some contexts,
further dots and identifiers can appear after the hierarchical path, to
select a member of a struct, union or class variable, or to call a method.


>Does the polymorphism issue arise back ?

No.

>
>Is that rule: "Hierarchical references cannot be started with class
>handles." expressed somewere in LRM text ?

In the merged LRM, section 22.6 describes what can appear in a
hierarchical path.  The new section 22.7 describes some distinctions
between member selects and hierarchical names.

Steven Sharp
sharp@cadence.com


-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
Received on Wed May 28 16:08:35 2008

This archive was generated by hypermail 2.1.8 : Wed May 28 2008 - 16:09:16 PDT