.if and .else
.if (condition_1) Statements .elseif (condition_2) Statements .else Statements .endif
Description
Specifies the different conditions that determine the components that are instantiated by the Spectre FX simulator for a given simulation. The determining conditions are computed from the values of parameter expressions. You can specify these conditions with the structural .if/.else statement. These statements can be embedded.
Arguments
Example
The following example illustrates the use of the .if statement. There are additional .if statements in the statement1 and statement2 fields.
.param cvalue=1p
.if (rseries == 0)
c1 a b cvalue
.if (gparallel != 0)
rgp1 a b '1/gparallel'
.endif
.else
r2 a x rseries
c2 x b cvalue
.if (gparallel != 0)
rgp2 x b '1/gparallel'
.endif
.endif
In the above example, the Spectre FX simulator adds different instance statements into the simulation depending on the values of the parameters, rseries and gparallel.
-
If both
rseriesandgparallelare zero, the simulator includes the instance statement for capacitorc1. Ifrseriesis zero andgparallelis a non-zero value, the simulator includes the instance statements for capacitorc1and resistorrgp1. -
If
rseriesis non-zero andgparallelis zero, the simulator includes the instance statements for resistorr2and capacitorc2. -
If neither
rseriesnorgparallelis zero, the simulator includes the instance statements for resistorr2, capacitorc2, and resistorrgp2.
Related Topics
Return to top