Subject: Re: ANSI-Parameter List Bug and Ambiguities
From: Adam Krolnik (krolnik@lsil.com)
Date: Wed Jan 09 2002 - 10:25:40 PST
Good morning all;
A few comments about this code:
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
1. I would not have expected the local parameter definition to be
part of the #() syntax, rather part of the signal declarations.
2. Paul's suggestion may work some times when the usage is small
and the operation simple.
We have a queue with a parameteric size. E.g.
parameter QDEPTH = 4;
parameter QWIDTH = 24+24+3;
parameter QDEPTHEXPOSED = QDEPTH; // how may Q entries to output.
parameter QINPUTDEPTH = 2; // how many Q entries to take in.
Internally we generate several parameters based on these values.
These would be local parameters. E.g.
parameter QSIZE = QWIDTH*QDEPTH;
parameter QIN = QWIDTH*QINPUTDEPTH;
parameter QOUT = QWIDTH*QDEPTHEXPOSED;
There are 48 uses of these parameters in the module (of 216 lines.)
Several uses of the local type parameters are in the definition of
the module and some in the body of the code. Restricting the usage
to only in the code creates a potential place for errors since you
must maintain two definitions of the values.
It would really be nice to have it work as we intended.
Cliff mentioned,
"Also note - one complaint that I have heard about Verilog-2001
configurations is that we did not provide a means of changing
parameters"
You can refer to it like #(), but if this was included, it would
in effect be equivalent to a defparam. It may not suffer the
problems of defparams (which order to apply them) since there
should be very few.
Also missing in the configuration files is how to explain where any
compiled versions of the library elements may be stored. We have
this very good facility to describe libraries of verilog code, but
the vendors/users now need to create another file to say, for
this library/tool/version, look here in this directory for
the precompiled library elements...
E.g. ModelTech can compile verilog to a library format.
They create a file (modelsim.ini by default) that provides this
information for the tool:
[Library]
others = /tools/modeltech/5.3a/bin/../sunos5/../modelsim.ini
design = build/design.mtlib
std_rtl = build/std_rtl.mtlib
sve_g1 = build/sve_g1.mtlib
Then we simulate the design by calling out the components, and the
libraries in the search order.
vlog -lib work thetop -Ldesign -Lstd_rtl -Lsve_g1
It reads the 'modelsim.ini' file by default to find out where the
libraries are stored. For verilog 2001, all this could be
substituted for the configuration file/lib.map files if the location
could be stored as well.
Adam Krolnik
Verification Mgr.
LSI Logic Corp.
Plano TX. 75074
This archive was generated by hypermail 2b28 : Wed Jan 09 2002 - 10:34:34 PST