コード例 #1
0
# If we want to examine any single layer, we can call them by their names,
# for example
gold_layer = ls['au']
print(ls['nb'])

# We can quickly preview our color scheme using the LayerSet.preview()
# function as well.
P = pg.preview_layerset(ls)
qp(P)
P.write_gds('MyLayerSetPreview.gds')

# We can even save the LayerSet as a KLayout .lyp file ("layer properties" file)
# useful for getting the color scheme in KLayout to match quickplot
import phidl.utilities as pu
pu.write_lyp('MyLayerSetPreview.lyp', layerset=ls)

#==============================================================================
# Removing  layers
#==============================================================================
# Now say we only wanted to get layers 4 and 5 from an imported.  We can remove
# the unwanted layers using the remove_layers() function
D = pg.import_gds(filename='MyLayerSetPreview.gds')

# We set "invert_selection" to True so that all layers EXCEPT 4 and 5
# are removed
D.remove_layers(layers=[4, 5], invert_selection=True)
qp(D)

# If we later decide that we actually don't want layer 4, as well, we
# can leave the `invert_selection` argument blank
コード例 #2
0
import layoutISING as li
import numpy as np
import matplotlib.pyplot as plt
from scipy.constants import pi, c

# # Initialization

# In[2]:

#Load process layers and save layer properties file for Klayout visualization.

ls = li.setup_layers()
P = pg.preview_layerset(ls)
qp(P)
# P.write_svg('Layers.svg')
pu.write_lyp('mac_0.lyp', layerset=ls)

#Set up the units

mm = 10**3
um = 1
nm = 10**(-3)

# Global Chip Parameters
chip_width = 23 * mm
chip_height = 13 * mm
ko = 1.5 * mm
T = li.chip(size=(chip_width, chip_height),
            name='MAC CHIP REV #0',
            text_size=150,
            keepout=ko)