The Cadence® Design Exchange Format (DEF) reader calls all callback routines when it reads in the appropriate part of the DEF file. Some routines, such as the design name callback, are called only once. Other routines, such as the net callback, can be called more than once.
This chapter contains the following sections:
All callback functions use the following format.
Each user-supplied callback routine is passed three arguments.
The callBackType argument is a list of objects that contains a unique number assignment for each callback from the parser. This list allows you to use the same callback routine for different types of DEF data.
The DEF_data argument provides the data specified by the callback. Data types returned by the callbacks vary for each callback. Examples of the types of arguments passed include const char*, double, int, and defiProp. Two points to note:
The data argument is a four-byte data item that is set by the user. Note that the DEF reader contains only user data. The user data is most often set to a pointer to the design data so that it can be passed to the routines. This is more effective than using a global variable.
Note: You can unset a callback by using the set function with a null argument.
The following table lists the DEF reader callback setting routines and the associated callback types. The contents of the setting routines are described in detail in the section "User Callback Routines".
void defrComponentMaskShiftLayerCbk |
||
This section describes the following routines:
Retrieves data from the BLOCKAGES statement in the DEF file. Use the arguments defined in the defiBlockage class to retrieve the data. For syntax information about the DEF BLOCKAGES statement, see Blockages in the LEF/DEF Language Reference.
Returns the defrBlockageCbkType type, which indicates that the blockage callback was called.
Returns a pointer to a defiBlockage structure. For more information, see defiBlockage.
Returns four bytes of user-defined data. User data is most often set to a pointer to the design data.
Retrieves data from the DIEAREA statement in the DEF file. Use the arguments defined in the defiBox class to retrieve the data. For syntax information about the DEF DIEAREA statement, see Die Area in the LEF/DEF Language Reference.
Returns the defrDieAreaCbkType type, which indicates that the die area callback was called.
Returns a pointer to a defiBox structure. For more information, see defiBox.
Returns four bytes of user-defined data. User data is most often set to a pointer to the design data.
Retrieves data from the COMPONENTS statement in the DEF file. Use the arguments defined in the defiComponent class to retrieve the data. For syntax information about the DEF COMPONENTS statement, see Components in the LEF/DEF Language Reference.
Returns the defrComponentCbkType, which indicates that the component callback was called.
Returns a pointer to a defiComponent structure. For more information, see defiComponent.
Returns four bytes of user-defined data. User data is most often set to a pointer to the design data.
Retrieves data from the COMPONENTMASKSHIFT statement of the DEF file. The format of the data returned is always the same, but the actual data represented varies depending on the calling routine.
For syntax information about the DEF COMPONENTMASKSHIFT statement, see "Component Mask Shift" in the LEF/DEF Language Reference.
Returns the defrComponentMaskShiftLayerCbkFnType. This allows you to verity within your program that this is a correct callback.
Returns a pointer to a defiComponentMaskShiftLayer. For more information, see defiComponentMaskShiftLayer.
Returns four bytes of user-defined data. User data is most often set to a pointer to the design data.
Retrieves data from the UNITS and VERSION statements of the DEF file. The format of the data returned is always the same, but the actual data represented varies depending on the calling routine.
For syntax information about the DEF UNITS and VERSION statements, see Units and Version in the LEF/DEF Language Reference.
Returns a type that varies depending on the callback routine used. The following types can be returned.
Returns data that varies depending on the callback used. The following kinds of data can be returned.
DEFconvertFactor in the UNITS statement |
|
versionNumber in the VERSION statement |
Specifies four bytes of user-defined data. User data is set most often to a pointer to the design data.
The following example shows a callback routine with the type defrVersionCbkType.
Retrieves data from the FILLS statement in the DEF file. Use the arguments defined in the defiFill class to retrieve the data. For syntax information about the DEF FILLS statement, see Fills in the LEF/DEF Language Reference.
Returns the defrFillCbkFnType, which indicates that the fill callback was called.
Returns a pointer to a defifill structure. For more information, see defiFill.
Specifies four bytes of user-defined data. User data is set most often to a pointer to the design data.
Retrieves data from the GCELLGRID statement in the DEF file. Use the arguments defined in the defiGcellGrid class to retrieve the data. For syntax information about the DEF GCELLGRID statement, see GCell Grid in the LEF/DEF Language Reference.
Returns the defrGcellGridCbkType, which indicates that the gcell grid callback was called.
Returns a pointer to a defiGcellGrid structure. For more information, see defiGcellGrid.
Specifies four bytes of user-defined data. User data is set most often to a pointer to the design data.
Retrieves data from the GROUPS statement in the DEF file. Use the arguments defined in the defiGroup class to retrieve the data. For syntax information about the DEF GROUPS statement, see Groups in the LEF/DEF Language Reference.
Returns the defrGroupCbkType, which indicates that the group callback was called.
Returns a pointer to a defiGroup structure. For more information, see defiGroup.
Specifies four bytes of user-defined data. User data is set most often to a pointer to the design data.
Returns a type that varies depending on the callback routine used. The following types can be returned.
Returns data that varies depending on the callback used. The following kinds of data can be returned.
numBlockages in the BLOCKAGES statement |
|
numComps in the COMPONENTS statement |
|
numFills in the FILLS statement |
|
numGroups in the GROUPS statement |
|
numNets in the NETS statement |
|
numRules in the NONDEFAULTRULES statement |
|
num in the PINPROPERTIES statement |
|
numPins in the PINS statement |
|
numRegions in the REGIONS statement |
|
numScanChains in the SCANCHAINS statement |
|
numSlots in the SLOTS statement |
|
numNets in the SPECIALNETS statement |
|
numStyles in the STYLES statement |
|
numVias in the VIAS statement |
Specifies four bytes of user-defined data. User data is set most often to a pointer to the design data.
Retrieves data from the NETS and SPECIALNETS sections of the DEF file. Use the arguments defined in the defiNet class to retrieve the data.
For syntax information about the DEF NETS and SPECIALNETS statements, see Nets and Special Nets in the LEF/DEF Language Reference.
Returns a type that varies depending on the callback routine used. The following types can be returned.
Returns a pointer to a defiNet structure. For more information, see defiNet.
Specifies four bytes of user-defined data. User data is set most often to a pointer to the design data.
Retrieves data from the NONDEFAULTRULES statement in the DEF file. Use the arguments defined in the defiNonDefault class to retrieve the data. For syntax information about the DEF NONDEFAULTRULES statement, see "Nondefault Rules," in the LEF/DEF Language Reference.
Returns the defrNonDefaultCbkType type, which indicates that the nondefault rule callback was called.
Returns a pointer to a defiNonDefault structure. For more information, see defiNonDefault.
Specifies four bytes of user-defined data. User data is set most often to a pointer to the design data.
Retrieves data from the regularWiring and specialWiring specifications in the NETS and SPECIALNETS statements of the DEF file. Use the arguments defined in the defiPath class to retrieve the data.
For syntax information about the DEF NETS and SPECIALNETS statements, see Nets and Special Nets in the LEF/DEF Language Reference.
Returns the defrPathCbkType type, which indicates that the path callback was called.
Returns a pointer to a defiPath structure. For more information, see defiPath.
Specifies four bytes of user-defined data. User data is set most often to a pointer to the design data.
Retrieves data from the PINS statement in the DEF file. Use the arguments defined in the defiPin class to retrieve the data. For syntax information about the DEF PINS statement, see Pins in the LEF/DEF Language Reference.
Returns the defrPinCbkType type, which indicates that the Pin callback was called.
Returns a pointer to a defiPin structure. For more information, see defiPin.
Specifies four bytes of user-defined data. User data is set most often to a pointer to the design data.
Retrieves data from the PINPROPERTIES statement in the DEF file. Use the arguments defined in the defiPinProp class to retrieve the data. For syntax information about the DEF PINPROPERTIES statement, see Pin Properties in the LEF/DEF Language Reference.
Returns the defrPinPropCbkType type, which indicates that the pin property callback was called.
Returns a pointer to a defiPinProp structure. For more information, see defiPinProp.
Specifies four bytes of user-defined data. User data is set most often to a pointer to the design data.
Retrieves data from the PROPERTYDEFINITIONS statement in the DEF file. Use the arguments defined in the defiProp class to retrieve the data. For syntax information about the DEF PROPERTYDEFINITIONS statement, see Property Definitions in the LEF/DEF Language Reference.
Returns the defrPropCbkType type, which indicates that the property callback was called.
Returns a pointer to a defiProp structure. For more information, see defiProp.
Specifies four bytes of user-defined data. User data is set most often to a pointer to the design data.
Retrieves data from the REGIONS statement in the DEF file. Use the arguments defined in the defiRegion class to retrieve the data. For syntax information about the DEF REGIONS statement, see Regions in the LEF/DEF Language Reference.
Returns the defrRegionCbkType type, which indicates that the region callback was called.
Returns a pointer to a defiRegion structure. For more information, see defiRegion.
Specifies four bytes of user-defined data. User data is set most often to a pointer to the design data.
Retrieves data from the ROWS statement in the DEF file. Use the arguments defined in the defiRow class to retrieve the data. For syntax information about the DEF ROWS statement, see Rows in the LEF/DEF Language Reference.
Returns the defrRowCbkType type, which indicates that the row callback was called.
Returns a pointer to a defiRow structure. For more information, see defiRow.
Specifies four bytes of user-defined data. User data is set most often to a pointer to the design data.
Retrieves data from the SCANCHAINS statement in the DEF file. Use the arguments defined in the defiScanchain class to retrieve the data. For syntax information about the DEF SCANCHAINS statement, see Scan Chains in the LEF/DEF Language Reference.
Returns the defrScanchainCbkType type, which indicates that the scan chains callback was called.
Returns a pointer to a defiScanchain structure. For more information, see defiScanchain.
Specifies four bytes of user-defined data. User data is set most often to a pointer to the design data.
Retrieves data from the SLOTS statement in the DEF file. Use the arguments defined in the defiSlot class to retrieve the data. For syntax information about the DEF SLOTS statement, see Slots in the LEF/DEF Language Reference.
Returns the type, defrSlotCbkFnType, which indicates that the slot callback was called.
Returns a pointer to a defiSlot structure. For more information, see defiSlot.
Specifies four bytes of user-defined data. User data is set most often to a pointer to the design data
Returns a type that varies depending on the callback routine used. The following types can be returned.
The data returned varies depending on the callback used.The following table shows the kinds of data returned.
delimiterPair in the BUSBITCHARS statement |
|
designName in the DESIGN statement |
|
tag in the EXTENSIONS statement |
|
character in the DIVIDERCHAR statement |
|
tag in the EXTENSION statement |
|
compNameRegExpr in the GROUPS statement |
|
groupName in the GROUPS statement |
|
anyText in the HISTORY statement |
|
tag in the EXTENSION statement |
|
tag in the EXTENSION statement |
|
tag in the EXTENSION statement |
|
tag in the EXTENSION statement |
|
technologyName in the TECHNOLOGY statement |
|
versionNumber in VERSION statement |
|
tag in the EXTENSION statement |
Specifies four bytes of user-defined data. User data is set most often to a pointer to the design data.
Retrieves data from the STYLES statement in the DEF file. Use the arguments defined in the defiStyles class to retrieve the data. For syntax information about the DEF STYLES statement, see "Styles," in the LEF/DEF Language Reference.
Returns the defrStylesCbkType, which indicates that the style callback was called.
Returns a pointer to a defiStyles structure. For more information, see defiStyles.
Specifies four bytes of user-defined data. User data is set most often to a pointer to the design data.
Retrieves data from the TRACKS statement in the DEF file. Use the arguments defined in the defiTrack class to retrieve the data. For syntax information about the DEF TRACKS statement, see Tracks in the LEF/DEF Language Reference.
Returns the defrTrackCbkType, which indicates that the track callback was called.
Returns a pointer to a defiTrack structure. For more information, see defiTrack.
Specifies four bytes of user-defined data. User data is set most often to a pointer to the design data.
Retrieves data from the VIAS statement in the DEF file. Use the arguments defined in the defiVia class to retrieve the data. For syntax information about the DEF VIAS statement, see Vias in the LEF/DEF Language Reference.
Returns the defrViaCbkType, which indicates that the via callback was called.
Returns a pointer to a defiVia structure. For more information, see defiVia.
Specifies four bytes of user-defined data. User data is set most often to a pointer to the design data.
Returns a type that varies depending on the callback routine used. The following types can be returned.
Returns data that varies depending on the callback used. The following kinds of data can be returned. For all data types, the variable returns NULL.
Specifies four bytes of user-defined data. User data is set most often to a pointer to the design data.
The following example shows a callback routine using the arguments for defrCallbackType_e, char*, and defiUserData.
The following example shows a callback routine using the arguments for defrCallbackType_e, int, and defiUserData.
The following example shows a callback routine using the arguments for defrCallbackType_e, defiVia, and defiUserData.