altermod
Alter model parameters
General form
altermod model parameter [=] value altermod @model[parameter] [=] value
Change a parameter of a .model in the current circuit. Every device that uses the model sees the new value from the next analysis on: altermod doesn't run anything itself. The change lasts until the circuit is loaded again or reset.
It works like alter, which changes device parameters, and the value is given in the same way: an expression, or a list of values in square brackets. The = is optional, and parameter names are not case sensitive. Unlike a device, a model has no principal value, so a parameter must always be named.
The model parameters of each device are listed in the device reference, and showmod prints their current values.
Examples
.model nmod nmos level=1 vto=1 kp=20u ... altermod nmod vto = 1.5 altermod @nmod[kp] = 40u
Stepping a threshold voltage in a .control script:
foreach vt 0.6 0.8 1.0
altermod nmod vto = $vt
dc vg 0 5 0.05
end
.step can step a model parameter too, and optimise can adjust one to meet a goal.
Errors
altermod only accepts a model name: altermod m1 vto = 1, where m1 is a device, is an error. Likewise alter on a device can't set a model parameter; use altermod on the device's model, and remember that this changes every device using it.