[sv-bc] Parameter types: question about scope


Subject: [sv-bc] Parameter types: question about scope
From: Rishiyur S. Nikhil (nikhil@bluespec.com)
Date: Fri Sep 12 2003 - 10:46:14 PDT


I have a small question about Parameters (LRM Section 20).

(My apologies if this has already been discussed; I'm new to the
 e-mail list, and I could not find this topic in the archives.)

Question/Issue:

    In a parameter list, can a type parameter be followed by another
    parameter of that type? e.g.,

        module foo #(parameter type T = int; parameter T x = 0;)

    For example, this would be useful to parameterize a module over a
    type (T) and an initial value (x) of that type.

    In other words, does the scope where T can be used include the
    rest of the parameter list? Or does it begin after the parameter
    list?

    (Of course, in this example, if the actual parameter for T is not
     an integral type, then the default initializer '0' for x may
     not typecheck.)

Thanks,

Nikhil
----------------------------------------------------------------
Rishiyur S. Nikhil
nikhil@bluespec.com



This archive was generated by hypermail 2b28 : Fri Sep 12 2003 - 10:48:26 PDT