LEF to OpenAccess Translator (lef2oa)

The LEF to OpenAccess Translator imports a file in the LEF format into a technology database and in some cases design data in the OpenAccess library structure. LEF contains technology information, design rules, macro cell definitions, and information about design objects such as vias, sites, and layers. LEF to OpenAccess is available from the command line through the executable lef2oa. A LEF file and destination library are required to begin a translation.

Command Syntax

To run lef2oa, enter the following:

lef2oa -lef file -lib library  [Optional Arguments]

Use the -help or -h argument to display command-line help. The command-line arguments are described in the following table.

Required Arguments
-lef file Specifies the LEF file to import into the OpenAccess database.
-lib library Specifies the name of the destination library. If the library exists, the library must contain a technology database or refer to a library with a technology database. If the specified library exists, new designs are created for macro definitions. If you redefine a macro in the file, a new design is created by overwriting the existing design. If the library does not exist, a library is created in the current working directory and will contain a technology database. For information about how the translator finds a library using the library definitions file, see How Translators Use Libraries.
Optional Arguments
-commentChar char Identifies the comment character
-dataModel dataModel value Specifies a dataModel value of 0, 1, 2, or 3, which determines the data model for the OpenAccess database and determines how properties are mapped to the database. If this option is omitted, the default dataModel value of 1 is used unless the OA_DATAMODEL environment variable is set or a file named OA.DATAMODEL is found in the data directory of your OpenAccess installation hierarchy. See the discussion Specifying a DataModelRev for a Flow for more information.
-defaultRuleName name Specifies the name of the LEFDefaultRouteSpec to generate in the technology database. If a constraint group named LEFDefaultRouteSpec already exists in a technology database being modified, the translation fails unless the -overwrite option is used.
-DMAttributes attributeList Specifies a list of DM attributes that are associated with every library that this application creates. Attributes are specified as name=value pairs. There must be no space on either side of the equal sign, two or more pairs must be space-separated, and the list must be enclosed in quotes. For example:
    lef2oa ... -DMAttributes "name1=value name2=value name3=value"
-DMSystem sysName Specifies the DM system to use for the library, which can be any DM plug-in available to the user. The DM plug-ins included with OpenAccess are oaDMTurbo or oaDMFileSys. The default DM system is oaDMSystem, which automatically selects between oaDMTurbo or oaDMFileSys. Use of the oaDMTurbo plug-in is not recommended.
-help | -h Display usage information.
-layerMap fileList Specifies a quoted, space-separated list of one or more layer mapping files to be used during translation. You must specify the complete path for each layer map file.

The format for the map file is:
   <layerName>  <layerNumber>
If you specify a layer mapping file, lef2oa maps LEF objects found on the specified layerName to the specified layerNumber. If a layer number does not exist in the technology library, the translator attempts to create it.

If you do not specify a mapping file, LEF layer names map to layer numbers in a sequential manner, starting at 0.

Lines in the layerMap file that are blank and lines beginning with the comment character (#) are ignored.

# Example layer map file
#layerName  	layerNumber
   Metal1        1 
   Via1          2
   Metal2        3
   Via2          4
   Metal3        5
   Via3          6
   Metal4        7
   Via4          8
   Metal5        9
   Via5          10
-libDefFile filename Specifies the lib.defs file to load. The path to the lib.defs file can be a full or relative path. If this option is omitted, the default search mechanism of the DM system is used to find and load the lib.defs file.
-libPath path Specifies the full path name (including the library name) for the library. Use this argument only if the library does not exist. If not specified, the library is ./<library>, where <library> is the value of the -lib argument.
-logFile file Specifies the log filename. If this option is omitted, the log filename defaults to lef2oa.log.
-noInfo msgIds Suppresses the specified INFO messages. msgIds is a quoted, space separated list of numbers. Each number in the list represents the numerical portion of the ID for the message you want to suppress. None of the numbers in the list may be zero. Suppressed messages do not appear on the terminal or in the log file.
-noWarning msgIds Suppresses the specified WARNING messages. msgIds is a quoted, space separated list of numbers. Each number in the list represents the numerical portion of the ID for the message you want to suppress. None of the numbers in the list may be zero. Suppressed messages do not appear on the terminal or in the log file and are not included in the total of WARNING messages displayed in the summary.
-overwrite Replaces MACROS in an existing design with the translated data. If this option is omitted, the default behavior is to update the existing library. This option does not affect the DBU value in an existing technology database.
-pinLabels Creates pin labels in designs by using OpenAccess oaAttrDisplay objects on oaTerms. Labels are added on the oaTerm for each pin figure of the terminal at the location of the pin figure. See also the -textLayer and -textHeight options.
-shared Allows other applications to access the output library while this application is running.
Note: The additional synchronization overhead required for shared library access can increase translation time.
-techDMAttributes attrList Specifies a list of DM attributes that are associated with every technology library created.
-techDMSystem sysName DM system to use for the technology library, which is either oaDMTurbo or oaDMFileSys. The default is oaDMTurbo.
-techLib library Specifies the name of a technology library to use when creating a new cell library. If the specified technology library does not exist, the library is created using the technology information in the LEF file.
-techLibPath path Specifies the path to use for creating a technology library specified by the -tech argument. The is only used when the library specified by the -techLib argument does not exist.
-techRefs parentTechs Creates an incremental technology database that derives from one or more of the specified parent technology databases.

Notes:
  • If the library being translated does not have a technology database, this option creates an incremental technology database that has references to the specified parentTechs.
  • If the library being translated already has a standalone technology database, this option converts that technology database to an incremental type that has references to the specified parentTechs.
  • If the library being translated has an attached technology database, that attached technology database must be included in the list of parentTechs, or the translator issues an error.
  • If the library being translated already uses an incremental technology database, the current references from the incremental technology database must be included in the specified parentTechs, or the translator issues an error. Additional references can be provided.
  • This option requires data model 3. If you use this option without setting the data model to 3 (by using the -dataModel option, the OA_DATAMODEL environment variable, or using the OA.DATAMODEL file), an error is issued and the translation stops.
For more information, refer to Incremental Technology Databases in the Using Technology Databases section of the Programmers Guide, and see also Specifying a DataModelRev for a Flow.
-templateFile file

Specifies a file containing arguments to lef2oa. You can specify a template file instead of entering a string of arguments on the command line.

If you specify a template file, arguments on the command line have precedence over arguments specified in the file. So, if the same argument exists in the template file and in the command line, the translator uses the argument on the command line.

Specify arguments in a template file as follows:

  • Enter arguments in the template file without a dash (-) before the argument.
  • Enter each argument and value pair on a single line.
  • Separate the argument from its value using a space or a tab.
  • Designate comment lines with a # sign as the first character in the line.

Sample Template File

logFile        mylef2oa.log
layerMap       mylefmap.txt
pinLabels
update
-textHeight <value> Specifies an integer value for the pin label text height in database units (DBU). The DBU value is set by lef2oa by using the DATABASE UNITS value in LEF. If -pinLabels is used, and this option is omitted, the pin label text height defaults to the DBU value in the technology database for maskLayout views.
-textLayer <layer name> Specifies the layer used for pin label text. If -pinLabels is used, and this option is not specified, the pin label text layer defaults to text. If the specified layer does not exist in the technology database, it is added.
-view viewName Specifies the output view name. The default view name is abstract.
-v Prints tool, format, and library version information.
-version Prints tool and format version information.

Note: Command line arguments specifying library, cell, and view names are interpreted according to the Native name space. See Native Name Space in the Name Mapping article of the Programmers Guide for details about the native name space.


The following is an example of lef2oa command line syntax.

    lef2oa -lef ac36.lef -lib ac36 -libPath /db/myProject/cds/ac36 -techLib techLib2  \
    -techLibPath /db/myProject/cds/techLib2/ -view abstract2 -layerMap layerMap.txt 

For information about how lef2oa can be used to work with incremental technology databases, refer to Translator Support in the Using Technology Databases section of the Programmers Guide.

How the Translator Uses Namespaces

A namespace is a set of rules that define the legal characters and determine how names are interpretted. This translator uses the oaNative namespace to interpret library, cell, and view names in the command line. Other names that refer to name-mapped OpenAccess objects, such as net and module names, use the LEF namespace.

Merging Verilog and LEF/DEF Information

If you need to merge Verilog and LEF/DEF information, you must follow a particular sequence of steps. Refer to the verilog2oa documentation and the section Creating a Design by Merging Verilog and LEF/DEF Information for the steps you must follow.

Error Handling

If an error occurs during translation, usually the translator can emit a warning or error message and continue. However, certain translation errors halt further translation. The manner in which translation errors are handled depend on the type of error.

Error and Warning Message Format

Translators emit messages that report translation progress, report warnings about unusual data or conditions, or report problems with files or data that caused partial or complete translation failure. These messages are written to a log file so you can review translation status, identify error and warning conditions, and consider whether additional actions are needed.

OpenAccess translators use a standard message format to ensure comprehensive and consistent messaging. This message format consists of three elements, which are: message type keyword, message prefix, and message text. The message text can be further divided into three parts. The first part indicates what caused the message, the second indicates the consequence of the problem or condition, and the third part suggests an action you can take to remedy the problem or condition.

In addition to the three standard elements, messages can also include two optional elements. An optional filename and optional line number element are included, when available, to more precisely identify the source of a problem or condition within the source data file. When present in an error or warning message, the filename and line number correspond to the location of the last line parsed for the object, and therefore, the cause of the error or warning can occur on a line preceding the indicated line number. A context string is another optional element that is included, when available, to identify the type of data object that caused the message to be emitted. Following is an example of an error message that includes the optional filename and line number element.

    ERROR: (OALEFDEF-50004): file.lef(123): A cell was not specified. Translation was terminated. 
    You must specify a cell.

One benefit of this message format is that it allows you to sort, filter, and examine only those types of messages that interest you. The keyword at the start of each message is either ERROR or WARNING and is always all uppercase. The message prefix identifies the translator family and the specific message source within the translator. The message prefix is a stable value that will not change between versions even when the message text gets updated. This makes it suitable for routine sorting and filtering.

If you seek assistance for resolving an issue related to a translator error or warning message, be sure to retain the message type keyword (ERROR or WARNING), and retain the message prefix to identify the translator family and the message source. Also make note of the filename/line number and context information if these are included in the message.

Return to top of page