KLayout 0.29.8 (2024-10-28 63dd591e5) [master]

About Layer Specifications

Layer specifications are used in various places, for example in layer mapping files (Layer Mapping Tables). Layer specifications are used inside the database to give a layer a name or a number/datatype pair or both. Layer specifications are the text representation of LayerInfo objects.

Blanks within layer specifications are ignored and can be put between the different components of the specification.

A simple number for the specification will indicate a layer with this layer number and a datatype of zero:

17

will give layer 17, datatype 0.

A number followed by a slash and another number will indicate a layer number and datatype:

17/5

will give layer 17, datatype 5.

Layers can be named. Named layers are present in DXF, CIF or other formats which don't use the GDS layer/datatype number scheme. Just giving a name will indicate such a layer:

METAL1

will give a named layer called "METAL1".

If you want to use a name that is a number, use quotes:

"17"

will give a named layer called "17".

If you want to use a name that includes blanks, put it into quotes as well:

"METAL 1"

will give a named layer called "METAL 1" (however, such layer names are usually illegal).

Finally, a layer can have both a name and layer/datatype numbers. In this case, add the layer/datatype number to the name in round brackets:

METAL1 (17)

will give a layer named "METAL1" with layer 17 and datatype 0 and

METAL1 (17/5)

will give a layer named "METAL1" with layer 17 and datatype 5.

Layer specifications as targets

When used in a target context (e.g. for layer mapping), a layer specification can use wildcards and relative layer/datatype specifications. Using "*" instead of a layer or datatype number means to reuse the source layer or datatype number. Using "+x" or "-x" for layer or datatype number means to add or subtract "x" from the source layer or datatype number.