Layer Mapping TablesLayer mapping tables are used to specify the behavior of the layout reader. Specifically, they define what actions are taken when a shape on a certain layer is encountered. They can be used to
A layer mapping table consists of two specifications: a match expression and an optional target expression. If a shape is encountered, the reader looks up the shape's layer in the mapping table. If an entry is found whose match expression matches the layer of the shape, the shape is assigned a new layer given by the target expression if present. By assigning different match expressions the same target expressions, multiple input layers can be combined into a single one. If no matching entry is found, the reader can be configured to either store the shape under the original layer or discard it. This option can be found in the reader options dialog as the "Read all layers" option. If that box is checked, the shapes are stored under their original layer and discarded if not. A target expression can be used also to add information, specifically a layer name. In GDS there is no layer name but just a layer and datatype number. In OASIS, there is a layer name in addition. Other formats just use named layers and don't have the concept of layer number or datatype number. When the target expression specifies a layer name that name is used. That allows adding of OASIS layer names to GDS files for example. Layers with names are usually more useful than layers that just have a number. The layer mapping table consists of lines, each specifying the match expression and optional target expression. The match and target expressions are separated by a colon. Each expression has the form "layer" (numeric), "layer/datatype" (both numberic), "name" (a string) or "name(layer)" or "name(layer/datatype)" (all specifications). When name and layer/datatype are specified in a match string, KLayout will first look for a matching layer/datatype and then for a matching layer name. The name match is case sensitive. For the numerical specifications, ranges are allowed using a hyphen for an interval and the comma for enumerations (see second example below). Here are some examples:
When the layer mapping is read from a file, each line corresponds to one entry. Blanks are ignored as are empty lines. Comments can be inserted using the "#" character in front of the comment. |