Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
VAMS-LRM-2-3-1.pdf
Скачиваний:
43
Добавлен:
05.06.2015
Размер:
3.73 Mб
Скачать

Accellera

 

Version 2.3.1, June 1, 2009

VERILOG-AMS

3.4.6 String parameters

String parameters can be declared. Strings are useful for parameters that act as flags, where the correspondence between numerical values and the flag values may not be obvious. The set of allowed values for the string can be specified as a comma-separated list of strings inside curly braces. String parameters may be used with the string operators listed in Table 3-3.

Example:

module ebersmoll (c,b,e); inout c, b, e; electrical c, b, e;

parameter

string transistortype = "NPN" from '{ "NPN", "PNP" };

parameter

real alphaf = 0.99

from (0:inf);

parameter

real alphar = 0.5 from (0:inf);

parameter

real ies = 1.0e-17

from (0:inf);

parameter

real ics = 1.0e-17

from (0:inf);

real sign, ifor, irev;

 

analog begin

 

sign =

(transistortype == "NPN") ? 1.0 : -1.0;

ifor =

ies * (limexp(sign*V(b,e)/$vt)-1);

irev =

ics * (limexp(sign*V(b,c)/$vt)-1);

I(b,e)

<+ sign*(ifor - alphar * irev);

I(b,c)

<+ sign*(irev - alphaf * ifor);

end

 

 

endmodule

Note how the string parameter transistortype associates the string "PNP" with a negative one (-1) value for the variable sign. It is common in compact modeling of transistors for the equations to be formulated for NPN or NMOS devices, and behavior of a PNP or PMOS can be described by multiplying all the voltages and currents by -1, even though the “p” denotes positively-charged carriers in the channel of the PMOS.

3.4.7 Parameter aliases

Aliases can be defined for parameters. This allows an alternate name to be used when overriding module parameter values as described in 6.3. Parameters with different names may be used for the same purpose in different simulators; some compact models accept parameter names with the letter “O” in place of the number “0.”

Parameter aliases are subject to the following rules.

The type of an alias (real, integer, or string) shall be determined by the original parameter, as is its range of allowed values, if specified.

The alias_identifier shall not occur anywhere else in the module; in particular, it shall not conflict with a different parameter_identifier, and the equations in the module shall reference the parameter by its original name, not the alias.

Multiple aliases can point to the same parameter.

When overriding parameters, it shall be an error to specify an override for a parameter by its original name and one or more aliases, or by more than one alias, regardless of how the override is done (by name or using the defparam statement).

When the simulator generates a list of parameter values used, such as for an operating point analysis, only the original name shall appear in the list.

Copyright © 2009 Accellera Organization, Inc.

30

Соседние файлы в предмете [НЕСОРТИРОВАННОЕ]