Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
Pearl River
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Manufacturing
Pearl River
Commits
876a3c1b
Commit
876a3c1b
authored
5 years ago
by
Andreas Westerwick
Browse files
Options
Downloads
Patches
Plain Diff
parallel processing
parent
4143eb50
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Tools/python/split_layers.py
+19
-11
19 additions, 11 deletions
Tools/python/split_layers.py
with
19 additions
and
11 deletions
Tools/python/split_layers.py
+
19
−
11
View file @
876a3c1b
...
...
@@ -4,6 +4,9 @@ import sys
import
os
import
gdspy
import
multiprocessing
from
joblib
import
Parallel
,
delayed
orig_box_width
=
10.
orig_box_spacing
=
10.
...
...
@@ -126,17 +129,8 @@ def generate_gds_file(layout_path,cellname):
cell
=
cell
.
add
(
gdspy
.
Rectangle
(
p11
,
p12
,
1
))
cell
=
cell
.
add
(
gdspy
.
Rectangle
(
p21
,
p22
,
1
))
cell
=
cell
.
flatten
()
for
layername
in
layer_mapping
:
ncell
=
cell
.
copy
(
layername
,
deep_copy
=
True
)
thelayers
=
layer_mapping
[
layername
]
ncell
=
ncell
.
remove_polygons
(
lambda
pts
,
layer
,
datatype
:
layer
not
in
thelayers
)
ncell
=
ncell
.
add
(
gdspy
.
Rectangle
(
p11
,
p12
,
1
))
ncell
=
ncell
.
add
(
gdspy
.
Rectangle
(
p21
,
p22
,
1
))
ncell
=
ncell
.
flatten
(
single_layer
=
1
,
single_datatype
=
1
)
newgdsii
=
gdspy
.
GdsLibrary
(
"
mask_
"
+
layername
)
newgdsii
.
add
(
ncell
)
newgdsii
.
write_gds
(
layout_path
+
"
/gds/mask_
"
+
layername
+
"
.gds
"
)
num_cores
=
multiprocessing
.
cpu_count
()
-
2
Parallel
(
n_jobs
=
num_cores
,
verbose
=
50
)(
delayed
(
split_task
)(
p11
,
p12
,
p21
,
p22
,
cell
,
layername
)
for
layername
in
layer_mapping
)
except
Exception
as
e
:
print
(
"
Can
'
t do this:
"
+
e
)
...
...
@@ -144,6 +138,20 @@ def generate_gds_file(layout_path,cellname):
if
'
-s
'
in
sys
.
argv
:
gdspy
.
LayoutViewer
()
def
split_task
(
p11
,
p12
,
p21
,
p22
,
cell
,
layername
):
ncell
=
cell
.
copy
(
layername
,
deep_copy
=
True
)
thelayers
=
layer_mapping
[
layername
]
ncell
=
ncell
.
remove_polygons
(
lambda
pts
,
layer
,
datatype
:
layer
not
in
thelayers
)
ncell
=
ncell
.
add
(
gdspy
.
Rectangle
(
p11
,
p12
,
1
))
ncell
=
ncell
.
add
(
gdspy
.
Rectangle
(
p21
,
p22
,
1
))
ncell
=
ncell
.
flatten
(
single_layer
=
1
,
single_datatype
=
1
)
newgdsii
=
gdspy
.
GdsLibrary
(
"
mask_
"
+
layername
)
newgdsii
.
add
(
ncell
)
newgdsii
.
write_gds
(
layout_path
+
"
/gds/mask_
"
+
layername
+
"
.gds
"
)
print
(
layername
)
def
show_help
():
print
(
"
-n cellname:
\t
name of the cell to export
"
)
print
(
"
-l:
\t\t
switch to render library cells because default is layout cells
"
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment