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.
- Miscellaneous Technology File Functions
-
Width Spacing Pattern Functions
- techAllocWidthSpacingPatternSpecArray
- techCreateWidthSpacingPattern
- techDeleteWidthSpacingPattern
- techFindWidthSpacingPattern
- techFreeWidthSpacingPatternSpecArray
- techGenWidthSpacingPattern
- techGetWidthSpacingPatternAllowedRepeatMode
- techGetWidthSpacingPatternDefaultRepeatMode
- techGetWidthSpacingPatternName
- techGetWidthSpacingPatternOffset
- techGetWidthSpacingPatternPatterns
- techGetWidthSpacingPatternRepeatOffset
- techGetWidthSpacingPatternShiftColor
- techGetWidthSpacingPatternStartingColor
- techSetWidthSpacingPatternRepeatMode
- techGetWidthSpacingPatternStartingColor
- techStartGenWidthSpacingPattern
- Width Spacing Pattern Group Functions
-
Width Spacing Snap Pattern Definition Functions
- techCreateWidthSpacingSnapPatternDef
- techDeleteWidthSpacingSnapPatternDef
- techFindWidthSpacingSnapPatternDefByName
- techGenWidthSpacingSnapPatternDef
- techGenWidthSpacingSnapPatternDefForLPP
- techGetWidthSpacingSnapPatternDefDefaultActiveName
- techGetWidthSpacingSnapPatternDefLayer
- techGetWidthSpacingSnapPatternDefName
- techGetWidthSpacingSnapPatternDefOffset
- techGetWidthSpacingSnapPatternDefPatternGroupNames
- techGetWidthSpacingSnapPatternDefPatternNames
- techGetWidthSpacingSnapPatternDefPeriod
- techGetWidthSpacingSnapPatternDefPurpose
- techGetWidthSpacingSnapPatternDefSnappingLayers
- techIsWidthSpacingSnapPatternDefHorizontal
- techStartGenWidthSpacingSnapPatternDefForLPP
- techStartGenWidthSpacingSnapPatternDef
- Related Snap Pattern Functions
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
Return Value
|
A mask color type name. Valid values are |
techStringToMaskColorType
Boolean
techStringToMaskColorType( constStringtypeStr, 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
|
Pointer to the memory area where the conversion result will be written. The value referenced by the pointer is undefined if |
Return Value
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
|
Number of width spacing pattern specifications to fit in the allocated memory. |
Return Value
techCreateWidthSpacingPattern
techWidthSpacingPatternId
techCreateWidthSpacingPattern( techFileIdtechfile, constStringname, techWidthSpacingPatternSpec*patterns, unsigned intnumPatterns, dbDistanceoffset, BooleanisRepeatOffset, techColorMaskTypestartingColor, Boolean isShiftColor);
Description
Creates a width spacing pattern in the specified technology file.
Arguments
Return Value
techDeleteWidthSpacingPattern
Boolean
techDeleteWidthSpacingPattern(
techWidthSpacingPatternId wspId
);
Description
Deletes the specified width spacing pattern object.
Arguments
Return Value
techFindWidthSpacingPattern
techWidthSpacingPatternId
techFindWidthSpacingPattern( techFileIdtechfile, constStringname);
Description
Searches for the width spacing pattern with the specified name in the specified technology file.
Arguments
|
Name of the width spacing pattern for which the search is performed. |
Return Value
techFreeWidthSpacingPatternSpecArray
void
techFreeWidthSpacingPatternSpecArray( unsigned intnumPatterns, techWidthSpacingPatternSpec*patterns);
Description
Deallocates the memory allocated for an array of width spacing pattern specifications.
colors, wireTypes, and specs members of each width spacing snap pattern specification in the array.Arguments
|
Size of the deallocated memory area, measured in blocks of sizeof(techWidthSpacingPatternSpec) bytes. |
|
Return Value
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
|
ID of the next |
Return Value
|
|
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
|
ID of the next |
Return Value
|
|
techGetWidthSpacingPatternAllowedRepeatMode
techWSPAllowedRepeatMode
techGetWidthSpacingPatternAllowedRepeatMode(
techWidthSpacingPatternId wspId
);
Description
Returns the allowed repeat mode set for a width spacing pattern.
Arguments
Return Value
techGetWidthSpacingPatternDefaultRepeatMode
techWSPRepeatMode
techGetWidthSpacingPatternDefaultRepeatMode(
techWidthSpacingPatternId wspId
);
Description
Returns the default repeat mode set for a width spacing pattern.
Arguments
techGetWidthSpacingPatternName
String
techGetWidthSpacingPatternName( techWidthSpacingPatternId wspId );
Description
Retrieves the name for the specified width spacing pattern object.
Arguments
Return Value
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
Return Value
|
The offset value of the specified width spacing pattern object. |
techGetWidthSpacingPatternPatterns
void
techGetWidthSpacingPatternPatterns( techWidthSpacingPatternIdwspId, 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
|
Pointer to the memory area where the number of pattern specifications is placed. |
|
|
Pointer to the memory area where the array of pattern specifications is placed. |
Return Value
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
Return Value
|
Repeat offset flag of the specified width spacing pattern object. |
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
Return Value
|
The shift color flag of the specified width spacing pattern object. |
techGetWidthSpacingPatternStartingColor
techColorMaskType
techGetWidthSpacingPatternStartingColor(
techWidthSpacingPatternId wspId
);
Description
Retrieves the color of the first track for the specified width spacing pattern object.
Arguments
Return Value
techSetWidthSpacingPatternRepeatMode
Boolean
techSetWidthSpacingPatternRepeatMode( techWidthSpacingPatternIdwspId, techWSPAllowedRepeatModeallowedMode, techWSPRepeatModedefaultMode);
Description
Sets the allowed and default repeat modes for a width spacing pattern.
Arguments
Return Value
|
|
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
|
ID of the technology file containing the width spacing patterns to be generated. |
Return Value
Width Spacing Pattern Group Functions
techCreateWidthSpacingPatternGroup
techWidthSpacingPatternGroupId
techCreateWidthSpacingPatternGroup( techFileIdtechfile, constStringname, constString*patternNames, unsigned intnumPatternNames);
Description
Creates a group of width spacing patterns in the specified technology file.
Arguments
|
ID of the technology file in which the width spacing pattern group is created. |
|
|
Array of the width spacing pattern names to include in the group. |
|
Return Value
techDeleteWidthSpacingPatternGroup
Boolean
techDeleteWidthSpacingPatternGroup(
techWidthSpacingPatternGroupId WSPGId
);
Description
Deletes the specified width spacing pattern group object.
Arguments
Return Value
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
|
Name for the width spacing pattern group for which the search is performed. |
Return Value
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
|
ID of the next width spacing pattern group produced by the generator. This value is undefined if FALSE is returned. |
Return Value
|
|
techGetWidthSpacingPatternGroupName
String
techGetWidthSpacingPatternGroupName(
techWidthSpacingPatternGroupId WSPGId
);
Description
Retrieves the name for the specified width spacing pattern group object.
Arguments
Return Value
techGetWidthSpacingPatternGroupPatternNames
void
techGetWidthSpacingPatternGroupPatternNames( techWidthSpacingPatternGroupIdWSPGId, 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
|
Pointer to the memory area where the number of pattern names is placed. |
|
|
Pointer to the memory area where the array of pattern names is placed. |
Return Value
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 the function.
Arguments
|
ID of the technology file containing the width spacing pattern groups to be generated. |
Return Value
Width Spacing Snap Pattern Definition Functions
techCreateWidthSpacingSnapPatternDef
techWidthSpacingSnapPatternDefId
techCreateWidthSpacingSnapPatternDef( techFileIdtechId, constStringname, techLayerNumlayerNum, techPurposepurposeNum, dbDistanceperiod, BooleanisHorizontal, dbDistanceoffset, techSnappingLayer*snappingLayers, unsigned intnumSnappingLayers, String*patternNames, unsigned intnumPatterns, String*patternGroupNames, unsigned intnumPatternGroups, StringdefaultActive);
Description
Creates a width spacing snap pattern definition object in the specified technology file.
Arguments
Return Value
|
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
Return Value
techFindWidthSpacingSnapPatternDefByName
techWidthSpacingSnapPatternDefId
techFindWidthSpacingSnapPatternDefByName( techFileIdtechId, constStringname);
Description
Searches for the width spacing snap pattern definition object with the specified name in the specified technology file.
Arguments
|
Name of the width spacing pattern for which the search is performed. |
Return Value
|
ID of the width spacing snap pattern definition object, if found. |
|
techGenWidthSpacingSnapPatternDef
Boolean
techGenWidthSpacingSnapPatternDef( techGenStateIdpState, 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
|
ID of the next width spacing snap pattern definition produced by the generator. This value is undefined if |
Return Value
|
|
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
|
ID of the next width spacing snap pattern definition object produced by the generator. This value is undefined if |
Return Value
|
|
techGetWidthSpacingSnapPatternDefDefaultActiveName
String
techGetWidthSpacingSnapPatternDefDefaultActiveName(
techWidthSpacingSnapPatternDefId spDefId
);
Description
Retrieves the name of the default active pattern for the specified width spacing snap pattern definition object.
Arguments
Return Value
|
Default active pattern name for the specified width spacing snap pattern definition object. |
techGetWidthSpacingSnapPatternDefLayer
techLayerNum
techGetWidthSpacingSnapPatternDefLayer(
techWidthSpacingSnapPatternDefId spDefId
);
Description
Retrieves layer number for the specified width spacing snap pattern definition object.
Arguments
Return Value
|
Layer number for the specified width spacing snap pattern definition object. |
techGetWidthSpacingSnapPatternDefName
String
techGetWidthSpacingSnapPatternDefName(
techWidthSpacingSnapPatternDefId spDefId
);
Description
Retrieves the name for the specified width spacing snap pattern definition object.
Arguments
Return Value
|
Name of the specified width spacing snap pattern definition object. |
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
Return Value
|
Offset value of the specified width spacing snap pattern definition object. |
techGetWidthSpacingSnapPatternDefPatternGroupNames
void
techGetWidthSpacingSnapPatternDefPatternGroupNames( techWidthSpacingSnapPatternDefIdspDefId, 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
|
Pointer to the memory area where the number of pattern group names is placed. |
|
|
Pointer to the memory area where the array of pattern group names is placed. |
Return Value
techGetWidthSpacingSnapPatternDefPatternNames
void
techGetWidthSpacingSnapPatternDefPatternNames( techWidthSpacingSnapPatternDefIdspDefId, 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
|
Pointer to the memory area where the number of pattern names is placed. |
|
|
Pointer to the memory area where the array of pattern names is placed. |
Return Value
techGetWidthSpacingSnapPatternDefPeriod
dbDistance
techGetWidthSpacingSnapPatternDefPeriod(
techWidthSpacingSnapPatternDefId spDefId
);
Description
Retrieves the spacing between coarse-grain period tracks for the specified width spacing snap pattern definition object.
Arguments
Return Value
techGetWidthSpacingSnapPatternDefPurpose
techPurpose
techGetWidthSpacingSnapPatternDefPurpose(
techWidthSpacingSnapPatternDefId spDefId
);
Description
Retrieves the purpose for the specified width spacing snap pattern definition object.
Arguments
Return Value
|
The purpose number for the specified width spacing snap pattern definition object. |
techGetWidthSpacingSnapPatternDefSnappingLayers
void
techGetWidthSpacingSnapPatternDefSnappingLayers( techWidthSpacingSnapPatternDefIdspDefId, unsigned int*numSnappingLayers, techSnappingLayer**snappingLayers);
Description
Retrieves an array of snapping layers for the specified width spacing snap pattern definition object.
Arguments
|
Pointer to the memory area where the number of snapping layers is placed. |
|
|
Pointer to the memory area where the array of snapping layers is placed. |
Return Value
techIsWidthSpacingSnapPatternDefHorizontal
Boolean
techIsWidthSpacingSnapPatternDefHorizontal(
techWidthSpacingSnapPatternDefId spDefId
);
Description
Verifies whether the specified width spacing snap pattern definition object is horizontal.
Arguments
Return Value
techStartGenWidthSpacingSnapPatternDefForLPP
techGenStateId
techStartGenWidthSpacingSnapPatternDefForLPP( techFileIdtechId, techLayerIdlayerId, techPurposeIdpurposeId);
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
|
ID of the technology file containing the width spacing snap pattern definition objects to be generated. |
|
Return Value
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
|
ID of the technology file containing the width spacing snap pattern definitions to be generated. |
Return Value
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.
|
Number of related snap pattern specifications to fit in the allocated memory. |
Return Value
techCreateRelatedSnapPatterns
techRelatedSnapPatternsId
techCreateRelatedSnapPatterns( techFileIdtechfile, constStringname, techRelatedSnapPatternsSpec*relatedSnapPatterns, unsigned intnumRelatedSnapPatterns);
Description
Creates a group of related snap patterns in the specified technology file.
Arguments
|
ID of the technology file in which the related snap patterns are created. |
|
|
Array of related snap pattern definitions to include in the group. |
|
Return Value
techDeleteRelatedSnapPatterns
Boolean
techDeleteRelatedSnapPatterns(
techRelatedSnapPatternsId relatedSnapPatternsId
);
Description
Deletes the specified related snap patterns object.
Arguments
Return Value
techFindRelatedSnapPatterns
techRelatedSnapPatternsId
techFindRelatedSnapPatterns( techFileIdtechfile, constStringname);
Description
Searches for the group of related snap patterns with the specified name in the specified technology file.
Arguments
|
Name of the group of related snap patterns for which the search is performed. |
Return Value
techFreeRelatedSnapPatternsSpecArray
void
techFreeRelatedSnapPatternsSpecArray( unsigned intnumSpecs, techRelatedSnapPatternsSpec*patternSpecs);
Description
Deallocates the memory allocated for an array of related snap patterns specifications.
patterns and patternGroups members of each related snap patterns specification in the array.Arguments
|
Size of the deallocated memory area, measured in blocks of sizeof(techRelatedSnapPatternsSpec) bytes. |
|
Return Value
techGenRelatedSnapPatterns
Boolean
techGenRelatedSnapPatterns( techGenStateIdpState, 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
|
ID of the next related snap pattern produced by the generator. This value is undefined if |
Return Value
|
|
techGetRelatedSnapPatternsName
String
techGetRelatedSnapPatternsName(
techRelatedSnapPatternsId relatedSnapPatternsId
);
Description
Retrieves the name for the specified related snap patterns object.
Arguments
Return Value
techGetRelatedSnapPatternsSpec
void
techGetRelatedSnapPatternsSpec( techRelatedSnapPatternsIdrelatedSnapPatternsId, 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
|
Pointer to the memory area where the number of snap pattern specifications is placed. |
|
|
Pointer to the memory area where the array of snap pattern specifications is placed. |
Return Value
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
|
ID of the technology file containing the related snap patterns to be generated. |
Return Value
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.
- Miscellaneous Database File Functions
- Global Grid Offset Functions
-
Width Spacing Pattern Functions
- dbAllocWidthSpacingPatternSpecArray
- dbCreateWidthSpacingPattern
- dbCreateWidthSpacingPatternWithRepeatMode
- dbFindWidthSpacingPattern
- dbFreeWidthSpacingPatternSpecArray
- dbGenWidthSpacingPattern
- dbGetWidthSpacingPatternAllowedRepeatMode
- dbGetWidthSpacingPatternDefaultRepeatMode
- dbGetWidthSpacingPatternName
- dbGetWidthSpacingPatternOffset
- dbGetWidthSpacingPatternPatterns
- dbGetWidthSpacingPatternRepeatOffset
- dbGetWidthSpacingPatternShiftColor
- dbGetWidthSpacingPatternStartingColor
- dbStartGenWidthSpacingPattern
- Width Spacing Pattern Group Functions
-
Pattern Region Functions
- dbGetPatternRegionCommittedPatterns
- dbGetPatternRegionActivePattern
- dbGetPatternRegionAllowedPatternGroups
- dbGetPatternRegionAllowedPatterns
- dbGetPatternRegionCreateType
- dbGetPatternRegionDefaultRepeatMode
- dbGetPatternRegionRepeatMode
- dbGetPatternRegionShiftColor
- dbHasPatternRegionActivePattern
- dbSetPatternRegionActivePattern
- dbSetPatternRegionAllowedPatternGroups
- dbSetPatternRegionAllowedPatterns
- dbSetPatternRegionRepeatMode
- dbShapeHasPatternRegionInfo
-
Width Spacing Snap Pattern Definition Functions
- dbAllocSnappingLayerArray
- dbFreeSnappingLayerArray
- dbCreateWidthSpacingSnapPatternDef
- dbDeleteWidthSpacingSnapPatternDef
- dbFindWidthSpacingSnapPatternDefByName
- dbFindWidthSpacingSnapPatternDefByName
- dbGenWidthSpacingSnapPatternDef
- dbGenWidthSpacingSnapPatternDefForSnappingLPP
- dbGetWidthSpacingSnapPatternDefDefaultActiveName
- dbGetWidthSpacingSnapPatternDefLayer
- dbGetWidthSpacingSnapPatternDefName
- dbGetWidthSpacingSnapPatternDefOffset
- dbGetWidthSpacingSnapPatternDefPatternGroupNames
- dbGetWidthSpacingSnapPatternDefPatternNames
- dbGetWidthSpacingSnapPatternDefPeriod
- dbGetWidthSpacingSnapPatternDefPurpose
- dbGetWidthSpacingSnapPatternDefSnappingLayers
- dbIsWidthSpacingSnapPatternDefHorizontal
- dbStartGenWidthSpacingSnapPatternDef
- dbStartGenWidthSpacingSnapPatternDefForSnappingLPP
- Related Snap Pattern Functions
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
Return Value
|
A mask color type name. Valid values are |
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
Return Value
Global Grid Offset Functions
dbGetGlobalGridDefaultRepeatMode
dbWSPRepeatMode
dbGetGlobalGridDefaultRepeatMode( dbCellViewIdcvId, constStringdefName);
Description
Returns the default repeat mode for the specified widthSpacingSnapPatternDef global grid in the specified cellview.
Arguments
Return 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
|
ID of the cellview used to obtain the global grid offset reference. |
|
The value of the global grid offset reference. Valid Values: |
dbGetGlobalGridRepeatMode
dbWSPRepeatMode
dbGetGlobalGridRepeatMode( dbCellViewIdcvId, constStringdefName, constStringwspName);
Description
Returns the repeat mode for the specified widthSpacingSnapPatternDef global grid in the specified cellview for the given width spacing pattern.
Arguments
Return 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( dbCellViewIdcvId, constStringdefName, dbWSPRepeatModerepeatMode);
Description
Sets the specified repeat mode as the default on a cellview for the specified widthSpacingSnapPatternDef global grid.
Arguments
|
Name of the repeat mode enum value to be set.
Valid values: |
Return Value
|
|
|
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
|
ID of the cellview used to store the global grid offset reference. |
|
|
Value of the global grid reference. Valid values: |
|
|
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
|
Number of width spacing pattern specifications to fit in the allocated memory |
Return Value
dbCreateWidthSpacingPattern
dbWidthSpacingPatternId
dbCreateWidthSpacingPattern( dbCellViewIdcv, constStringname, dbWidthSpacingPatternSpec*patterns, unsigned intnumPatterns, dbDistanceoffset, BooleanisRepeatOffset, dbMaskColorTypestartingColor, BooleanisShiftColor);
Description
Creates a width spacing pattern in the specified cellview.
Arguments
Return Value
dbCreateWidthSpacingPatternWithRepeatMode
dbWidthSpacingPatternId
dbCreateWidthSpacingPatternWithRepeatMode( dbCellViewIdcv, constStringname, dbWidthSpacingPatternSpec*patterns, unsigned intnumPatterns, dbDistanceoffset, BooleanisRepeatOffset, dbMaskColorTypestartingColor, BooleanisShiftColordbWSPAllowedRepeatModeallowedMode, dbWSPRepeatModedefaultMode);
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
Return Value
dbDeleteWidthSpacingPattern
Boolean
dbDeleteWidthSpacingPattern(
dbWidthSpacingPatternId wspId
);
Description
Deletes the specified width spacing snap pattern object.
Arguments
Return Value
dbFindWidthSpacingPattern
dbWidthSpacingPatternId
dbFindWidthSpacingPattern( dbCellViewIdcv, constStringname);
Description
Searches for the width spacing pattern with the specified name in the specified cellview.
Arguments
|
Name for the width spacing pattern for which the search is performed. |
Return Value
dbFreeWidthSpacingPatternSpecArray
void
dbFreeWidthSpacingPatternSpecArray( unsigned intnumPatternSpecs, dbWidthSpacingPatternSpec*patternSpecs);
Description
Deallocates the memory allocated for an array of width spacing pattern specifications.
colors, wireTypes, and specs members of each width spacing snap pattern specification in the array.Arguments
|
Size of the deallocated memory area, measured in blocks of sizeof(dbWidthSpacingPatternSpec) bytes. |
|
Return Value
dbGenWidthSpacingPattern
Boolean
dbGenWidthSpacingPattern( dbGenStateIdpState, 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
|
ID of the next width spacing pattern object produced by the generator. This value is undefined if |
Return Value
|
|
dbGetWidthSpacingPatternAllowedRepeatMode
dbWSPAllowedRepeatMode
dbGetWidthSpacingPatternAllowedRepeatMode(
dbWidthSpacingPatternId wspId
);
Description
Returns the allowed repeat mode for the specified width spacing pattern.
Arguments
Return 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
Return 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
Return Value
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
Return Value
dbGetWidthSpacingPatternPatterns
void
dbGetWidthSpacingPatternPatterns( dbWidthSpacingPatternIdwspId, 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
|
Pointer to the memory area where the number of pattern specifications is placed. |
|
|
Pointer to the memory area where the array of pattern specifications is placed. |
Return Value
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
Return Value
|
The repeat offset flag of the specified width spacing pattern object. |
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
Return Value
|
The shift color flag of the specified width spacing pattern object. |
dbGetWidthSpacingPatternStartingColor
dbColorMaskType
dbGetWidthSpacingPatternStartingColor(
dbWidthSpacingPatternId wspId
);
Description
Retrieves the color of the first track for the specified width spacing pattern object.
Arguments
Return Value
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
|
ID of the cellview containing the width spacing pattern objects to be generated. |
Return Value
Width Spacing Pattern Group Functions
dbCreateWidthSpacingPatternGroup
dbWidthSpacingPatternGroupId
dbCreateWidthSpacingPatternGroup( dbCellViewIdcv, constStringgroupName, const constString*patternNames, unsigned intnumPatternNames);
Description
Creates a group of width spacing patterns in the specified cellview.
Arguments
|
ID of the cellview in which the width spacing pattern group is created. |
|
Return Value
dbDeleteWidthSpacingPatternGroup
Boolean
dbDeleteWidthSpacingPatternGroup(
dbWidthSpacingPatternGroupId groupId
);
Description
Deletes the specified width spacing pattern group object.
Arguments
Return Value
dbFindWidthSpacingPatternGroup
dbWidthSpacingPatternGroupId
dbFindWidthSpacingPatternGroup( dbCellViewIdcv, constStringname);
Description
Searches for the width spacing pattern group with the specified name in the specified cellview.
Arguments
|
Name of the width spacing pattern group for which the search is performed. |
Return Value
dbGenWidthSpacingPatternGroup
Boolean
dbGenWidthSpacingPatternGroup( dbGenStateIdpState, 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
|
ID of the next width spacing pattern group object produced by the generator. This value is undefined if |
Return Value
|
|
dbGetWidthSpacingPatternGroupName
String
dbGetWidthSpacingPatternGroupName(
dbWidthSpacingPatternGroupId groupId
);
Description
Retrieves the name for the specified width spacing pattern group object.
Arguments
Return Value
dbGetWidthSpacingPatternGroupPatternNames
void
dbGetWidthSpacingPatternGroupPatternNames( dbWidthSpacingPatternGroupIdgroupId, 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
|
Pointer to the memory area where the number of pattern names is placed. |
|
|
Pointer to the memory area where the array of pattern names is placed. |
Return Value
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
|
ID of the cellview containing the width spacing pattern group objects to be generated. |
Return Value
Pattern Region Functions
dbGetPatternRegionCommittedPatterns
void
dbGetPatternRegionCommittedPatterns( dbShapeIdshapeId, 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
|
Pointer to the memory area where the array of committed patterns is placed. |
|
|
Pointer to the memory area where the number of committed patterns is placed. |
Return Value
dbGetPatternRegionActivePattern
String
dbGetPatternRegionActivePattern(
dbShapeId shapeId
);
Description
Retrieves the name of the active pattern currently set for the specified shape.
Arguments
|
ID of the shape for which the active pattern is to be retrieved. |
Return Value
dbGetPatternRegionAllowedPatternGroups
void
dbGetPatternRegionAllowedPatternGroups( dbShapeIdshapeId, 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
|
Pointer to the memory area where the array of allowed pattern groups is placed. |
|
|
Pointer to the memory area where the number of allowed pattern groups is placed. |
Return Value
dbGetPatternRegionAllowedPatterns
void
dbGetPatternRegionAllowedPatterns( dbShapeIdshapeId, 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
|
Pointer to the memory area where the array of allowed patterns is placed. |
|
|
Pointer to the memory area where the number of allowed patterns is placed. |
Return Value
dbGetPatternRegionCreateType
String
dbGetPatternRegionCreateType(
dbShapeId shapeId
);
Description
Retrieves the create type for the specified shape. The return value is either “systemCreated” or “userCreated”.
Arguments
Return Value
dbGetPatternRegionDefaultRepeatMode
dbWSPRepeatMode
dbGetPatternRegionDefaultRepeatMode(
dbShapeId shapeId
);
Description
Returns the default repeat mode for the specified pattern region.
Arguments
Return Value
|
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( dbShapeIdshapeId, constStringwspName, );
Description
Returns the repeat mode for the specified width spacing pattern in the given pattern region.
Arguments
Return Value
|
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
Return Values
dbHasPatternRegionActivePattern
Boolean
dbHasPatternRegionActivePattern(
dbShapeId shapeId
);
Description
Checks if an active pattern is set for the specified shape.
Arguments
Return Values
|
|
dbSetPatternRegionActivePattern
Boolean
dbSetPatternRegionActivePattern( dbShapeIdshapeId, constStringpatternName) );
Description
Sets the active pattern for the specified shape.
Arguments
Return Valuesf
dbSetPatternRegionAllowedPatternGroups
Boolean
dbSetPatternRegionAllowedPatternGroups( dbShapeIdshapeId, String**groupNames, unsigned int*numGroups);
Description
Sets allowed pattern groups for the specified shape.
Arguments
Return Values
dbSetPatternRegionAllowedPatterns
Boolean
dbSetPatternRegionAllowedPatterns( dbShapeIdshapeId, consString**patternNames, unsigned int*numPatterns);
Description
Sets the allowed patterns for the specified shape.
Arguments
Return Values
dbSetPatternRegionDefaultRepeatMode
Boolean
SetPatternRegionDefaultRepeatMode( dbShapeIdshapeId, dbWSPRepeatModerepeatMode);
Description
Sets the default repeat mode on the specified pattern region.
Arguments
Value Returned
|
|
|
dbSetPatternRegionDefaultRepeatMode(shapeID, dbcWSPStepped)
Sets the default repeat mode as dbcWSPStepped for the pattern region shapeID.
dbSetPatternRegionRepeatMode
Boolean
dbSetPatternRegionRepeatMode( dbShapeIdshapeId, constStringwspName, dbWSPRepeatModerepeatMode);
Description
Sets the specified repeat mode on the pattern region for the specified width spacing pattern.
Arguments
Return Value
|
|
|
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
Return Values
|
|
dbGetPatternRegionName
constString
dbGetPatternRegionName(
dbShapeId shapeId
);
Description
Returns the name of the pattern region set for the specified shape.
Arguments
Value Returned
dbSetPatternRegionName
Boolean
dbSetPatternRegionName( dbShapeIdshapeId, constStringname);
Description
Sets the specified pattern region for the specified shape.
Arguments
Value Returned
|
|
dbGetPatternRegionCommittedPatternShiftColor
Boolean
dbGetPatternRegionCommittedPatternShiftColor( dbShapeIdshapeId, constStringpatternName);
Description
Returns a shiftColor flag of the committed pattern with the specified name.
Arguments
|
ID of the shape for which the committed patterns are retrieved. |
|
Return Value
|
|
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
Return Value
dbFreeSnappingLayerArray
void
dbFreeSnappingLayerArray( unsigned intnumLayers, dbSnappingLayer*layers);
Description
Deallocates the memory allocated for an array of snapping layers.
Arguments
|
Size of the deallocated memory area, measured in blocks of sizeof(dbSnappingLayer) bytes. |
|
Return Value
dbCreateWidthSpacingSnapPatternDef
dbWidthSpacingSnapPatternDefId
dbCreateWidthSpacingSnapPatternDef( dbCellViewIddbId, constStringname, dbLayerlayerNum, dbPurposepurposeNum, dbDistanceperiod, BooleanisHorizontal, dbDistanceoffset, dbSnappingLayer*snappingLayers, unsigned intnumSnappingLayers, String*patternNames, unsigned intnumPatterns, String*patternGroupNames, unsigned intnumPatternGroups, StringdefaultActive);
Description
Creates a width spacing snap pattern definition object in the specified database.
Arguments
Return Value
|
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
Return Value
dbFindWidthSpacingSnapPatternDefByName
dbWidthSpacingSnapPatternDefId
dbFindWidthSpacingSnapPatternDefByName( dbCellViewIddbId, constStringname);
Description
Searches for the width spacing snap pattern definition object with the specified name in the specified database.
Arguments
|
Name of the width spacing pattern for which the search is performed. |
Return Value
|
ID of the width spacing snap pattern definition object, if found. |
|
dbGenWidthSpacingSnapPatternDef
Boolean
dbGenWidthSpacingSnapPatternDef( dbGenStateIdpState, 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
|
ID of the next width spacing snap pattern definition object produced by the generator. This value is undefined if |
Return Value
|
|
dbGenWidthSpacingSnapPatternDefForLPP
Boolean
dbGenWidthSpacingSnapPatternDefForLPP( dbGenStateIdpState, 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
|
ID of the next width spacing snap pattern definition object produced by the generator. This value is undefined if |
Return Value
|
|
dbGenWidthSpacingSnapPatternDefForSnappingLPP
Boolean
dbGenWidthSpacingSnapPatternDefForSnappingLPP( dbGenStateIdpState, 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
|
ID of the next width spacing snap pattern definition object produced by the generator. This value is undefined if |
Return Value
|
|
dbGetWidthSpacingSnapPatternDefDefaultActiveName
String
dbGetWidthSpacingSnapPatternDefDefaultActiveName(
dbWidthSpacingSnapPatternDefId spDefId
);
Description
Retrieves the name of the default active pattern for the specified width spacing snap pattern definition object.
Arguments
Return Value
|
Default active pattern name of the specified width spacing snap pattern definition object. |
dbGetWidthSpacingSnapPatternDefLayer
dbLayer
dbGetWidthSpacingSnapPatternDefLayer(
dbWidthSpacingSnapPatternDefId spDefId
);
Description
Retrieves the layer number for the specified width spacing snap pattern definition object.
Arguments
Return Value
|
The layer number for the specified width spacing snap pattern definition object. |
dbGetWidthSpacingSnapPatternDefName
String
dbGetWidthSpacingSnapPatternDefName(
dbWidthSpacingSnapPatternDefId spDefId
);
Description
Retrieves the name for the specified width spacing snap pattern definition object.
Arguments
Return Value
|
Name of the specified width spacing snap pattern definition object. |
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
Return Value
|
The offset value of the specified width spacing snap pattern definition object. |
dbGetWidthSpacingSnapPatternDefPatternGroupNames
void
dbGetWidthSpacingSnapPatternDefPatternGroupNames( dbWidthSpacingSnapPatternDefIdspDefId, 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
Return Value
dbGetWidthSpacingSnapPatternDefPatternNames
void
dbGetWidthSpacingSnapPatternDefPatternNames( dbWidthSpacingSnapPatternDefIdspDefId, 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
|
Pointer to the memory area where the number of pattern names is placed. |
|
|
Pointer to the memory area where the array of pattern names is placed. |
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
|
ID of the specified width spacing snap pattern definition object. |
Return Value
dbGetWidthSpacingSnapPatternDefPurpose
dbPurpose
dbGetWidthSpacingSnapPatternDefPurpose(
dbWidthSpacingSnapPatternDefId spDefId
);
Description
Retrieves the purpose for the specified width spacing snap pattern definition object.
Arguments
|
ID of the specified width spacing snap pattern definition object. |
Return Value
|
The purpose number for the specified width spacing snap pattern definition object. |
dbGetWidthSpacingSnapPatternDefSnappingLayers
void
dbGetWidthSpacingSnapPatternDefSnappingLayers( dbWidthSpacingSnapPatternDefIdspDefId, unsigned int*numSnappingLayers, dbSnappingLayer**snappingLayers);
Description
Retrieves an array of snapping layers for the specified width spacing snap pattern definition object.
Arguments
|
Pointer to the memory area where the number of snapping layers is placed. |
|
|
Pointer to the memory area where the array of snapping layers is placed. |
Return Value
dbIsWidthSpacingSnapPatternDefHorizontal
Boolean
dbIsWidthSpacingSnapPatternDefHorizontal(
dbWidthSpacingSnapPatternDefId spDefId
);
Description
Verifies whether the direction of the specified width spacing snap pattern definition object is horizontal.
Arguments
Return Value
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
|
ID of the cellview containing the width spacing snap pattern definition objects to be generated. |
Return Value
dbStartGenWidthSpacingSnapPatternDefForSnappingLPP
dbGenStateId
dbStartGenWidthSpacingSnapPatternDefForSnappingLPP( dbCellViewIddbId, dbLayerlayer, dbPurposepurpose);
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
|
ID of the cellview containing the width spacing snap pattern definition objects to be generated. |
|
Return Value
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.
|
The number of related snap patterns specifications to fit in the allocated memory. |
Return Value
dbCreateRelatedSnapPatterns
dbRelatedSnapPatternsId
dbCreateRelatedSnapPatterns( dbCellViewIdcv, constStringname, const dbRelatedSnapPatternsSpec*relatedSnapPatterns, unsigned intnumRelatedSnapPatterns);
Description
Creates the specified related snap patterns object in the specified cellview.
Arguments
|
ID of the cellview in which the related snap patterns object is created. |
|
Return Value
dbDeleteRelatedSnapPatterns
Boolean
dbDeleteRelatedSnapPatterns(
dbRelatedSnapPatternsId rspId
);
Description
Deletes the specified related snap patterns object.
Arguments
Return Value
dbFindRelatedSnapPatterns
dbRelatedSnapPatternsId
dbFindRelatedSnapPatterns( dbCellViewIdcv, constStringname);
Description
Searches for the related snap patterns object with the specified name in the specified cellview.
Arguments
|
Name of the related snap patterns object for which the search is performed. |
Return Value
dbFreeRelatedSnapPatternsSpecArray
void
dbFreeRelatedSnapPatternsSpecArray( unsigned intnumSpecs, dbRelatedSnapPatternsSpec*patternSpecs);
Description
Frees the memory allocated for an array of related snap patterns specifications.
Arguments
|
Size of the deallocated memory area, measured in blocks of sizeof(dbRelatedSnapPatternsSpec) bytes. |
|
Return Value
dbGenRelatedSnapPatterns
Boolean
dbGenRelatedSnapPatterns( dbGenStateIdpState, 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
|
ID of the next related snap patterns object produced by the generator. This value is undefined if |
Return Value
|
|
dbGetRelatedSnapPatternsName
String
dbGetRelatedSnapPatternsName(
dbRelatedSnapPatternsId relatedSnapPatternsId
);
Description
Retrieves the name for the specified related snap patterns object.
Arguments
Return Value
dbGetRelatedSnapPatternsSpec
void
dbGetRelatedSnapPatternsSpec( dbRelatedSnapPatternsIdrelatedSnapPatternsId, unsigned int*numSpecs, dbRelatedSnapPatternsSpec**patternSpecs);
Description
Retrieves the array of related snap pattern specifications for the specified related snap patterns object.
Arguments
|
Pointer to the memory area where the number of related snap pattern specifications is placed. |
|
|
Pointer to the memory area where the array of related snap pattern specifications is placed. |
Return Value
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
|
ID of the cellview containing the related snap patterns objects to be generated. |
Return Value
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