File Exchange

image thumbnail

nicolasayotte/Matla​bGDSPhotonicsToolbo​x

version 1.2 (2.41 MB) by

A library of functions to facilitate the design of Photonics Integrated Circuits GDS layouts

26 Downloads

Updated

Matlab GDS Photonics Toolbox
============================
This is a Matlab library of functions to facilitate the design of Photonics Integrated Circuits GDS layouts that I have developped with Alexandre D. Simard during my PhD.
This is oriented towards intuitive and adaptable creation of GDS layout files for fabrication in different facilities across the world. The toolbox creates a GDS based on a general layer map, but can be set up to export to any other layer map once the design is done.

Nicolas Ayotte and Alexandre D. Simard have used this library to efficiently create multiple layouts for different fabrication facilities across the world with successful results.

Features
--------
- Relative orientation group waveguide routing including turns, tapers, s-bends and the possibility to customize inter-waveguide distance at any point.
- Access to the travelled distance (physical or optical) of any waveguide offering a quick way to measure your devices.
- Possibility of referencing premade structures (fiber couplers, directional couplers, detectors, etc.)
- Possibility of referencing custom structures created on the fly.
- Premade functions for microrings, Bragg gratings, multi-mode interferometer, contra-directional couplers, output array of fiber couplers, etc.
- Tutorial project with many cells showcasing the features.
- A PDF presentation presenting the library's purpose and principles.
- Intuitive relative cell placement in the master floorplan for easy teamwork.
- Relative and scalable routing solution.
- Includes functions to export to other layer maps, including boolean operations on the layers.
- Easy scripting language (i.e.: Matlab).

It is strongly encouraged to get the free software KLayout to look at your GDS files:
http://www.klayout.de/

Suggested first steps
---------------------
- Look through the PDF presentation
- (Optional) Run the command "mex -setup" to install a C compiler in matlab.
- Run the makemex.m function in the main folder to compile all the C functions needed for the library.
- Open the tutorial project folder: Project - New Project
- Go through the Cells script, run them, look at the resulting .gds files.
- Look at the Cell_RoutingWG.m script that places the cell in the floorplan.
- Read at the ProjectDefinition.m file.
- Run the Main.m to merge the gds cells and export to the ouput layer map.
- Duplicate the Project folder and make your own!

License
---------
Copyright © 2014 Nicolas Ayotte and Alexandre D. Simard. MIT License

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Comments and Ratings (9)

Hi Gal!

Yes, once you create a library and a structure, you can add custom polygons in it using the [xin, yin] pattern. Look in Functions/PlaceRect and PlaceArc at the lines using gds_element like:

gds_element('boundary', 'xy', RotTransXY(xy, info.pos(row, : ), info.ori(row)), 'layer', layer(row, col), 'dtype', datatype(row, col));

You might want to use RotTransXY to rotate and translate your polygon (or not). :)

info.pos(row, : ) is a translation vector array [x, y]
info.ori(row) is an angle

You can look specifically in Functions\GDSII Library\Basic\@gds_element and the other basic elements (library, structure and elements) of Functions\GDSII Library\Basic\

If you end up using the library in your work, and if you can, please send me a one-liner description of your project: I like knowing who's using the lib and where they're from. :)

Cheers,
Nick

Gal Harari

Thanks for your work, is there a simple way to generate a GDS file using your library from direct coordinates? i.e., I use matlab to generate polygons, in the form of NX2 matrices, say [xin yin] and [xout yout] denoting the inner and outer circumferences of a shape. I would like to put these shapes in a gds file. The shapes are of arbitrary contour and therefore i cannot use any of the pre-made structures and only needs the basic conversion to GDS.

Thanks.

The gds generated by this library should not contain self-intersecting polygons. However, opening the gds file with Klayout and saving it on a different name could allow the user to
1) define the maximum number of vertices per polygon
2) remove existing collinear coordinates
3) change the database unit

Simcha

Simcha (view profile)

Your work is very valuable and I am sure will find use in many labs besides optics.
We are a quantum information processing lab and have a need to design superconducting circuits using laser lithography.
I am now trying to learn how to use your library and adapt it to our purposes.
It is very important for us to be able to perform boolean operations between layers, as for RF circuits there needs to be a ground layer with a fixed gap to signal lines (waveguides).

For people having problems with makemex - remove .net framework before installing the C++ SDK.

Apodized Bragg gratings:

Typical "amplitude" apodized Bragg gratings, as well as "phase" and "superposition" apodized Bragg grating (i.e. "A. D. Simard, N. Belhadj, Y. Painchaud and S. Larochelle, “Apodized Silicon-on-Insulator Bragg Gratings,” Photon. Technol. Lett., vol. 24, no. 12, pp. 1033 -1035, June 2012.") can be easily generated using the function "BraggFromProfile" and by adjusting the flag "apodizationType" to "amplitude", "phase" or "superposition".

PlaceSBend has been updated and now features a flag that automatically finds the shortest length required for the structure.

From the user standpoint, this library reduces significantly the time required to produce a complex and multi-layer layout (both for active and passive photonic circuit). This code allows producing a flexible layout than can be easily adjusted and modified to match improved simulation results.

Updates

1.2

CheckForLargePolygons added to the library to cut polygons larger than 8191 vertices resulting from boolean operations

1.1

Version 2.0 - Improved stability, new tutorials, boolean operations, new options in PlaceRect, PlaceArc and PlaceSBend. Added a PlaceARef, compact u-turn, a multi-mode interferometer, a Mach-Zehnder interferometer, and a CDC.

MATLAB Release
MATLAB 8.1 (R2013a)

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video