2
CST Access SKILL Functions
Introduction
This chapter provides information about DFII constraint objects using Cadence® SKILL language. There are two objects:
- cstConstraintID can be layer constraint, layer-pair constraint, layer array constraint, or a simple constraint. It contains attribute values and parameters. The attribute values are represented in integer, float, string, or SKILL list. The parameters are represented in a SKILL list.
- cstConstraintGroupID is the container of member constraints and member constraint groups.
The following figure displays the relationship between cstConstraintID, cstConstraintGroupID, tech, cellview, and objects, and their attributes. The attributes of cstConstraintID and cstConstraintGroupID have either Read (R) or Read/Write (RW) access.

The following example illustrates that you can get the attributes of a member constraintGroup and a layerConstraint from the parentConstraintGroup, which contains them:
parentConstraintGroup~>objects~>
returns
(
(cst:0x080ef495 tech db:0x080ef892 cellview nil
objType "constraintGroup" name "maximumYield" defName
"userDefined" operator precedence owner nil
objects (cst:0x080ee9ea cst:0x080ee9eb)
)
(cst:0x080ee9df tech db:0x080ef892 cellview nil
objType "layerConstraint" name "C__187" defName
"minSpacing" layers ("METAL2") value 0.555
params nil hard nil ID
nil description nil
)
)
Constraint Functions
All constraint objects are defined by the constraint definition. Constraints always have a value associated with them and also a list of constraint parameters. There are four types of constraints: layer constraint, layer-pair constraint, layer array constraint, and simple constraint (has no layer).
The list of constraint functions is given below:
- cstCreateConstraint
- cstDeleteConstraint
- cstFindCutClassConstraintByName
- cstFindCutClassConstraintBySize
- cstGetUnreferencedConstraints
- cstGet1DTableValue
- cstGet2DTableValue
- cstGetTwoWidthTableValue
- cstIsId
cstCreateConstraint
cstCreateConstraint(g_cstConstraintGroupID t_constraintDefName g_layers g_value[l_params] [g_isHard] [g_append] [t_name] ) =>g_cstConstraintID/nil
Description
Creates a constraint in the constraint group (g_cstConstraintGroupID) with the specified constraint definition name (t_constraintDefName), layers, constraint value, constraint parameters, hard attribute, the position of the constraint with the members of the constraint group and the name of the constraint.
Arguments
Value Returned
|
Returns the ID of the constraint, which is created in the constraint group. |
|
Example
-
Layer constraint
tech = techOpenTechFile("tech" "tech.db" "a") foundryCG = cstFindConstraintGroupIn(tech "foundry" 't) cst1 = cstCreateConstraint(foundryCG "viaSpacing" list("viaLayer") 0.4 list(list('distance 0.5) list('numCuts 2)))
-
Layer-pair constraint
cst2 = cstCreateConstraint(foundryCG "minSpacing" list("metal1" "metal2")1.2)
-
Layer-array constraint
cst3 = cstCreateConstraint(foundryCG "minTouchingDirEnclosure" list("metal1""metal2" "cont") 1.0)
-
You can use nil for layers to create a simple constraint:
cst4 = cstCreateConstraint(foundryCG "validLayers" nil list("metal1""metal2"))
- Constraint with one-dimensional table value
tech=techOpenTechFile("test" "tech.db" "r")
foundryCG = cstFindConstraintGroupIn(tech "foundry" )
c = cstCreateConstraint(foundryCG "minSpacing" list("Metal1")
'(
(("width") 0.3)
(
0.2 0.25
0.3 0.26
0.4 0.27
0.5 0.28
)
);value
'(
('spacingDirection "vertical")
('sameMask t)
);params
);cstCreateConstraint
printf("Minspacing 1D:\n %L\n %L\n" c~>value c~>params)
tech=techOpenTechFile("test" "tech.db" "r")
foundryCG = cstFindConstraintGroupIn(tech "foundry" )
c = cstCreateConstraint(foundryCG "minSpacing" list("Metal1")
'(
(("width" "length") 0.3);header and default value
(
(0.2 2.0) 0.5
(0.2 3.0) 0.2
(0.7 2.0) 0.2
(0.7 3.0) 0.7
);table
);value
'(
('spacingDirection "vertical"
('sameMask t)
);parameters
);cstCreateConstraint
printf("Minspacing 2D:\n %L\n %L\n" c~>value c~>params)
tech=techOpenTechFile("test" "tech.db" "r")
foundryCG = cstFindConstraintGroupIn(tech "foundry" )
c = cstCreateConstraint(foundryCG "minDensity" list("Metal1")
'(
(("step") 10.0);header and default value
(
10 20.0
20 30.0
);table
);value
'(
('windowStepSize ((("window")) (60.0 100.0 120.0 200.0)))
);params
)
printf("minDensity:\n %L\n %L\n" c~>value c~>params) techCloseTechFile(tech)
cstDeleteConstraint
cstDeleteConstraint(g_cstConstraintID) =>t/nil
Description
Deletes the constraint from any of the constraint groups it is a part of. Its value and constraint parameters are also deleted.
Arguments
Value Returned
|
Returns t when |
|
Examples
cstDeleteConstraint(cstnet1l)
cstFindCutClassConstraintByName
cstFindCutClassConstraintByName(d_constraintGroupId tx_layer t_name) =>d_cutClassConstraintId/ nil
Description
Returns the database ID of the cut class constraint with a given cut class name, layer, and constraint group.
For more details, see cutClasses.
Arguments
Value Returned
Example
Retrieves the database ID of a cut class constraint named BAR0.2 on layer BAR0 in the constraint group referenced by grp.
cstId = cstFindCutClassConstraintByName(grp "BAR0" "BAR0.2")
cstFindCutClassConstraintBySize
cstFindCutClassConstraintBySize(d_constraintGroupId tx_layer n_width n_length g_checkOrientation) =>d_cutClassConstraintId/ nil
Description
Searches the specified layer in the specified constraint group and returns the first cut class constraint with the specified width and length. If g_checkOrientation is set to t, the orientation of the cut class will also be included as part of the search.
For more details, see cutClasses.
Arguments
|
When set to |
Value Returned
|
No matching cut class constraint was found on the specified layer. |
Example
Retrieves the database ID of a cut class constraint with width 0.2, length 0.3, and a fixed orientation on the layer BAR0.
cstId = cstFindCutClassConstraintBySize(grp "BAR0" 0.2 0.3 t)
cstGetUnreferencedConstraints
cstGetUnreferencedConstraints( {d_techID|d_cellViewID} ) =>l_unreferencedConstraints/nil
Description
Returns all the unreferrenced constraints not belonging to any constraint group in a database (a technology database or a cellview).
cstGetUnreferencedConstraints or cstGetConstraintGroups API.Arguments
Value Returned
|
Returns the identification of all the unreferenced constraints. |
|
|
Returns nil if there are no unreferenced constraints available for a constraint group in a database. |
Example
list_constraints = cstGetUnreferencedConstraints(techDB1)
foreach(danglingConstraint cstGetUnreferencedConstraints(cellViewId_1)
cstDeleteConstraint(danglingConstraint)
cstGet1DTableValue
cstGet1DTableValue(d_ConstraintIDn_index1) =>n_value
Description
Returns the value of the table for the given index. The index varies depending on the constraint. It can be a width or a length.
Arguments
Value Returned
Example
cstNDrule2_Int1DTbl~>value =
list(list(list("width") 0.4)
list(0.1 0.15 0.2 0.25 0.3 0.35 0.4 0.45)
)
((("width") 0.4)
0.1 0.15 0.2 0.25 0.3
0.35 0.4 0.45
)
cstGet1DTableValue(cstNDrule2_Int1DTbl 0.1)
cstGet2DTableValue
cstGet2DTableValue(d_ConstraintID n_index1 n_index2) =>n_value
Description
Returns the value of the table for the given indexes.
Arguments
|
The index can be a width or a length, which usually correspond to the row of the table. |
|
|
The index can be a width or a length, which usually correspond to the column of the table. |
Value Returned
Example
Int2DTbl~>value
((("width" "length") 0.33)
((0.0 0.1) 0.22
(0.0 0.3) 0.32
(0.2 0.1)
0.23
(0.2 0.3) 0.0
(0.4 0.1) 0.24
(0.4 0.3) 0.34
)
)
cstGet2DTableValue(Int2DTbl 0.0 0.1)
cstGetTwoWidthTableValue
cstGetTwoWidthTableValue(d_ConstraintIDn_index1 n_index2 n_index3) =>n_value
Description
Applies to the twoWidth table. It only returns the spacing value for a given width1, width2, and length.
Arguments
Value Returned
Example
twoWidthCst = cstCreateConstraint(foundry "minSpacing" list("metal1") list(list(list("twoWidths" "length") 0.0)
list(list(0.0 -0.001) 0.15
list(0.0 0.0) 0.2
list(0.0 1.5) 0.5
list(0.0 3.0) 1.0
list(0.25 -0.001) 0.2
list(0.25 0.0) 0.25
list(0.25 1.5) 0.5
list(0.25 3.0) 1.0
list(1.5 -0.001) 0.5
list(1.5 0.0) 0.5
list(1.5 1.5) 0.6
list(1.5 3.0) 1.0
list(3.0 -0.001) 1.0
list(3.0 0.0) 1.0
list(3.0 1.5) 1.0
list(3.0 3.0) 1.2)) list(list('widthLengthTableType "twoWidthPRL")))
cstGetTwoWidthTableValue(twoWidthCst 0.25 0.25 0.1)
cstIsId
cstIsId(g_id) =>t/nil
Description
Returns a Boolean that indicates whether the specified ID is a constraint ID.
Arguments
Value Returned
Example
cg1OnTopCV = cstCreateConstraintGroupIn(cv "cg1OnTopCV" "userDefined")
> cst:0x107ae616
cstIsId(nil)
> nil
cstIsId(cv)
> nil
cstIsId(cg1OnTopCV)
> t
Constraint Group Functions
The list of constraint group functions is given below:
- cstAddToConstraintGroup
- cstCreateConstraintGroupIn
- cstCreateConstraintGroupOn
- cstDeleteConstraintGroup
- cstFindConstraintGroupIn
- cstFindConstraintGroupOn
- cstFindFirstConstraint
- cstGetConstraintGroups
- cstGetDefaultConstraintGroupIdByName
- cstGetDefaultConstraintGroupName
- cstGetDefaultConstraintGroupNameById
- cstSetDefaultConstraintGroupName
cstAddToConstraintGroup
cstAddToConstraintGroup(g_cstConstraintGroupID g_memberConstraintGroupID[g_append] ) =>t/nil
Description
Adds a constraint group to be a member constraint group of the containing constraint. You can position the constraint group at the beginning of the members or at the end of the members with g_append. The default value for g_append is nil, which means that add the constraint group to the beginning of the members. The member constraint group cannot be owned by other objects.
Note: A member constraint group cannot be added to itself.
Arguments
Value Returned
|
Puts the constraint to the end of the member in the constraint group. |
|
|
Puts the constraint at the beginning of the members in the constraint group. |
Example
cstAddToConstraintGRoup (netcstGroup1 cvCstGroup1 nil)
Here, nil is for append argument.
cstAddToConstraintGroup(containingCG1 containedCG2 t)
cstCreateConstraintGroupIn
cstCreateConstraintGroupIn({d_techID | d_cellViewID } t_constraintGroupName [t_constraintGroupDefName] [g_operator] ) =>g_cstConstraintGroupID/nil
Description
Creates a constraint group in the technology database (that is, techDb) or a cellview with arguments of the database ID, constraint group name, constraint group definition name and operator symbol.
Arguments
Value Returned
|
Returns the ID of the constraint group, which is created in the technology database or a cellview. |
|
Example
Create a constraint group techCstGroup1 in a techDB (techDB1) with the default constraint group definition ("default") and precedence ('precedence).
techcstGroup1 = cstCreateConstraintGroupIn(techDB1 "techcstGroup1”).
Create a constraint group techCG2 in a techDB (techDB1) with a constraint group definition of "foundry" and a precedence of 'or.
techCG2 = cstCreateConstraintGroupIn(techDB1 "spacingCG1" "foundry" 'or)
Create a constraint group cvcstGroup1 in a cellview (cv1).
cvcstGroup1 = cstCreateConstraintGroupIn(cv1 "cvcstGroup1”).
cstCreateConstraintGroupOn
cstCreateConstraintGroupOn(g_object t_constraintGroupDefName[g_operator] ) =>g_cstConstraintGroupID/nil
Description
Creates a constraint group on an object (for example, net, term, and so on) with arguments of the object ID, constraint group definition name, and operator symbol. The constraint group definition name is required while constraint group operators are optional for this SKILL function.
Arguments
Value Returned
|
Returns the ID of the constraint group, which is created in the technology database or a cellview. |
|
|
Returns nil if the constraint group is not created on an object. |
Example
netcstGroup1 = cstCreateConstraintGroupOn (net1 "inputTaper" "'precedence").
netCG2 = cstCreateConstraintGroupOn(net1 "outputTaper" 'or)
cstDeleteConstraintGroup
cstDeleteConstraintGroup(g_cstConstraintGroupID) =>t/nil
Description
Deletes the constraint group (g_cstConstraintGroupID). The contained constraints in the constraint group are not automatically deleted when the constraintGroup is deleted.
Arguments
Value Returned
|
Returns t when the constraint group is successfully deleted. |
|
|
Returns nil when unable to find a constraint group that is to be deleted. |
Example
cstDeleteConstraintGroup(cstGroupID)
cstFindConstraintGroupIn
cstFindConstraintGroupIn({d_techID | d_cellViewID } t_constraintGroupName [g_localOnly] ) =>g_cstConstraintGroupID/nil
Description
Returns a constraint group ID (g_cstConstraintGroupID) from a database ID with constraint group name and a Boolean flag (g_localOnly).
Arguments
|
Looks for a constraint group in an ITDB graph if the database ID is a technology database.The default value is |
Value Returned
|
Returns the ID of the constraint group that is found in the database. |
|
|
Returns |
Example
foundryCGId = cstFindConstraintGroupIn(techDB1 "foundry" 't)
cv1CG1 = cstFindConstraintGroupIn(cellView1 "cvCG1")
cstFindConstraintGroupOn
cstFindConstraintGroupOn(g_object t_constraintGroupDefName) =>g_cstConstraintGroupID/nil
Description
Returns a constraint group ID (g_cstConstraintGroupID) from an object (g_object) with constraint group definition name.
Arguments
|
The DFII constraint group definition name. For information on this argument, refer to the cstCreateConstraintGroupOn function. |
Value Returned
|
Returns the ID of the constraint group that is found in an object. |
|
|
Returns nil if unable to find any constraint group in an object. |
Example
netcstGroup1 = cstFindConstraintGroupOn(net1 "inputTaper")
cstFindFirstConstraint
cstFindFirstConstraint(d_ConstraintGroupID t_constraintDefName[ (tx_layer[tx_purpose] )... ] [l_params] [g_onlyHard] ) =>d_ConstraintID/nil
Description
Searches a constraint group in the hierarchical order and returns the ID of the first constraint found with the given name, layers, purposes, and params. If the onlyHard argument is not specified, the first matching constraint is returned and it is possible that it is a hard constraint. If the onlyHard argument is specified, then the first matching hard constraint is returned.
Arguments
Value Returned
Example
cstfound = cstFindFirstConstraint(foundry "minSpacing" list("Metal2"))
cstfound = cstFindFirstConstraint(foundry "minSpacing" list("Metal2") nil t)
cstfound = cstFindFirstConstraint(foundry "minSpacing" list(list("Metal1" "drawing")) nil t)
cstGetConstraintGroups
cstGetConstraintGroups(g_cstConstraintID) =>l_containingConstraintGroups/nil
Description
Returns all the containing constraint groups for the constraint (g_cstConstraintID).
Arguments
Value Returned
|
Returns all the constraint groups that contain the particular constraint. |
|
|
Returns |
|
Example
list_CGs = cstGetConstraintGroups(constraintId)
cstGetDefaultConstraintGroupIdByName
cstGetDefaultConstraintGroupIdByName(d_cellView t_ConstraintGroupName) =>g_constraintGroupId/nil
Description
Returns the constraint group ID that is used by the default constraint group name on the objects of the cellview.
Arguments
Value Returned
Examples
cstGetDefaultConstraintGroupIdByName(cv "myCG")
=> cst:0x2b2ddfaa
cstGetDefaultConstraintGroupIdByName(cv "tech:default")
=> cst:0x2bc2df9a
cstGetDefaultConstraintGroupName
cstGetDefaultConstraintGroupName(d_cellView t_type[g_fallBackToWireCG])=>t_constraintGroupName/nil
Description
Returns the name of the default constraint group that is used on the objects of the cellview according to the specified application type.
Arguments
Value Returned
Examples
cstGetDefaultConstraintGroupName(cv1 "Wire")
=> "tech:default"
cstGetDefaultConstraintGroupName(cv2 "Wire")
=> "default"
cstGetDefaultConstraintGroupName(cv1 "Setup")
=> ""
cstGetDefaultConstraintGroupName(cv3 "Wire")
=> "tech:cg1(refTechDB2)"
cstGetDefaultConstraintGroupNameById
cstGetDefaultConstraintGroupNameById(d_cellView) =>t_constraintGroupName/nil
Description
Returns the name of the default constraint group name by cellview and constraint group ID.
Arguments
|
The cellview is allied with the specified constraint group and application type. |
Value Returned
Examples
cstGetDefaultConstraintGroupNamebyId(cv1 cgId)
=> "tech:default"
cstGetDefaultConstraintGroupNamebyId(cv2 cgId2)
=> "myCG"
cstGetFoundryCGName
cstGetFoundryCGName()=> t_constraintGroupName
Description
Returns the name of the alternate foundry constraint group. If there is no alternate foundry constraint group specified, it returns the name of the foundry constraint group.
Arguments
Value Returned
|
The name of the alternate foundry constraint group (if specified) or the foundry constraint group. |
Example
Returns the name of the alternate foundry constraint group specified:
cgName = cstGetFoundryCGName()
cstGetFoundryConstraintGroup
cstGetFoundryConstraintGroup(d_techID) =>d_cgID/nil
Description
Returns the database ID of the alternate foundry constraint group specified for a given technology file. If there is no alternate foundry constraint group specified, it returns the ID of the foundry constraint group.
Arguments
Value Returned
Example
Returns the alternate foundry constraint group specified for the technology file assigned to pointer tfId:
cgID = cstGetFoundryConstraintGroup(tfId)
cstSetDefaultConstraintGroupName
cstSetDefaultConstraintGroupName(d_cellview t_constraintGroupName t_type) =>t/nil
Description
Sets the specified constraint group name to be used as the default constraint group on the objects of the cellview according to the specified application type.
Arguments
Value Returned
|
Returns t when the specified constraint group is used as the default constraint group. |
|
|
Returns nil when unable to use the specified constraint group as the default constraint group. |
Example
cstSetDefaultConstraintGroupName(cv1 "default" "Wire")
cstSetDefaultConstraintGroupName(cv1 "dsn:default" "Wire")
cstSetDefaultConstraintGroupName(cv1 "tech:foundry" "Setup")
cstSetDefaultConstraintGroupName(cv1 "foundry" "Wire")
Return to top