.subckt or .macro
.subcktsubckt_name[port1 ... portn] [par1 = val1 ... parn = valn] [m =value]
.macrosubckt_name[port1 ... portn] [par1 = val1 ... parn = valn] [m =value]
Description
The .subckt or .macro statements specify the beginning of a subcircuit definition. A subcircuit can have zero ports when all the nodes used in the subcircuit definition are declared as global. A subcircuit definition can contain elements, subcircuit calls, nested subcircuit definitions, as well as simulation output statements. The parameters can be declared within the subcircuit definitions using the .subckt or .macro command, or on a subcircuit call. Multipliers are also supported on subcircuits (for example, m=2).
Example
.subckt inv in out w = wval l = lval m1 out in vdd vdd pmos w = vval*3 l = lval*2 m2 out in gnd gnd nmos w = wval l = lval
.eom
x1 n1 n2 inv w = 1e-06 l = 2.5e-07
Tells the Spectre FX simulator to define a subcircuit named inv that has two ports and takes two parameters, w and l. It is instantiated by a call named x1, which passes the values for w and l.
Return to top