Subcircuits allow you to construct hierarchical circuits by including a circuit block within a schematic or system diagram. The circuit block can be a schematic, a netlist, an EM structure, or a data file.
After adding a data file to a project, (see “Importing Data Files”), the data file displays under Subcircuits in the Elements Browser, and you can drag and drop it into a schematic or system diagram like any other subcircuit.
A subcircuit can be one of many types including data files, netlists, schematics, and EM structures.
To add a subcircuit element to a schematic or system diagram:
Click Subcircuits in the Elements Browser. The available subcircuits display in the lower window pane. These include all of the schematics, netlists, system blocks, and EM structures associated with the project, as well as any imported data files added to the project.
To place the desired subcircuit, click and drag it into the schematic or system diagram, release the mouse button, position it, and click to place it.
Alternatively, you can add a subcircuit by clicking the Subcircuit button on the toolbar or by choosing Draw > Add Subcircuit or typing Ctrl + K from within a schematic to display the Add Subcircuit Element dialog box. For more information about this dialog box, see “Add Subcircuit Element Dialog Box”. Specify the required information, click OK, and then drop the subcircuit into the schematic or system diagram window.
For schematics as subcircuits only, you can right-click a schematic in the Project Browser and drag it into a schematic or system diagram window to add it as a subcircuit. Choose Insert Subcircuit Here on the menu that displays when you drop the schematic in the window.
When adding a subcircuit via the Draw menu or using the Ctrl + K hotkeys, you can decide how to handle the grounding type for the subcircuit. (For more information about this dialog box, see “Add Subcircuit Element Dialog Box”). After placing a subcircuit you can change its grounding type by double-clicking the subcircuit to display the Element Options: SUBCKT dialog box and clicking the Ground tab to view options. For more information about this dialog box, see “Element Options Dialog Box: Ground Tab”.
is the default setting and the most common. In this case the ground used is ideal ground.
The default symbol in this mode is a box with the nodes spaced around the outside of it. The following figure shows a two-port subcircuit.
An explicit ground node can be viewed as a local ground for the subcircuit file. It is important to understand that the same ground is used for all ports in the subcircuit. This implies that physically, the structure is electrically small, or has a very good (perfect) internal grounding system connecting the ports. Normally, exposing the ground node is used for transistor data, where a common ground node in the measurement is being exposed.
The default symbol in this mode is a box with the nodes spaced around the outside of the box and one additional node with a ground symbol to indicate which node is exposing the ground node. The following figure shows a two-port subcircuit using the explicit ground setting.
To better understand the explicit ground node, the following diagram shows how you can recreate the explicit ground setting using transformers.
Balanced ports extend the exposed ground node concept by creating a local ground node for each port. It is possible to misuse this concept so you should familiarize yourself with the following sections on limitations.
The default symbol in this mode is a box with the nodes spaced around the outside of the box. The symbol has text indicating which node is the positive and negative terminal of the port. The following figure shows a two-port subcircuit using the balanced ports setting.
For more than two ports, the terminals for each port are along the same side of the symbol. The following figure shows a three-port subcircuit using the balanced ports setting.
To better understand the balanced ports, the following diagram shows how you can recreate the balanced setting using transformers.
Exposing the ground is a perfectly valid concept when properly used, but, unfortunately, it is often misapplied. As an example, assume you start with a two-port S-parameter file. By exposing the ground, a three-port S-parameter file is obtained, with the third port being the "local ground" return. Remember, the assumption is that the local grounds of the ports are electrically the same (they are connected to each other by a very, very good ground return). The exposed node connects to that ground return. By doing this, for example, an engineer can DC bias the ground return. Typically, this procedure is used for transistor S-parameters. Transistors have three ports, but when measuring a transistor with a network analyzer, one port is grounded, and a two-port S-parameter file results. By exposing the ground node of the S-parameter file, a designer can attach elements to the previously grounded port, for example, an inductance to the common source node. This concept can also be used where the transistor is housed in a package and the global circuit ground is attached to the "transistor package's ground." The key point is that this method works because the local grounds of the ports are essentially the same, and are attached to each other by a perfect grounding structure.
A common mistake is to assume that imperfect ground properties can be observed by looking at the exposed node, for example, the loss of the ground plane. The exposed ground approximation assumes the ports’ local grounds are the same; however, imperfect ground properties would make the ports' local grounds different voltages. There is even greater confusion with multi-port S-parameter files, where differential ports, or local grounds, are requested. For example, a two-port S-parameter file will now have four ports, with Port 3 corresponding to Port 1's "ground," and Port 4 corresponding to Port 2's "ground." This can be a useful tool, but unfortunately is misunderstood by many designers who incorrectly assume they are looking at the "local ground" of the port. For example, they mistakenly think they can measure the resistance of the original lossy ground by placing an Ohmmeter across the two new "ground" ports. The original S-parameter file did not have this information (it assumed the local grounds were at the same voltage!). These ports were created by the mathematical operation of adding transformers. A math trick cannot recover lost physics, no matter how hard a designer tries.
To edit subcircuit parameters:
Click on the subcircuit in the schematic or system diagram window to select it.
Right-click, and choose Edit Subcircuit. The subcircuit opens in the workspace.
Double-click an entity in the subcircuit to display the Element Options dialog box. You can edit subcircuit entities like any other entities, as described in “Editing Element Parameter Values”.
To change the grounding type of the subcircuit, click the Ground tab in the Element Options dialog box and select the appropriate type. Ground type may only be specified for one or two port subcircuits.
You can edit the name of the network referenced by the subcircuit directly on the schematic. To edit the NET parameter on the schematic, double-click this parameter name and then select the name of the network to use.
The AWR Design Environment platform supports parameterized subcircuits, which allow subcircuits to use values passed in from system diagrams or schematics at a higher level in the hierarchy. Creating a parameterized subcircuit requires creating variables and equations to express the parameter values. The following AWR Microwave Office example shows the types of variables and equations that you must create. For details on creating variables and equations, see “Variables And Equations”.
This AWR Microwave Office example demonstrates how to create and use a parameterized subcircuit. The example shows a model of a simple thin-film capacitor implemented as a parameterized network. A passed-in parameterized variable is created using the following syntax:
VariableName << DefaultValue
The following figure shows the use of the parameterized subcircuit within another schematic. You can change the values passed in by editing the W or L parameter of the subcircuit. The passed-in variables do not have units, but when they are assigned to an element that has units, they use the element units. This is consistent with variable use within the schematics. For example, if the passed-in value for W is 20, then the value used for the W parameter of TLI (in the previous diagram) is 20 um.
When parameterized subcircuits have passed-in variables that
units set (in the Edit Equation dialog
box), equations Unit Type is not set to
Scalar, and dependent parameters
do not use base
units, you can select Scale exported parameters with units to user unit
values on the Options
dialog box Schematic tab to scale the values passed in from the parent to user units
(project units as opposed to base units) in the child. Starting in V13, passed parameters with
units are scaled correctly with this option set.
By default, Scale exported parameters with units to user unit values is selected, but for projects prior to V13, the software checks to see if there are any documents that are not set to use base units, and that have passed parameters with units. If this combination of events is detected, this option is cleared for every document where this scenario is detected to prevent changing the behavior of any documents that may have applied manual rescaling of the equations in previous versions of the software. If you want to enable this option for a document in which it is auto-disabled, you may need to rewrite some of your equations to take care of the difference in unit scaling.
Parameterized subcircuits draw the geometry by scaling the subcircuit parameters that affect the layout. By default, a parameterized subcircuit has the same layout as the subcircuit. To create a parameterized subcircuit with layout, simply create a passed-in variable for parameters that affect layout. For example, the Thin Film Capacitor with layout cells in the following figure has parameters L and W as passed parameters. When this subcircuit is used in another schematic, you can change the exposed layout parameters for each instance, and the layout changes accordingly.
The subcircuit shown in the previous figure is used twice in another schematic, as shown in the following figure, and its passed parameters are altered. The layout updates accordingly.
If the parameters passed into the subcircuit do not affect layout, the subcircuit's default layout displays. For example, capacitor dielectric thickness or process corners.
To prevent a parameter from affecting the layout:
Right-click the parameter equation and choose Properties to display the Edit Equation dialog box. See “Edit Equation Dialog Box” for more information.
Select Parameter definition under Variable Type.
Select the Does not affect layout check box under Parameter Description.
If the element does not have an associated layout, you can also use the Cell Stretcher to create the parameterized subcircuit with layout.
For a parameterized layout cell, the passed-in parameters are unitless, so the parameterized subcircuit should be designed to have unitless parameters passed in, to make it compatible with existing layout cells. For example, the following parameterized subcircuit is designed to work with um length units (1e-6 m).
As shown in the following figure, you need to specify the values of W and L in meters for the subcircuit instance.
Select the subcircuit, right-click, choose Properties and then click
the Layout tab to assign the subcircuit instance a layout cell to draw
that uses the W and L parameters. If you choose the TFC (thin-film capacitor) layout cell, the
following layout is produced from the previous circuit (read in the
MMIC.lpf file in the program directory
/Examplessubdirectory to re-create this example).
You can create parameterized layout cells using the Layout Cell Wizard. For more information on layout cells, see “Layout Overview ”.
For a Cell Stretcher, you set up the artwork cell and Cell Stretcher objects as described in “Stretching Artwork Cells”, and then assign the subcircuit's layout as the newly created artwork cell configured for cell stretching.
An alternative to using the parameterized equation syntax for specifying parameterized subcircuits is to set variables as inherited parameters. An inherited parameter is a parameter that is passed down through hierarchy from the top level without requiring you to explicitly pass the parameter from each subcircuit. To change a variable inheritance value you can use the Tune tool and press Ctrl (weak) or Shift (strong) when you select the variables. Alternatively, you can change the Pass Down Mode in the Edit Equation dialog box (see “Edit Equation Dialog Box”). The setting is indicated by a red box around the variable. A solid red box indicates strong dependency and a dashed box, a weak dependency. The following example demonstrates how the values for W and L display when strong and weak dependencies are set.
The following figure shows the subcircuit where the variables "L" and "W" are used, but not defined on the schematic.
The following figure shows the "L" and "W" parameters being passed down strong to the subcircuit.
The following figure shows the "L" and "W" parameters being passed down weak to the subcircuit.
Note that subcircuit variables with a strong dependency override any other variable values from that level and down the hierarchy. Subcircuit variables with a weak dependency are only used if there is no other definition of that variable.
Variables defined in the Global Definitions window do not have an inheritance setting; they effectively always have weak inheritance.