[sv-ec] ambiguities for class scope resolution operator for parameterized classes (8.24.1)

From: Francoise Martinolle <fm@cadence.com>
Date: Mon Jan 31 2011 - 12:19:54 PST

Is the unadorned name of the class strictly restricted to be legal when appearing as the first class scope of a
:: name within the scope of THAT class declaration and its tasks/functions?

Typical uses of the undornamed name is to use the unardorned name (meaning the self class parameterization) within a nested class
declaration such as in Ex1:

Ex1:
------
class A#(parameter p = 1);

    class B #(parameter p = 1);
    int mb;
        function new;
           mb = A::p + p; [1]
        endfunction
    endclass
 int ma = A::p; [2]
endclass

But the LRM does not state if the unadorned name can be used
ONLY in the first prefix if we have a multiple :: class scoped name?
Are 3 and 4 legal?
[4] is certainly not legal for B since we do not know which parameterization it refers to.

Ex2:
------
class A #(parameter p = 1);
  static int sa;

   class B #(parameter p = 1);
       static int sb;
       function f_b;
        return A::B::sb; [3]
   endclass

function f_a;
    return A::B::sb; [4]
endclass
endclass

[3] is A::B::sb equivalent to :

A(self)::B(self)::sb ?

 But can I write this as a legal name if I want to refer to the default specialization of B#():
 A::B#()::sb meaning A(self)::B#()::sb?

Ex3:
-------
can this special class scope rule also apply if we have a package/comp unit class scope name?

Replace the references above with $unit::A::p or put the class declarations in a package
and replace all the references to A:: with pkg::A::. is pkg::A:: illegal then or is it the special class scope to A(self)?

Are all [1], [2], [3], [4] legal names with references to $unit::A:: (or pkg::A::)?

consider this last example of mixed styles:
  class A #(parameter int p = 1);
   class B #(parameter q = 1);
       typedef logic [q:0] logic_B;

      class C #(parameter r = 1);
            typedef logic [q:r] logic_C;
            A::B#()::C n2a = 32'hffff; [1]
            A::B#()::C::logic_C n2l = 32'hffff; [2]
      endclass
   endclass : B
   class D;
           A::B#()::C d2a = 32'hffff; [3]

            A::B#()::C::logic_C d2l = 32'hffff; [4]
   endclass: B_c
endclass : A_c

Are [1], [2],[3] and [4] legal and if they are what do they mean?

Francoise

-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
Received on Mon Jan 31 12:20:58 2011

This archive was generated by hypermail 2.1.8 : Mon Jan 31 2011 - 12:21:19 PST