1) The open-source Verilog-A compiler ADMS uses the "type" attribute,
specified in front of each parameter, to differentiate.
2) One commercial simulator requires an attribute on the module
(rather than on the parameters) to indicate all the instance
parameters for the module.
(* compact_module = "mosfet" *)
(* instance_parameter_list = "L,W" *)
module newmosmodel( d, g, s, b);
3) The Verilog-AMS LRM has a powerful system called "paramsets" to
specify this.
At the CMC meeting last week, there was some preference for 1) for two
reasons: first, that an open-source tool uses it, and second, that the
R2_CMC and R3_CMC models use this syntax. Are there any objections to
making this a CMC recommendation?
If we use lower case -- which would match the way built-in
model parameters are done in case-sensitive simulators --
we have a problem when the parameter conflicts with a
Verilog-AMS keyword.
For example, in BSIMSOI, there is a parameter "LN" -- we
can't use "ln" because that conflicts with the natural log.
r2_cmc and r3_cmc use lowercase, as does Hicum.
However, more use uppercase: Mextram, BSIMSOI, PSP, Mosvar,
HiSIM-HV, diode_cmc.
To avoid conflicts with keywords in the case of lower-case parameters, we
can recommend using escaped identifiers:
===========================================
module testme;
parameter real \if = 1.2M;
analog begin
if(\if < 0) $strobe("Warning!");
end
endmodule
===========================================
This is LRM-compliant and reasonably straightforward. Adding the backslash
is a little bit of a hassle, but sure beats having to type all the
parameters using uppercase in the model body.
- Boris
-----Original Message-----
From: cmc-ve...@googlegroups.com [mailto:cmc-ve...@googlegroups.com] On Behalf Of Boris Troyanovsky
Sent: Friday, December 16, 2011 12:08 AM
To: cmc-ve...@googlegroups.com
Subject: Re: [cmc-verilog-a] Re: Parameter Declarations
For Geoffrey's example, any current netlist using "ln" at the netlist
level would transparently work with a Verilog-netlist using "\ln "
internally. And of course for a non-keyword, having an escape is
equivalent to not having it (ie, "\hello " and "hello" are the same entity
in Verilog-A/D/AMS).
I chose to make all the parameters upper-case; Boris is
pointing out that I could have used "\ln"
I happen to like code that uses upper-case parameter names,
because then it's easy to tell, as I read the code, what is
a parameter and what is a variable.