Skip to content

Commit

Permalink
Merge branch 'master' into FAVE
Browse files Browse the repository at this point in the history
  • Loading branch information
lukasc-ubc authored Nov 2, 2024
2 parents 37738bb + bd4b674 commit 8d3a8d8
Show file tree
Hide file tree
Showing 47 changed files with 300 additions and 63 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/check-path-length.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# .github/workflows/check-path-length.yml
name: Check Path Length (200 limit)

on:
push:
pull_request:

jobs:
check-path-length:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Check file path lengths
run: |
# Set the maximum allowed length
MAX_LENGTH=200
# Find all files in the repository and check their path lengths
too_long_paths=0
# Loop through each file path found by find
IFS=$'\n' # Set Internal Field Separator to newline to handle spaces in filenames
for file in $(find . -type f); do
length=${#file}
if (( length > MAX_LENGTH )); then
echo "Path too long: $file ($length characters)"
too_long_paths=$((too_long_paths + 1))
fi
done
if (( too_long_paths > 0 )); then
echo "Error: Found $too_long_paths file paths longer than $MAX_LENGTH characters."
exit 1
else
echo "All file paths are within the $MAX_LENGTH character limit."
fi
24 changes: 24 additions & 0 deletions check_path_lengths
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Set the maximum allowed length
MAX_LENGTH=200
# Find all files in the repository and check their path lengths
too_long_paths=0


# Loop through each file path found by find
IFS=$'\n' # Set Internal Field Separator to newline to handle spaces in filenames
for file in $(find . -type f); do
length=${#file}
if (( length > MAX_LENGTH )); then
echo "Path too long: $file ($length characters)"
too_long_paths=$((too_long_paths + 1))
fi
done

echo "Files too long: $too_long_paths"
if (( too_long_paths > 0 )); then
echo "Error: Found $too_long_paths file paths longer than $MAX_LENGTH characters."
exit 1
else
echo "All file paths are within the $MAX_LENGTH character limit."
fi

78 changes: 16 additions & 62 deletions klayout/EBeam/EBeam.lyt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<description/>
<group/>
<dbu>0.001</dbu>
<default-grids/>
<base-path/>
<original-base-path>/Users/lukasc/Documents/GitHub/SiEPIC_EBeam_PDK/klayout/EBeam</original-base-path>
<layer-properties_file>EBeam.lyp</layer-properties_file>
Expand Down Expand Up @@ -37,17 +38,17 @@
<produce-regions>true</produce-regions>
<region-layer>REGIONS</region-layer>
<produce-via-geometry>true</produce-via-geometry>
<special-via_geometry-suffix-string/>
<special-via_geometry-datatype-string>0</special-via_geometry-datatype-string>
<via_geometry-suffix-string/>
<via_geometry-datatype-string>0</via_geometry-datatype-string>
<produce-pins>true</produce-pins>
<special-pins-suffix-string>.PIN</special-pins-suffix-string>
<special-pins-datatype-string>2</special-pins-datatype-string>
<pins-suffix-string>.PIN</pins-suffix-string>
<pins-datatype-string>2</pins-datatype-string>
<produce-lef-pins>true</produce-lef-pins>
<special-lef_pins-suffix-string>.PIN</special-lef_pins-suffix-string>
<special-lef_pins-datatype-string>2</special-lef_pins-datatype-string>
<lef_pins-suffix-string>.PIN</lef_pins-suffix-string>
<lef_pins-datatype-string>2</lef_pins-datatype-string>
<produce-fills>true</produce-fills>
<special-fills-suffix-string>.FILL</special-fills-suffix-string>
<special-fills-datatype-string>5</special-fills-datatype-string>
<fills-suffix-string>.FILL</fills-suffix-string>
<fills-datatype-string>5</fills-datatype-string>
<produce-obstructions>true</produce-obstructions>
<obstructions-suffix>.OBS</obstructions-suffix>
<obstructions-datatype>3</obstructions-datatype>
Expand All @@ -61,15 +62,16 @@
<lef-labels-suffix>.LABEL</lef-labels-suffix>
<lef-labels-datatype>1</lef-labels-datatype>
<produce-routing>true</produce-routing>
<special-routing-suffix-string/>
<special-routing-datatype-string>0</special-routing-datatype-string>
<routing-suffix-string/>
<routing-datatype-string>0</routing-datatype-string>
<produce-special-routing>true</produce-special-routing>
<special-routing-suffix-string/>
<special-routing-datatype-string>0</special-routing-datatype-string>
<via-cellname-prefix>VIA_</via-cellname-prefix>
<read-lef-with-def>true</read-lef-with-def>
<macro-resolution-mode>default</macro-resolution-mode>
<separate-groups>false</separate-groups>
<joined-paths>false</joined-paths>
<map-file/>
</lefdef>
<dxf>
Expand Down Expand Up @@ -105,6 +107,7 @@
</mag>
</reader-options>
<writer-options>
<format>GDS2</format>
<gds2>
<write-timestamps>true</write-timestamps>
<write-cell-properties>true</write-cell-properties>
Expand All @@ -117,12 +120,12 @@
<libname>EBeam</libname>
</gds2>
<oasis>
<compression-level>2</compression-level>
<write-cblocks>false</write-cblocks>
<compression-level>10</compression-level>
<write-cblocks>true</write-cblocks>
<strict-mode>false</strict-mode>
<write-std-properties>1</write-std-properties>
<subst-char>*</subst-char>
<permissive>false</permissive>
<permissive>true</permissive>
</oasis>
<cif>
<polygon-mode>0</polygon-mode>
Expand All @@ -137,55 +140,6 @@
<write-timestamp>true</write-timestamp>
</mag>
</writer-options>
<d25>
<src># Provide z stack information here
#
# Each line is one layer. The specification consists of a layer specification, a colon and arguments.
# The arguments are named (like "x=...") or in serial. Parameters are separated by comma or blanks.
# Named arguments are:
#
# zstart The lower z position of the extruded layer in µm
# zstop The upper z position of the extruded layer in µm
# height The height of the extruded layer in µm
#
# 'height', 'zstart' and 'zstop' can be used in any combination. If no value is given for 'zstart',
# the upper level of the previous layer will be used.
#
# If a single unnamed parameter is given, it corresponds to 'height'. Two parameters correspond to
# 'zstart' and 'zstop'.
#
# Examples:
# 1: 0.5 1.5 # extrude layer 1/0 from 0.5 to 1.5 vertically
# 1/0: 0.5 1.5 # same with explicit datatype
# 1: zstop=1.5, zstart=0.5 # same with named parameters
# 1: height=1.0, zstop=1.5 # same with z stop minus height
# 1: 1.0 zstop=1.5 # same with height as unnamed parameter
#
# VARIABLES
#
# You can declare variables with:
# var name = value
#
# You can use variables inside numeric expressions.
# Example:
# var hmetal = 0.48
# 7/0: 0.5 0.5+hmetal*2 # 2x thick metal
#
# You cannot use variables inside layer specifications currently.
#
# CONDITIONALS
#
# You can enable or disable branches of the table using 'if', 'else', 'elseif' and 'end':
# Example:
# var thick_m1 = true
# if thickm1
# 1: 0.5 1.5
# else
# 1: 0.5 1.2
# end

</src>
</d25>
<connectivity>
</connectivity>
</technology>
2 changes: 1 addition & 1 deletion klayout/EBeam/pymacros/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

version = "0.4.27"

print('SiEPIC-EBeam-PDK Python module: pymacros')
print('SiEPIC-EBeam-PDK Python module: pymacros, v%s' % version)

from SiEPIC.scripts import load_klayout_library

Expand Down
99 changes: 99 additions & 0 deletions klayout/EBeam/pymacros/pcells_EBeam_Beta/slot_SiN.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
import pya
from SiEPIC.utils import get_technology_by_name
from pya import *

class slot_SiN(pya.PCellDeclarationHelper):
"""
Simple sloted waveguide for the SiN plaform
draft by Bobby Zou Oct 24, 2024
"""

def __init__(self):
super(slot_SiN, self).__init__()
TECHNOLOGY = get_technology_by_name('EBeam')

# declare the parameters
self.param("layer", self.TypeLayer, "Layer", default = TECHNOLOGY['SiN'])
self.param("w", self.TypeDouble, "Waveguide Width", default=1)
self.param("rails", self.TypeDouble, "Rails", default=0.5)
self.param("slot", self.TypeDouble, "Slot", default=0.12)
self.param("length", self.TypeDouble, "Length", default=50)

self.param("pinrec", self.TypeLayer, "PinRec Layer", default=TECHNOLOGY["PinRec"])
self.param("devrec", self.TypeLayer, "DevRec Layer", default=TECHNOLOGY["DevRec"])

def display_text_impl(self):
# Provide a descriptive text for the cell
return (
"Slot_SiN(rails="
+ ("%.3f" % self.rails)
+ ",slot="
+ ("%g" % (self.slot))
+ ")"
)

def can_create_from_shape_impl(self):
return False


def produce_impl(self):
# This is the main part of the implementation: create the layout

from SiEPIC.extend import to_itype
from SiEPIC.utils import arc_wg_xy

# fetch the parameters
dbu = self.layout.dbu
ly = self.layout
cell = self.cell
shapes = self.cell.shapes

LayerSiN = ly.layer(self.layer)
LayerPinRecN = ly.layer(self.pinrec)
LayerDevRecN = ly.layer(self.devrec)

# Use to_itype() to prevent rounding errors
w = to_itype(self.w, dbu)
rails = to_itype(self.rails, dbu)
slot = to_itype(self.slot, dbu)
length = to_itype(self.length, dbu)

# Create the top left 1/2 waveguide
wg1 = Box(0, slot/2, length, rails + slot/2)
shapes(LayerSiN).insert(wg1)

wg2 = Box(0, -(slot/2), length, -(rails + slot/2))
shapes(LayerSiN).insert(wg2)

# PinRec Left
shapes(LayerPinRecN).insert(
pya.Path(
[
pya.Point(0.05 / dbu, 0),
pya.Point(-0.05 / dbu, 0),
],
2 * rails + slot,
)
)
shapes(LayerPinRecN).insert(
pya.Text("opt1", pya.Trans(pya.Trans.R0, 0, 0))
).text_size = 0.5 / dbu

# PinRec Right
shapes(LayerPinRecN).insert(
pya.Path(
[
pya.Point(length-0.05 / dbu, 0),
pya.Point(length+0.05 / dbu, 0),
],
2 * rails + slot,
)
)
shapes(LayerPinRecN).insert(
pya.Text("opt2", pya.Trans(pya.Trans.R0, length, 0))
).text_size = 0.5 / dbu

# Create the device recognition layer -- make it 1 * wg_width away from the waveguides.
dev = Box(0,-(rails + slot/2 + w), length, (rails + slot/2 + w))
shapes(LayerDevRecN).insert(dev)
Loading

0 comments on commit 8d3a8d8

Please sign in to comment.