RE: [sv-bc] visibility with parameterized types

From: Rich, Dave <Dave_Rich@mentorg.com>
Date: Wed Oct 06 2004 - 12:56:43 PDT

 This should be related to http://www.eda.org/svdb/bug_view_page.php?bug_id=0000026

I think the answer should be yes. See the thread starting at http://www.eda.org/sv-bc/hm/1783.html

Dave

-----Original Message-----
From: owner-sv-bc@eda.org [mailto:owner-sv-bc@eda.org] On Behalf Of Paul Graham
Sent: Wednesday, October 06, 2004 12:24 PM
To: sv-bc@eda.org
Subject: [sv-bc] visibility with parameterized types

Does using a parameterized type have an effect on visibility? For instance:

    module sub #(parameter type t = int)
             (input t x, ...);
        ...
    endmodule

    module top();
        typedef struct { bit f1, f2; } mystruct;
        typedef enum {red, blue, green} color;

        sub #(mystruct) u1((...);
        sub #(color) u2(...);
    endmodule

If sub is instantiated with type mystruct, then within sub are the fields f1 and f2 visible?

        assign y = x.f1; // ??

If sub is instantiated with type color, then within sub are the colors red, blue, and green visible?

        assign y = (x == blue); // ??

These components of the types are not directly visible within sub, but I wonder if they are somehow imported through the type parameter.

Paul
Received on Wed Oct 6 12:56:49 2004

This archive was generated by hypermail 2.1.8 : Wed Oct 06 2004 - 12:56:52 PDT