Skip to content

Commit

Permalink
Merge branch 'SiEPIC:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
Ghazaleh-nour authored Jul 14, 2024
2 parents 4da1e68 + a047a84 commit 9cac884
Show file tree
Hide file tree
Showing 73 changed files with 17,350 additions and 30 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/AutomaticApprove.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ jobs:
uses: mheap/automatic-approve-action@v1
with:
token: ${{ secrets.PAT }}
workflows: "*"
workflows: "run-verification.yml,run-drc.yml,run-yaml-verification.yml,yaml_file.yml"
3 changes: 3 additions & 0 deletions .github/workflows/run-drc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ on:
branches:
- '**'
pull_request:
paths:
- 'submissions/**.gds'
- 'submissions/**.oas'
branches:
- '**'

Expand Down
151 changes: 129 additions & 22 deletions .github/workflows/run-verification.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ on:
push:
paths:
- 'submissions/**.gds'
- 'submissions/**.GDS'
- 'submissions/**.oas'
- 'submissions/**.OAS'
branches:
- '**'
pull_request:
Expand All @@ -27,6 +29,17 @@ jobs:
with:
fetch-depth: 0

- name: write what triggered this workflow to a txt file
run: |
echo "${{ github.event_name }}" > trigger_info.txt
cat trigger_info.txt
- name: upload trigger txt file as an artifact
uses: actions/upload-artifact@v4
with:
name: verification-trigger
path: trigger_info.txt

# can also specify python version if needed
- name: setup python
uses: actions/setup-python@v4
Expand All @@ -35,41 +48,63 @@ jobs:
run: |
python -m pip install --upgrade pip
pip install klayout SiEPIC siepic_ebeam_pdk
python -m pip install --upgrade SiEPIC
- name: get .gds and .oas files, run example layout verification
id: run-script
- name: download latest python-to-oas-gds artifact from triggering workflow
uses: dawidd6/action-download-artifact@v2
with:
run_id: ${{ github.event.workflow_run.id }}
name: python-to-oas-gds
path: ./binary_files
search_artifacts: true
if: ${{ github.event_name == 'workflow_run' }}

- name: get .gds and .oas files
run: |
# if the action is being triggered after running python files, get resulting oas files from txt file
# github actions is not configured to detect files pushed from another action, thus we cannot use the method below
if [ -s "python-to-gds_oas.txt" ] && [ -n "$(cat python-to-gds_oas.txt)" ]; then
export FILES=$(cat python-to-gds_oas.txt)
IFS=' '
echo "" > python-to-gds_oas.txt
# push empty text file to repo
git config --local user.email "${{ github.actor }}@users.noreply.github.com"
git config --local user.name "${{ github.actor }}"
git add python-to-gds_oas.txt
git commit -m "Emptying text file"
git push
# if the action is being triggered after running python files, get resulting oas/gds files from artifact
# github actions is not configured to detect files pushed from another action, thus we cannot use the 'else' method below
if [ "${{ github.event_name }}" == "workflow_run" ]; then
FILES=$(ls ./binary_files)
else
if [ "${{ github.event_name }}" = "pull_request" ]; then
if [[ "${{ github.event_name }}" == "pull_request" || "${{ github.event_name }}" == "pull_request_target" ]]; then
# triggered on pull request, get all changed / added files from forked repo
export FILES=$(git diff --name-only --diff-filter=ACM FETCH_HEAD | grep -E '\.(gds|oas)$' | sed 's|^submissions/||')
FILES=$(git diff --name-only --diff-filter=ACM FETCH_HEAD | grep -i -E '\.(gds|oas)$' | sed 's|^submissions/||')
else
# triggered push, locate the changed / added .gds and .oas files in the submission folder
export FILES=$(git diff --name-status --diff-filter=ACM --relative=submissions ${{ github.event.before }} ${{ github.sha }} submissions | grep -E '\.(gds|oas)$' | awk '{print $2}')
FILES=$(git diff --name-status --diff-filter=ACM --relative=submissions ${{ github.event.before }} ${{ github.sha }} submissions | grep -i -E '\.(gds|oas)$' | awk '{print $2}')
fi
IFS=$'\n'
fi
# we cannot set a multiline env vars so we must change it to single line (seperated by commas) if we have more than one file
if [ $(echo "$FILES" | wc -l) -gt 1 ]; then
# Replace newlines with a delimiter (e.g., comma)
FILES_SINGLE_LINE=$(echo "$FILES" | tr '\n' ',')
else
# Keep the original content without modification
FILES_SINGLE_LINE="$FILES"
fi
echo "$FILES_SINGLE_LINE"
echo "FILES_SINGLE_LINE=$FILES_SINGLE_LINE" >> $GITHUB_ENV
- name: run layout verification
run: |
# Check if there is a comma in the variable and revert it back to a multiline var
if [[ "$FILES_SINGLE_LINE" == *","* ]]; then
# Replace the delimiter with newlines
FILES=$(echo "$FILES_SINGLE_LINE" | tr ',' '\n')
else
# No comma found, keep the original content without modification
FILES="$FILES_SINGLE_LINE"
fi
# print the names of the files
echo "Files for verification; $FILES"
files_with_errors=""
IFS=$'\n'
# run verification on all files
for file in $FILES; do
Expand All @@ -85,6 +120,7 @@ jobs:
# if file results in verification errors add to string files_with_errors
if [[ "$errors_from_output" -ge 1 ]]; then
echo "$output"
files_with_errors+="$file, $errors_from_output errors. "
echo $files_with_errors >> $GITHUB_STEP_SUMMARY
echo $output >> $GITHUB_STEP_SUMMARY
Expand All @@ -93,8 +129,11 @@ jobs:
echo "Done verification on $file"
done
echo "$output" > verification_output.txt
echo "files_with_errors=$files_with_errors" >> $GITHUB_ENV
- name: move output files to new folder
run: |
export OUTPUT_FILES=$(find /home/runner/work/openEBL-2024-07-Si-Heaters/openEBL-2024-07-Si-Heaters/submissions -name "*.lyrdb")
Expand Down Expand Up @@ -123,3 +162,71 @@ jobs:
exit 1
fi
- name: get .gds and .oas files, run example layout verification
id: run-script
run: |
# if the action is being triggered after running python files, get resulting oas files from txt file
# github actions is not configured to detect files pushed from another action, thus we cannot use the method below
if [ -s "python-to-gds_oas.txt" ] && [ -n "$(cat python-to-gds_oas.txt)" ]; then
export FILES=$(cat python-to-gds_oas.txt)
IFS=' '
echo "" > python-to-gds_oas.txt
# push empty text file to repo
git config --local user.email "${{ github.actor }}@users.noreply.github.com"
git config --local user.name "${{ github.actor }}"
git add python-to-gds_oas.txt
git commit -m "Emptying text file"
git push
else
if [ "${{ github.event_name }}" = "pull_request" ]; then
# triggered on pull request, get all changed / added files from forked repo
export FILES=$(git diff --name-only --diff-filter=ACM FETCH_HEAD | grep -E '\.(gds|oas)$' | sed 's|^submissions/||')
else
# triggered push, locate the changed / added .gds and .oas files in the submission folder
export FILES=$(git diff --name-status --diff-filter=ACM --relative=submissions ${{ github.event.before }} ${{ github.sha }} submissions | grep -E '\.(gds|oas)$' | awk '{print $2}')
fi
IFS=$'\n'
fi
# print the names of the files
echo "Files for verification; $FILES"
files_with_errors=""
# run verification on all files
for file in $FILES; do
echo "Running verification on $file"
output=$(python run_verification.py "submissions/$file")
# get number of errors
errors_from_output=$(echo "$output" | tail -n 1)
echo "$errors_from_output errors detected for $file"
# if file results in verification errors add to string files_with_errors
if [[ "$errors_from_output" -ge 1 ]]; then
files_with_errors+="$file, $errors_from_output errors. "
echo $files_with_errors >> $GITHUB_STEP_SUMMARY
echo $output >> $GITHUB_STEP_SUMMARY
fi
echo "Done verification on $file"
done
echo "files_with_errors=$files_with_errors" >> $GITHUB_ENV
# Don't run:
if: github.repository == 'octo-org/octo-repo-prod'
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
- Oxide cladding
- TiW metal heater, and Au metal bond pads
- Details: [Slides](https://docs.google.com/presentation/d/1_ppHYec6LydML4RMRJdNI4DXHb0hgW7znToQCGgSF6M)
- design size: 470 µm height x 440 µm width
- Process Design Kit: [SiEPIC-EBeam-PDK](https://github.com/siepic/SiEPIC_EBeam_PDK)

## Layer table
Expand Down Expand Up @@ -90,5 +91,5 @@ The verification and merging is performed using GitHub actions. The repository i
## Latest Merge Layout File

<!-- start-link -->
https://github.com/SiEPIC/openEBL-2024-07-Si-Heaters/actions/runs/9919495037/artifacts/1697893480
https://github.com/SiEPIC/openEBL-2024-07-Si-Heaters/actions/runs/9930179632/artifacts/1699683971
<!-- end-link -->
Binary file modified framework/EBL_Framework_1cm_PCM_static.oas
Binary file not shown.
10 changes: 5 additions & 5 deletions merge/EBeam_merge.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,8 @@ def log(text):
top_cell.insert(CellInstArray(cell_edXphot1x.cell_index(), t))
cell_ELEC413 = layout.create_cell("ELEC413")
top_cell.insert(CellInstArray(cell_ELEC413.cell_index(), t))
cell_SiEPIC_Passives = layout.create_cell("SiEPIC_Passives")
top_cell.insert(CellInstArray(cell_SiEPIC_Passives.cell_index(), t))
cell_SiEPIC = layout.create_cell("SiEPIC")
top_cell.insert(CellInstArray(cell_SiEPIC.cell_index(), t))
cell_unknown = layout.create_cell("unknown")
top_cell.insert(CellInstArray(cell_unknown.cell_index(), t))

Expand Down Expand Up @@ -153,8 +153,8 @@ def log(text):
course = 'edXphot1x'
elif 'elec413' in f.lower():
course = 'ELEC413'
elif 'siepic_passives' in f.lower():
course = 'SiEPIC_Passives'
elif 'siepic' in f.lower():
course = 'SiEPIC'
else:
course = 'unknown'

Expand Down Expand Up @@ -273,7 +273,7 @@ def log(text):
# Measure the height of the cell that was added, and move up
y += max (cell_Height, subcell.bbox().height()) + cell_Gap_Height
# move right and bottom when we reach the top of the chip
if y + cell_Height > chip_Height1 and x == 0:
if y + cell_Height > chip_Height1 and x < (cell_Width + cell_Gap_Width)*2:
y = cell_Height + cell_Gap_Height
x += cell_Width + cell_Gap_Width
if y + cell_Height > chip_Height2:
Expand Down
3 changes: 3 additions & 0 deletions run_DRC.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@
import os
gds_file = os.path.join(os.path.dirname(os.path.realpath(__file__)), 'submissions/EBeam_heaters_BraggGratingwithHeater.gds')

if "framework/EBL_Framework_1cm_PCM_static" in gds_file:
exit()

# load into layout
try:
# load into layout
Expand Down
5 changes: 4 additions & 1 deletion run_verification.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@
# gds file to run verification on
gds_file = sys.argv[1]

if "framework/EBL_Framework_1cm_PCM_static" in gds_file:
exit()

# load into layout
layout = pya.Layout()
layout.read(gds_file)
Expand All @@ -42,7 +45,7 @@
file_lyrdb = os.path.join(path,filename+'.lyrdb')

# run verification
num_errors = layout_check(cell = top_cell, verbose=True, GUI=True, file_rdb=file_lyrdb)
num_errors = layout_check(cell = top_cell, verbose=False, GUI=True, file_rdb=file_lyrdb)

# Print the result value to standard output
print(num_errors)
Expand Down
Binary file added submissions/EBeam_AndrazDebevc_CDCeskid.gds
Binary file not shown.
Binary file added submissions/EBeam_AndrazDebevc_CDCeskid_2.gds
Binary file not shown.
Binary file added submissions/EBeam_AndrazDebevc_CDCeskid_3.gds
Binary file not shown.
Binary file added submissions/EBeam_aonurdasdemir_A.gds
Binary file not shown.
Loading

0 comments on commit 9cac884

Please sign in to comment.