The Cadence® Library Exchange Format (LEF) reader calls all callback routines when it reads in the appropriate part of the LEF file. Some routines, such as the version callback, are called only once. Other routines can be called more than once.
This chapter contains the following sections:
All callback functions have 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 LEF data. For examples, see Appendix A, "LEF Reader and Writer Examples."
The LEF_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. The LEF reader contains only user data. The user data is most often set to a pointer to the library 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 LEF 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 lefrSetDensityCbk |
||
void lefrSetExtensionCbk |
||
void lefrSetMacroSizeCbk |
||
This section describes the following user callback routines:
Retrieves data from the DENSITY object from within the MACRO object. Use the arguments defined in the lefiDensity class to retrieve the data.
For syntax information about the LEF MACRO statement, see "Macro" in the LEF/DEF Language Reference.
Returns the lefrDensityCbkType type. This allows you to verify within your program that this is a correct callback.
Returns a pointer to a lefiDensity structure. For more information, see "lefiDensity".
Returns four bytes of user-defined data. User data is set most often to a pointer to the design data.
For more information about LEF syntax, see 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.
value in the MANUFACTURINGGRID statement |
|
number in the VERSION statement |
Returns four bytes of user-defined data. User data is set most often to a pointer to the design data.
For more information about the FIXEDMASK statement, see "FIXEDMASK" 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 type that varies depending on the callback used. The following kind of data can be returned.
Fixed mask: Does not allow mask shifting. All the LEF MACRO PIN MASK assignments must be kept fixed and cannot be shifted to a different mask, (1indicates not allowed, and 0 allowed).
Macro FixedMask: Indicates that the specified macro does not allow mask shifting. All the LEF PIN MASK assignments must be kept fixed and cannot be shifted to a different mask. (1 indicates not allowed, and 0 allowed).
Returns four bytes of user-defined data. User data is set most often to a pointer to the design data.
Retrieves data from the LAYER object of the LEF file. Use the arguments defined in the lefiLayer class to retrieve the data.
For syntax information about the LEF LAYER statement, see "Layer (Cut)," "Layer (Masterslice or Overlap)," "Layer (Routing)," or "Layer (Implant)" in the LEF/DEF Language Reference.
Returns the lefrLayerCbkType type. This allows you to verify within your program that this is a correct callback.
Returns a pointer to a lefiLayer structure. For more information, see "lefiLayer".
Returns four bytes of user-defined data. User data is set most often to a pointer to the design data.
Retrieves data from the MACRO object in the LEF file. Use the arguments defined in the lefiMacro class to retrieve the data.
For syntax information about the LEF MACRO statement, see "Macro" in the LEF/DEF Language Reference.
Returns the lefrMacroCbkType type. This allows you to verify within your program that this is a correct callback.
Returns a pointer to a lefiMacro structure. For more information, see "lefiMacro".
Returns four bytes of user-defined data. User data is set most often to a pointer to the design data.
Retrieves data for in-place processing of a MACRO FOREIGN statement. Use the arguments defined in the lefiMacroForeign class to retrieve the data.
For syntax information about the LEF MACRO FOREIGN statement, see "Macro" in the LEF/DEF Language Reference.
Returns the lefrMacroForeignCbkType type. This allows you to verify within your program that this is a correct callback.
Returns a pointer to a lefiMacroForeign structure. For more information, see lefiMacroForeign.
Returns four bytes of user-defined data. User data is set most often to a pointer to the design data.
For syntax information about the LEF MACRO statement, see "Macro" 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.
value for ORIGIN in the MACRO statement. |
|
value for SIZE in the MACRO statement. |
Returns four bytes of user-defined data. User data is set most often to a pointer to the design data.
Retrieves data for in-place processing of a MACRO SITE statement. Use the arguments defined in the lefiMacroSite class to retrieve the data.
For syntax information about the LEF MACRO FOREIGN statement, see "Macro" in the LEF/DEF Language Reference.
Returns the lefrMacroSiteCbkType type. This allows you to verify within your program that this is a correct callback.
Returns a pointer to a lefiMacroSite structure. For more information, see lefiMacroSite.
Returns four bytes of user-defined data. User data is set most often to a pointer to the design data.
Retrieves data from the MAXVIASTACK object in the LEF file. Use the arguments defined in the lefiMaxStackVia class to retrieve the data.
For syntax information about the LEF NONDEFAULTRULE statement, see "Maximum Via Stack" in the LEF/DEF Language Reference.
Returns the lefrMaxStackViaCbkType type. This allows you to verify within your program that this is a correct callback.
Returns a pointer to a lefiMaxStackVia structure. For more information, see "lefiMaxStackVia".
Returns four bytes of user-defined data. User data is set most often to a pointer to the design data.
Retrieves data from the NONDEFAULTRULE object in the LEF file. Use the arguments defined in the lefiNonDefault class to retrieve the data.
For syntax information about the LEF NONDEFAULTRULE statement, see "Nondefault Rule" in the LEF/DEF Language Reference.
Returns the lefrNonDefaultCbkType type. This allows you to verify within your program that this is a correct callback.
Returns a pointer to a lefiNonDefault structure. For more information, see "lefiNonDefault".
Returns four bytes of user-defined data. User data is set most often to a pointer to the design data.
Retrieves data from the OBS (macro obstruction) object within the MACRO object in the LEF file. Use the arguments defined in the lefiObstruction class to retrieve the data.
For syntax information about the LEF OBS statement, see "Macro Obstruction Statement" in the LEF/DEF Language Reference.
Returns the lefrObstructionCbkType type. This allows you to verify within your program that this is a correct callback.
Returns a pointer to a lefiObstruction structure. For more information, see "lefiObstruction".
Returns four bytes of user-defined data. User data is set most often to a pointer to the design data.
Retrieves data from the PIN object within the MACRO object in the LEF file. Use the arguments defined in the lefiPin class to retrieve the data.
For syntax information about the LEF PIN statement, see "Macro Pin Statement" in the LEF/DEF Language Reference.
Returns the lefrPinCbkType type. This allows you to verify within your program that this is a correct callback.
Returns a pointer to a lefiPin structure. For more information, see "lefiPin".
Returns four bytes of user-defined data. User data is set most often to a pointer to the design data.
Retrieves data from the PROPERTYDEFINITIONS object in the LEF file. Use the arguments defined in the lefiProp class to retrieve the data.
For syntax information about the LEF PROPERTYDEFINITIONS statement, see "Property Definitions" in the LEF/DEF Language Reference.
Returns the lefrPropCbkType type. This allows you to verify within your program that this is a correct callback.
Returns a pointer to a lefiProp structure. For more information, see "lefiProp".
Returns four bytes of user-defined data. User data is set most often to a pointer to the design data.
Retrieves data from the SITE object in the LEF file. Use the arguments defined in the lefiSite class to retrieve the data.
For syntax information about the LEF SITE statement, see "Site" in the LEF/DEF Language Reference.
Returns the lefrSiteCbkType type. This allows you to verify within your program that this is a correct callback.
Returns a pointer to a lefiSite structure. For more information, see "lefiSite".
Returns four bytes of user-defined data. User data is set most often to a pointer to the design data.
Retrieves data from the SPACING object of the LEF file. Use the arguments defined in the lefiSpacing class to retrieve the data.
For syntax information about the LEF SPACING statement, see "Samenet Spacing" in the LEF/DEF Language Reference.
Returns the lefrSpacingCbkType type. This allows you to verify within your program that this is a correct callback.
Returns a pointer to a lefiSpacing structure. For more information, see "lefiSpacing".
Returns four bytes of user-defined data. User data is set most often to a pointer to the design data.
For more information about LEF syntax, see 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.
delimterPair in the BUSBITCHARS statement |
|
Returns the string set for a CLEARANCEMEASURE statement |
|
character in a DIVIDERCHAR statement |
|
Retruns the string set for an EXTENSION statement |
|
macroName in a MACRO statement |
|
Returns the string set for a CLASS statement in a MACRO statement |
|
END macroName in a MACRO statement |
|
Returns the string set for a VERSION statement |
Returns four bytes of user-defined data. User data is set most often to a pointer to the design data.
Retrieves data from the UNITS object in the LEF file. Use the arguments defined in the lefiUnits class to retrieve the data.
For syntax information about the LEF UNITS statement, see "Units" in the LEF/DEF Language Reference.
Returns the lefrUnitsCbkType type. This allows you to verify within your program that this is a correct callback.
Returns a pointer to a lefiUnits structure. For more information, see "lefiUnits".
Returns four bytes of user-defined data. User data is set most often to a pointer to the design data.
Retrieves data from the USEMINSPACING object in the LEF file. Use the arguments defined in the lefiUseMinSpacing class to retrieve data.
For information about the LEF USEMINSPACING statement, see "Use Min Spacing" in the
LEF/DEF Language Reference.
Returns the lefrUseMinSpacingCbkFnType type. This allows you to verify within your program that this is a correct callback.
Returns a pointer to a lefiUseMinSpacing structure. For more information, see "lefiUseMinSpacing"
Returns four bytes of user-defined data. User data is set most often to a pointer to the design data.
Retrieves data from the VIA object in the LEF file. Use the arguments defined in the lefiVia class to retrieve the data.
For syntax information about the LEF VIA statement, see "Via" in the LEF/DEF Language Reference.
Returns the lefrViaCbkType type. This allows you to verify within your program that this is a correct callback.
Returns a pointer to a lefiVia structure. For more information, see "lefiVia".
Returns four bytes of user-defined data. User data is set most often to a pointer to the design data.
Retrieves data from the VIARULE object in the LEF file. Use the arguments defined in the lefiViaRule class to retrieve the data.
For syntax information about the LEF VIARULE statement, see "Via Rule" in the LEF/DEF Language Reference.
Returns the lefrViaRuleCbkType type. This allows you to verify within your program that this is a correct callback.
Returns a pointer to a lefiViaRule structure. For more information, see "lefiViaRule".
Returns four bytes of user-defined data. User data is set most often to a pointer to the design data.
For more information about LEF syntax, see the LEF/DEF Language Reference.
Returns a type that varies depending on the callback routine used. The following types can be returned.
Returns nothing. (This is a placeholder value to meet the required three arguments for each routine).
Returns 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 lefrCallbackType_e, char*, and lefiUserData.
The following callback routine has arguments of lefrCallbackType_e, void*, and lefiUserData.