RE: [sv-ec] class related questions

From: Neil Korpusik <Neil.Korpusik_at_.....>
Date: Thu Jul 10 2008 - 18:38:42 PDT
<forwarding bounced email from Gordon Vreugdenhil>


Subject: RE: [sv-ec] class related questions
Date: Wed, 9 Jul 2008 20:52:14 -0700
From: "Vreugdenhil, Gordon" <gordon_vreugdenhil@mentor.com>
To: "Mark Hartoog" <Mark.Hartoog@synopsys.com>,
         "Rich, Dave" <Dave_Rich@mentor.com>,
         "Francoise Martinolle" <fm@cadence.com>, <sv-ec@server.eda.org>


Absolutely; sorry for not addressing that aspect as well
in my response -- I was focusing on the forward referencing
aspects that Francoise also raised.  I should have also raised
the required #() aspect that Mark addressed.

Thanks Mark.

Gord

-----Original Message-----
From: owner-sv-ec@server.eda.org on behalf of Mark Hartoog
Sent: Wed 7/9/2008 4:45 PM
To: Rich, Dave; Francoise Martinolle; sv-ec@server.eda.org
Subject: RE: [sv-ec] class related questions
=20
module top;

class C #(parameter q =3D 0, parameter type T =3D byte);

endclass

=20

parameter p =3D C::q;

parameter type R =3D C::T;

=20

According to 8.24.1 this is illegal. You cannot use the unadorned name
of a parameterized with the scope resolution operator outside of the
class or its out of block method declarations. This would be legal if
you used C#()::q and C#()::T.

=20

From: owner-sv-ec@eda.org [mailto:owner-sv-ec@eda.org] On Behalf Of
Rich, Dave
Sent: Wednesday, July 09, 2008 2:21 PM
To: Francoise Martinolle; sv-ec@eda.org
Subject: RE: [sv-ec] class related questions

=20

________________________________

From: owner-sv-ec@server.eda.org [mailto:owner-sv-ec@server.eda.org] On
Behalf Of Francoise Martinolle
Sent: Wednesday, July 09, 2008 1:29 PM
To: sv-ec@server.eda.org
Subject: [sv-ec] class related questions

=20

Question 1:

Can you use the "dot" to refer to a type declared inside a class?

module top;

class C;

   typedef bit T[4];

endclass

C c =3D new;

    bit b;

    initial

       b =3D c.T'{0, 1, 0, 1};

endmodule

=20

The bnf for assignment pattern type does not allow the above, neither

does it allow C::T'{0, 1, 0, 1}

=20

I also remember that we decided that hierarchical identifiers to types
are not legal, but does c.T qualifies

as a hierarchical identifier? or is it just what we called a dotted
name?

[DR] You can not use a dotted name as a type. The only exception is with
an interface port. And had introduced the scope operator '::' at the
time, we should have used that instead of allowing '.'.

=20

I think C::T should be allowed as we have used it resolve Mantis 1857.
It might be an oversight in the BNF.

=20

=20

Question 2:

=20

Can a parameter initial expression be a class scoped identifier?

The LRM currently only allows package references. I assume this is not
legal:

=20

module top;

class C #(parameter q =3D 0, parameter type T =3D byte);

endclass

=20

parameter p =3D C::q;

parameter type R =3D C::T;

=20

endmodule

[DR] Again, I think there is LRM text to support this usage in terms of
parameters that are nested in classes, but no BNF. For example T::p
refers to the parameter up in the class hierarchy.

=20

class C #(parameter p =3D 0) extends T;

parameter q =3D T::p;

endclass

=20

Another example, T::p refers to a parameter within the class

class C #(parameter type T =3D int);

parameter q =3D T::p;

endclass

=20

=2E

=2

--=20
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 Thu Jul 10 18:39:19 2008

This archive was generated by hypermail 2.1.8 : Thu Jul 10 2008 - 18:39:55 PDT