[sv-ec] Questions/Issues on classes


Subject: [sv-ec] Questions/Issues on classes
From: Jay Lawrence (lawrence@cadence.com)
Date: Wed Mar 12 2003 - 04:57:01 PST


In the process of trying to write some examples of classes I found the
following other nitty-picking problems with the current class
definition that should be fixed and should be a quick vote or
explanation.

-------------------------------
Declaration of class parameters
-------------------------------

The current syntax for class parameters in the examples is

        class Foo_c #(parameter type p_t);
                ...
        endclass

This should be changed to be like module, interface, and program
parameters:

        class Foo_c;
                parameter type p_t;

                ...
        endclass

---------------------------
Declaration of 'new' method
---------------------------

None of the examples show a type on the declaration of the "new" method

        class Foo_c;

                function new;
        enclass

Is this OK or should we require/allow a type?

        class Foo_c;
                function Foo_c new;
        endclass

-----------------------------
Setting return value from new
-----------------------------

Is the "new" method allowed/required to set the return value?

None of the examples show it.

        class Foo_c;

                function new;
                begin
                        ...
                        new = this;
                endfunction

        endclass

----------------------------
Sensitivity of class objects
----------------------------

Will a change on the value of 'x' or 'x.i' wake up the following event
control?

        class C;
                int i;
        endclass

        C x;

        ...
        @(x)
        ...

===================================
Jay Lawrence
Architect - Functional Verification
Cadence Design Systems, Inc.
(978) 262-6294
lawrence@cadence.com
===================================



This archive was generated by hypermail 2b28 : Wed Mar 12 2003 - 04:57:44 PST