Newer process rules are written in a LEF file as properties whose names begin LEF58_, each holding the rule as a quoted string. The LEF grammar passes the string through unread. This page describes how OpenROAD's database, OpenDB, reads those strings. The syntax below is the behaviour of OpenDB's parsers, and the last section is what OpenROAD's router does with some of the rules; neither is the Cadence definition of these properties, and another program may accept more, less or something else. Which properties are read for which kind of layer is listed under Layer properties.
How a string is read
- White space separates words but is not required: a keyword is matched character by character at the next position that is not white space.
- Keywords come in the order shown. Where alternatives are given they are tried from left to right, and the first that fits is taken.
- A name is a letter followed by any characters other than space, tab and line feed. A name written against a
;therefore takes the semicolon with it. - Distances are in micrometres and areas in square micrometres; OpenDB converts them to its database units.
The string is handled in one of three ways, given for each property below:
| Reading | What happens |
|---|---|
| whole | The entire string must fit the grammar. |
| rule by rule | The string is cut at every ;. Each piece that is not blank is given its semicolon back and judged alone: a piece that does not fit is reported and the others are kept. |
| all rules | The string must end with ;, and is then cut and read in the same way; if any piece fails, the string is reported. |
In the syntax below, [ ] marks an optional part, | separates alternatives, ( ) groups, + means one or more and * any number. Brackets that belong to the string are written "(" and ")".
Routing layers
LEF58_SPACING, end of line
Used when the string does not contain WRONGDIRECTION; read rule by rule. A rule without ENDOFLINE is reported as unsupported.
SPACING space ENDOFLINE eolWidth [EXACTWIDTH] [WRONGDIRSPACING space]
( within | TOCONCAVECORNER [MINLENGTH l] [MINADJACENTLENGTH l1 [l2]]
| TONOTCHLENGTH l ) [;]
within:
[OPPOSITEWIDTH w] WITHIN within [wrongDirWithin] [SAMEMASK]
[EXCEPTEXACTWIDTH exactWidth otherWidth] [FILLCONCAVECORNER triangle]
[WITHCUT [CUTCLASS number] [ABOVE] cutSpace [ENCLOSUREEND width [WITHIN d]]]
[ENDPRLSPACING space PRL length]
[ENDTOEND space [oneCutSpace twoCutSpace] [EXTENSION ext [wrongDirExt]]
[OTHERENDWIDTH w]]
[MAXLENGTH l | MINLENGTH l [TWOSIDES]] [EQUALRECTWIDTH]
[PARALLELEDGE [SUBTRACTEOLWIDTH] parSpace WITHIN parWithin [PRL length]
[MINLENGTH l] [TWOEDGES] [SAMEMETAL] [NONEOLCORNERONLY] [PARALLELSAMEMASK]]
[ENCLOSECUT [ABOVE | BELOW] distance CUTSPACING cutToMetal [ALLCUTS]]LEF58_SPACING, wrong direction
Used when the string contains WRONGDIRECTION; read whole.
SPACING space WRONGDIRECTION [NONEOL width] [PRL length] [LENGTH length] ;LEF58_SPACINGTABLE
Read whole, one or more tables, and only when the string contains PARALLELRUNLENGTH. Every WIDTH row has as many spacings as there are run lengths.
( SPACINGTABLE PARALLELRUNLENGTH [WRONGDIRECTION] [SAMEMASK] [EXCEPTEOL eolWidth]
length+
( WIDTH w [EXCEPTWITHIN low high] spacing+ )+
[SPACINGTABLE INFLUENCE ( WIDTH w WITHIN d SPACING space )+ ;] ; )+LEF58_MINSTEP and LEF57_MINSTEP
Read whole.
( MINSTEP length [MAXEDGES n] [EXCEPTRECTANGLE]
[ MINADJACENTLENGTH l1 [CONVEXCORNER | CONCAVECORNER | l2]
| MINBETWEENLENGTH l [EXCEPTSAMECORNERS]
| NOADJACENTEOL width [MINADJACENTLENGTH l]
| NOBETWEENEOL width ] ; )+LEF58_CORNERSPACING
All rules. Where a WIDTH entry gives one spacing, the second equals it.
CORNERSPACING
( CONVEXCORNER [SAMEMASK] [CORNERONLY within | CORNERTOCORNER]
[EXCEPTEOL eolWidth [EXCEPTJOGLENGTH jog [EDGELENGTH l] [INCLUDELSHAPE]]]
| CONCAVECORNER [MINLENGTH l [EXCEPTNOTCH [notchLength]]] )
[EXCEPTSAMENET | EXCEPTSAMEMETAL]
( WIDTH w SPACING space1 [space2] )+ ;Other routing properties
| Property | Reading | Syntax |
|---|---|---|
LEF58_RIGHTWAYONGRIDONLY | whole | RIGHTWAYONGRIDONLY [CHECKMASK] ; |
LEF58_RECTONLY | whole | RECTONLY [EXCEPTNONCOREPINS] ; |
LEF58_EOLEXTENSIONSPACING | rule by rule | EOLEXTENSIONSPACING space [PARALLELONLY] ( ENDOFLINE eolWidth EXTENSION extension )+ ; |
LEF58_EOLKEEPOUT | rule by rule | EOLKEEPOUT eolWidth EXTENSION backward side forward [EXCEPTWITHIN low high] [CLASS name] [CORNERONLY] ; |
LEF58_WIDTHTABLE | rule by rule | WIDTHTABLE width+ [WRONGDIRECTION] [ORTHOGONAL] ; |
LEF58_MINIMUMCUT | rule by rule | MINIMUMCUT ( cuts | ( CUTCLASS name cuts )+ ) WIDTH w [WITHIN cutDistance] [FROMABOVE | FROMBELOW] [LENGTH l WITHIN d | AREA area [WITHIN d] | SAMEMETALOVERLAP | FULLYENCLOSED] ; |
LEF58_PITCH | whole | PITCH x [y] [FIRSTLASTPITCH pitch] ; – after a mismatch the pitch is set to 0 and the first and last pitch to -1 |
LEF58_AREA | rule by rule | AREA area [MASK n] [EXCEPTMINWIDTH w] [EXCEPTEDGELENGTH l1 [l2]] [EXCEPTMINSIZE width height] [EXCEPTSTEP x y] [RECTWIDTH w] [EXCEPTRECTANGLE] [LAYER name OVERLAP n] ; |
LEF58_FORBIDDENSPACING | rule by rule | FORBIDDENSPACING space1 space2 [WIDTH w [WITHIN d] [PRL length] [TWOEDGES d] ;] – the semicolon lies inside the optional part, so a rule without WIDTH does not fit |
LEF58_TWOWIRESFORBIDDENSPACING | rule by rule | TWOWIRESFORBIDDENSPACING minSpace maxSpace MINSPANLENGTH l [EXACTSPANLENGTH] MAXSPANLENGTH l [EXACTSPANLENGTH] PRL length ; |
LEF58_MINWIDTH | whole | MINWIDTH w [WRONGDIRECTION] ; |
LEF58_VOLTAGESPACING | whole | ( VOLTAGESPACING [TOCUT [ABOVE | BELOW]] ( voltage spacing )+ ; )+ – TOCUT without a side means both |
Cut layers
LEF58_SPACING and LEF57_SPACING
Read whole, one or more rules.
( SPACING space
( MAXXY | SAMEMASK
| [CENTERTOCENTER] [SAMENET | SAMEMETAL | SAMEVIA]
[layer | adjacent | overlap | within | edge | AREA cutArea] ) ; )+
layer: LAYER name [ STACK | ORTHOGONALSPACING space | CUTCLASS name [class] ]
class: SHORTEDGEONLY [PRL length]
| CONCAVECORNER [ WIDTH w ENCLOSURE e EDGELENGTH l
| PARALLEL length WITHIN w ENCLOSURE e
| EDGELENGTH l ENCLOSURE edgeEnclosure adjacentEnclosure ]
| EXTENSION extension | NONEOLCONVEXCORNER eolWidth [MINLENGTH l]
| ABOVEWIDTH w [ENCLOSURE e] | MASKOVERLAP | WRONGDIRECTION
adjacent: ADJACENTCUTS ( 1 | 2 | 3 ) [EXACTALIGNED n] [TWOCUTS n [SAMECUT]]
WITHIN w [w2] [EXCEPTSAMEPGNET] [CUTCLASS name [TO ALL]]
[SIDEPARALLELOVERLAP | NOPRL] [SAMEMASK]
overlap: PARALLELOVERLAP [EXCEPTSAMENET | EXCEPTSAMEMETAL | EXCEPTSAMEVIA
| EXCEPTSAMEMETALOVERLAP]
within: PARALLELWITHIN w [EXCEPTSAMENET] [CUTCLASS name
[LONGEDGEONLY | ENCLOSURE e ( ABOVE | BELOW ) PARALLEL length WITHIN w]]
edge: SAMEMETALSHAREDEDGE w [ABOVE] [CUTCLASS name] [EXCEPTTWOEDGES]
[EXCEPTSAMEVIA n]TO ALLis matched as one piece of text, with a single space.EXCEPTSAMEMETALOVERLAPcan never be read:EXCEPTSAMEMETALis tried first, takes its beginning and leaves text that fits nothing.- The value after
ORTHOGONALSPACINGis not stored as a spacing.
LEF58_CUTCLASS
Read whole. ORIENT is reported as unsupported.
( CUTCLASS name WIDTH w [LENGTH l] [CUTS n] [ORIENT word] ; )+LEF58_ENCLOSURE
Read rule by rule. A cut class that the layer does not define is reported.
ENCLOSURE [CUTCLASS name] [ABOVE | BELOW]
( EOL width [MINLENGTH l] [EOLONLY] [SHORTEDGEONEOL] overhang1 overhang2
[ SIDESPACING space EXTENSION forward backward
| ENDSPACING space EXTENSION extension ]
| overhang1 overhang2
| [OFFCENTERLINE] END overhang SIDE overhang
| HORIZONTAL overhang VERTICAL overhang )
[WIDTH w [INCLUDEABUTTED] [EXCEPTEXTRACUT within [PRL | NOSHAREDEDGE]]]
[LENGTH l] [EXTRACUT [EXTRAONLY]] [REDUNDANTCUT within]
[PARALLEL length [length2] WITHIN w [w2] [BELOWENCLOSURE e]]
[CONCAVECORNERS n] ;LEF58_ENCLOSURETABLE
Read whole, one rule. A rule naming an unknown cut class is dropped. The LAYER part is recognised and thrown away.
ENCLOSURETABLE [CUTCLASS name] ( DEFAULT group+ )* ( WIDTH w group+ )+ ;
group: [ABOVE | BELOW] overhang1 overhang2 overhang3 overhang4 [LAYER name [OVERLAP n]]LEF58_SPACINGTABLE
Read whole, one or more tables of either form.
SPACINGTABLE ORTHOGONAL ( WITHIN w SPACING space )+ ;
SPACINGTABLE [DEFAULT space] [SAMEMASK] [SAMENET | SAMEMETAL | SAMEVIA]
[LAYER name [NOSTACK] [NONZEROENCLOSURE | PRLFORALIGNEDCUT ( a TO b )+]]
[CENTERTOCENTER ( a TO b )+]
[CENTERANDEDGE [NOPRL] ( a TO b )+]
[PRL length [HORIZONTAL | VERTICAL] [MAXXY] ( a TO b length )*]
[ENDEXTENSION extension ( TO class extension )* [SIDEEXTENSION ( TO class extension )+]]
[EXACTALIGNEDSPACING [HORIZONTAL | VERTICAL] ( class space )+]
[NONOPPOSITEENCLOSURESPACING ( class space )+]
[OPPOSITEENCLOSURERESIZESPACING ( class resize1 resize2 space )+]
CUTCLASS ( name [SIDE | END] )+ ( cell cell )+ ( name [SIDE | END] ( cell cell )+ )* ;In the closing table the last name before the first numbers heads the first row; the names before it head the columns. A column heading without SIDE or END stands for both. Cells come in pairs, and each is a spacing or -, which takes the DEFAULT value.
Other cut properties
| Property | Reading | Syntax |
|---|---|---|
LEF58_ARRAYSPACING | whole | ARRAYSPACING [CUTCLASS name] [PARALLELOVERLAP] [LONGARRAY] [WIDTH viaWidth] [WITHIN w ARRAYWIDTH width] CUTSPACING space ( ARRAYCUTS n SPACING space )+ ; |
LEF58_KEEPOUTZONE | rule by rule | KEEPOUTZONE CUTCLASS name [TO name] [EXCEPTEXACTALIGNED [SIDE | END] space] ( EXTENSION side forward | ENDEXTENSION endSide endForward SIDEEXTENSION sideSide sideForward ) SPIRALEXTENSION extension ; |
LEF58_MAXSPACING | all rules | MAXSPACING space [CUTCLASS name] ; |
Implant layers
In a list of layer names, the names end at one of the rule's own keywords or at ;. The names in implant width, spacing and core edge length rules are looked up after the whole file has been read; a rule naming a layer that is never defined is dropped with a warning.
| Property | Reading | Syntax |
|---|---|---|
LEF58_SPACING | all rules | SPACING space ( LAYER name | HORIZONTAL | VERTICAL | PRL length | EXCEPTABUTTED | EXCEPTCORNERTOUCH | LENGTH l | INTERSECTLAYERS name+ )* ; – at most one LAYER, and one of HORIZONTAL and VERTICAL |
LEF58_WIDTH | all rules | WIDTH w ( LAYER ( name | ANY ) | ZEROPRL | MAXWIDTH w | EXCEPTCORNERTOUCH | LENGTH l | CELLHEIGHT h | CHECKIMPLANTGROUP name | WITHINLAYER name+ )* ; – at most one LAYER |
LEF58_COREEDGELENGTH | all rules | COREEDGELENGTH minLength ( MAXLENGTH l | EXCEPTADJACENTLENGTH ( length adjacentLength [EXACTADJACENTLENGTH] )+ | WITHINLAYER name+ | EXCEPTLAYER name+ )* ; – at most one MAXLENGTH |
LEF58_CORNERSPACING | all rules | CORNERSPACING space ( ALIGNEDONLY | CHECKIMPLANTGROUPONLY )* ; – neither word twice |
LEF58_MINENCLOSEDAREA | all rules | MINENCLOSEDAREA area [WIDTH w] ; |
LEF58_MAXSPACING | all rules | MAXSPACING space WIDTH w LENGTH l ; |
LEF58_AREA | rule by rule | as for a routing layer |
LEF58_MINSTEP | whole | as for a routing layer |
Macros, pins and the library
LEF58_CLASS (macro)
Read whole.
CLASS ( ENDCAP ( BOTTOMEDGE | TOPEDGE | RIGHTEDGE | LEFTEDGE | RIGHTBOTTOMEDGE
| LEFTBOTTOMEDGE | RIGHTTOPEDGE | LEFTTOPEDGE | RIGHTBOTTOMCORNER
| LEFTBOTTOMCORNER | RIGHTTOPCORNER | LEFTTOPCORNER | PRE | POST
| TOPLEFT | TOPRIGHT | BOTTOMLEFT | BOTTOMRIGHT )
| COVER [BUMP] | RING | BLOCK [BLACKBOX] [SOFT]
| CORE [FEEDTHRU] [TIEHIGH] [TIELOW] [SPACER] [ANTENNACELL] [WELLTAP]
| PAD [INPUT] [OUTPUT] [INOUT] [POWER] [SPACER] [AREAIO] ) ;Other macro, pin and library properties
| Property | Belongs to | Reading | Syntax |
|---|---|---|---|
LEF58_EDGETYPE | macro | rule by rule | EDGETYPE ( RIGHT | LEFT | TOP | BOTTOM ) type [CELLROW n | HALFROW n | RANGE begin end] ; |
LEF58_BACKSIDE_BRIDGE | macro | whole | BACKSIDEBRIDGE ; |
LEF58_MUSTJOINALLPORTS | pin | – | any value that contains MUSTJOINALLPORTS |
LEF58_METALWIDTHVIAMAP | property definitions | rule by rule | METALWIDTHVIAMAP [USEVIACUTCLASS] ( VIA layer ( belowLow belowHigh aboveLow aboveHigh | belowWidth aboveWidth ) via [PGVIA] )+ ; |
LEF58_CELLEDGESPACINGTABLE | property definitions | rule by rule | CELLEDGESPACINGTABLE [NODEFAULT] ( EDGETYPE type1 type2 [EXCEPTABUTTED] [EXCEPTNONFILLERINBETWEEN] [OPTIONAL] [SOFT] [EXACT] spacing )+ ; |
The library values are those given with the definition: LIBRARY name STRING "value" ; in PROPERTYDEFINITIONS.
What OpenROAD's router checks
OpenROAD's detailed router has its own geometry checker, which gives some of these rules a working meaning. This section is what that checker does. It is not the Cadence definition, and it leaves out options that the parsers above accept. The rules are matched to properties by their names and parameters; the step that turns database rules into router constraints is not covered. A fixed shape is one that comes from the libraries and not from routing; most checks pass over a pair of fixed shapes.
End-of-line spacing
- An end edge is an edge strictly shorter than the end-of-line width with an outside (convex) corner at both ends.
- It is measured against an edge of another polygon that faces it. The search region reaches ahead of the end by the spacing and extends beyond both of its corners by
WITHIN. Nets with their own minimum spacing are skipped, routed metal must take part, and nothing is reported if metal already fills the gap. WRONGDIRSPACINGreplaces the spacing for the end of a wire that runs against the layer's preferred direction.ENDPRLSPACING: for a gap of at least the ordinary end-of-line spacing but within this one, there is a violation only if the parallel run length is above 0 and at most thePRLvalue.ENDTOENDapplies when the facing edge is an end too. WithEXTENSIONboth edges are widened by it; otherwise the first is widened byWITHIN. The edges must overlap along one axis, and the distance must be strictly smaller than the spacing.MINLENGTHandMAXLENGTHrequire a side edge next to the end to be at least, or at most, that long. One side is enough unlessTWOSIDESis given.PARALLELEDGErequires an edge running the opposite way in a box beside a corner of the end: the parallel spacing sideways, from the end-of-lineWITHINahead of the end to the parallelWITHINbehind it. One side is enough unlessTWOEDGESis given.ENCLOSECUTlooks for cuts in the layer above, below or both, within the distance behind the end and closer thanCUTSPACINGto the facing edge. WithALLCUTSevery such cut must be that close, and there must be one; otherwise any one will do.
End-of-line keep-out and extension spacing
EOLKEEPOUTbuilds a rectangle on the end edge: the side value beyond each corner, the forward value outwards and the backward value into the wire. Metal of another polygon overlapping it is a violation. WithCORNERONLYonly its corners inside the rectangle count.EXCEPTWITHIN low highremoves the violation when the metal reaches into a side band fromlowtohighbeyond either corner.EOLEXTENSIONSPACING: an end edge shorter than the widest entry is pushed outwards by the extension that its length selects, and so is the other edge if it is an end too. The straight-line distance must then be at least the spacing.PARALLELONLYlimits the check to facing parallel edges.
Wrong-direction spacing
Both edges must run against the preferred direction, be at least the NONEOL width long when that is given, and have a parallel run length greater than the PRL value. They violate the rule when closer than the spacing. This check does not use LENGTH.
Minimum step, rectangles and area
MINSTEPin LEF58 form is checked in two shapes.NOBETWEENEOL width: two edges shorter than the step, separated by an end edge shorter than the width.MINADJACENTLENGTH: an edge shorter than the step whose previous or next edge is shorter than that length; withNOADJACENTEOL widtha neighbouring end edge shorter than the width also counts;EXCEPTRECTANGLEpasses over rectangles. Runs made only of fixed edges are skipped.RECTONLY: a shape that is not a single rectangle is reported at each inside (concave) corner that is not made wholly of fixed metal.LEF58_AREAis applied to shapes without fixed metal. For a rectangle, the first rule whoseRECTWIDTHis at least the shorter side gives the area. Otherwise the rules are tried from the largest area down, those withEXCEPTRECTANGLEonly for shapes that are not rectangles. A smaller area is a violation.
Cut spacing
- Of the cut-layer
SPACINGforms, this part of the checker handles the second-layer, adjacent-cuts and parallel-overlap ones and warns that any other is skipped.CENTERTOCENTERmeasures between centres, otherwise the distance is from edge to edge. PARALLELOVERLAP: applies to two cuts whose projections overlap. It is waived when a metal rectangle of either net on the layer above or below covers the whole region between them.ADJACENTCUTS n: applies when the first cut has at leastnother cuts of the rule's class closer thanWITHIN; withNOPRLonly cuts with no parallel run are counted. WithTWOCUTS nit also applies when both cuts have at leastnsuch neighbours.
Forbidden spacing
For FORBIDDENSPACING the checker takes a wire that passes the rule's width and run-length tests and, for TWOEDGES, has another shape within that distance on both sides. A parallel shape at a distance in the forbidden range is reported only when a third shape, touching neither of the two, also lies in the region between them.
Links
Reference
- OpenDB LEF reader sources – one parser file for each property, in C++ (BSD-3-Clause, Copyright The OpenROAD Authors)
- OpenROAD detailed router geometry checker – the source of the rule checks (BSD-3-Clause, Copyright The OpenROAD Authors)