UP

COMPONENT PROPERTY SYNTAX


Component property strings can be set in the usual way with the 'q' on a selected component instance or by menu Properties --> Edit

The dialog box allows to change the property string as well as the symbol reference. The property string is essentially a list of attribute=value items. As with symbol properties if a value has white space it should be double-quoted. The following property definitions are identical:

name=mchanged_name model=nmos w=20u l=3u m=10
 

name="mchanged_name" model="nmos" w="20u" l="3u" m="10"
 

Given the role of the " character, if quoted values are needed escapes must be used, like in the following example where the model name will be with quotes in netlist:

name="mchanged_name" model="\"nmos\"" w="20u" l="3u" m="10"
 

or

name="mchanged_name" model=\"nmos\" w="20u" l="3u" m="10"
 

the resulting SPICE netlist will be:
mchanged_name DRAIN GATE SOURCE BODY "nmos" w=20u l=3u m=10

There is no limit on the number of attribute=value items, each attribute should have a corresponding @attribute in the symbol definition format, but this is not a requirement. There are a number of special attributes as we will see later.

Important: a name=<inst_name> item is mandatory and must be placed in component property string to get a valid netlist, as this is the partname or so-called refdes (reference designator). If <inst_name> is already used in another component XSCHEM will auto-rename it to a unique name preserving the first letter (which ts a device type indicator for SPICE like netlists).

PREDEFINED COMPONENT ATTRIBUTES


TCL ATTRIBUTE SUBSTITUTION

Any attribute and symbol text can be embedded in a tcleval(....) construct, the string inside the parentheses will be passed to the tcl interpreter for evaluation. This allows to use any tcl variable/command/expression. Example:
value="tcleval([expr {[info exists ::resval] ? $::resval : {100k}}])"
this attribute will set value (example: value of a resistor) to 100k if global tcl variable resval is not set or to the value of resval if set.