Subject: Localparam documentation bug??
From: Clifford E. Cummings (cliffc@sunburst-design.com)
Date: Fri Jan 04 2002 - 17:27:36 PST
Hi, All -
Did we miss adding an important localparam definition to the Verilog-2001
Standard description and BNF?
I thought we discussed that a localparam could be placed in an ANSI-style
parameter list and that its position would be ignored if the module were
instantiated with positional parameter redefinition. The reason this is
important is because an engineer might want to use the localparam value,
calculated from other parameters, in the ANSI-style port declarations. Take
for example the following multiplier example:
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
We want to protect the YWIDTH parameter and calculate it from the WIDTH
parameter values of the two inputs, but we also want to use the YWIDTH
value to declare the ANSI-style output port of this multiplier.
The BNF appears to be missing the option to permit localparam's in the
ANSI-style parameter list, and the localparam description is pretty short
and does not address the issue.
Please, somebody tell me that we covered this somewhere in the Standard or
that we intended for this capability to be included in the Standard?
We will certainly want to fix this in the SystemVerilog Standard.
Regards - Cliff
//*****************************************************************//
// 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 : Fri Jan 04 2002 - 17:34:07 PST