Product Documentation
Cadence Integrators Toolkit Database Reference
Product Version IC23.1, June 2023

22


Width Spacing Pattern Functions

This chapter includes the following topics:

WSP Technology File Functions

Width Spacing Pattern (WSP) technology file functions are used to operate with widthSpacingPattern, widthSpacingPatternGroup, widthSpacingSnapPatternDef, and relatedSnapPatterns objects in the technology database.

These functions have the ability to create, find, and delete objects, access object parameters, and iterate over the objects stored in the database.

To learn how to use WSP technology file functions, see Example- Using the WSP Technology File Functions.

Supported functions include:

Miscellaneous Technology File Functions

techMaskColorTypeToString

String
techMaskColorTypeToString(
int  type
);

Description

Converts a techColorMask type enum to a string holding the name of the corresponding mask color type. Valid input values are integers from 0 to 3, or integer constants techcGrayColorMask, techcMask1ColorMask, techcMask2ColorMask and techcMask3ColorMask, respectively.

Arguments

type

A techMaskColor type enum.

Return Value

String

A mask color type name. Valid values are “grayColor”, “mask1Color”, “mask2Color” and “mask3Color”.

techStringToMaskColorType

Boolean
techStringToMaskColorType(
constString         typeStr,
techColorMaskType   *type
);

Description

Converts the string holding a mask color type name to a techColorMask type enum. Valid input strings are “grayColor”, “mask1Color”, “mask2Color”, and “mask3Color”. The result is written to the memory area referenced by the type pointer.

Arguments

typeStr

A mask color type name.

type

Pointer to the memory area where the conversion result will be written. The value referenced by the pointer is undefined if FALSE is returned.

Return Value

Boolean

TRUE, if the conversion returned a valid result.

FALSE, in case of failure.

Width Spacing Pattern Functions

techAllocWidthSpacingPatternSpecArray

techRelatedSnapPatternsSpec*
techAllocWidthSpacingPatternSpecArray(
unsigned int numPatterns
);

Description

Allocates memory for the array of width spacing pattern specifications and initializes the memory with zeros.

Arguments

numPatterns

Number of width spacing pattern specifications to fit in the allocated memory.

Return Value

techRelatedSnapPatternsSpec*

   

Pointer to the allocated memory area.

techCreateWidthSpacingPattern

techWidthSpacingPatternId
techCreateWidthSpacingPattern(
techFileId                    techfile,
constString                   name,
techWidthSpacingPatternSpec   *patterns,
unsigned int                  numPatterns,
dbDistance                    offset,
Boolean                       isRepeatOffset,
techColorMaskType             startingColor,
Boolean                       isShiftColor
);

Description

Creates a width spacing pattern in the specified technology file.

Arguments

techfile

ID of the technology file in which the width spacing pattern is created.

name

Name for the width spacing pattern.

patterns

Array of pattern specifications.

numPatterns

Number of pattern specifications in the array of patterns.

offset

Distance of the first track from the period track.

isRepeatOffset

Flag to indicate whether the offset is applied when a pattern repeats.

startingColor

Color of the first track. If the color of the first track is not gray, all tracks are automatically colored such that the color pattern changes on each track. In other words, you cannot specify the color for a track other than the first one or leave a track uncolored.

isShiftColor

Flag to indicate whether track colors change when a pattern repeats. This attribute is used only when all tracks are individually colored. If no color is specified for a track, it remains uncolored (that is, gray).

Return Value

techWidthSpacingPatternId

ID of the created width spacing pattern.

techDeleteWidthSpacingPattern

Boolean
techDeleteWidthSpacingPattern(
techWidthSpacingPatternId   wspId
);

Description

Deletes the specified width spacing pattern object.

Arguments

wspId

ID of a width spacing pattern object.

Return Value

Boolean

TRUE, if the object was successfully deleted.

FALSE, if the object was not deleted.

techFindWidthSpacingPattern

techWidthSpacingPatternId
techFindWidthSpacingPattern(
techFileId  techfile,
constString name
);

Description

Searches for the width spacing pattern with the specified name in the specified technology file.

Arguments

techfile

ID of the technology file in which the search is performed.

name

Name of the width spacing pattern for which the search is performed.

Return Value

techWidthSpacingPatternId

ID of the width spacing pattern, if found.

Returns NULL in case of failure.

techFreeWidthSpacingPatternSpecArray

void
techFreeWidthSpacingPatternSpecArray(
unsigned int                numPatterns,
techWidthSpacingPatternSpec *patterns
);

Description

Deallocates the memory allocated for an array of width spacing pattern specifications.

In addition to deallocating the specified memory area, the function also frees the memory internally on the non-null colors, wireTypes, and specs members of each width spacing snap pattern specification in the array.

Arguments

numPatterns

Size of the deallocated memory area, measured in blocks of sizeof(techWidthSpacingPatternSpec) bytes.

patterns

Pointer to the memory area to deallocate.

Return Value

No value returned.

techGenWidthSpacingPattern

Boolean
techGenWidthSpacingPattern(
techGenStateId              pState,
techWidthSpacingPatternId   *wspId
);

Description

Retrieves the next width spacing pattern ID from the generator with the given techGenStateId. The widthSpacingPattern ID is returned in the wspId argument.

Arguments

pState

State ID for the generator.

relatedSPId

ID of the next widthSpacingPattern produced by the generator. This value is undefined if FALSE is returned.

Return Value

Boolean

TRUE, if ID of the next width spacing pattern is successfully generated.

FALSE, if the list is exhausted or an error occurs.

techGenWidthSpacingPattern

Boolean
techGenWidthSpacingPattern(
techGenStateId              pState,
techWidthSpacingPatternId   *wspId
);

Description

Retrieves the next width spacing pattern ID from the generator with the given techGenStateId. The widthSpacingPattern ID is returned in the wspId argument.

Arguments

pState

State ID for the generator.

relatedSPId

ID of the next widthSpacingPattern produced by the generator. This value is undefined if FALSE is returned.

Return Value

Boolean

TRUE, if ID of the next width spacing pattern is successfully generated.

FALSE, if the list is exhausted or an error occurs.

techGetWidthSpacingPatternAllowedRepeatMode

techWSPAllowedRepeatMode
techGetWidthSpacingPatternAllowedRepeatMode(
techWidthSpacingPatternId   wspId
);

Description

Returns the allowed repeat mode set for a width spacing pattern.

Arguments

wspId

ID of the width spacing pattern.

Return Value

techWSPAllowedRepeatMode

The allowed repeat mode set for the width spacing pattern.

techGetWidthSpacingPatternDefaultRepeatMode

techWSPRepeatMode
techGetWidthSpacingPatternDefaultRepeatMode(
techWidthSpacingPatternId   wspId
);

Description

Returns the default repeat mode set for a width spacing pattern.

Arguments

wspId

ID of the width spacing pattern.

Return Value

techWSPRepeatMode

The default repeat mode set for the width spacing pattern.

techGetWidthSpacingPatternName

String
techGetWidthSpacingPatternName(
techWidthSpacingPatternId   wspId
);

Description

Retrieves the name for the specified width spacing pattern object.

Arguments

wspId

ID of a width spacing pattern object.

Return Value

String

Name of the specified width spacing pattern object.

Returns NULL in case of error.

techGetWidthSpacingPatternOffset

dbDistance
techGetWidthSpacingPatternOffset(
techWidthSpacingPatternId   wspId
);

Description

Retrieves the offset, which is the distance of the first track from the period track, for the specified width spacing pattern object.

Arguments

wspId

ID of a width spacing pattern object.

Return Value

dbDistance

The offset value of the specified width spacing pattern object.

Returns 0 in case of error.

techGetWidthSpacingPatternPatterns

void
techGetWidthSpacingPatternPatterns(
techWidthSpacingPatternId   wspId,
unsigned int                *numPatternSpecs,
techWidthSpacingPatternSpec **patternSpecs
);

Description

Allocates a suitable amount of heap memory, and fills it with the array of pattern specifications of the specified width spacing pattern object. Pointer to the allocated memory area is returned through the patternSpecs parameter and the size of this memory area is returned through the numPatternSpecs parameter.

Arguments

wspId

ID of a width spacing pattern object.

numPatternSpecs

Pointer to the memory area where the number of pattern specifications is placed.

patternSpecs

Pointer to the memory area where the array of pattern specifications is placed.

Return Value

No value returned.

techGetWidthSpacingPatternRepeatOffset

Boolean
techGetWidthSpacingPatternRepeatOffset(
techWidthSpacingPatternId   wspId
);

Description

Retrieves the repeat offset flag for the specified width spacing pattern object. The repeat offset flag is a Boolean value indicating whether the offset is applied when a pattern repeats.

Arguments

wspId

ID of a width spacing pattern object.

Return Value

Boolean

Repeat offset flag of the specified width spacing pattern object.

Returns FALSE in case of failure.

techGetWidthSpacingPatternShiftColor

Boolean
techGetWidthSpacingPatternShiftColor(
techWidthSpacingPatternId   wspId
);

Description

Retrieves the shift color flag for the specified width spacing pattern object. The shift color flag is a Boolean value indicating whether the track colors shift when a pattern repeats.

Arguments

wspId

ID of a width spacing pattern object.

Return Value

Boolean

The shift color flag of the specified width spacing pattern object.

Returns FALSE in case of failure.

techGetWidthSpacingPatternStartingColor

techColorMaskType
techGetWidthSpacingPatternStartingColor(
techWidthSpacingPatternId   wspId
);

Description

Retrieves the color of the first track for the specified width spacing pattern object.

Arguments

wspId

ID of a width spacing pattern object.

Return Value

techColorMaskType

Color of the first track.

Returns techcGrayColorMask in case of error.

techSetWidthSpacingPatternRepeatMode

Boolean
techSetWidthSpacingPatternRepeatMode(
techWidthSpacingPatternId   wspId,
techWSPAllowedRepeatMode   allowedMode,
techWSPRepeatMode   defaultMode
);

Description

Sets the allowed and default repeat modes for a width spacing pattern.

Arguments

wspId

ID of the width spacing pattern.

allowedMode

The allowed repeat pattern mode.

defaultMode

The default repeat pattern mode.

Return Value

Boolean

TRUE, if the allowed and default repeat modes were set.

FALSE, if the allowed and default repeat modes were not set.

techStartGenWidthSpacingPattern

techGenStateId
techStartGenWidthSpacingPattern(
techFileId          techId
);

Description

Initializes a generator for all width spacing patterns in the specified technology file. A generator state ID is returned, which is used with the techGenWidthSpacingPattern function.

Arguments

techId

ID of the technology file containing the width spacing patterns to be generated.

Return Value

techGenStateId

State ID for the generator.

Width Spacing Pattern Group Functions

techCreateWidthSpacingPatternGroup

techWidthSpacingPatternGroupId
techCreateWidthSpacingPatternGroup(
techFileId   techfile,
constString  name,
constString  *patternNames,
unsigned int numPatternNames
);

Description

Creates a group of width spacing patterns in the specified technology file.

Arguments

techfile

ID of the technology file in which the width spacing pattern group is created.

name

Name of the width spacing pattern group.

patternNames

Array of the width spacing pattern names to include in the group.

numPatternNames

Number of elements in the array of pattern names.

Return Value

techWidthSpacingPatternGroupId

ID of the newly created width spacing pattern group.

techDeleteWidthSpacingPatternGroup

Boolean
techDeleteWidthSpacingPatternGroup(
techWidthSpacingPatternGroupId   WSPGId
);

Description

Deletes the specified width spacing pattern group object.

Arguments

WSPGId

ID of a width spacing pattern group object.

Return Value

Boolean

TRUE, if the object was successfully deleted.

FALSE, if the object was not deleted.

techFindWidthSpacingPatternGroup

techWidthSpacingPatternGroupId
techFindWidthSpacingPatternGroup(
techFileId  techfile,
constString name
);

Description

Searches for the width spacing pattern group with the specified name in the specified technology file.

Arguments

techfile

ID of the technology file in which the search is performed.

name

Name for the width spacing pattern group for which the search is performed.

Return Value

techWidthSpacingPatternGroupId

ID of the width spacing pattern group, if found.

Returns NULL in case of failure.

techGenWidthSpacingPatternGroup

Boolean
techGenWidthSpacingPatternGroup(
techGenStateId                   pState,
techWidthSpacingPatternGroupId   *wspGroupId
);

Description

Retrieves the ID of the next width spacing pattern group from the generator with the given techGenStateId. The widthSpacingPatternGroup ID is returned in the wspGroupId argument.

Arguments

pState

State ID for the generator.

wspGroupId

ID of the next width spacing pattern group produced by the generator. This value is undefined if FALSE is returned.

Return Value

Boolean

TRUE, if ID of the next width spacing pattern group is successfully generated.

FALSE, if the list is exhausted or an error occurs.

techGetWidthSpacingPatternGroupName

String
techGetWidthSpacingPatternGroupName(
techWidthSpacingPatternGroupId   WSPGId
);

Description

Retrieves the name for the specified width spacing pattern group object.

Arguments

WSPGId

ID of a width spacing pattern group object.

Return Value

String

Name of the specified width spacing pattern group object.

Returns NULL in case of error.

techGetWidthSpacingPatternGroupPatternNames

void
techGetWidthSpacingPatternGroupPatternNames(
techWidthSpacingPatternGroupId  WSPGId,
unsigned int                    *numPatterns,
String                          **patterns
);

Description

Allocates a suitable amount of heap memory and fills it with the array of pattern names of the specified width spacing pattern group. Pointer to the allocated memory area is returned through the patterns parameter and the size of this memory area is returned through the numPatterns parameter.

Arguments

WSPGId

ID of a width spacing pattern group object.

numPatterns

Pointer to the memory area where the number of pattern names is placed.

patterns

Pointer to the memory area where the array of pattern names is placed.

Return Value

No value returned.

techStartGenWidthSpacingPatternGroup

techGenStateId
techStartGenWidthSpacingPatternGroup(
techFileId          techId
);

Description

Initializes a generator for all width spacing pattern groups in the specified technology file. A generator state ID is returned, which is used with techGenWidthSpacingPatternGroup the function.

Arguments

techId

ID of the technology file containing the width spacing pattern groups to be generated.

Return Value

techGenStateId

State ID for the generator.

Width Spacing Snap Pattern Definition Functions

techCreateWidthSpacingSnapPatternDef

techWidthSpacingSnapPatternDefId
techCreateWidthSpacingSnapPatternDef(
techFileId          techId,
constString         name,
techLayerNum        layerNum,
techPurpose         purposeNum,
dbDistance          period,
Boolean             isHorizontal,
dbDistance          offset,
techSnappingLayer   *snappingLayers,
unsigned int        numSnappingLayers,
String              *patternNames,
unsigned int        numPatterns,
String              *patternGroupNames,
unsigned int        numPatternGroups,
String              defaultActive
);

Description

Creates a width spacing snap pattern definition object in the specified technology file.

Arguments

techId

ID of the technology file in which the width spacing snap pattern definition object is created.

name

Name for the width spacing snap pattern definition object.

layerNum

Layer number for the width spacing snap pattern definition object.

purposeNum

Purpose number for the width spacing snap pattern definition object.

period

Spacing between coarse-grain period tracks (heart-beat period).

isHorizontal

Pattern direction: TRUE for horizontal and FALSE for vertical.

offset

Distance from the nearest period track to the anchor reference (either the lower edge of the PRBoundary or the origin axis).

snappingLayers

Array of snapping layers for the width spacing snap pattern definition object.

numSnappingLayers

Number of elements in the array of snapping layers.

patternNames

Array of allowed width spacing pattern names.

numPatterns

Number of elements in the array of pattern names.

patternGroupNames

Array of allowed width spacing pattern group names.

numPatternGroups

Number of elements in the array of pattern group names.

defaultActive

Pattern to be used in areas where no region has been drawn.

Return Value

techWidthSpacingSnapPatternDefId

ID of the newly created width spacing snap pattern definition object.

techDeleteWidthSpacingSnapPatternDef

Boolean
techDeleteWidthSpacingSnapPatternDef(
techWidthSpacingSnapPatternDefId spDefId
);

Description

Deletes the specified width spacing snap pattern definition object.

Arguments

spDefId

ID of a width spacing snap pattern definition object.

Return Value

Boolean

TRUE, if the object was successfully deleted.

FALSE, if the object was not deleted.

techFindWidthSpacingSnapPatternDefByName

techWidthSpacingSnapPatternDefId
techFindWidthSpacingSnapPatternDefByName(
techFileId        techId,
constString       name
);

Description

Searches for the width spacing snap pattern definition object with the specified name in the specified technology file.

Arguments

techId

ID of the technology file in which the search is performed.

name

Name of the width spacing pattern for which the search is performed.

Return Value

techWidthSpacingSnapPatternDefId

ID of the width spacing snap pattern definition object, if found.

Returns NULL in case of failure.

techGenWidthSpacingSnapPatternDef

Boolean
techGenWidthSpacingSnapPatternDef(
techGenStateId                       pState,
techWidthSpacingSnapPatternDefId     *wsspDefId
);

Description

Retrieves the ID of the next width spacing snap pattern definition from the generator with the given techGenStateId. The widthSpacingSnapPatternDef ID is returned in the wsspDefId argument.

Arguments

pState

State ID for the generator.

wsspDefId

ID of the next width spacing snap pattern definition produced by the generator. This value is undefined if FALSE is returned.

Return Value

Boolean

TRUE, if ID of the next width spacing snap pattern definition is successfully generated.

FALSE, if the list is exhausted or an error occurs.

techGenWidthSpacingSnapPatternDefForLPP

Boolean
techGenWidthSpacingSnapPatternDefForLPP(
techGenStateId                    pState,
techWidthSpacingSnapPatternDefId *wsspDefId
);

Description

Retrieves the ID of the next width spacing snap pattern definition object from the generator using the given techGenStateId. The widthSpacingPatternDef layer-purpose pair (LPP) ID is returned in the wsspDefId argument.

Arguments

pState

State ID for the generator.

wsspDefId

ID of the next width spacing snap pattern definition object produced by the generator. This value is undefined if FALSE is returned.

Return Value

Boolean

TRUE, if the ID of the next width spacing pattern definition object is successfully generated.

FALSE, if the list is exhausted or an error occurs.

techGetWidthSpacingSnapPatternDefDefaultActiveName

String
techGetWidthSpacingSnapPatternDefDefaultActiveName(
techWidthSpacingSnapPatternDefId   spDefId
);

Description

Retrieves the name of the default active pattern for the specified width spacing snap pattern definition object.

Arguments

spDefId

ID of a width spacing snap pattern definition object.

Return Value

String

Default active pattern name for the specified width spacing snap pattern definition object.

Returns NULL in case of error.

techGetWidthSpacingSnapPatternDefLayer

techLayerNum
techGetWidthSpacingSnapPatternDefLayer(
techWidthSpacingSnapPatternDefId   spDefId
);

Description

Retrieves layer number for the specified width spacing snap pattern definition object.

Arguments

spDefId

ID of a width spacing snap pattern definition object.

Return Value

techLayerNum

Layer number for the specified width spacing snap pattern definition object.

Returns techcNullLayer in case of error.

techGetWidthSpacingSnapPatternDefName

String
techGetWidthSpacingSnapPatternDefName(
techWidthSpacingSnapPatternDefId   spDefId
);

Description

Retrieves the name for the specified width spacing snap pattern definition object.

Arguments

spDefId

ID of a width spacing snap pattern definition object.

Return Value

String

Name of the specified width spacing snap pattern definition object.

Returns NULL in case of error.

techGetWidthSpacingSnapPatternDefOffset

dbDistance
techGetWidthSpacingSnapPatternDefOffset(
techWidthSpacingSnapPatternDefId   spDefId
);

Description

Retrieves the offset for the specified width spacing snap pattern definition object. This is the distance from the nearest period track to the anchor reference (either the lower edge of the PRBoundary or the origin axis).

Arguments

spDefId

ID of a width spacing snap pattern definition object.

Return Value

dbDistance

Offset value of the specified width spacing snap pattern definition object.

Returns 0 in case of error.

techGetWidthSpacingSnapPatternDefPatternGroupNames

void
techGetWidthSpacingSnapPatternDefPatternGroupNames(
techWidthSpacingSnapPatternDefId   spDefId,
unsigned int                       *numPatternGroups,
String                             **patternGroupNames
);

Description

Allocates a suitable amount of heap memory, and fills it with the array of pattern group names of the specified width spacing snap pattern definition object. Pointer to the allocated memory area is returned through the patternGroupNames parameter and the size of this memory area is returned through the numPatternGroups parameter.

Arguments

spDefId

ID of a width spacing snap pattern definition object.

numPatternGroups

Pointer to the memory area where the number of pattern group names is placed.

patternGroupNames

Pointer to the memory area where the array of pattern group names is placed.

Return Value

No value returned.

techGetWidthSpacingSnapPatternDefPatternNames

void
techGetWidthSpacingSnapPatternDefPatternNames(
techWidthSpacingSnapPatternDefId   spDefId,
unsigned int                       *numPatterns,
String                             **patternNames
);

Description

Allocates a suitable amount of heap memory, and fills it with the array of pattern names of the specified width spacing snap pattern definition object. Pointer to the allocated memory area is returned through the patternNames parameter and the size of this memory area is returned through the numPatterns parameter.

Arguments

spDefId

ID of a width spacing snap pattern definition object.

numPatterns

Pointer to the memory area where the number of pattern names is placed.

patternNames

Pointer to the memory area where the array of pattern names is placed.

Return Value

No value returned.

techGetWidthSpacingSnapPatternDefPeriod

dbDistance
techGetWidthSpacingSnapPatternDefPeriod(
techWidthSpacingSnapPatternDefId   spDefId
);

Description

Retrieves the spacing between coarse-grain period tracks for the specified width spacing snap pattern definition object.

Arguments

spDefId

ID of a width spacing snap pattern definition object.

Return Value

dbDistance

Space between coarse-grain period tracks.

Returns 0 in case of error.

techGetWidthSpacingSnapPatternDefPurpose

techPurpose
techGetWidthSpacingSnapPatternDefPurpose(
techWidthSpacingSnapPatternDefId   spDefId
);

Description

Retrieves the purpose for the specified width spacing snap pattern definition object.

Arguments

spDefId

ID of a width spacing snap pattern definition object.

Return Value

techPurpose

The purpose number for the specified width spacing snap pattern definition object.

Returns techcUnknownPurpose in case of error.

techGetWidthSpacingSnapPatternDefSnappingLayers

void
techGetWidthSpacingSnapPatternDefSnappingLayers(
techWidthSpacingSnapPatternDefId   spDefId,
unsigned int                      *numSnappingLayers,
techSnappingLayer                 **snappingLayers
);

Description

Retrieves an array of snapping layers for the specified width spacing snap pattern definition object.

Arguments

spDefId

ID of a width spacing snap pattern definition object.

numSnappingLayers

Pointer to the memory area where the number of snapping layers is placed.

snappingLayers

Pointer to the memory area where the array of snapping layers is placed.

Return Value

No value returned.

techIsWidthSpacingSnapPatternDefHorizontal

Boolean
techIsWidthSpacingSnapPatternDefHorizontal(
techWidthSpacingSnapPatternDefId    spDefId
);

Description

Verifies whether the specified width spacing snap pattern definition object is horizontal.

Arguments

spDefId

ID of a width spacing snap pattern definition object.

Return Value

Boolean

TRUE, if the object is horizontal.

FALSE, if the object is vertical.

techStartGenWidthSpacingSnapPatternDefForLPP

techGenStateId
techStartGenWidthSpacingSnapPatternDefForLPP(
techFileId          techId,
techLayerId         layerId,
techPurposeId       purposeId
);

Description

Initializes a generator for all the width spacing snap pattern definition objects in the technology file specified by the techFileId that have the given LPP. A generator state ID is returned, which is used with the techGenWidthSpacingSnapPatternDefForLPP function.

Arguments

techId

ID of the technology file containing the width spacing snap pattern definition objects to be generated.

layerId

Layer ID in a layer-purpose pair.

purposeId

Purpose ID in a layer-purpose pair.

Return Value

techGenStateId

State ID for the generator.

techStartGenWidthSpacingSnapPatternDef

techGenStateId
techStartGenWidthSpacingSnapPatternDef(
techFileId          techId
);

Description

Initializes a generator for all width spacing snap pattern definition objects in the specified technology file. A generator state ID is returned, which is used with the techGenWidthSpacingSnapPatternDef function.

Arguments

techId

ID of the technology file containing the width spacing snap pattern definitions to be generated.

Return Value

techGenStateId

State ID for the generator.

Related Snap Pattern Functions

techAllocRelatedSnapPatternsSpecArray

techRelatedSnapPatternsSpec*
techAllocRelatedSnapPatternsSpecArray(
unsigned int     numSpecs
);

Description

Allocates memory for the array of related snap patterns specifications and initializes the memory with zeroes.

Arguments

numSpecs

Number of related snap pattern specifications to fit in the allocated memory.

Return Value

techRelatedSnapPatternsSpec*

     

Pointer to the allocated memory area.

techCreateRelatedSnapPatterns

techRelatedSnapPatternsId
techCreateRelatedSnapPatterns(
techFileId                    techfile,
constString                   name,
techRelatedSnapPatternsSpec   *relatedSnapPatterns,
unsigned int                  numRelatedSnapPatterns
);

Description

Creates a group of related snap patterns in the specified technology file.

Arguments

techfile

ID of the technology file in which the related snap patterns are created.

name

Name for the group of related snap patterns.

relatedSnapPatterns

Array of related snap pattern definitions to include in the group.

numRelatedSnapPatterns

Number of elements in the array of related snap patterns.

Return Value

techRelatedSnapPatternsId

  

ID of the newly created group of related snap patterns.

techDeleteRelatedSnapPatterns

Boolean
techDeleteRelatedSnapPatterns(
techRelatedSnapPatternsId relatedSnapPatternsId
);

Description

Deletes the specified related snap patterns object.

Arguments

relatedSnapPatternsId

ID of a related snap patterns object.

Return Value

Boolean

TRUE, if the object was successfully deleted.

FALSE, if the object was not deleted.

techFindRelatedSnapPatterns

techRelatedSnapPatternsId
techFindRelatedSnapPatterns(
techFileId        techfile,
constString       name
);

Description

Searches for the group of related snap patterns with the specified name in the specified technology file.

Arguments

techfile

ID of the technology file in which the search is performed.

name

Name of the group of related snap patterns for which the search is performed.

Return Value

techRelatedSnapPatternsId

ID of the group of related snap patterns, if found.

Returns NULL in case of failure.

techFreeRelatedSnapPatternsSpecArray

void
techFreeRelatedSnapPatternsSpecArray(
unsigned int                numSpecs,
techRelatedSnapPatternsSpec *patternSpecs
);

Description

Deallocates the memory allocated for an array of related snap patterns specifications.

In addition to deallocating the specified memory area, the function also frees the memory internally on the non-null patterns and patternGroups members of each related snap patterns specification in the array.

Arguments

numSpecs

Size of the deallocated memory area, measured in blocks of sizeof(techRelatedSnapPatternsSpec) bytes.

patternSpecs

Pointer to the memory area to deallocate.

Return Value

No value returned.

techGenRelatedSnapPatterns

Boolean
techGenRelatedSnapPatterns(
techGenStateId              pState,
techRelatedSnapPatternsId   *relatedSPId
);

Description

Retrieves the ID of the next related snap patterns from the generator with the given techGenStateId. The relatedSnapPatterns ID is returned in the relatedSPId argument.

Arguments

pState

State ID for the generator.

relatedSPId

ID of the next related snap pattern produced by the generator. This value is undefined if FALSE is returned.

Return Value

Boolean

TRUE, if ID of the next related snap patterns is successfully generated.

FALSE, if the list is exhausted or an error occurs.

techGetRelatedSnapPatternsName

String
techGetRelatedSnapPatternsName(
techRelatedSnapPatternsId   relatedSnapPatternsId
);

Description

Retrieves the name for the specified related snap patterns object.

Arguments

relatedSnapPatternsId

ID of a related snap patterns object.

Return Value

String

Name of the specified related snap patterns object.

Returns NULL in case of error.

techGetRelatedSnapPatternsSpec

void
techGetRelatedSnapPatternsSpec(
techRelatedSnapPatternsId   relatedSnapPatternsId,
unsigned int                *numSpecs,
techRelatedSnapPatternsSpec **patternSpecs
);

Description

Retrieves an array of snap pattern specifications for the specified related snap patterns object.

Allocates a suitable amount of heap memory, and fills it with the array of related snap pattern specifications of the specified related snap patterns object. Pointer to the allocated memory area is returned through the patternSpecs parameter and the size of this memory area is returned via the numSpecs parameter.

Arguments

relatedSnapPatternsId

ID of a related snap patterns object.

numSpecs

Pointer to the memory area where the number of snap pattern specifications is placed.

patternSpecs

Pointer to the memory area where the array of snap pattern specifications is placed.

Return Value

No value returned.

techStartGenRelatedSnapPatterns

techGenStateId
techStartGenRelatedSnapPatterns(
techFileId          techId
);

Description

Initializes a generator for all related snap patterns in the specified technology file. A generator state ID is returned, which is used with the techGenRelatedSnapPatterns function.

Arguments

techId

ID of the technology file containing the related snap patterns to be generated.

Return Value

techGenStateId

State ID for the generator.

Example- Using the WSP Technology File Functions

// Create a scratch technology database.
ddId                        libId = ddCreateLib("design",
                                                getTestDir() + "/design");
techFileId                  techfile = techOpenTechFile("design", "tech.db",
                                                        "a");
// *** WIDTH SPACING PATTERN API EXAMPLES ***
// Create the test data.
const unsigned int          num_wsps = 3;
constString                 *wspNames = calloc(num_wsps,
                                                     constString);
wspNames[0] = strdup("1X");
wspNames[1] = strdup("2X");
wspNames[2] = strdup("1X2X");
const unsigned int          num_colors = 2;
techColorMaskType           *colors = calloc(num_colors,
                                                   techColorMaskType);
colors[0] = techcGrayColorMask;
// Alternative way to set a mask color.
techStringToMaskColorType("mask3Color", &colors[1]);
const unsigned int          num_wireTypes = 2;
constString                 *wireTypes = calloc(num_wireTypes,
                                                      constString);
wireTypes[0] = strdup("wire0");
wireTypes[1] = strdup("wire1");
const unsigned int          num_baseSpecs = 2;
techWidthSpacingSpec        *baseSpecs = calloc(num_baseSpecs,
                                                      techWidthSpacingSpec);
baseSpecs[0] = { 20, 20, techcGrayColorMask, (String) wireTypes[0] };
baseSpecs[1] = { 10, 10, techcGrayColorMask, (String) wireTypes[1] };
const unsigned int          num_wspSpecs = 2;
techWidthSpacingPatternSpec *wspSpecs 
    = techAllocWidthSpacingPatternSpecArray(num_wspSpecs);
// Note: techFreeWidthSpacingPatternSpecArry() deallocates all members of the 
// array and assumes that all members were allocated on the heap.  This means
// that techWidthSpacingPatternSpec  members must be allocated with a heap
// allocation function such as calloc().
wspSpecs[0] = {3, NULL, 0, NULL, 0, baseSpecs, num_baseSpecs };
wspSpecs[1] = {3, colors, num_colors, (String *) wireTypes, num_wireTypes,
               NULL, 0 };
const unsigned int            num_wspSpecs_invalid = 2;
techWidthSpacingPatternSpec   *wspSpecs_invalid
    = techAllocWidthSpacingPatternSpecArray(num_wspSpecs_invalid);
techColorMaskType             *colors2 = calloc(num_colors,
                                                      techColorMaskType);
memcpy(colors2, colors, num_colors * sizeof(techColorMaskType));
constString                   *wireTypes2 = calloc(num_wireTypes,
                                                         constString);
memcpy(wireTypes2, wireTypes, num_wireTypes * sizeof(constString));
techWidthSpacingSpec          *baseSpecs2 = calloc(num_baseSpecs,
                                                         techWidthSpacingSpec);
techWidthSpacingSpec          *baseSpecs3 = calloc(num_baseSpecs,
                                                         techWidthSpacingSpec);
memcpy(baseSpecs2, baseSpecs, num_baseSpecs * sizeof(techWidthSpacingSpec));
memcpy(baseSpecs3, baseSpecs, num_baseSpecs * sizeof(techWidthSpacingSpec));
// This spec is invalid because it specifies the list of repeat colors
// both in the widthSpacingSpec and in the widthSpacingPattern spec.
wspSpecs_invalid[0] = {3, colors2, num_colors, NULL, 0,
                       baseSpecs2, num_baseSpecs };
// This spec is invalid because it specifies the list of wire types
// both in the widthSpacingSpec and in the widthSpacingPattern spec.
wspSpecs_invalid[1] = {3, NULL, 0, (String *) wireTypes2, num_wireTypes,
                       baseSpecs3, num_baseSpecs };
// These commands will fail due to the invalid specs.
techCreateWidthSpacingPattern(techfile, "bad_wsp1", wspSpecs_invalid, 1,
                              0, FALSE, techcGrayColorMask, FALSE);
techCreateWidthSpacingPattern(techfile, "bad_wsp2", wspSpecs_invalid + 1, 1,
                              0, FALSE, techcGrayColorMask, FALSE);
// This command will fail because we cannot define both the startingColor 
// parameter and the list of repeat colors in the specification.
techCreateWidthSpacingPattern(techfile, "bad_wsp3", wspSpecs, 2,
                              0, FALSE, techcMask3ColorMask, FALSE);
// Generate valid widthSpacingPatterns.
techWidthSpacingPatternId wsps[num_wsps];
for (int i = 0; i < num_wsps; i++) {
    wsps[i] = techCreateWidthSpacingPattern(techfile, wspNames[i], wspSpecs,
                                            num_wspSpecs, 0, FALSE,
                                            techcGrayColorMask, FALSE);
    assert(wsps[i]);
}
// Examples for the getter functions.
cout << "Sample WSP dump: " << endl;
cout << "  name: " << techGetWidthSpacingPatternName(wsps[0]) << endl;
cout << "  offset: " << techGetWidthSpacingPatternOffset(wsps[0]) << endl;
cout << "  repeat offset: " << techGetWidthSpacingPatternRepeatOffset(wsps[0])
     << endl;
cout << "  shift color: " << (bool) techGetWidthSpacingPatternShiftColor(wsps[0])
     << endl;
cout << "  starting color: "
     << techMaskColorTypeToString(techGetWidthSpacingPatternStartingColor(wsps[0])) << endl;
cout << endl << endl;
unsigned int                tmp_num = 0;
techWidthSpacingPatternSpec *tmp_specs = NULL;
techGetWidthSpacingPatternPatterns(wsps[0], &tmp_num, &tmp_specs);
assert(tmp_num == num_wspSpecs);
techFreeWidthSpacingPatternSpecArray(tmp_num, tmp_specs);
// Examples for the generator functions.
techGenStateId            gen_state = techStartGenWidthSpacingPattern(techfile);
techWidthSpacingPatternId tmp_wsp;
cout << "Pattern names returned by the generator: ";
while (techGenWidthSpacingPattern(gen_state, &tmp_wsp))
    cout << " " << techGetWidthSpacingPatternName(tmp_wsp);
cout << endl << endl;
techStopGen(gen_state);
// Examples for the find and delete functions.
assert(techFindWidthSpacingPattern(techfile, "tmp_wsp")
       == techcNullWidthSpacingPatternId);
tmp_wsp = techCreateWidthSpacingPattern(techfile, "tmp_wsp", wspSpecs,
                                        num_wspSpecs, 0, FALSE,
                                        techcGrayColorMask, FALSE);
assert(techFindWidthSpacingPattern(techfile, "tmp_wsp"));
assert(techDeleteWidthSpacingPattern(tmp_wsp));
assert(techFindWidthSpacingPattern(techfile, "tmp_wsp")
       == techcNullWidthSpacingPatternId);
// *** WIDTH SPACING PATTERN GROUP API EXAMPLES ***
constString                     wspgNames[] = {"wspg1"};
const unsigned int              num_wspgs = ARRAY_SIZE(wspgNames);
// This command will fail because a nonexisting widthSpacingPattern name
 is specified.
constString                     bad_wsp = "bad_wsp";
techCreateWidthSpacingPatternGroup(techfile, NULL, &bad_wsp, 1);
// Generate valid widthSpacingPatternGroups.
techWidthSpacingPatternGroupId    wspgs[num_wspgs];
for (int i = 0; i < num_wspgs; i++) {
    wspgs[i] = techCreateWidthSpacingPatternGroup(techfile, wspgNames[i],
                                                  &wspNames[0],
                                                  num_wsps);
    assert(wspgs[i]);
}
// Examples for the getter functions.
cout << "Sample WSP group dump: " << endl;
cout << "  name: " << techGetWidthSpacingPatternGroupName(wspgs[0]) << endl;
cout << "  patterns:";
constString*  tmp_names = NULL;
techGetWidthSpacingPatternGroupPatternNames(wspgs[0], &tmp_num,
                                            (String **) &tmp_names);
assert(tmp_num == num_wsps);
for (int i = 0; i < tmp_num; i++)
    cout << " " << tmp_names[i];
cout << endl << endl;
free(tmp_names);
// Examples for the generator functions.
gen_state = techStartGenWidthSpacingPatternGroup(techfile);
techWidthSpacingPatternGroupId tmp_wspg;
cout << "Pattern group names returned by the generator: ";
while (techGenWidthSpacingPatternGroup(gen_state, &tmp_wspg))
    cout << " " << techGetWidthSpacingPatternGroupName(tmp_wspg);
cout << endl << endl;
techStopGen(gen_state);
// Examples for the find and delete functions.
assert(techFindWidthSpacingPatternGroup(techfile, "tmp_wspg")
       == techcNullWidthSpacingPatternGroupId);
tmp_wspg = techCreateWidthSpacingPatternGroup(techfile, "tmp_wspg",
                                              &wspNames[0], 1);
assert(techFindWidthSpacingPatternGroup(techfile, "tmp_wspg"));
assert(techDeleteWidthSpacingPatternGroup(tmp_wspg));
assert(techFindWidthSpacingPatternGroup(techfile, "tmp_wspg")
       == techcNullWidthSpacingPatternGroupId);
// *** WIDTH SPACING PATTERN DEF API EXAMPLES ***
 Create the test data.
techLayerNum        layers[] = { 6, 8 };
techPurpose         purposes[] = { 1001, 1002 };
techLayerNum        snapLayerNum = 8;
techPurpose         snapPurposeNum = 5;
Boolean             isHorizontal = TRUE;
dbDistance          offset = 30;
dbDistance          period = 20;
const unsigned int  num_snapLayers = 1;
techSnappingLayer   *snapLayers = techAllocSnappingLayerArray(num_snapLayers);
snapLayers[0].layerNum = snapLayerNum;
snapLayers[0].purposes = calloc(1, techPurpose);
snapLayers[0].numPurposes = 1;
snapLayers[0].purposes[0] = snapPurposeNum;
constString                         wsspDefNames[] = { "wsspdef1", "wsspdef2" };
const unsigned int                  num_wsspDefs = ARRAY_SIZE(wsspDefNames);
techWidthSpacingSnapPatternDefId    wsspDefs[num_wsspDefs];
constString                         defaultWSP =  "1X2X";
for (int i = 0; i < num_wsspDefs; i++) {
    wsspDefs[i] = techCreateWidthSpacingSnapPatternDef(techfile,
                                                       wsspDefNames[i],
                                                       layers[i], purposes[i],
                                                       period, isHorizontal,
                                                       offset, snapLayers, 1,
                                                       &wspNames[0], num_wsps,
                                                       &wspgNames[0], num_wspgs,
                                                       defaultWSP);
    assert(wsspDefs[i]);
}
// Examples for the getter functions.
cout << "Sample widthSpacingSnapPatternDef dump: " << endl;
cout << "  name: "
     << techGetWidthSpacingSnapPatternDefName(wsspDefs[0]) << endl;
cout << "  layer: "
     << techGetWidthSpacingSnapPatternDefLayer(wsspDefs[0]) << endl;
cout << "  purpose: "
     << techGetWidthSpacingSnapPatternDefPurpose(wsspDefs[0]) << endl;
cout << "  period: "
     << techGetWidthSpacingSnapPatternDefPeriod(wsspDefs[0]) << endl;
cout << "  offset: "
     << techGetWidthSpacingSnapPatternDefOffset(wsspDefs[0]) << endl;
cout << "  horizontal: "
     << (bool) techIsWidthSpacingSnapPatternDefHorizontal(wsspDefs[0]) << endl;
cout << "  default active pattern: "
     << techGetWidthSpacingSnapPatternDefDefaultActiveName(wsspDefs[0])
     << endl;
techSnappingLayer*    tmp_snapLayers = NULL;
// Test techGetWidthSpacingSnapPatternDefSnappingLayers().
techGetWidthSpacingSnapPatternDefSnappingLayers(wsspDefs[0], &tmp_num,
                                                &tmp_snapLayers);
assert(tmp_num == num_snapLayers);
cout << "  snapping layers:" << endl;
for (int i = 0; i < tmp_num; i++) {
    cout << "    layer: " << tmp_snapLayers[i].layerNum << " purposes:";
    
    for (int j = 0; j < tmp_snapLayers[i].numPurposes; j++)
        cout << " " << tmp_snapLayers[i].purposes[j];
    cout << endl;
}
cout << endl;
techFreeSnappingLayerArray(tmp_num, tmp_snapLayers);
// Test techGetWidthSpacingSnapPatternDefPatternNames().
techGetWidthSpacingSnapPatternDefPatternNames(wsspDefs[0], &tmp_num,
                                              &tmp_names);
assert(tmp_num == num_wsps);
cout << "  patterns:";
for (int i = 0; i < tmp_num; i++)
    cout << " " << tmp_names[i];
cout << endl;
free(tmp_names);
// Test techGetWidthSpacingSnapPatternDefPatternGroupNames().
techGetWidthSpacingSnapPatternDefPatternGroupNames(wsspDefs[0], &tmp_num,
                                                   &tmp_names);
assert(tmp_num == num_wspgs);
cout << "  pattern groups:";
for (int i = 0; i < tmp_num; i++)
    cout << " " << tmp_names[i];
cout << endl;
free(tmp_names);
// Examples for the generator functions.
gen_state = techStartGenWidthSpacingSnapPatternDef(techfile);
techWidthSpacingSnapPatternDefId tmp_wsspdef;
cout << "Snap pattern definition names returned by the generator: ";
while (techGenWidthSpacingSnapPatternDef(gen_state, &tmp_wsspdef))
    cout << " " << techGetWidthSpacingSnapPatternDefName(tmp_wsspdef);
cout << endl << endl;
techStopGen(gen_state);
// Examples for the find and delete functions.
techLayerNum  tmp_layer = 10;
techPurpose   tmp_purpose = 1003;
assert(techFindWidthSpacingSnapPatternDefByName(techfile, "tmp_wsspdef")
       == techcNullWidthSpacingSnapPatternDefId);
tmp_wsspdef = techCreateWidthSpacingSnapPatternDef(techfile,
                                                   "tmp_wsspdef",
                                                   tmp_layer, tmp_purpose,
                                                   period, isHorizontal,
                                                   offset, snapLayers, 1,
                                                   NULL, 0,
                                                   NULL, 0,
                                                   defaultWSP);
assert(techFindWidthSpacingSnapPatternDefByName(techfile, "tmp_wsspdef"));
assert(techDeleteWidthSpacingSnapPatternDef(tmp_wsspdef));
assert(techFindWidthSpacingSnapPatternDefByName(techfile, "tmp_wsspdef")
       == techcNullWidthSpacingSnapPatternDefId);
tmp_wsspdef = techCreateWidthSpacingSnapPatternDef(techfile,
                                                   "tmp_wsspdef",
                                                   tmp_layer, tmp_purpose,
                                                   period, isHorizontal,
                                                   offset, snapLayers, 1,
                                                   NULL, 0,
                                                   NULL, 0,
                                                   defaultWSP);
assert(techDeleteWidthSpacingSnapPatternDef(tmp_wsspdef));
// *** RELATED SNAP PATTERNS API EXAMPLES ***
// Create the test data.
const unsigned int          num_rspSpecs = 1;
techRelatedSnapPatternsSpec *rspSpecs = techAllocRelatedSnapPatternsSpecArray(num_rspSpecs);
constString                 *wspNames2 = calloc(num_wsps, constString);
constString                 *wspgNames2 = calloc(num_wspgs, constString);
memcpy(wspNames2, wspNames, num_wsps * sizeof(constString));
memcpy(wspgNames2, wspgNames, num_wspgs * sizeof(constString));
rspSpecs[0] = { (String) wsspDefNames[0], (String *) wspNames2, num_wsps,
                (String *) wspgNames2, num_wspgs };
// Create invalid specs.
const unsigned int          num_rspSpecs_invalid = 3;
techRelatedSnapPatternsSpec *rspSpecs_invalid = techAllocRelatedSnapPatternsSpecArray(num_rspSpecs_invalid);
constString                 *wspNames_invalid = calloc(1,
                                                             constString);
constString                 *wspgNames_invalid = calloc(1,
                                                              constString);
wspNames_invalid[0] = "bad_wsp";
wspgNames_invalid[0] = "bad_wspg";
// Nonexisting widthSpacingPattern name.
rspSpecs_invalid[0] = { (String) wsspDefNames[0],
                        (String *) wspNames_invalid, 1, NULL, 0 };
// Nonexisting widthSpacingPatternGroup name.
rspSpecs_invalid[1] = { (String) wsspDefNames[0], NULL, 0,
                        (String *) wspgNames_invalid, 1};
// Nonexisting widthSpacingSnapPatternDef name.
rspSpecs_invalid[2] = { "bad_wsspdef", NULL, 0, NULL, 0};
// These commands will fail due to invalid relatedSnapPatternsSpecs.
for (int i = 0; i < num_rspSpecs_invalid; i++)
    assert(techCreateRelatedSnapPatterns(techfile, "bad_rsp",
                                       rspSpecs_invalid + i, 1)
           == techcNullRelatedSnapPatternsId);
// This command generates a valid relatedSnapPatterns object.
techRelatedSnapPatternsId rsp = techCreateRelatedSnapPatterns(techfile,
                                                              "rsp0",
                                                              rspSpecs,
                                                              num_rspSpecs);
assert(rsp);
// End of the examples section.
// The remaining auxiliary objects should be deallocated.
techFreeSnappingLayerArray(1, snapLayers);
techFreeWidthSpacingPatternSpecArray(num_wspSpecs, wspSpecs);
techFreeWidthSpacingPatternSpecArray(num_wspSpecs_invalid, wspSpecs_invalid);
techFreeRelatedSnapPatternsSpecArray(num_rspSpecs, rspSpecs);
techFreeRelatedSnapPatternsSpecArray(num_rspSpecs_invalid, rspSpecs_invalid);
return TRUE;

WSP Database Functions

Width Spacing Pattern (WSP) database functions are used to operate with widthSpacingPattern, widthSpacingPatternGroup, patternRegion, widthSpacingSnapPatternDef, and relatedSnapPatterns objects in the database.

These functions have the ability to create, find, and delete objects, access object parameters, and iterate over the objects stored in the database.

To learn how to use WSP database functions, see Example- Using WSP Database Functions.

Supported functions include:

Miscellaneous Database File Functions

dbMaskColorTypeToString

String
dbMaskColorTypeToString(
dbMaskColorType type
);

Description

Converts a dbMaskColorType enum to a string holding the name of the corresponding mask color type. Valid input values are integers from 1 to 6, or integer constants dbcGrayColor, dbcMask1Color, dbcMask2Color, dbcMask3Color, dbcBlackColor, dbcMultiColor, respectively. If the input parameter is dbcUnknownColor (equivalent to 0) or any other integer outside the range 1-6, the output string is "unknown".

Arguments

type

A dbMaskColorType enum.

Return Value

String

A mask color type name. Valid values are “grayColor”, “mask1Color”, “mask2Color”, mask3Color”, "blackColor", and "multiColor".

Returns “unknown” in case of error.

dbStringToMaskColorType

dbMaskColorType
dbStringToMaskColorType(
       constString     s,
);

Description

Converts the string holding a mask color type name to a dbMaskColorType enum. Valid input strings are "grayColor", "mask1Color", "mask2Color", "mask3Color", "blackColor" and "multiColor". Any other input string results in returning 0, which is same as dbcUnknownColor.

Arguments

s

A mask color type name.

Return Value

dbMaskColorType

A mask color enum value.

Returns 0 or dbcUnknownColor in case of error.

Global Grid Offset Functions

dbGetGlobalGridDefaultRepeatMode

dbWSPRepeatMode
dbGetGlobalGridDefaultRepeatMode(
dbCellViewId   cvId,
constString    defName
);

Description

Returns the default repeat mode for the specified widthSpacingSnapPatternDef global grid in the specified cellview.

Arguments

cvId

ID of a cellview.

defName

Name of a widthSpacingSnapPatternDef object.

Return Value

dbWSPRepeatMode

Value of the default repeat mode enum value.

Example

dbGetGlobalGridDefaultRepeatMode(cvId, "defName")

Returns the default repeat mode enum value for the defName global grid in the cellview cvId.

dbGetGlobalGridOffsetReferenceType

dbGlobalGridOffsetType
dbGetGlobalGridOffsetReferenceType(
dbCellViewId cellViewId
);

Description

Returns the global grid offset reference type of a cellview for snapPatternDef and widthSpacingSnapPatternDef global grids.

Arguments

cellViewId

ID of the cellview used to obtain the global grid offset reference.

Return Value

dbGlobalGridOffsetType

The value of the global grid offset reference. Valid Values: dbcBoundaryOffset or dbcOriginOffset.

dbGetGlobalGridRepeatMode

dbWSPRepeatMode
dbGetGlobalGridRepeatMode(
dbCellViewId  cvId,
constString   defName,
constString   wspName
);

Description

Returns the repeat mode for the specified widthSpacingSnapPatternDef global grid in the specified cellview for the given width spacing pattern.

Arguments

cvId

ID of a cellview.

defName

Name of a widthSpacingSnapPatternDef object.

wspName

Name of a width spacing pattern.

Return Value

dbWSPRepeatMode

Value of a valid repeat mode enum value.

Example

dbGetGlobalGridRepeatMode(cvId, "defName", "wspName")

Returns the repeat mode enum value for the defName global grid in the cellview cvId for the width spacing pattern wspName.

dbSetGlobalGridDefaultRepeatMode

Boolean
dbSetGlobalGridDefaultRepeatMode(
dbCellViewId       cvId,
constString        defName,
dbWSPRepeatMode    repeatMode
);

Description

Sets the specified repeat mode as the default on a cellview for the specified widthSpacingSnapPatternDef global grid.

Arguments

cvId

ID of a cellview.

defName

Name of a widthSpacingSnapPatternDef object.

repeatMode

Name of the repeat mode enum value to be set.

Valid values: dbcWSPNoRepeat, dbcWSPStepped, dbcWSPFlippedStartsWithOdd, dbcWSPFlippedStartsWithEven

Return Value

Boolean

TRUE, if the default repeat mode is successfully set for the specified widthSpacingSnapPatternDef global grid.

FALSE, in case of failure.

Example

dbSetGlobalGridDefaultRepeatMode(cvId, "defName", dbcWSPStepped)

The value dbcWSPStepped is set as the default repeat mode enum value for the defName global grid in the cellview cvId.

dbSetGlobalGridOffsetReferenceType

Boolean
dbSetGlobalGridOffsetReferenceType(
dbCellViewId cellViewId,
dbGlobalGridOffsetType type
);

Description

Sets the global grid offset reference on a cellview for snapPatternDef and widthSpacingSnapPatternDef global grids. The global grid reference can either be dbcBoundaryOffset or dbcOriginOffset.

Arguments

cellViewId

ID of the cellview used to store the global grid offset reference.

type

Value of the global grid reference. Valid values: dbcBoundaryOffset or dbcOriginOffset.

Return Value

Boolean

TRUE, if the global grid offset reference is set on the specified cellview.

FALSE, in case of failure.

Width Spacing Pattern Functions

dbAllocWidthSpacingPatternSpecArray

dbWidthSpacingPatternSpec*
dbAllocWidthSpacingPatternSpecArray(
unsigned int    numPatternSpecs
);

Description

Allocates memory for the array of width spacing pattern specifications and initializes the memory with zeroes.

Arguments

numPatternSpecs

Number of width spacing pattern specifications to fit in the allocated memory

Return Value

dbWidthSpacingPatternSpec*

Pointer to the allocated memory area.

dbCreateWidthSpacingPattern

dbWidthSpacingPatternId
dbCreateWidthSpacingPattern(
dbCellViewId                cv,
constString                 name,
dbWidthSpacingPatternSpec   *patterns,
unsigned int                numPatterns,
dbDistance                  offset,
Boolean                     isRepeatOffset,
dbMaskColorType             startingColor,
Boolean                     isShiftColor
);

Description

Creates a width spacing pattern in the specified cellview.

Arguments

cv

ID of the cellview in which the width spacing pattern is created.

name

Name for the width spacing pattern.

patterns

An array of pattern specifications.

numPatterns

Number of pattern specifications in the array of patterns.

offset

Distance of the first track from the period track.

isRepeatOffset

Flag to indicate whether the offset is applied when a pattern repeats.

startingColor

Color of the first track. If the color of the first track is not gray, all tracks are automatically colored such that the color pattern changes on each track. In other words, you cannot specify the color for a track other than the first one or leave a track uncolored.

isShiftColor

Flag to indicate whether track colors change when a pattern repeats. This attribute is used only when all tracks are individually colored. If no color is specified for a track, it remains uncolored (that is, gray).

startingColor

Color of the first track. If the color of the first track is not gray, all tracks are automatically colored so that the color shifts on each track, that is there is no way to specify color for the tracks other than the first one or to leave some tracks uncolored.

isShiftColor

Flag to indicate whether track colors shift when a pattern repeats. This attribute is used only when all tracks are individually colored and no automatic color assignment is done. If no color is specified for a track, then it would be uncolored (that is gray).

Return Value

dbWidthSpacingPatternId

ID of the created width spacing pattern.

dbCreateWidthSpacingPatternWithRepeatMode

dbWidthSpacingPatternId
dbCreateWidthSpacingPatternWithRepeatMode(
dbCellViewId                cv,
constString                 name,
dbWidthSpacingPatternSpec   *patterns,
unsigned int                numPatterns,
dbDistance                  offset,
Boolean                     isRepeatOffset,
dbMaskColorType             startingColor,
Boolean                     isShiftColor
dbWSPAllowedRepeatMode    allowedMode,
dbWSPRepeatMode           defaultMode
);

Description

Creates a width spacing pattern in the specified cellview keeping into consideration the enum values of allowed repeat pattern and default repeat pattern mode.

Arguments

cv

ID of the cellview in which the width spacing pattern is created.

name

Name for the width spacing pattern.

patterns

An array of pattern specifications.

numPatterns

Number of pattern specifications in the array of patterns.

offset

Distance of the first track from the period track.

isRepeatOffset

Flag to indicate whether the offset is applied when a pattern repeats.

startingColor

Color of the first track. If the color of the first track is not gray, all tracks are automatically colored such that the color pattern changes on each track. In other words, you cannot specify the color for a track other than the first one or leave a track uncolored.

isShiftColor

Flag to indicate whether track colors change when a pattern repeats. This attribute is used only when all tracks are individually colored. If no color is specified for a track, it remains uncolored (that is, gray).

startingColor

Color of the first track. If the color of the first track is not gray, all tracks are automatically colored so that the color shifts on each track, that is there is no way to specify color for the tracks other than the first one or to leave some tracks uncolored.

isShiftColor

Flag to indicate whether track colors shift when a pattern repeats. This attribute is used only when all tracks are individually colored and no automatic color assignment is done. If no color is specified for a track, then it would be uncolored (that is gray).

allowedMode

Name of the allowed repeat pattern enum value to be set.

Valid values: dbcWSPAllowedUnknown. dbcWSPAny, dbcWSPNone, dbcWSPSteppedOnly, dbcWSPFlippedOnly

defaultMode

Name of the default repeat pattern mode enum value to be set.

Valid values: dbcWSPUnknown,dbcWSPNoRepeat, dbcWSPStepped, dbcWSPFlippedStartsWithOdd, dbcWSPFlippedStartsWithEven

Return Value

dbWidthSpacingPatternId

ID of the created width spacing pattern.

dbDeleteWidthSpacingPattern

Boolean
dbDeleteWidthSpacingPattern(
dbWidthSpacingPatternId wspId
);

Description

Deletes the specified width spacing snap pattern object.

Arguments

wspId

ID of a width spacing pattern object.

Return Value

Boolean

TRUE, if the object was successfully deleted.

FALSE, if the object was not deleted.

dbFindWidthSpacingPattern

dbWidthSpacingPatternId
dbFindWidthSpacingPattern(
dbCellViewId  cv,
constString   name
);

Description

Searches for the width spacing pattern with the specified name in the specified cellview.

Arguments

cv

ID of the cellview in which the search is performed.

name

Name for the width spacing pattern for which the search is performed.

Return Value

dbWidthSpacingPatternId

ID of the width spacing pattern, if found.

Returns NULL in case of failure.

dbFreeWidthSpacingPatternSpecArray

void
dbFreeWidthSpacingPatternSpecArray(
unsigned int                 numPatternSpecs,
dbWidthSpacingPatternSpec    *patternSpecs
);

Description

Deallocates the memory allocated for an array of width spacing pattern specifications.

In addition to deallocating the specified memory area, the function also frees the memory internally on the non-null colors, wireTypes, and specs members of each width spacing snap pattern specification in the array.

Arguments

numPatternSpecs

Size of the deallocated memory area, measured in blocks of sizeof(dbWidthSpacingPatternSpec) bytes.

patternSpecs

Pointer to the memory area to deallocate.

Return Value

No value returned.

dbGenWidthSpacingPattern

Boolean
dbGenWidthSpacingPattern(
dbGenStateId               pState,
dbWidthSpacingPatternId    *wspId
);

Description

Retrieves the ID of the next width spacing pattern object from the generator with the given dbGenStateId. ID of the width spacing pattern object is returned in the wspId argument.

Arguments

pState

State ID for the generator.

wspId

ID of the next width spacing pattern object produced by the generator. This value is undefined if FALSE is returned.

Return Value

Boolean

TRUE, if the next width spacing pattern ID is successfully generated.

FALSE, if the list is exhausted or an error occurs.

dbGetWidthSpacingPatternAllowedRepeatMode

dbWSPAllowedRepeatMode
dbGetWidthSpacingPatternAllowedRepeatMode(
dbWidthSpacingPatternId  wspId
);

Description

Returns the allowed repeat mode for the specified width spacing pattern.

Arguments

wspId

ID of a width spacing pattern.

Return Value

dbWSPAllowedRepeatMode

  

Value of the allowed repeat mode enum value.

Example

dbGetWidthSpacingPatternAllowedRepeatMode(wspId)

Returns the allowed repeat mode enum value for the width spacing pattern wspId.

dbGetWidthSpacingPatternDefaultRepeatMode

dbWSPRepeatMode
dbGetWidthSpacingPatternDefaultRepeatMode(
dbWidthSpacingPatternId  wspId
);

Description

Returns the default repeat mode of the specified width spacing pattern.

Arguments

wspId

ID of a width spacing pattern.

Return Value

dbWSPRepeatMode

Value of the default repeat mode enum value.

Example

dbGetWidthSpacingPatternDefaultRepeatMode(wspId)

Returns default repeat mode enum value of the width spacing pattern wspId.

dbGetWidthSpacingPatternName

String
dbGetWidthSpacingPatternName(
dbWidthSpacingPatternId   wspId
);

Description

Retrieves the name for the specified width spacing pattern object.

Arguments

wspId

ID of a width spacing pattern object.

Return Value

String

Name of the specified width spacing pattern object.

Returns NULL in case of error.

dbGetWidthSpacingPatternOffset

dbDistance
dbGetWidthSpacingPatternOffset(
dbWidthSpacingPatternId   wspId
);

Description

Retrieves the offset, which is the distance of the first track from the period track, for the specified width spacing pattern object.

Arguments

wspId

ID of a width spacing pattern object.

Return Value

dbDistance

Offset value of the specified width spacing pattern object.

Returns 0 in case of error.

dbGetWidthSpacingPatternPatterns

void
dbGetWidthSpacingPatternPatterns(
dbWidthSpacingPatternId    wspId,
unsigned int               *numPatternSpecs,
dbWidthSpacingPatternSpec  **patternSpecs
);

Description

Allocates a suitable amount of heap memory, and fills it with the array of pattern specifications of the specified width spacing pattern object. Pointer to the allocated memory area is returned through the patternSpecs parameter and the size of this memory area is returned through the numPatternSpecs parameter.

Arguments

wspId

ID of the specified width spacing pattern object.

numPatternSpecs

Pointer to the memory area where the number of pattern specifications is placed.

patternSpecs

Pointer to the memory area where the array of pattern specifications is placed.

Return Value

No value returned.

dbGetWidthSpacingPatternRepeatOffset

Boolean
dbGetWidthSpacingPatternRepeatOffset(
dbWidthSpacingPatternId   wspId
);

Description

Retrieves the repeat offset flag for the specified width spacing pattern object. The repeat offset flag is a Boolean value indicating whether the offset is applied when a pattern repeats.

Arguments

wspId

ID of a width spacing pattern object.

Return Value

Boolean

The repeat offset flag of the specified width spacing pattern object.

Returns FALSE in case of error.

dbGetWidthSpacingPatternShiftColor

Boolean
dbGetWidthSpacingPatternShiftColor(
dbWidthSpacingPatternId   wspId
);

Description

Retrieves the shift color flag for the specified width spacing pattern object. The shift color flag is a Boolean value indicating whether the track colors shift when a pattern repeats.

Arguments

wspId

ID of the specified width spacing pattern object.

Return Value

Boolean

The shift color flag of the specified width spacing pattern object.

Returns FALSE in case of error.

dbGetWidthSpacingPatternStartingColor

dbColorMaskType
dbGetWidthSpacingPatternStartingColor(
dbWidthSpacingPatternId   wspId
);

Description

Retrieves the color of the first track for the specified width spacing pattern object.

Arguments

wspId

ID of a width spacing pattern object.

Return Value

dbColorMaskType

Color of the first track.

dbStartGenWidthSpacingPattern

dbGenStateId
dbStartGenWidthSpacingPattern(
dbCellViewId  cvId
);

Description

Initializes a generator for all width spacing pattern objects in the specified cellview. A generator state is returned, which is used with the dbGenWidthSpacingPattern function.

Arguments

cvId

ID of the cellview containing the width spacing pattern objects to be generated.

Return Value

dbGenStateId

State ID for the generator.

Width Spacing Pattern Group Functions

dbCreateWidthSpacingPatternGroup

dbWidthSpacingPatternGroupId
dbCreateWidthSpacingPatternGroup(
dbCellViewId      cv,
constString       groupName,
const constString *patternNames,
unsigned int      numPatternNames
);

Description

Creates a group of width spacing patterns in the specified cellview.

Arguments

cv

ID of the cellview in which the width spacing pattern group is created.

groupName

Name of the width spacing pattern group.

patternNames

An array of pattern names to be included in the group.

numPatternNames

Number of elements in the array of pattern names.

Return Value

dbWidthSpacingPatternGroupId

ID of the created width spacing pattern group, if found.

dbDeleteWidthSpacingPatternGroup

Boolean
dbDeleteWidthSpacingPatternGroup(
dbWidthSpacingPatternGroupId groupId
);

Description

Deletes the specified width spacing pattern group object.

Arguments

groupId

ID of a width spacing pattern group object.

Return Value

Boolean

TRUE, if the object was successfully deleted.

FALSE, if the object was not deleted.

dbFindWidthSpacingPatternGroup

dbWidthSpacingPatternGroupId
dbFindWidthSpacingPatternGroup(
dbCellViewId  cv,
constString   name
);

Description

Searches for the width spacing pattern group with the specified name in the specified cellview.

Arguments

cv

ID of the cellview in which the search is performed.

name

Name of the width spacing pattern group for which the search is performed.

Return Value

dbWidthSpacingPatternId

ID of the width spacing pattern group, if found.

Returns NULL in case of failure.

dbGenWidthSpacingPatternGroup

Boolean
dbGenWidthSpacingPatternGroup(
dbGenStateId                  pState,
dbWidthSpacingPatternGroupId  *wspGroupId
);

Description

Retrieves the ID of the next width spacing pattern group object from the generator with the given dbGenStateId. The width spacing pattern group object ID is returned in the wspGroupId argument.

Arguments

pState

State ID for the generator.

wspGroupId

ID of the next width spacing pattern group object produced by the generator. This value is undefined if FALSE is returned.

Return Value

Boolean

TRUE, if the ID of the next width spacing pattern group object is successfully generated.

FALSE, if the list is exhausted or an error occurs.

dbGetWidthSpacingPatternGroupName

String
dbGetWidthSpacingPatternGroupName(
dbWidthSpacingPatternGroupId  groupId
);

Description

Retrieves the name for the specified width spacing pattern group object.

Arguments

groupId

ID of the specified width spacing pattern group object.

Return Value

String

Name of the specified width spacing pattern group object.

Returns NULL in case of error.

dbGetWidthSpacingPatternGroupPatternNames

void
dbGetWidthSpacingPatternGroupPatternNames(
dbWidthSpacingPatternGroupId    groupId,
unsigned int                    *numPatternNames,
String                          **patternNames
);

Description

Allocates a suitable amount of heap memory and fills it with the array of pattern names of the specified width spacing pattern group. Pointer to the allocated memory area is returned through the patternsName parameter and the size of this memory area is returned through the numPatternNames parameter.

Arguments

groupId

ID of the specified width spacing pattern group object.

numPatternNames

Pointer to the memory area where the number of pattern names is placed.

patternsName

Pointer to the memory area where the array of pattern names is placed.

Return Value

No value returned.

dbStartGenWidthSpacingPatternGroup

dbGenStateId
dbStartGenWidthSpacingPatternGroup(
dbCellViewId     cvId
);

Description

Initializes a generator for all width spacing pattern group objects in the specified cellview. A generator state is returned, which is used with the dbGenWidthSpacingPatternGroup function.

Arguments

cvId

ID of the cellview containing the width spacing pattern group objects to be generated.

Return Value

dbGenStateId

State ID for the generator.

Pattern Region Functions

dbGetPatternRegionCommittedPatterns

void
dbGetPatternRegionCommittedPatterns(
dbShapeId       shapeId,
String          **patternNames,
unsigned int    *numPatterns
);

Description

Allocates a suitable amount of heap memory, and fills it with the array of committed pattern names of the specified pattern region object. Pointer to the allocated memory area is returned through the patternNames parameter and the size of this memory area is returned through the numPatterns parameter.

Arguments

shapeId

ID of the shape for which committed patterns are retrieved.

patternNames

Pointer to the memory area where the array of committed patterns is placed.

numPatterns

Pointer to the memory area where the number of committed patterns is placed.

Return Value

No value returned.

dbGetPatternRegionActivePattern

String
dbGetPatternRegionActivePattern(
dbShapeId       shapeId
);

Description

Retrieves the name of the active pattern currently set for the specified shape.

Arguments

shapeId

ID of the shape for which the active pattern is to be retrieved.

Return Value

String

Name of the active pattern.

dbGetPatternRegionAllowedPatternGroups

void
dbGetPatternRegionAllowedPatternGroups(
dbShapeId     shapeId,
String        **groupNames,
unsigned int  *numGroups
);

Description

Allocates a suitable amount of heap memory, and fills it with the array of allowed pattern group names of the specified pattern region object. Pointer to the allocated memory area is returned through the groupNames parameter and the size of this memory area is returned through the numGroups parameter.

Arguments

shapeId

ID of the shape.

groupNames

Pointer to the memory area where the array of allowed pattern groups is placed.

numGroups

Pointer to the memory area where the number of allowed pattern groups is placed.

Return Value

No value returned.

dbGetPatternRegionAllowedPatterns

void
dbGetPatternRegionAllowedPatterns(
dbShapeId     shapeId,
String        **patternNames,
unsigned int  *numPatterns
);

Description

Allocates a suitable amount of heap memory, and fills it with the array of allowed pattern names of the specified pattern region object. Pointer to the allocated memory area is returned through the patternNames parameter and the size of this memory area is returned through the numPatterns parameter.

Arguments

shapeId

ID of the shape.

patternNames

Pointer to the memory area where the array of allowed patterns is placed.

numPatterns

Pointer to the memory area where the number of allowed patterns is placed.

Return Value

No value returned.

dbGetPatternRegionCreateType

String
dbGetPatternRegionCreateType(
dbShapeId     shapeId
);

Description

Retrieves the create type for the specified shape. The return value is either “systemCreated” or “userCreated”.

Arguments

shapeId

ID of the shape.

Return Value

String

Create type of the pattern region.

dbGetPatternRegionDefaultRepeatMode

dbWSPRepeatMode
dbGetPatternRegionDefaultRepeatMode(
dbShapeId   shapeId
);

Description

Returns the default repeat mode for the specified pattern region.

Arguments

shapeID

ID of the pattern region for which the repeat mode is set.

Return Value

dbWSPRepeatMode

The default repeat mode enum value for the specified pattern region.

Example

dbGetPatternRegionDefaultRepeatMode(shapeId)

Returns the default repeat mode enum value for the pattern region shapeId.

dbGetPatternRegionRepeatMode

dbWSPRepeatMode
dbGetPatternRegionRepeatMode(
dbShapeId       shapeId,
constString     wspName,
);

Description

Returns the repeat mode for the specified width spacing pattern in the given pattern region.

Arguments

shapeID

ID of the pattern region for which the repeat mode is set.

wspName

Name of a width spacing pattern.

Return Value

dbWSPRepeatMode

The repeat mode enum value for the specified pattern region.

Example

dbGetPatternRegionRepeatMode(shapeId, "wspName")

Returns the repeat mode enum value for the width spacing pattern wspName in the pattern region shapeId.

dbGetPatternRegionShiftColor

Boolean
dbGetPatternRegionShiftColor(
dbShapeId     shapeId
);

Description

Retrieves the shift color flag for the specified shape.

Arguments

shapeId

ID of the shape.

Return Values

Boolean

Shift color flag of the shape.

Returns FALSE in case of failure.

dbHasPatternRegionActivePattern

Boolean
dbHasPatternRegionActivePattern(
dbShapeId   shapeId
);

Description

Checks if an active pattern is set for the specified shape.

Arguments

shapeId

ID of the shape.

Return Values

Boolean

TRUE, if an active pattern is set for the shape.

FALSE, if the shape does not have an active pattern set or in case of failure.

dbSetPatternRegionActivePattern

Boolean
dbSetPatternRegionActivePattern(
dbShapeId     shapeId,
constString   patternName)
);

Description

Sets the active pattern for the specified shape.

Arguments

shapeId

ID of the shape.

patternName

Name of the pattern to be set as active.

Return Valuesf

Boolean

TRUE, if active pattern is set.

FALSE, in case of failure.

dbSetPatternRegionAllowedPatternGroups

Boolean
dbSetPatternRegionAllowedPatternGroups(
dbShapeId     shapeId,
String        **groupNames,
unsigned int  *numGroups
);

Description

Sets allowed pattern groups for the specified shape.

Arguments

shapeId

ID of the shape.

groupNames

Array of allowed pattern groups to be set.

numGroups

Number of elements in the array of group names.

Return Values

Boolean

TRUE, if the allowed pattern groups are set.

FALSE, in case of failure.

dbSetPatternRegionAllowedPatterns

Boolean
dbSetPatternRegionAllowedPatterns(
dbShapeId     shapeId,
consString    **patternNames,
unsigned int  *numPatterns
);

Description

Sets the allowed patterns for the specified shape.

Arguments

shapeId

ID of the shape.

patternNames

Array of allowed patterns to be set.

numPatterns

Number of elements in the array of patterns.

Return Values

Boolean

TRUE, if the allowed patterns are set.

FALSE, in case of failure.

dbSetPatternRegionDefaultRepeatMode

Boolean
SetPatternRegionDefaultRepeatMode(
dbShapeId          shapeId,
dbWSPRepeatMode    repeatMode
);

Description

Sets the default repeat mode on the specified pattern region.

Arguments

shapeId

ID of the pattern region for which the repeat mode is to be set.

repeatMode

Name of the repeat mode enum value to be set.
Valid values: dbcWSPNoRepeat, dbcWSPStepped, dbcWSPFlippedStartsWithOdd, dbcWSPFlippedStartsWithEven

Value Returned

Boolean

TRUE, if the sepecified repeat mode is successfully set on the pattern region.

FALSE, in case of failure.

Example

dbSetPatternRegionDefaultRepeatMode(shapeID, dbcWSPStepped)

Sets the default repeat mode as dbcWSPStepped for the pattern region shapeID.

dbSetPatternRegionRepeatMode

Boolean
dbSetPatternRegionRepeatMode(
dbShapeId          shapeId,
constString        wspName,
dbWSPRepeatMode    repeatMode
);

Description

Sets the specified repeat mode on the pattern region for the specified width spacing pattern.

Arguments

shapeId

ID of the pattern region on which the repeat mode is to be set.

wspName

Name of a width spacing pattern.

repeatMode

Name of the repeat mode enum value to be set.

Valid values: dbcWSPNoRepeat, dbcWSPStepped, dbcWSPFlippedStartsWithOdd, dbcWSPFlippedStartsWithEven

Return Value

Boolean

TRUE, if the repeat mode is successfully set on the pattern region for the specified width spacing pattern.

FALSE, in case of failure.

Example

dbSetPatternRegionRepeatMode(shapeId, "wspName", dbcWSPStepped)

In this example, repeat mode dbcWSPStepped is successfully set on the pattern region shapeId for the width spacing pattern wspName.

dbShapeHasPatternRegionInfo

Boolean
dbShapeHasPatternRegionInfo(
dbShapeId     shapeId
);

Description

Returns a Boolean value indicating whether the specified shape contains pattern region information.

Arguments

shapeId

ID of the shape.

Return Values

Boolean

TRUE, if the shape contains pattern region information.

FALSE, if the shape does not contain pattern region information or in case of failure.

dbGetPatternRegionName

constString
dbGetPatternRegionName(
dbShapeId   shapeId
);

Description

Returns the name of the pattern region set for the specified shape.

Arguments

shapeId

Database ID of a shape.

Value Returned

constString

Name of the pattern region.

dbSetPatternRegionName

Boolean
dbSetPatternRegionName(
dbShapeId   shapeId,
constString name);

Description

Sets the specified pattern region for the specified shape.

Arguments

shapeId

Database ID of a shape.

name

Name of a pattern region.

Value Returned

Boolean

TRUE if the specified pattern region is set.

FALSE is the specified region is not set or an error occurs.

dbGetPatternRegionCommittedPatternShiftColor

Boolean
dbGetPatternRegionCommittedPatternShiftColor(
dbShapeId   shapeId,
constString patternName
);

Description

Returns a shiftColor flag of the committed pattern with the specified name.

Arguments

shapeId

ID of the shape for which the committed patterns are retrieved.

patternName

Name of the committed pattern.

Return Value

Boolean

TRUE if the shiftColor flag of the committed pattern is retrieved.

FALSE if the shiftColor flag of the committed pattern is not retrieved or an error occurs.

Width Spacing Snap Pattern Def Functions

dbAllocSnappingLayerArray

dbSnappingLayer*
dbAllocSnappingLayerArray(
unsigned int    numLayers
);

Description

Allocates memory for the array of snapping layers and initializes the memory with zeroes.

Arguments

numLayers

Number of snapping layers to fit in the allocated memory.

Return Value

dbSnappingLayer*

Pointer to the allocated memory area.

dbFreeSnappingLayerArray

void
dbFreeSnappingLayerArray(
unsigned int    numLayers,
dbSnappingLayer *layers
);

Description

Deallocates the memory allocated for an array of snapping layers.

Arguments

numLayers

Size of the deallocated memory area, measured in blocks of sizeof(dbSnappingLayer) bytes.

layers

Pointer to the memory area to deallocate.

Return Value

No value returned.

dbCreateWidthSpacingSnapPatternDef

dbWidthSpacingSnapPatternDefId
dbCreateWidthSpacingSnapPatternDef(
dbCellViewId     dbId,
constString      name,
dbLayer          layerNum,
dbPurpose        purposeNum,
dbDistance       period,
Boolean          isHorizontal,
dbDistance       offset,
dbSnappingLayer  *snappingLayers,
unsigned int     numSnappingLayers,
String           *patternNames,
unsigned int     numPatterns,
String           *patternGroupNames,
unsigned int     numPatternGroups,
String           defaultActive
);

Description

Creates a width spacing snap pattern definition object in the specified database.

Arguments

dbId

ID of the database in which the width spacing snap pattern definition object is created.

name

Name for the width spacing snap pattern definition object.

layerNum

Layer number for the width spacing snap pattern definition object.

purposeNum

Purpose number for the width spacing snap pattern definition object.

period

Spacing between coarse-grain period tracks (heart-beat period).

isHorizontal

Pattern direction: TRUE for horizontal and FALSE for vertical.

offset

Distance from the nearest period track to the anchor reference (either the lower edge of the PRBoundary or the origin axis).

snappingLayers

Array of snapping layers for the width spacing snap pattern definitions.

numSnappingLayers

Number of elements in the array of snapping layers..

patternNames

Array of allowed width spacing pattern names.

numPatterns

Number of elements in the array of patterns names.

patternGroupNames

Array of allowed width spacing pattern group names.

numPatternGroups

Number of elements in the array of pattern group names.

defaultActive

Pattern to be used in areas where no region has been drawn.

Return Value

bWidthSpacingSnapPatternDefId

d  

ID of the created width spacing snap pattern definition object.

dbDeleteWidthSpacingSnapPatternDef

Boolean
dbDeleteWidthSpacingSnapPatternDef(
dbWidthSpacingSnapPatternDefId spDefId
);

Description

Deletes the specified width spacing snap pattern definition object.

Arguments

spDefId

ID of a width spacing snap pattern definition object.

Return Value

Boolean

TRUE, if the object was successfully deleted.

FALSE, if the object was not deleted.

dbFindWidthSpacingSnapPatternDefByName

dbWidthSpacingSnapPatternDefId
dbFindWidthSpacingSnapPatternDefByName(
dbCellViewId dbId,
constString  name
);

Description

Searches for the width spacing snap pattern definition object with the specified name in the specified database.

Arguments

dbId

ID of the database in which the search is performed.

name

Name of the width spacing pattern for which the search is performed.

Return Value

dbWidthSpacingSnapPatternDefId

    

ID of the width spacing snap pattern definition object, if found.

Returns NULL in case of failure.

dbGenWidthSpacingSnapPatternDef

Boolean
dbGenWidthSpacingSnapPatternDef(
dbGenStateId                   pState,
dbWidthSpacingSnapPatternDefId *wsspDefId
);

Description

Retrieves the ID of the next width spacing snap pattern definition object from the generator with the given dbGenStateId. ID of the width spacing snap pattern definition object is returned in the wsspDefId argument.

Arguments

pState

State ID for the generator.

wsspDefId

ID of the next width spacing snap pattern definition object produced by the generator. This value is undefined if FALSE is returned.

Return Value

Boolean

TRUE, if the ID of the next width spacing snap pattern definition object is successfully generated.

FALSE, if the list is exhausted or an error occurs.

dbGenWidthSpacingSnapPatternDefForLPP

Boolean
dbGenWidthSpacingSnapPatternDefForLPP(
dbGenStateId                    pState,
dbWidthSpacingSnapPatternDefId  *wsspDefId
);

Description

Retrieves the ID of the next width spacing snap pattern definition object with the given dbGenStateId. ID of the width spacing snap pattern definition object is returned in the wsspDefId argument.

Arguments

pState

State ID for the generator.

wsspDefId

ID of the next width spacing snap pattern definition object produced by the generator. This value is undefined if FALSE is returned.

Return Value

Boolean

TRUE, if the ID of the next width spacing snap pattern definition object is successfully generated.

FALSE, if the list is exhausted or an error occurs.

dbGenWidthSpacingSnapPatternDefForSnappingLPP

Boolean
dbGenWidthSpacingSnapPatternDefForSnappingLPP(
dbGenStateId                    pState,
dbWidthSpacingSnapPatternDefId  *wsspDefId
);

Description

Retrieves the ID of the next width spacing snap pattern definition object with the given dbGenStateId. ID of the width spacing snap pattern definition object is returned in the wsspDefId argument.

Arguments

pState

State ID for the generator.

wsspDefId

ID of the next width spacing snap pattern definition object produced by the generator. This value is undefined if FALSE is returned.

Return Value

Boolean

TRUE, if the ID of the next width spacing snap pattern definition object is successfully generated.

FALSE, if the list is exhausted or an error occurs.

dbGetWidthSpacingSnapPatternDefDefaultActiveName

String
dbGetWidthSpacingSnapPatternDefDefaultActiveName(
dbWidthSpacingSnapPatternDefId   spDefId
);

Description

Retrieves the name of the default active pattern for the specified width spacing snap pattern definition object.

Arguments

spDefId

ID of a width spacing snap pattern definition object.

Return Value

String

Default active pattern name of the specified width spacing snap pattern definition object.

Returns NULL in case of error.

dbGetWidthSpacingSnapPatternDefLayer

dbLayer
dbGetWidthSpacingSnapPatternDefLayer(
dbWidthSpacingSnapPatternDefId   spDefId
);

Description

Retrieves the layer number for the specified width spacing snap pattern definition object.

Arguments

spDefId

ID of a width spacing snap pattern definition object.

Return Value

dbLayer

The layer number for the specified width spacing snap pattern definition object.

Returns dbcNullLayer in case of error.

dbGetWidthSpacingSnapPatternDefName

String
dbGetWidthSpacingSnapPatternDefName(
dbWidthSpacingSnapPatternDefId   spDefId
);

Description

Retrieves the name for the specified width spacing snap pattern definition object.

Arguments

spDefId

ID of a width spacing snap pattern definition object.

Return Value

String

Name of the specified width spacing snap pattern definition object.

Returns NULL in case of error.

dbGetWidthSpacingSnapPatternDefOffset

dbDistance
dbGetWidthSpacingSnapPatternDefOffset(
dbWidthSpacingSnapPatternDefId   spDefId
);

Description

Retrieves the offset for the specified width spacing snap pattern definition object. This is the distance from the nearest period track to the anchor reference (either the lower edge of the PRBoundary or the origin axis).

Arguments

spDefId

ID of a width spacing snap pattern definition object.

Return Value

dbDistance

The offset value of the specified width spacing snap pattern definition object.

dbGetWidthSpacingSnapPatternDefPatternGroupNames

void
dbGetWidthSpacingSnapPatternDefPatternGroupNames(
dbWidthSpacingSnapPatternDefId     spDefId,
unsigned int                       *numPatternGroups,
String                             **patternGroupNames
);

Description

Allocates a suitable amount of heap memory, and fills it with the array of pattern group names of the specified width spacing snap pattern definition object. Pointer to the allocated memory area is returned through the patternGroupNames parameter and the size of this memory area is returned through the numPatternGroups parameter.

Arguments

spDefId

ID of the specified width spacing snap pattern definition object.

numPatternGroups

Pointer to the memory area where the number of pattern group names is placed.

patternGroupNames

Pointer to the memory area where the array of pattern group names is placed.

Return Value

No value returned.

dbGetWidthSpacingSnapPatternDefPatternNames

void
dbGetWidthSpacingSnapPatternDefPatternNames(
dbWidthSpacingSnapPatternDefId     spDefId,
unsigned int                       *numPatterns,
String                             **patternNames
);

Description

Allocates a suitable amount of heap memory, and fills it with the array of pattern names of the specified width spacing snap pattern definition object. Pointer to the allocated memory area is returned through the patternNames parameter and the size of this memory area is returned through the numPatterns parameter.

Arguments

spDefId

ID of a width spacing snap pattern definition object.

numPatterns

Pointer to the memory area where the number of pattern names is placed.

patternNames

Pointer to the memory area where the array of pattern names is placed.

Return Value

No return value.

dbGetWidthSpacingSnapPatternDefPeriod

dbDistance
dbGetWidthSpacingSnapPatternDefPeriod(
dbWidthSpacingSnapPatternDefId   spDefId
);

Description

Retrieves the spacing between coarse-grain period tracks for the specified width spacing snap pattern definition object.

Arguments

spDefId

ID of the specified width spacing snap pattern definition object.

Return Value

dbDistance

Spacing between coarse-grain period tracks.

dbGetWidthSpacingSnapPatternDefPurpose

dbPurpose
dbGetWidthSpacingSnapPatternDefPurpose(
dbWidthSpacingSnapPatternDefId   spDefId
);

Description

Retrieves the purpose for the specified width spacing snap pattern definition object.

Arguments

spDefId

ID of the specified width spacing snap pattern definition object.

Return Value

dbPurpose

The purpose number for the specified width spacing snap pattern definition object.

Returns dbcUnknownPurpose in case of error.

dbGetWidthSpacingSnapPatternDefSnappingLayers

void
dbGetWidthSpacingSnapPatternDefSnappingLayers(
dbWidthSpacingSnapPatternDefId  spDefId,
unsigned int                  *numSnappingLayers,
dbSnappingLayer                 **snappingLayers
);

Description

Retrieves an array of snapping layers for the specified width spacing snap pattern definition object.

Arguments

spDefId

ID of a width spacing snap pattern definition object.

numSnappingLayers

Pointer to the memory area where the number of snapping layers is placed.

snappingLayers

Pointer to the memory area where the array of snapping layers is placed.

Return Value

No value returned.

dbIsWidthSpacingSnapPatternDefHorizontal

Boolean
dbIsWidthSpacingSnapPatternDefHorizontal(
dbWidthSpacingSnapPatternDefId    spDefId
);

Description

Verifies whether the direction of the specified width spacing snap pattern definition object is horizontal.

Arguments

spDefId

ID of a width spacing snap pattern definition object.

Return Value

Boolean

TRUE, if the object direction is horizontal.

FALSE, if the object direction is vertical.

dbStartGenWidthSpacingSnapPatternDef

dbGenStateId
dbStartGenWidthSpacingSnapPatternDef(
dbCellViewId   dbId
);

Description

Initializes a generator for all width spacing snap pattern definition objects in the specified cellview. A generator state is returned, which is used with the dbGenWidthSpacingSnapPatternDef function.

Arguments

dbId

ID of the cellview containing the width spacing snap pattern definition objects to be generated.

Return Value

dbGenStateId

State ID for the generator.

dbStartGenWidthSpacingSnapPatternDefForSnappingLPP

dbGenStateId
dbStartGenWidthSpacingSnapPatternDefForSnappingLPP(
dbCellViewId dbId,
dbLayer      layer,
dbPurpose    purpose
);

Description

Initializes a generator for all width spacing snap pattern definition objects in the specified cellview that have the specified snapping LPP. A generator state is returned, which is used with the dbGenWidthSpacingSnapPatternDefForSnappingLPP function.

Arguments

dbId

ID of the cellview containing the width spacing snap pattern definition objects to be generated.

layer

Layer ID in a layer-purpose pair.

purpose

Purpose ID in a layer-purpose pair.

Return Value

dbGenStateId

State ID for the generator.

Related Snap Pattern Functions

dbAllocRelatedSnapPatternsSpecArray

dbRelatedSnapPatternsSpec*
dbAllocRelatedSnapPatternsSpecArray(
unsigned int    numSpecs
);

Description

Allocates memory for the array of related snap patterns specifications and initializes the memory with zeroes.

Arguments

numSpecs

The number of related snap patterns specifications to fit in the allocated memory.

Return Value

dbRelatedSnapPatternsSpec*

   

Pointer to the allocated memory area.

dbCreateRelatedSnapPatterns

dbRelatedSnapPatternsId
dbCreateRelatedSnapPatterns(
dbCellViewId                    cv,
constString                     name,
const dbRelatedSnapPatternsSpec *relatedSnapPatterns,
unsigned int                    numRelatedSnapPatterns
);

Description

Creates the specified related snap patterns object in the specified cellview.

Arguments

cv

ID of the cellview in which the related snap patterns object is created.

name

Name of a related snap patterns object.

relatedSnapPatterns

Array of related snap pattern names.

numRelatedSnapPatterns

Number of elements in the array of related snap patterns.

Return Value

dbRelatedSnapPatternsId

   

ID of the created related snap patterns object.

dbDeleteRelatedSnapPatterns

Boolean
dbDeleteRelatedSnapPatterns(
dbRelatedSnapPatternsId     rspId
);

Description

Deletes the specified related snap patterns object.

Arguments

rspId

ID of the related snap patterns object.

Return Value

Boolean

TRUE, if the object was successfully deleted.

FALSE, if the object was not deleted.

dbFindRelatedSnapPatterns

dbRelatedSnapPatternsId
dbFindRelatedSnapPatterns(
dbCellViewId  cv,
constString   name
);

Description

Searches for the related snap patterns object with the specified name in the specified cellview.

Arguments

cv

ID of the cellview in which the search is performed.

name

Name of the related snap patterns object for which the search is performed.

Return Value

dbRelatedSnapPatternsId

ID of the related snap patterns object, if found.

Returns NULL in case of failure.

dbFreeRelatedSnapPatternsSpecArray

void
dbFreeRelatedSnapPatternsSpecArray(
unsigned int                 numSpecs,
dbRelatedSnapPatternsSpec    *patternSpecs
);

Description

Frees the memory allocated for an array of related snap patterns specifications.

Arguments

numSpecs

Size of the deallocated memory area, measured in blocks of sizeof(dbRelatedSnapPatternsSpec) bytes.

patternSpecs

Pointer to the memory area to deallocate.

Return Value

No value returned.

dbGenRelatedSnapPatterns

Boolean
dbGenRelatedSnapPatterns(
dbGenStateId                pState,
dbRelatedSnapPatternsId    *rSPId
);

Description

Retrieves the ID of the next related snap patterns object from the generator with the given dbGenStateId. ID of the related snap patterns object is returned in the rSPId argument.

Arguments

pState

State ID for the generator.

rSPId

ID of the next related snap patterns object produced by the generator. This value is undefined if FALSE is returned.

Return Value

Boolean

TRUE, if ID of the next related snap patterns object is successfully generated.

FALSE, if the list is exhausted or an error occurs.

dbGetRelatedSnapPatternsName

String
dbGetRelatedSnapPatternsName(
dbRelatedSnapPatternsId  relatedSnapPatternsId
);

Description

Retrieves the name for the specified related snap patterns object.

Arguments

relatedSnapPatternsId

ID of the related snap patterns object.

Return Value

String

Name of the specified related snap patterns object.

Returns NULL in case of error.

dbGetRelatedSnapPatternsSpec

void
dbGetRelatedSnapPatternsSpec(
dbRelatedSnapPatternsId    relatedSnapPatternsId,
unsigned int               *numSpecs,
dbRelatedSnapPatternsSpec  **patternSpecs 
);

Description

Retrieves the array of related snap pattern specifications for the specified related snap patterns object.

Arguments

relatedSnapPatternsId

ID of a related snap patterns object.

numSpecs

Pointer to the memory area where the number of related snap pattern specifications is placed.

patternSpecs

Pointer to the memory area where the array of related snap pattern specifications is placed.

Return Value

No value returned.

dbStartGenRelatedSnapPatterns

dbGenStateId
dbStartGenRelatedSnapPatterns(
dbCellViewId      cvId
);

Description

Initializes a generator for all related snap patterns objects in the specified cellview. A generator state is returned, which is used with the dbDeleteRelatedSnapPatterns function.

Arguments

cvId

ID of the cellview containing the related snap patterns objects to be generated.

Return Value

dbGenStateId

State ID for the generator.

Example- Using WSP Database Functions

// Create a scratch cellview.
ddId                libId = ddCreateLib("design", getTestDir() + "/design");
dbCellViewId        cellview = dbOpenCellViewByType("design", "top", "layout",
             "maskLayout", "w",
             dbcNullCellViewId);
// *** WIDTH SPACING PATTERN API EXAMPLES ***
// Create the test data.
const unsigned int          num_wsps = 3;
constString                 *wspNames = calloc(num_wsps,
              constString);
wspNames[0] = strdup("1X");
wspNames[1] = strdup("2X");
wspNames[2] = strdup("1X2X");
const unsigned int          num_colors = 2;
dbMaskColorType             *colors = calloc(num_colors,
               dbMaskColorType);
colors[0] = dbcGrayColor;
colors[1] = dbcMask3Color;
const unsigned int          num_wireTypes = 2;
constString                 *wireTypes = calloc(num_wireTypes,
               constString);
wireTypes[0] = strdup("wire0");
wireTypes[1] = strdup("wire1");
const unsigned int          num_baseSpecs = 2;
dbWidthSpacingSpec          *baseSpecs = calloc(num_baseSpecs,
               dbWidthSpacingSpec);
baseSpecs[0] = { 20, 20, dbcGrayColor, (String) wireTypes[0] };
baseSpecs[1] = { 10, 10, dbcGrayColor, (String) wireTypes[1] };
const unsigned int          num_wspSpecs = 2;
dbWidthSpacingPatternSpec   *wspSpecs 
= dbAllocWidthSpacingPatternSpecArray(num_wspSpecs);
// Note: dbFreeWidthSpacingPatternSpecArry() deallocates all members of the 
// array and assumes that all members were allocated on the heap.  This means
// that dbWidthSpacingPatternSpec  members must be allocated with a heap
// allocation function such as calloc().
wspSpecs[0] = {3, NULL, 0, NULL, 0, baseSpecs, num_baseSpecs };
wspSpecs[1] = {3, colors, num_colors, (String *) wireTypes, num_wireTypes,
      NULL, 0 };
const unsigned int          num_wspSpecs_invalid = 2;
dbWidthSpacingPatternSpec   *wspSpecs_invalid
= dbAllocWidthSpacingPatternSpecArray(num_wspSpecs_invalid);
dbMaskColorType             *colors2 = calloc(num_colors,
             dbMaskColorType);
memcpy(colors2, colors, num_colors * sizeof(dbMaskColorType));
constString                 *wireTypes2 = calloc(num_wireTypes,
                constString);
memcpy(wireTypes2, wireTypes, num_wireTypes * sizeof(constString));
dbWidthSpacingSpec          *baseSpecs2 = calloc(num_baseSpecs,
                dbWidthSpacingSpec);
dbWidthSpacingSpec          *baseSpecs3 = calloc(num_baseSpecs,
                dbWidthSpacingSpec);
memcpy(baseSpecs2, baseSpecs, num_baseSpecs * sizeof(dbWidthSpacingSpec));
memcpy(baseSpecs3, baseSpecs, num_baseSpecs * sizeof(dbWidthSpacingSpec));
// This spec is invalid because it specifies the list of repeat colors
// both in the widthSpacingSpec and in the widthSpacingPattern spec.
wspSpecs_invalid[0] = {3, colors2, num_colors, NULL, 0,
        baseSpecs2, num_baseSpecs };
// This spec is invalid because it specifies the list of wire types
// both in the widthSpacingSpec and in the widthSpacingPattern spec.
wspSpecs_invalid[1] = {3, NULL, 0, (String *) wireTypes2, num_wireTypes,
        baseSpecs3, num_baseSpecs };
// These commands will fail due to the invalid specs.
dbCreateWidthSpacingPattern(cellview, "bad_wsp1", wspSpecs_invalid, 1,
       0, FALSE, dbcGrayColor, FALSE);
dbCreateWidthSpacingPattern(cellview, "bad_wsp2", wspSpecs_invalid + 1, 1,
       0, FALSE, dbcGrayColor, FALSE);
// This command will fail because we cannot define both the startingColor 
// parameter and the list of repeat colors in the specification.
dbCreateWidthSpacingPattern(cellview, "bad_wsp3", wspSpecs, 2,
       0, FALSE, dbcMask3Color, FALSE);
// Generate valid widthSpacingPatterns.
dbWidthSpacingPatternId wsps[num_wsps];
for (int i = 0; i < num_wsps; i++) {
 wsps[i] = dbCreateWidthSpacingPattern(cellview, wspNames[i], wspSpecs,
            num_wspSpecs, 0, FALSE,
            dbcGrayColor, FALSE);
 assert(wsps[i]);
dbWidthSpacingPatternId wsp_repeat;
wsp_repeat = dbCreateWidthSpacingPatternWithRepeatMode(cellview, "wsp_repeat",
           wspSpecs, num_wspSpecs,
           0, FALSE, dbcGrayColor,
           FALSE, dbcWSPSteppedOnly,
           dbcWSPStepped); assert(wsp_repeat);
}
// Examples for the getter functions.
cout << "Sample WSP dump: " << endl;
cout << "  name: " << dbGetWidthSpacingPatternName(wsps[0]) << endl;
cout << "  offset: " << dbGetWidthSpacingPatternOffset(wsps[0]) << endl;
cout << "  repeat offset: " << dbGetWidthSpacingPatternRepeatOffset(wsps[0])
<< endl;
cout << "  shift color: " << (bool) dbGetWidthSpacingPatternShiftColor(wsps[0])
<< endl;
cout << "  starting color: "
<< dbMaskColorTypeToString(dbGetWidthSpacingPatternStartingColor(wsps[0])) << endl;
cout << endl << endl;
unsigned int                tmp_num = 0;
dbWidthSpacingPatternSpec   *tmp_specs = NULL;
dbGetWidthSpacingPatternPatterns(wsps[0], &tmp_num, &tmp_specs);
assert(tmp_num == num_wspSpecs);
dbFreeWidthSpacingPatternSpecArray(tmp_num, tmp_specs);
// Examples for the generator functions.
dbGenStateId            gen_state = dbStartGenWidthSpacingPattern(cellview);
dbWidthSpacingPatternId tmp_wsp;
cout << "Pattern names returned by the generator: ";
while (dbGenWidthSpacingPattern(gen_state, &tmp_wsp))
 cout << " " << dbGetWidthSpacingPatternName(tmp_wsp);
cout << endl << endl;
dbStopGen(gen_state);
// Examples for the find and delete functions.
assert(dbFindWidthSpacingPattern(cellview, "tmp_wsp")
    == dbcNullWidthSpacingPatternId);
tmp_wsp = dbCreateWidthSpacingPattern(cellview, "tmp_wsp", wspSpecs,
           num_wspSpecs, 0, FALSE,
           dbcGrayColor, FALSE);
assert(dbFindWidthSpacingPattern(cellview, "tmp_wsp"));
assert(dbDeleteWidthSpacingPattern(tmp_wsp));
assert(dbFindWidthSpacingPattern(cellview, "tmp_wsp")
    == dbcNullWidthSpacingPatternId);
// *** WIDTH SPACING PATTERN GROUP API EXAMPLES ***
constString                     wspgNames[] = {"wspg1"};
const unsigned int              num_wspgs = ARRAY_SIZE(wspgNames);
// This command will fail because a nonexisting widthSpacingPattern name
// is specified.
constString                     bad_wsp = "bad_wsp";
dbCreateWidthSpacingPatternGroup(cellview, NULL, (String *) &bad_wsp, 1);
// Generate valid widthSpacingPatternGroups.
dbWidthSpacingPatternGroupId    wspgs[num_wspgs];
for (int i = 0; i < num_wspgs; i++) {
 wspgs[i] = dbCreateWidthSpacingPatternGroup(cellview, wspgNames[i],
            (String *) &wspNames[0],
            num_wsps);
 assert(wspgs[i]);
}
// Examples for the getter functions.
cout << "Sample WSP group dump: " << endl;
cout << "  name: " << dbGetWidthSpacingPatternGroupName(wspgs[0]) << endl;
cout << "  patterns:";
constString*  tmp_names = NULL;
dbGetWidthSpacingPatternGroupPatternNames(wspgs[0], &tmp_num, &tmp_names);
assert(tmp_num == num_wsps);
for (int i = 0; i < tmp_num; i++)
 cout << " " << tmp_names[i];
cout << endl << endl;
free(tmp_names);
// Examples for the generator functions.
gen_state = dbStartGenWidthSpacingPatternGroup(cellview);
dbWidthSpacingPatternGroupId tmp_wspg;
cout << "Pattern group names returned by the generator: ";
while (dbGenWidthSpacingPatternGroup(gen_state, &tmp_wspg))
 cout << " " << dbGetWidthSpacingPatternGroupName(tmp_wspg);
cout << endl << endl;
dbStopGen(gen_state);
// Examples for the find and delete functions.
assert(dbFindWidthSpacingPatternGroup(cellview, "tmp_wspg")
    == dbcNullWidthSpacingPatternGroupId);
tmp_wspg = dbCreateWidthSpacingPatternGroup(cellview, "tmp_wspg",
           (String *) &wspNames[0], 1);
assert(dbFindWidthSpacingPatternGroup(cellview, "tmp_wspg"));
assert(dbDeleteWidthSpacingPatternGroup(tmp_wspg));
assert(dbFindWidthSpacingPatternGroup(cellview, "tmp_wspg")
    == dbcNullWidthSpacingPatternGroupId);
// *** PATTERN REGION API EXAMPLES ***
dbBBox     bBox;
dbFillBBox(&bBox, 0, 0, 200, 100);
dbRectId    rect = dbCreateRect(cellview, 10, dbcDrawingPurpose, &bBox);
// Since "rect" is a normal figure, this command will return FALSE.
assert(dbShapeHasPatternRegionInfo(rect) == FALSE);
// Examples for the dbSetPatternRegion...() functions.
// Using any dbSetPatternRegion... command on a dbShapeId initializes pattern
// region data, so dbShapeHasPatternRegionInfo() will be returning TRUE.
dbSetPatternRegionActivePattern(rect, wspNames[0]);
assert(dbShapeHasPatternRegionInfo(rect) == TRUE);
assert(dbHasPatternRegionActivePattern(rect) == TRUE);
dbSetPatternRegionAllowedPatterns(rect, wspNames, num_wsps);
dbSetPatternRegionAllowedPatternGroups(rect, wspgNames, num_wspgs);
// Examples for the dbGetPatternRegion...() functions.
cout << "Sample patternRegion dump: " << endl;
cout << "  create type: "
<< dbGetPatternRegionCreateType(rect) << endl;
cout << "  shift color: "
<< (bool) dbGetPatternRegionShiftColor(rect) << endl;
dbGetPatternRegionAllowedPatterns(rect, &tmp_names, &tmp_num);
assert(tmp_num == num_wsps);
cout << "  patterns:";
for (int i = 0; i < tmp_num; i++)
 cout << " " << tmp_names[i];
cout << endl;
free(tmp_names);
dbGetPatternRegionAllowedPatternGroups(rect, &tmp_names, &tmp_num);
assert(tmp_num == num_wspgs);
cout << "  pattern groups:";
for (int i = 0; i < tmp_num; i++)
 cout << " " << tmp_names[i];
cout << endl;
free(tmp_names);
dbGetPatternRegionCommittedPatterns(rect, &tmp_names, &tmp_num);
assert(tmp_num == num_wsps);
cout << "  committed patterns:";
for (int i = 0; i < tmp_num; i++)
 cout << " " << tmp_names[i];
cout << endl;
free(tmp_names);
cout << "  active pattern: "
<< dbGetPatternRegionActivePattern(rect) << endl;
// *** WIDTH SPACING SNAP PATTERN DEF API EXAMPLES ***
// Create the test data.
// At this point, we need the technology database.
techFileId          tech = techOpenTechFile("design", "tech.db", "w");
dbLayer             layers[] = { 6, 8 };
dbPurpose           purposes[] = { 1001, 1002 };
dbLayer             snapLayerNum = 8;
dbPurpose           snapPurposeNum = 5;
Boolean             isHorizontal = TRUE;
dbDistance          offset = 30;
dbDistance          period = 20;
const unsigned int  num_snapLayers = 1;
dbSnappingLayer     *snapLayers = dbAllocSnappingLayerArray(num_snapLayers);
    
snapLayers[0].layerNum = snapLayerNum;
snapLayers[0].purposes = calloc(1, dbPurpose);
snapLayers[0].numPurposes = 1;
snapLayers[0].purposes[0] = snapPurposeNum;
constString                     wsspDefNames[] = { "wsspdef1", "wsspdef2" };
const unsigned int              num_wsspDefs = ARRAY_SIZE(wsspDefNames);
dbWidthSpacingSnapPatternDefId  wsspDefs[num_wsspDefs];
constString                     defaultWSP =  "1X2X";
for (int i = 0; i < num_wsspDefs; i++) {
 wsspDefs[i] = dbCreateWidthSpacingSnapPatternDef(cellview,
              wsspDefNames[i],
              layers[i], purposes[i],
              period, isHorizontal,
              offset, snapLayers, 1,
              &wspNames[0], num_wsps,
              &wspgNames[0], num_wspgs,
              defaultWSP);
 assert(wsspDefs[i]);
}
// Examples for the getter functions.
cout << "Sample widthSpacingSnapPatternDef dump: " << endl;
cout << "  name: "
<< dbGetWidthSpacingSnapPatternDefName(wsspDefs[0]) << endl;
cout << "  layer: "
<< dbGetWidthSpacingSnapPatternDefLayer(wsspDefs[0]) << endl;
cout << "  purpose: "
<< dbGetWidthSpacingSnapPatternDefPurpose(wsspDefs[0]) << endl;
cout << "  period: "
<< dbGetWidthSpacingSnapPatternDefPeriod(wsspDefs[0]) << endl;
cout << "  offset: "
<< dbGetWidthSpacingSnapPatternDefOffset(wsspDefs[0]) << endl;
cout << "  horizontal: "
<< (bool) dbIsWidthSpacingSnapPatternDefHorizontal(wsspDefs[0]) << endl;
cout << "  default active pattern: "
<< dbGetWidthSpacingSnapPatternDefDefaultActiveName(wsspDefs[0])
<< endl;
dbSnappingLayer*    tmp_snapLayers = NULL;
// Test dbGetWidthSpacingSnapPatternDefSnappingLayers().
dbGetWidthSpacingSnapPatternDefSnappingLayers(wsspDefs[0], &tmp_num,
             &tmp_snapLayers);
assert(tmp_num == num_snapLayers);
cout << "  snapping layers:" << endl;
for (int i = 0; i < tmp_num; i++) {
 cout << "    layer: " << tmp_snapLayers[i].layerNum << " purposes:";
        
 for (int j = 0; j < tmp_snapLayers[i].numPurposes; j++)
  cout << " " << tmp_snapLayers[i].purposes[j];
 cout << endl;
}
cout << endl;
dbFreeSnappingLayerArray(tmp_num, tmp_snapLayers);
// Test dbGetWidthSpacingSnapPatternDefPatternNames().
dbGetWidthSpacingSnapPatternDefPatternNames(wsspDefs[0], &tmp_num,
           &tmp_names);
assert(tmp_num == num_wsps);
cout << "  patterns:";
for (int i = 0; i < tmp_num; i++)
 cout << " " << tmp_names[i];
cout << endl;
free(tmp_names);
// Test dbGetWidthSpacingSnapPatternDefPatternGroupNames().
dbGetWidthSpacingSnapPatternDefPatternGroupNames(wsspDefs[0], &tmp_num,
             &tmp_names);
assert(tmp_num == num_wspgs);
cout << "  pattern groups:";
for (int i = 0; i < tmp_num; i++)
 cout << " " << tmp_names[i];
cout << endl;
free(tmp_names);
// Examples for the generator functions.
gen_state = dbStartGenWidthSpacingSnapPatternDef(cellview);
dbWidthSpacingSnapPatternDefId tmp_wsspdef;
cout << "Snap pattern definition names returned by the generator: ";
while (dbGenWidthSpacingSnapPatternDef(gen_state, &tmp_wsspdef))
 cout << " " << dbGetWidthSpacingSnapPatternDefName(tmp_wsspdef);
cout << endl << endl;
dbStopGen(gen_state);
// Examples for the find and delete functions.
dbLayer     tmp_layer = 10;
dbPurpose   tmp_purpose = 1003;
assert(dbFindWidthSpacingSnapPatternDefByName(cellview, "tmp_wsspdef")
    == dbcNullWidthSpacingSnapPatternDefId);
tmp_wsspdef = dbCreateWidthSpacingSnapPatternDef(cellview,
             "tmp_wsspdef",
             tmp_layer, tmp_purpose,
             period, isHorizontal,
             offset, snapLayers, 1,
             NULL, 0,
             NULL, 0,
             defaultWSP);
assert(dbFindWidthSpacingSnapPatternDefByName(cellview, "tmp_wsspdef"));
assert(dbDeleteWidthSpacingSnapPatternDef(tmp_wsspdef));
assert(dbFindWidthSpacingSnapPatternDefByName(cellview, "tmp_wsspdef")
    == dbcNullWidthSpacingSnapPatternDefId);
tmp_wsspdef = dbCreateWidthSpacingSnapPatternDef(cellview,
             "tmp_wsspdef",
             tmp_layer, tmp_purpose,
             period, isHorizontal,
             offset, snapLayers, 1,
             NULL, 0,
             NULL, 0,
             defaultWSP);
assert(dbDeleteWidthSpacingSnapPatternDef(tmp_wsspdef));
// *** RELATED SNAP PATTERNS API EXAMPLES ***
// Create the test data.
const unsigned int          num_rspSpecs = 1;
dbRelatedSnapPatternsSpec   *rspSpecs = dbAllocRelatedSnapPatternsSpecArray(num_rspSpecs);
constString                 *wspNames2 = calloc(num_wsps, constString);
constString                 *wspgNames2 = calloc(num_wspgs, constString);
memcpy(wspNames2, wspNames, num_wsps * sizeof(constString));
memcpy(wspgNames2, wspgNames, num_wspgs * sizeof(constString));
rspSpecs[0] = { (String) wsspDefNames[0], (String *) wspNames2, num_wsps,
    (String *) wspgNames2, num_wspgs };
// Create invalid specs.
const unsigned int          num_rspSpecs_invalid = 3;
dbRelatedSnapPatternsSpec   *rspSpecs_invalid = dbAllocRelatedSnapPatternsSpecArray(num_rspSpecs_invalid);
constString                 *wspNames_invalid = calloc(1,
                constString);
constString                 *wspgNames_invalid = calloc(1,
                 constString);
wspNames_invalid[0] = "bad_wsp";
wspgNames_invalid[0] = "bad_wspg";
// Nonexisting widthSpacingPattern name.
rspSpecs_invalid[0] = { (String) wsspDefNames[0],
      (String *) wspNames_invalid, 1, NULL, 0 };
// Nonexisting widthSpacingPatternGroup name.
rspSpecs_invalid[1] = { (String) wsspDefNames[0], NULL, 0,
      (String *) wspgNames_invalid, 1};
// Nonexisting widthSpacingSnapPatternDef name.
rspSpecs_invalid[2] = { "bad_wsspdef", NULL, 0, NULL, 0};
// These commands will fail due to invalid relatedSnapPatternsSpecs.
for (int i = 0; i < num_rspSpecs_invalid; i++)
 assert(dbCreateRelatedSnapPatterns(cellview, "bad_rsp",
            rspSpecs_invalid + i, 1)
     == dbcNullRelatedSnapPatternsId);
// This command generates a valid relatedSnapPatterns object.
dbRelatedSnapPatternsId rsp = dbCreateRelatedSnapPatterns(cellview,
                "rsp0",
                rspSpecs,
                num_rspSpecs);
assert(rsp);
// End of the examples section.
// The remaining auxiliary objects should be deallocated.
dbFreeSnappingLayerArray(1, snapLayers);
dbFreeWidthSpacingPatternSpecArray(num_wspSpecs, wspSpecs);
dbFreeWidthSpacingPatternSpecArray(num_wspSpecs_invalid, wspSpecs_invalid);
dbFreeRelatedSnapPatternsSpecArray(num_rspSpecs, rspSpecs);


Return to top
 ⠀
X