next up previous contents index
Next: The Export Cell Data Up: The Convert Menu: Data Previous: Layer Filtering and Aliasing   Contents   Index


GDSII Layer Mapping

The GDSII file format does not use layer names. Instead, geometry can exist on a numbered layer and datatype. Typically, the layer number and datatype can be in the range 0-255, or 0-63 for some older versions of the GDSII specification. Here, the combination of a GDSII layer number and datatype is referred to as a ``specification''.

Although the GDSII file format documentation, which is maintained by Cadence Design Systems, Inc., specifies the 0-255 range for the current GDSII release, the file format uses 16-bit integers to store these values, and other vendors support layer and datatype numbers outside of this range. Xic release 2.5.67 and later can semi-transparently handle layer and datatype values in the range 0-65535.

Although this section refers to the GDSII file format, the same mapping logic applies when reading OASIS and CGX files, when a layer/datatype are given.

When reading a GDSII file, Xic will attempt to map specifications encountered into existing Xic layers. If that fails, a new Xic layer will be created. The GDSII mapping for Xic layers is generally assigned in the technology file using the StreamIn keyword (for reading) and StreamOut (for writing), or can be specified with the Tech Parameter Editor from the Edit Tech Params button in the Attributes Menu. This is the primary means by which GDSII specifications are interpreted as Xic layers, but this requires a-priori knowledge of the content of the GDSII file.

This section describes the process Xic uses to map an unknown specification encountered when reading GDSII input, where ``unknown'' means that no suitable mapping exists in the StreamIn lines of the present Xic layers.

Xic will first try to identify an existing Xic layer to map to the unknown specification. The first test is to look for an output mapping (as produced with a StreamOut line) that matches. If a match is found, an input mapping will be created. The behavior depends on the setting of the NoMapDatatypes variable, which reflects the state of the Map all unmapped GDSII datatypes to same Xic layer check box in the Setup page of the Import Control panel from the Convert Menu. When this variable is set (directly with the !set command, or by the button), the datatype will be ignored. The following pseudo-code illustrates the logic:

loop through existing Xic layers {
  if Xic layer has no GDSII input mapping {
    if Xic layer output mapping = GDSII layer {
      if NoMapDatatypes set
        (use this layer)
      else if output mapping datatype = GDSII datatype
        (use this layer)
    }
  }
}

Each layer/datatype specification has an equivalent hex code. If the layer and datatype are less than 256, the hex code is of the form LLDD, where the Ls are hex digits, zero-padded, which represent the layer number, and the Ds similarly represent the datatype. If either number is larger than 255, the format is LLLLDDDD, which has the same interpretation, e.g., the Ls are a four-digit zero-padded hex integer representing the layer number. If the NoMapDatatypes variable is in effect, the datatype field (the Ds) can instead be filled with `X' characters.

The hex values are produced in upper case, but matching is case insensitive.

If no suitable output mapping is found, Xic will look for layer names or long names which match the hex encoding. If a layer is found with a name or long name matching (case-insensitive) the hex code for the specification, and that layer has no input mapping, an input mapping will be created. The following pseudo-code illustrates the logic:

if NoMapDatatypes set {
  if layer and datatype less than 256
    hex_code = hhXX
  else
    hex_code = hhhhXXXX
}
else {
  if layer and datatype less than 256
    hex_code = hhhh
  else
    hex_code = hhhhhhhh
}
loop through existing Xic layers {
  if Xic layer name or long name matches hex_code
    (use this layer)
}

If no existing layer is found that can be mapped to, a new layer will be created. If the hex code is four characters, the name of the new layer is the same as the hex code. If the hex code is eight characters, the new name is an internally-generated unique four-character name, and the long name is assigned the hex code. The layer name in this case is in the form ``L???'' where ??? is a sequential decimal zero-padded integer, starting with ``000''. This mapping is also used in the four-character hex code case, if the hex code conflicts with an existing layer name.

After the GDSII file has been read, newly created layers will appear in the layer menu (they are added above existing layers). The user can modify colors, fill patterns, and other attributes for these layers, and dump a new technology file with the Save Tech command.


next up previous contents index
Next: The Export Cell Data Up: The Convert Menu: Data Previous: Layer Filtering and Aliasing   Contents   Index
Stephen R. Whiteley 2017-11-08