Chapter 6: Advanced Editing
plug
6-8: Text
6-8-5: Cell Parameters
plug


Parameters are special pieces of text that are passed from icon instances to the schematic cells. Parameters are defined in the icon or schematic cell, and then they appear on the icon instances. Users can set different values on each icon instance, and these values will be passed down into the schematic and applied as necessary. The computer-programming equivalent of this is that the cell's parameter is the "formal" value and the instance parameters are the "actual" values.

For example, an inverter schematic may have transistor sizes defined with a parameter. The actual transistors inside of the inverter schematic will use the parameter values, and each inverter instance will have a different parameter value, causing that particular inverter to have a different transistor ratio. Another example of the use of cell parameters is in the Spice primitives, where user-defined values (such as voltage) are communicated into the icon for generation in the Spice deck (see Section 9-4-4).

To define parameters on a cell, it is necessary to be editing either the schematic or one of its icons (it does not matter which, because the set of parameters is the same inside of the cell group). Use the Cell Parameters... command (in menu Edit / Properties).

A list of parameters is shown at the top. You can create a new parameter by typing its name in the "Name" field, its default value in the "Value" field and then clicking the "Create New" button. If "Show new parameter on instances" is checked, this new parameter will be seen on all instances with its default value.

Figure 6.18

The "Edit" button next to the "Value" field lets you change the value in a separate dialog (useful for major changes). You can delete a parameter with the "Delete" button and change its name with the "Rename..." button. You can also copy parameters from another parameterized cell using the "Copy From Cell..." button.

The bottom part of the dialog has controls for the appearance and nature of the selected parameter.

The "Done" button terminates this dialog. Note that there is no "Cancel" button: this dialog makes changes as they are entered.

Special Considerations

To use a parameter inside of a cell, create text that has the code set to "Java" and has a "@" in front of the parameter name. For example, if a cell has the parameter "size" defined and you want a transistor in the cell to be size*2 in width, then edit the transistor and set its width to "@size*2" and its code to "Java".

To display the current value of a parameter from up the hierarchy, create a piece of "Annotation Text" (found in the "Misc" entry of the component menu) and set its "code" to Java and its value to "@PNAME" (where PNAME is the parameter name). Note that when a parameter is used in a cell but there is no value from up the hierarchy, the text appears as "not found".

Parameters on cells are not tied to any node or arc. Instead, they float freely inside of the cell. You can select the text and drag it to any location in the cell.

Parameters get inherited when the cell is instantiated. This means that each new icon, when created, will have all of the parameters shown on it, with default values. You can select any of these pieces of text and edit their text or other information (with the exception of the "Units" field which must match the defined parameter's units). If you delete a parameter's text, the parameter remains, but with its default value.

Parameters on instances of cells are placed at the same location as they appear inside of the icon cell. To change the location on all subsequently created icon instances, move the location in the icon.

If a parameter is added to a cell without checking "Show new parameter on instances", existing instances of that cell will not show the parameter. To see the parameter at a later time, use the Update Parameters on Node command (in menu Edit / Properties). To do this everywhere, use the Update Parameters all Libraries command.

It is sometimes desirable for each instance parameter to have a unique value. When the default value of a parameter inside the schematic or icon cell has "++" in it, then the number before that will be incremented after each new icon instance is created. Similarly, a "--" indicates that the number be decremented after instance is created. This allows all instance parameters to be given unique values.


Prev Previous     Contents Table of Contents     Next Next