Product Documentation
Virtuoso Schematic Editor SKILL Functions Reference
Product Version IC23.1, November 2023

defcell

defcell(
t_cellName
t_pinType
t_pinName
defsymbol
t_viewname
symbolProps
t_propName
g_propValue
defTermProp
t_defPinName
defVisibleProp
labelAttr
symbolParam
f_spacing
f_length
f_vLength
f_hLength
t_connector
t_origin
symbolLabels
t_labelText
controlParam
g_boolean
pinNumSpec
t_pinName
x_pinNumber
pinLocSpec
t_leftPinName
t_rightPinName
t_topPinName
t_bottomPinName
pinGraphicSpec
t_pinGraph
pinLogicSpec
t_posPin
t_negPin
clockPins
t_clockPin
)
=> t / nil

Description

Used with TSG template files to call lmdefcell.

defcell is classified as a control command in that it is used as a control in a tsg template file. When this template is read, lmDefCell() is run based on the defcell settings.

Arguments

t_cellName

The cell name portion of a symbol cellview into which the generated symbol is stored; must be enclosed in quotation marks.

t_pinType

The type of pin: must be enclosed in quotation marks.
Valid Values: input, output, io

By default, all input pins are drawn on the left side of the symbol from top to bottom, all output pins are drawn on the right side of the symbol from top to bottom, and all I/O pins are drawn on top of the symbol from left to right.

To move a pin to any other side, specify the pin in the pinLocSpec construct. If a pin specified in pinLocSpec is also specified in the output or io constructs, an error message is generated.

t_pinName

The name of the pin: must be enclosed in quotation marks.

defsymbol

Specifies symbol properties and parameters, control parameters, labels, and pin information. These values override applicable defaults.

t_viewName

The view name of the cellview to be created. If you specify t_viewName, it must be the first parameter in the defsymbol construct.
Default: symbol

symbolProps

Creates properties on the symbol cellview or properties on sets of terminal pins.

t_propName

The name of the property.

g_propValue

The value of the property to set; can be any of the following:

tnb_value 
tnb_value [ ( { { t_stringEnum | t_string } | { n_beginRange | nil } { n_endRange | nil } } ) ]
time( t_timeVal ) 
filename( t_filename ) 
ilExpr( t_ilExpr ) 
nlpExpr( t_nlpExpr ).

defTermProp

Defines properties on terminals.

t_defPinName

The pin name to define properties for.
Valid Values: all, input, output, inputOutput, top, bottom, left, right

defVisibleProp

Defines a property and the label attributes information for displaying that property.

labelAttr

Defines the attributes for the label.

symbolParam

Specifies symbol parameters. They can be included in any order without replication. They are not stored in the symbol master property list.

f_spacing

The minimum spacing between any pair of adjacent pin wires on a side, rounded to the nearest multiple of snap spacing.

f_length

The length of each pin wire (a pin stub), rounded to the nearest multiple of snap spacing
Default: twice the value of the wireSpacing field

f_vLength

The minimum length of the vertical sides, rounded to the nearest snap spacing. If the value you supply is less than the computed default, the computed default is used.

f_hLength

The minimum width of the horizontal sides, rounded to the nearest snap spacing. If the value you supply is less than the computed default, the computed default is used.

t_connector

The default pin connector graphic (each entry is mapped into a cellview that contains the graphics for the connector); must be enclosed in quotation marks.
Valid Values: square, block, circle

t_origin

The default placement of the symbol origin.
Valid Values: topLeftPin, bottomLeftPin, centerLeft

symbolLabels

Define symbol labels. If this construct is not specified, a set of default labels is generated on the symbol.

t_labelText

The text of the label; must be enclosed in quotation marks.

controlParam

Contains control parameters to define execution behavior.

This control parameter is not stored in the property list of the symbol master.

g_boolean

Use only when the specified symbol master already exists in the library. When set to t, TSG asks several questions interactively. When set to nil (the default), TSG assumes an existing symbol should be overwritten. It does not prompt you for permission to overwrite an existing symbol cellview.
Valid Values: t, nil
Default: nil

This control parameter is the only one that can be included in this construct and is not stored in the property list of the symbol master.

pinNumSpec

This construct is most often used for printed circuit board design libraries.

t_pinName

A pin name; must also be declared in input, output, or io.

x_pinNumber

A pin number.

pinLocSpec

Allows you to override default pin placement locations; specifies the pin location in any order without replication.

t_leftPinName

The names of pins to draw on the left of the symbol; must be enclosed in quotation marks. Must also be specified in the input, output, or io construct.

Other pins can be drawn on the left of the symbol. Pins specified in input are also drawn on the left of the symbol. A pin specified in input but not specified in pinLocSpec is drawn on the left before those in leftPins. A pin name in leftPins cannot be specified again in the other three subconstructs.

t_rightPinName

The names of pins to draw on the right of the symbol; must be enclosed in quotation marks. Must also be specified in the input, output, or io construct.

Other pins can be drawn on the right of the symbol. Pins specified in output are also drawn on the right of the symbol. A pin specified in output but not specified in pinLocSpec is drawn on the right before those in rightPins. A pin name in rightPins cannot be specified again in the other three subconstructs.

t_topPinName

The names of pins to draw on the top of the symbol; must be enclosed in quotation marks.

Other pins can be drawn on the top of the symbol. Pins specified in io are also drawn on the top of the symbol. A pin specified in io but not in pinLocSpec is drawn on the top before those in topPins. A pin name in topPins cannot be specified again in the other three subconstructs.

t_bottomPinName

The names of pins to draw on the bottom of the symbol; must be enclosed in quotation marks.

A pin name in bottomPins cannot be specified again in the other three subconstructs.

pinGraphicSpec

Identifies special pin graphics, such as negation bubbles and clock indicators, to be drawn with the specified pins.

t_pinGraph

Identifies special pin graphics, such as negation bubbles and clock indicators.
Valid Values: actHi, actLo, ieeeActLo, clock, actLoClock
Default: actHi

Each of these values must match an entry in the schConfig.il file.

pinLogicSpec

Using this construct is not recommended, but it remains supported for backward compatibility. The pinGraphicSpec construct is the preferred method for specifying special pin graphics.

Specifies negation indicators.

t_posPin

A list of pin names that indicate the positive logic type of the pins; must be enclosed in quotation marks.

t_negPin

A list of pin names that indicate the negative logic pin type; must be enclosed in quotation marks. Negative pins appear in the symbol as a bubble.

clockPins

Using this construct is not recommended, but it remains supported for backward compatibility. The pinGraphicSpec construct is the preferred method for specifying special pin graphics.

Specifies the display of clock indicators.

t_clockPin

A list of pin names that indicate clock pins. Any pins must also be specified in input, output, or io. Clock pins are designated by a small triangle next to the pin.

Value Returned

t

Command successfully run.

nil

Command failed.

Examples

defcell("count4"
input("clock" "reset")
output("a0" "a1" "a2" "a3")
defsymbol(
symbolProps(
partName = "count4" ; cellview prop with valueType=string
pinNum = (4 (0 24))
timeVal = time("Jan 1 12:00:00 1993")
color = ("red" ("red" "green" "blue"))
defTermProp(
input Iih = 1.24 ) ; all input pins get property "Iih".
defTermProp(
all b=6 ) ; all pins get property "b".
symbolParam(
wireSpacing = 0.125000
wireLength = 0.250000
vSideLength = 0.000000
hSideLength = 0.000000
origin = topLeftPin
pinConnector = "block"
)
symbolLabels(
defLabel( name("[@partName]")
location( "(xleft + xright)/2:(ytop + ybottom)*3/4")
labelType(NLPLabel)
layer(device)
purpose(label)
)
defLabel( name("[@instanceName]")
location( "xleft:(ytop + ybottom)/2")
labelType(NLPLabel)
justification(upperLeft)
layer(instance)
purpose(label)
apply(cellview)
fontHeight(0.1)
)
defLabel( name("{pinName}")
location( "1.15*stubLength:0")
justification(centerLeft)
apply(left)
)
defLabel( name("[@p_{pinName}]")
location( "-stubLength/2:0.03125")
labelType(NLPLabel)
layer(pin)
purpose(annotate)
apply(right)
)
)
pinNumSpec( "a0":16 "a1":17 "a2":18 )
pinGraphicSpec( "reset":ieeeActLo "clock":clock )
)
)

Related Topics

tsg

Text-to-Symbol Generator

g_propValue

labelAttr


Return to top
 ⠀
X