This chapter contains the following sections:
This manual describes the application programming interface (API) routines for the following Cadence® Library Exchange Format (LEF) components:
Note: The writer portion of the API does not always optimize the LEF output.
The LEF 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 lefrInit(), 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 lefrInitSession() instead of lefrInit() to start a new parsing session and close any old parsing session, if opened. |
|
Data processing: - Do one or multiple parsing of LEF files with the lefrRead() function. |
|
Cleaning of the parsing configuration: Call the lefrClear() 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 lefrInitSession() call. |
In the session-based mode, the properties once defined in PROPERTYDEFINITIONS remain active in all the LEF 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 lefrInitSession() 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 LEF parser works in the compatibility mode. To activate the session-based mode, you must use lefrInitSession() instead of lefrInit().
Note: Currently, the compatibility mode can be used in all old applications where the code has not been adjusted. The lef2oa translator has already been adjusted to use the session-based parsing mode.
The LEF file comparison utility, lefdefdiff, helps you verify that your usage of the API is consistent and complete. This utility reads two LEF files, generally an initial file and the resulting file from reading in an application, then writes out a LEF file. The comparison utility reads and writes the data so that the UNIX diff utility can be used to compare the files.
The LEF reader can parse compressed LEF files. To do so, you must link the liblef.a and liblefzlib.a libraries.
A zlib compression library is also required in order to read compressed LEF files. The zlib source code is free software that can be downloaded from www.gnu.com.
For information on compressed file routines, see "LEF 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.