The Designer's Guide Community
Forum
Welcome, Guest. Please Login or Register. Please follow the Forum guidelines.
Jun 30th, 2024, 9:13am
Pages: 1
Send Topic Print
Why use macros to define Verliog-A model/instance parameters? (Read 28 times)
TomH_vams
New Member
*
Offline



Posts: 1
USA
Why use macros to define Verliog-A model/instance parameters?
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)
Back to top
 
 
View Profile   IP Logged
Ken Kundert
Global Moderator
*****
Offline



Posts: 2385
Silicon Valley
Re: Why use macros to define Verliog-A model/instance parameters?
Reply #1 - 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.
Back to top
 
 
View Profile WWW   IP Logged
Pages: 1
Send Topic Print
Copyright 2002-2024 Designer’s Guide Consulting, Inc. Designer’s Guide® is a registered trademark of Designer’s Guide Consulting, Inc. All rights reserved. Send comments or questions to editor@designers-guide.org. Consider submitting a paper or model.