This chapter contains the following sections:
This manual describes the application programming interface (API) routines for the following Cadence® Design Exchange Format (DEF) components:
Note: The writer portion of the API does not always optimize the DEF output.
The DEF reader can work in two modes - compatibility mode and session-based mode.
|
Compatibility mode (session-less mode) - This mode is compatible with the old parser behavior. You can call the parser initialization once with defrInit(), adjust parsing settings and initialize the parser callbacks any time. The properties once defined in PROPERTYDEFINITIONS sections will be also defined in all subsequent file reads. |
|
Parser initialization: Call defrInitSession() instead of defrInit() to start a new parsing session and close any old parsing session, if opened. |
|
Data processing: Do one or multiple parsing of DEF files with the defrRead() function. |
|
Cleaning of the parsing configuration: Call the defrClear() function (optional). The call releases all parsing session data and closes the parsing session. If this is skipped, the data cleaning and the session closing is done by the next defrInitSession() call. |
In the session-based mode, the properties once defined in PROPERTYDEFINITIONS remain active in all the DEF file parsing cycles in the session and the properties definition data is cleaned when the parsing session ends.
The session-based mode does not require you to call callbacks and property unsetter functions. All callbacks and properties are set to default by the next defrInitSession() call.
The session-based mode allows you to avoid the lasting PROPERTYDEFINITIONS data effect when not required as you can just configure your application to parse one file per session.
By default, the DEF parser works in the compatibility mode. To activate the session-based mode, you must use defrInitSession() instead of defrInit().
Note: Currently, the compatibility mode can be used in all old applications where the code has not been adjusted. The def2oa translator has already been adjusted to use the session-based parsing mode.
The DEF file comparison utility, lefdefdiff, helps you verify that your usage of the API is consistent and complete. This utility reads two DEF files, generally an initial file and the resulting file from reading in an application, then writes out a DEF file. The comparison utility reads and writes the data so that the UNIX diff utility can be used to compare the files.
The DEF reader can parse compressed DEF files. To do so, you must link the libdef.a and libdefzlib.a libraries.
A zlib compression library is also required in order to read compressed DEF files. The zlib source code is free software that can be downloaded from www.gnu.com.
For information on compressed file routines, see "DEF Compressed File Routines."
Note: The location given is the lower left corner of the resulting site or component after the mirroring and rotation are applied. It is not the location of the origin of the child cell.