Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding HRES table for GF180MCU DRC #63

Merged
merged 5 commits into from
Apr 6, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
150 changes: 150 additions & 0 deletions klayout/drc/rule_decks/hres.drc
Original file line number Diff line number Diff line change
@@ -0,0 +1,150 @@
# frozen_string_literal: true

################################################################################################
# Copyright 2022 GlobalFoundries PDK Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
################################################################################################

if FEOL
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#58 but not blocking

#================================================
#----------------H POLY RESISTOR-----------------
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#57 but not blocking

#================================================

logger.info('Starting HRES derivations')
hres_poly = poly2.interacting(pplus).interacting(sab).interacting(res_mk).interacting(resistor)
hres1_poly = poly2.interacting(pplus).interacting(sab).interacting(res_mk)

# Rule HRES.1: Minimum space. Note : Merge if the spacing is less than 0.4 um. is 0.4µm
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not sure why need to repeat the constraint twice?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above

logger.info('Executing rule HRES.1')
hres1_l1 = resistor.interacting(hres1_poly).space(0.4.um, euclidian)
hres1_l1.output('HRES.1', 'HRES.1 : Minimum space. Note : Merge if the spacing is less than 0.4 um. : 0.4µm')
proppy marked this conversation as resolved.
Show resolved Hide resolved
hres1_l1.forget
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#53 but not blocking


# Rule HRES.2: Minimum width of Poly2 resistor. is 1µm
logger.info('Executing rule HRES.2')
hres2_l1 = hres_poly.width(1.um, euclidian)
hres2_l1.output('HRES.2', 'HRES.2 : Minimum width of Poly2 resistor. : 1µm')
hres2_l1.forget

# Rule HRES.3: Minimum space between Poly2 resistors. is 0.4µm
logger.info('Executing rule HRES.3')
hres3_l1 = hres_poly.space(0.4.um, euclidian)
hres3_l1.output('HRES.3', 'HRES.3 : Minimum space between Poly2 resistors. : 0.4µm')
hres3_l1.forget

# Rule HRES.4: Minimum RESISTOR overlap of Poly2 resistor. is 0.4µm
logger.info('Executing rule HRES.4')
hres4_l1 = hres_poly.enclosed(resistor, 0.4.um, euclidian).polygons(0.001.um)
proppy marked this conversation as resolved.
Show resolved Hide resolved
hres4_l2 = hres_poly.not_outside(resistor).not(resistor)
hres4_l = hres4_l1.or(hres4_l2)
hres4_l.output('HRES.4', 'HRES.4 : Minimum RESISTOR overlap of Poly2 resistor. : 0.4µm')
hres4_l1.forget
hres4_l2.forget
hres4_l.forget

# Rule HRES.5: Minimum RESISTOR space to unrelated Poly2. is 0.3µm
logger.info('Executing rule HRES.5')
hres5_l1 = resistor.interacting(hres1_poly).separation(poly2.not_interacting(sab), 0.3.um, euclidian)
hres5_l1.output('HRES.5', 'HRES.5 : Minimum RESISTOR space to unrelated Poly2. : 0.3µm')
hres5_l1.forget

# Rule HRES.6: Minimum RESISTOR space to COMP.
proppy marked this conversation as resolved.
Show resolved Hide resolved
logger.info('Executing rule HRES.6')
hres6_l1 = resistor.interacting(hres1_poly).separation(comp, 0.3.um, euclidian).polygons(0.001.um)
proppy marked this conversation as resolved.
Show resolved Hide resolved
proppy marked this conversation as resolved.
Show resolved Hide resolved
hres6_l2 = comp.not_outside(resistor.interacting(hres1_poly))
hres6_l = hres6_l1.or(hres6_l2)
hres6_l.output('HRES.6', 'HRES.6 : Minimum RESISTOR space to COMP.')
proppy marked this conversation as resolved.
Show resolved Hide resolved
hres6_l.forget
hres6_l1.forget
hres6_l2.forget
hres1_poly.forget

# Rule HRES.7: Minimum Pplus overlap of contact on Poly2 resistor. is 0.2µm
logger.info('Executing rule HRES.7')
hres7_l1 = contact.and(hres_poly).enclosed(pplus, 0.2.um, euclidian).polygons(0.001.um)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do we have .001 here?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we use 1.dbu instead?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@proppy DBU is sensitive to GDS scaling. I prefer real measurement value.

Copy link
Member

@proppy proppy Apr 5, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

but don't we want to smaller possible unit there?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, but In some cases were we are measuring corner to corner for example, we have seen that klayout has numerical errors. And it's better to have a slightly larger tolerance.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

then maybe it's best to define a top level ε variable for this delta so that arithmetic can be done on it (when you need to add or subtract it) and be easier to update if the "numerical errors" conditions happen to change.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@proppy Each rule might have a different delta. It's not the same for all rules. I thought like you mentioned above, but while running through klayout and testing. We have seen that every type of rule might have a different delta.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My comment to this: measurements usually are taken in terms of database units (usually nm). Rounding happens to the closer value and is not exactly specified when in between. So if you measure across a diagonal, you may have an exact value like 0.9995 and it will come out as 1000 DBU (assuming a DBU of 1 nm) or 999 DBU which will either give you an error or not.
It is pretty common in any-angle situations that you have to work with some delta. Technically you could implement the check with projection metrics exactly and with a slightly smaller value in Euclidian metrics.

But honestly I think this is nitpicking. Physics is usually in a way that corner-to-corner situations are much different from edge-to-edge ones due to resist or lithography effects and long lines usually behave differently than short edge-to-edge interaction cases. There is no simple mathematical model that describes these cases properly. Every rule you are using is an approximation and so are the check implementations. In practice, DRC checks are made to remind you to take care of potentially critical situations. It's not a good idea to exploit the layout space down to the very limits allowed by DRC (and good layout engineers know that), so whether the check is precise to nanometers or not does not make a difference between a functional and a non-functional chip.

Copy link
Member

@proppy proppy Apr 6, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Each rule might have a different delta

Is that currently the case (I couldn't only find 0.001um delta in the current set of rules) or something that you're predicting?

But honestly I think this is nitpicking

How would you recommend that we maintain those delta?

  • encode them directly it in the rule parameter: with_length(80.00X.um, nil)
  • express them with discrete offset value: with_length(80.001.um + X.dbu, nil)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

filed #67 to discuss this further

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we save contact.and(hres_poly) in an intermediate variable? it seems that it is duplicated below.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

hres7_l2 = contact.and(hres_poly).not_outside(pplus).not(pplus)
hres7_l = hres7_l1.or(hres7_l2)
hres7_l.output('HRES.7', 'HRES.7 : Minimum Pplus overlap of contact on Poly2 resistor. : 0.2µm')
hres7_l1.forget
hres7_l2.forget
hres7_l.forget

# Rule HRES.8: Space from salicide block to contact on Poly2 resistor.
proppy marked this conversation as resolved.
Show resolved Hide resolved
logger.info('Executing rule HRES.8')
hres8_l1 = contact.and(hres_poly).separation(sab,
0.22.um).polygons(0.001.um).or(contact.and(hres_poly).interacting(sab))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do we have .001 here?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we use 1.dbu instead?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@proppy Same comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is that a workaround for a KLayout bug?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

according to #65 (comment) this is to convert edges to polygons, I suggested using simple_merge_e2p instead but @atorkmabrains is not sure if this is available in the DRC context.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

filed #66 to investigate this further

hres8_l1.output('HRES.8', 'HRES.8 : Space from salicide block to contact on Poly2 resistor.')
proppy marked this conversation as resolved.
Show resolved Hide resolved
hres8_l1.forget

# Rule HRES.9: Minimum salicide block overlap of Poly2 resistor in width direction.
proppy marked this conversation as resolved.
Show resolved Hide resolved
logger.info('Executing rule HRES.9')
hres9_sab = sab.interacting(pplus).interacting(res_mk).interacting(resistor)
hres9_clear_sab = hres9_sab.not(hres_poly)
hres9_bad_inside_edge = hres9_sab.edges.inside_part(hres_poly).extended(0, 0, 0.001.um, 0.001.um).interacting(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do we have .001 here?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we use 1.dbu instead?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added #66

hres9_clear_sab, 1, 1
)
hres9_sab_hole = hres9_sab.holes.and(hres_poly)
hres9_l1 = hres_poly.enclosed(hres9_sab, 0.28.um, euclidian).polygons(0.001.um)
hres9_l2 = hres9_bad_inside_edge.or(hres9_sab_hole)
hres9_l = hres9_l1.or(hres9_l2)
hres9_l.output('HRES.9', 'HRES.9 : Minimum salicide block overlap of Poly2 resistor in width direction.')
proppy marked this conversation as resolved.
Show resolved Hide resolved
hres9_l.forget
hres9_l1.forget
hres9_l2.forget
hres9_sab.forget
hres9_clear_sab.forget
hres9_bad_inside_edge.forget
hres9_sab_hole.forget

# Rule HRES.10: Minimum & maximum Pplus overlap of SAB.
proppy marked this conversation as resolved.
Show resolved Hide resolved
logger.info('Executing rule HRES.10')
pplus1_hres10 = pplus.and(sab).drc(width != 0.1.um)
pplus2_hres10 = pplus.not_overlapping(sab).edges
hres10_l1 = pplus1_hres10.or(pplus2_hres10).extended(0, 0, 0.001.um, 0.001.um).interacting(hres_poly)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do we have .001 here?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we use 1.dbu instead?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added #66

hres10_l1.output('HRES.10', 'HRES.10 : Minimum & maximum Pplus overlap of SAB.')
proppy marked this conversation as resolved.
Show resolved Hide resolved
hres10_l1.forget
pplus1_hres10.forget
pplus2_hres10.forget

# Rule HRES.11 is not a DRC check
## Please refer to https://gf180mcu-pdk.readthedocs.io/en/latest/physical_verification/design_manual/drm_10_03.html#hres-poly-resistor-phres-optional-with-one-additional-mask
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#55 but not blocking


# Rule HRES.12a: P type Poly2 resistor (high sheet rho) shall be covered by RES_MK marking.
## RES_MK length shall be coincide with resistor length (Defined by Pplus space)
## and width covering the width of Poly2.
logger.info('Executing rule HRES.12a')
mk_hres12a = res_mk.edges.not(poly2.not(pplus).and(sab).edges).inside_part(poly2)
hres12a_l1 = res_mk.interacting(resistor).interacting(mk_hres12a)
hres12a_l1.output('HRES.12a',
'HRES.12a : P type Poly2 resistor (high sheet rho) shall be covered by RES_MK marking.
RES_MK length shall be coincide with resistor length (Defined by Pplus space)
and width covering the width of Poly2. ')
hres12a_l1.forget
mk_hres12a.forget

# Rule HRES.12b: If the size of single RES_MK mark layer is greater than 15000 um2
## and both side (X and Y) are greater than 80 um.
## Then the minimum spacing to adjacent RES_MK layer. is 20µm
logger.info('Executing rule HRES.12b')
hres12b = res_mk.with_area(15_000.001.um, nil).edges.with_length(80.001.um, nil)
proppy marked this conversation as resolved.
Show resolved Hide resolved
hres12b_l1 = hres12b.separation(res_mk.edges, 20.um)
hres12b_l1.output('HRES.12b',
'HRES.12b : If the size of single RES_MK mark layer is greater than 15000 um2
and both side (X and Y) are greater than 80 um.
Then the minimum spacing to adjacent RES_MK layer. : 20µm')
hres12b_l1.forget
hres12b.forget
hres_poly.forget

end
Binary file added klayout/drc/testing/testcases/unit/hres.gds
Binary file not shown.
Loading