The Designer's Guide Community Forum
https://designers-guide.org/forum/YaBB.pl
Modeling >> Semiconductor Devices >> Why use macros to define Verliog-A model/instance parameters?
https://designers-guide.org/forum/YaBB.pl?num=1719436097

Message started by TomH_vams on Jun 26th, 2024, 2:08pm

Title: Why use macros to define Verliog-A model/instance parameters?
Post by TomH_vams on Jun 26th, 2024, 2:08pm

Some verilog-a compact models heavily use macros to define model & instance parameters.
What is the purpose and benefit of this, compared to just using conventional parameter declarations?

Some examples from ASMHEMT 101.4, which defines nearly 40 such macros:

`define MPRnb(nam,def,uni,        des) (*units=uni,                   desc=des*) parameter real    nam=def;
`define MPRex(nam,def,uni,exc,    des) (*units=uni,                   desc=des*) parameter real    nam=def exclude exc;
`define MPRcc(nam,def,uni,lwr,upr,des) (*units=uni,                   desc=des*) parameter real    nam=def from[lwr:upr];
`define MPRoo(nam,def,uni,lwr,upr,des) (*units=uni,                   desc=des*) parameter real    nam=def from(lwr:upr);
`define MPRco(nam,def,uni,lwr,upr,des) (*units=uni,                   desc=des*) parameter real    nam=def from[lwr:upr);
`define MPRoc(nam,def,uni,lwr,upr,des) (*units=uni,                   desc=des*) parameter real    nam=def from(lwr:upr];
`define MPRcz(nam,def,uni,        des) (*units=uni,                   desc=des*) parameter real    nam=def from[  0:inf);
`define MPRoz(nam,def,uni,        des) (*units=uni,                   desc=des*) parameter real    nam=def from(  0:inf);

etc

and a few specific uses in ASMHEMT:
`MPRco( tnom           ,27.0           ,"deg C"       ,-`P_CELSIUS0,inf         ," Nominal Temperature in degree Celsius" )
`MPRcc( voff           ,-2.0           ,"V"           ,-100.0      ,5           ," Cut-off voltage" )
`MPRoo( kt1            ,0.0e-3         ,""            ,-inf        ,inf         ," Temperature Dependence for Voff" )


etc

I asked one of the original asmhemt developers about this, and he replied "the EDA publisher(s) wanted it".

I've seen same method used in PSP, MSIMCMG, and other compact models, so it's not simply a developer's preference.

What is advantage vs using simple parameter declarations?

Is it a convention that I'm simply unaware of?    Where would I find the relevant style manual? (I'm not a CMC member)

Title: Re: Why use macros to define Verliog-A model/instance parameters?
Post by Ken Kundert on Jun 27th, 2024, 8:48pm

I don't know, but if I were to guess, it is due to limitations in the various simulators they are supporting. By using defines, they can keep their standard definition of the model constant for all simulators, with the adaptation of the model to particular simulators using simulator specific defines.

The Designer's Guide Community Forum » Powered by YaBB 2.2.2!
YaBB © 2000-2008. All Rights Reserved.