Scope of Definition for a Device and for a Node

The scope of definition for a device is the "youngest" subcircuit whose scope of definition encompasses the device statement of the device in question. For the statements shown in the example below, the capacitor CB is considered to be defined in the subcircuit "SUB2" whereas the capacitor CA is considered to be defined in the subcircuit "SUB1".

Each device is considered to be local in its subcircuit in the sense that its name is only "made known" to this subcircuit and its name is not made available to other subcircuits. In the example below, the device names CA, RA, and XSUB are known only within the subcircuit SUB1, but not in the subcircuit SUB2. Similarly, the device names CB and RB are known only within the subcircuit SUB2. For devices which are controlled by the voltage or current of another device, such as some controlled sources, simple switches, and simple transistor switches, the controlling device must also be defined in the same circuit as the controlled device or SIMPLIS will not be able to locate the controlling device.

Similarly, the scope of definition for a node is the "youngest" subcircuit whose scope of definition encompasses the node name in question. For the statements in the example below, the nodes 101, 102, and 103 are considered to be defined in the subcircuit "SUB2" whereas the nodes 1, 2, and 3 are considered to be defined in the subcircuit "SUB1". Each node is considered to be local in its circuit and its name is not made available to other circuits. This rule for the scope of definition of a node applies to all nodes defined in a circuit except for node 0 .

If the option MAPNODE0 is turned off, which is the default case, node 0 in any subcircuit is treated as the same node as node 0 in the main circuit. If the option MAPNODE0 is turned on through an .OPTION statement, then node 0 in any subcircuit is considered to be defined locally in that particular subcircuit.

Since each device or node is only locally defined in its circuit of definition, it is acceptable to have the same device names and the node names used in different circuits.

Example 5.3
.SUBCKT SUB1 1 3
CA 1 2 10U IC=2
RA 2 3 10K
XSUB 2 3 SUB2
.SUBCKT SUB2 101 103
CB 101 102 10U IC=2
RB 102 103 10K
...
...
.ENDS SUB2
.ENDS SUB1