Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
L
LibrePDK
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
Generator tools
LibrePDK
Commits
cdff192c
Commit
cdff192c
authored
2 years ago
by
David Lanzendörfer
Browse files
Options
Downloads
Patches
Plain Diff
Moving essential stuff into PDK
parent
4b137bdd
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
contact.py
+10
-9
10 additions, 9 deletions
contact.py
helper.py
+17
-0
17 additions, 0 deletions
helper.py
with
27 additions
and
9 deletions
contact.py
+
10
−
9
View file @
cdff192c
...
...
@@ -2,6 +2,7 @@ import gdsfactory as gf
from
gdsfactory.components.compass
import
compass
from
librepdk.structure
import
LibrePDKStructure
import
librepdk.helper
as
lph
class
ViaStripe
(
LibrePDKStructure
):
device_layers
=
[
'
nwell
'
,
'
ndiffusion
'
,
'
pdiffusion
'
,
'
poly
'
,
'
pwell
'
,]
...
...
@@ -52,10 +53,10 @@ class ViaStripe(LibrePDKStructure):
vlid
=
self
.
config
.
get_layer_id
(
vln
)
space
=
self
.
config
.
get_min_spacing
((
vln
,
vln
))
vdim
=
self
.
config
.
get_via_size
(
vln
)
vs
=
self
.
to_nm
(
vdim
)
vs
=
lph
.
to_nm
(
self
.
config
,
vdim
)
vr
=
gf
.
components
.
rectangle
(
size
=
(
vs
,
vs
),
layer
=
vlid
)
dxy
=
self
.
to_nm
(
-
vdim
/
2
)
via
<<
vr
.
move
(
self
.
snap_to_grid
(
[
dxy
,
dxy
])
)
dxy
=
lph
.
to_nm
(
self
.
config
,
-
vdim
/
2
)
via
<<
vr
.
move
([
dxy
,
dxy
])
# find spacing of largest via layer
if
vdim
>
maxdim
:
maxdim
=
vdim
...
...
@@ -91,17 +92,17 @@ class ViaStripe(LibrePDKStructure):
h
=
hn
# centering the via group
sp
=
self
.
to_nm
(
spacing
+
maxdim
)
sp
=
lph
.
to_nm
(
self
.
config
,
spacing
+
maxdim
)
varr
=
gf
.
components
.
array
(
component
=
via
,
spacing
=
(
sp
,
sp
),
columns
=
col
,
rows
=
row
)
if
self
.
less_vias
:
dcpx
=
(
self
.
to_nm
(
w
+
spacing
)
-
varr
.
xsize
)
/
2
dcpy
=
(
self
.
to_nm
(
h
+
spacing
)
-
varr
.
ysize
)
/
2
dcpx
=
(
lph
.
to_nm
(
self
.
config
,
w
+
spacing
)
-
varr
.
xsize
)
/
2
dcpy
=
(
lph
.
to_nm
(
self
.
config
,
h
+
spacing
)
-
varr
.
ysize
)
/
2
else
:
dcpx
=
dcpy
=
self
.
to_nm
((
maxdim
+
spacing
)
/
2
)
dcpx
=
dcpy
=
lph
.
to_nm
(
self
.
config
,
(
maxdim
+
spacing
)
/
2
)
self
<<
varr
.
move
(
self
.
snap_to_grid
([
dcpx
,
dcpy
]))
self
<<
varr
.
move
(
lph
.
snap_to_grid
(
self
.
config
,
[
dcpx
,
dcpy
]))
s
=
(
self
.
to_nm
(
w
),
self
.
to_nm
(
h
))
s
=
(
lph
.
to_nm
(
self
.
config
,
w
),
lph
.
to_nm
(
self
.
config
,
h
))
for
mln
in
metalstackup
:
lid
=
self
.
config
.
get_layer_id
(
mln
)
r1
=
gf
.
components
.
rectangle
(
size
=
s
,
layer
=
lid
)
...
...
This diff is collapsed.
Click to expand it.
helper.py
0 → 100644
+
17
−
0
View file @
cdff192c
def
value_to_grid
(
config
,
val
):
g
=
config
.
get_grid
()
r
=
int
(
round
(
val
/
g
)
*
int
(
g
))
return
r
def
to_nm
(
config
,
val
):
if
val
==
0
:
return
0
ret
=
val
.
m_as
(
config
.
ureg
.
m
)
/
config
.
get_dbunit
()
return
value_to_grid
(
config
,
ret
)
def
snap_to_grid
(
config
,
val
):
x
=
value_to_grid
(
config
,
val
[
0
])
y
=
value_to_grid
(
config
,
val
[
1
])
return
[
x
,
y
]
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