[sv-bc] visibility with parameterized types

From: Paul Graham <pgraham@cadence.com>
Date: Wed Oct 06 2004 - 12:23:49 PDT

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:23:52 2004

This archive was generated by hypermail 2.1.8 : Wed Oct 06 2004 - 12:24:09 PDT