Library Exchange Format (LEF) is an open specification for representing physical layout information on components of an integrated circuit in an ASCII format. It represents all required information for a place and route of the components without the need to include the full physical design. It is normally used in conjunction with DEF file format. Besides the component information it also stores some technology information on conducting layers and via layers.
The LEF file format is strong connected with the DEF file format. So both files are needed for a correct display of a physical design. Please first open the corresponding LEF file and then import or attach the DEF file. With the opening of the LEF file also the technology information on routing layers are set. The LEF file format only knows layernames. By opening a LEF file the LayoutEditor analysed the used layers. If a used layername already exist in the current setup, this layer is used. Otherwise the first unused layer is renamed.
Save to the LEF file format will create a LEF files for the current displayed cell. So only cells used as reference in the displayed cell are saved. All referred cell need to have a bounding box painted on the layer set as bounding box layer in the SetupDialog. Also only layers set as connecting layers are exported. The information on the technology layers is stored as well as the definition of the default via. The export can be used in conjunction with the DEF file format to trigger an external routing tool.
For a correct placement it is important to define a bounding layer. Shapes located outside this bounding layer will be placed overlapping when placing two cell next to each other and a missing or incorrect bounding layer will lead to incorrect placements of rotated and mirrored cells. The bounding layer can be set in the setup.
Not all information required for a complete LEF file with all its options can be stored in a GDS the used representation within the LayoutEditor. These additional and optional information of a LEF file can be set by an macro script. Please see the API documentation of the class setup for details.