Skip to content

RNetExtractor internal error #2102

@martinjankoehler

Description

@martinjankoehler

Hi @klayoutmatthias,

I get an internal error

RuntimeError: Internal error: src/db/db/dbPLC.cc:461 i != v2e.end () && i->first == v && i->second != mp_e.back () was not true in RNetExtractor.extract

It can be reproduced with this script:

from typing import *
import klayout.db as kdb
import klayout.pex as klp

# reproduce internal error of RNetExtractor
# single NFET example

NSDM = 8
POLY = 20
LI1 = 21
LICON_POLY = 22
LICON_NSDM = 23

#------------------------- prepare tech -------------------------------
tech = klp.RExtractorTech()

for l in (POLY, LI1):
    c = klp.RExtractorTechConductor()
    c.layer = l
    c.resistance = 1000.0
    c.algorithm = klp.Algorithm.SquareCounting
    tech.add_conductor(c)

for cut, bot, top in ((LICON_POLY, POLY, LI1), (LICON_NSDM, NSDM, LI1)):
    v = klp.RExtractorTechVia()
    v.cut_layer = cut
    v.bottom_conductor = bot
    v.top_conductor = top
    v.resistance = 5000.0
    tech.add_via(v)
#--------------------------------------------------------

def P(points: List[Tuple[int, int]], net: str) -> kdb.Point:
    pg = kdb.Polygon([kdb.Point(x, y) for x, y in points])
    return kdb.PolygonWithProperties(pg, {'net': net})

region_nsdm = kdb.Region([
    P([(340,235), (340,885), (600,885), (600,235)], 'S'),
    P([(750,235), (750,885), (1010,885), (1010,235)], 'D'),
])

region_poly = kdb.Region([
    P([(600,105), (600,1325), (750,1325), (750,105)], 'G'),
    P([(750,1155), (750,1325), (770,1325), (770,1155)], 'G'),
    P([(600,235), (600,885), (750,885), (750,235)], 'G'),
])

region_li1 = kdb.Region([
    P([(380,-175), (380,825), (550,825), (550,-175)], 'S'),
    P([(600,1155), (600,1325), (770,1325), (770,1155)], 'G'),
    P([(800,315), (800,1315), (970,1315), (970,315)], 'D'),
])

region_licon_poly = kdb.Region([
    P([(600,1155), (600,1325), (770,1325), (770,1155)], 'G'),
])

region_licon_nsdm = kdb.Region([
    P([(380,655), (380,825), (550,825), (550,655)], 'S'),
    P([(380,315), (380,485), (550,485), (550,315)], 'S'),
    P([(800,655), (800,825), (970,825), (970,655)], 'D'),
    P([(800,315), (800,485), (970,485), (970,315)], 'D'),
])

geo: Dict[int, kdb.Region] = {
    NSDM: region_nsdm,
    POLY: region_poly,
    LI1: region_li1,
    LICON_POLY: region_licon_poly,
    LICON_NSDM: region_licon_nsdm,
}
vertex_ports: Dict[int, List[kdb.Point]] = {}
polygon_ports: Dict[int, List[kdb.Polygon]] = {}

#--------------------------------------------------------
rexer = klp.RNetExtractor(dbu=0.001)
nw = rexer.extract(tech, geo, vertex_ports, polygon_ports)

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions