Subject: ANSI-Parameter List Bug and Ambiguities
From: Clifford E. Cummings (cliffc@sunburst-design.com)
Date: Tue Jan 08 2002 - 15:25:38 PST
VSG & BTF Members -
There is a bug in the Verilog-2001 BNF for the ANSI-C style parameters.
There are also a couple of ambiguities.
The Verilog-2001 BNF incorrectly shows that a semi-colon is required after
all parameter definitions in an ANSI-C style parameter list. Section 12.2
of the Verilog-2001 Standard shows an example of the intended use of ANSI-C
style parameters, where three parameters are defined, comma separated and
no comma or semicolon after the last parameter definition.
The BNF should be fixed (I could volunteer to propose the fix if all agree).
NOT CLEAR: What is not clear is whether semicolons should be required
between parameter assignments if the "parameter" keyword is repeated in the
list.
Did we want to broach the issue of localparam being added to the ANSI-C
parameter list? Below is a model that requires the ANSI-style localparam;
otherwise, the model would have to be coded using the more verbose
old-style parameters and ports.
module multiplier #(parameter AWIDTH=8, BWIDTH=8;
localparam YWIDTH=AWIDTH+BWIDTH)
(output [YWIDTH-1:0] y,
input [AWIDTH-1:0] a,
input [BWIDTH-1:0] b);
assign y = a * b;
endmodule
Should there be a semicolon before the localparam keyword? This is
inconsistent with ANSI-C ports where a comma separates the output, input,
inout keywords. I think it should be a comma and not a semicolon (for
consistency).
Also note - one complaint that I have heard about Verilog-2001
configurations is that we did not provide a means of changing parameters
from a config file. Seems like adding the #(.name(value)) syntax to the
instance assignment might be the best approach. I would recommend NOT
allowing defparam!
I would appreciate comments from both the BTF members and the Verilog
Standards Group. Aaargh!
Regards - Cliff Cummings
//*****************************************************************//
// Cliff Cummings Phone: 503-641-8446 //
// Sunburst Design, Inc. FAX: 503-641-8486 //
// 14314 SW Allen Blvd. E-mail: cliffc@sunburst-design.com //
// PMB 501 Web: www.sunburst-design.com //
// Beaverton, OR 97005 //
// //
// Expert Verilog, Synthesis and Verification Training //
//*****************************************************************//
This archive was generated by hypermail 2b28 : Tue Jan 08 2002 - 15:36:12 PST