This manual describes the application programming interface (API) routines for the following Cadence® Library Exchange Format (LEF) components:
||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.|
||Session-based mode - This mode introduces the concept of the parsing session. In this mode, the order of calling parsing configuration and processing API is strict:|
||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.
Because the LEF file comparison utility works incrementally (writing out as it operates), the size of files it can process has no limitations. However, large files can have performance restrictions. In general, this utility is intended only to verify the use of the API; that is, the utility is not a component of a production design flow.
The LEF reader can parse compressed LEF files. To do so, you must link the liblef.a and liblefzlib.a libraries.
A number from 0 to 7, corresponding to the compass direction orientations, represents the orientation of a site or component. The following figure shows the combination of mirroring and rotation that is used for each of the eight possible orientations.
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.