Subject: [Fwd: Re: [sv-bc] Parameter types: question about scope]
From: Rishiyur S. Nikhil (nikhil@bluespec.com)
Date: Fri Sep 12 2003 - 13:49:55 PDT
(Forwarding my response to Mark Hartook that I originally sent just to
him. Nikhil)
-------- Original Message --------
Subject: Re: [sv-bc] Parameter types: question about scope
Date: Fri, 12 Sep 2003 16:47:54 -0400
From: Rishiyur S. Nikhil <nikhil@bluespec.com>
To: Mark Hartoog <Mark.Hartoog@synopsys.com>
References: <NGEBIPIGDOEMMEDCGNHPEEKLEEAA.markh@synopsys.com>
Hi Mark,
Thanks for your response.
Mark Hartoog wrote:
>>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.
>>
>>
>
>I see no reason whey this should not be allowed, although the BNF is
>a little vague.
>
In general it's hard to express such a constraint in BNF, assuming such
a constraint is intended.
(Another example of a constraint that is hard to express in BNF is in
the Verilog 2001 manual
section 12.1.3.2, which says "Both genvar assignments in the for-loop
shall assign to the
same genvar ... The first genvar assignment in the for-loop shall not
reference the loop index
variable on the right hand side." It's very hard to express such
context-sensitive
constraints in the BNF, which is mostly a context-free notation).
So, re. my original question, I hope there can be some text in Section
20 of the LRM,
to clarify this. I'm hoping someone can clarify what is intended, and
then one could
propose a sentence in Section 20 to make that intention clear.
>By the way, the correct syntax for these parameters is comma separated.
>It was a mistake on the V2k LRM BNF that had the ';' separator. The IEEE
>errata committee has voted to correct this, and it is corrected in the
>System Verilog LRM.
>
Ah! Ok, thanks for that clarification.
Nikhil
----------------------------------------------------------------
Rishiyur S. Nikhil, Ph.D. Email: nikhil@bluespec.com
Chief Technology Officer http://www.bluespec.com
Bluespec, Inc. Cell: +1.617.359.0747
c/o Sandburst Corporation Tel: +1.978.689.1679
600 Federal Street Fax: +1.978.794.1835
Andover, MA 01810, USA
This archive was generated by hypermail 2b28 : Fri Sep 12 2003 - 13:51:30 PDT