GDSII Toolbox

An Octave & MATLAB toolbox for layout files in GDSII format.

The GDSII library, or database, format has become an important industry standard for the description of nano-structure designs that are fabricated with either photo- or electron lithography - despite being poorly documented. GDSII library files are used to define the layout of integrated circuits, MEMS devices, nano-structured optics, and so on. This toolbox of functions for MATLAB or Octave can be used to create, read, and modify files in GDSII library format. The toolbox is particularly useful when a layout is the result of numerical modeling as is often the case, e.g., for nano-structured optics, photonic devices, or micro-fluidic devices. MATLAB or Octave can become very efficient tools for post-processing of modeling results and for creating a lithographic layout as input to the fabrication process. The toolbox can also be used to modify GDSII layout files using scripts, e.g. for merging of several layout files. Layouts can be inspected with the excellent free layout viewer KLayout. Development versions of the toolbox are stored on GitHub. A local copy of the repository can be created with the following command:

git clone https://github.com/ulfgri/gdsii-toolbox.git

News:

  • versions >= 112a use nested functions and require Octave versions >= 3.8.
  • beginning with version 107a, most element properties are stored in a C structure that is "hidden" in a single array and accessed through mex functions. This makes the toolbox more memory efficient and enables processing of larger layout files (many GB). Should be faster too.
  • beginning with version 100a, low-level file I/O is done through a set of mex functions that read and write element data. This speeds up reading and writing of layout files by about a factor of 5 (the actual speedup depends on the element mix). Does not work with the LCC compiler that was included with some versions of MATLAB.
  • the Clipper library by Angus Johnson is now used for Boolean set operations. The General Polygon Clipper library is no longer included with the toolbox.