From 44325f81e6eea971bca4cabee54e277bb81d946c Mon Sep 17 00:00:00 2001 From: Tim Edwards Date: Mon, 28 Dec 2020 16:54:20 -0500 Subject: [PATCH] Corrected two errors: (1) Do not write subcircuit calls to subcircuits that have been removed by flattening into the parent cell due to lack of devices. Previously the checks on writing the subcircuit and writing the call were slightly different, leading to instances in which the subcircuit call would be written to the netlist output without the subcircuit being defined. (2) Corrected an error in the "bridge" CIF/GDS output operator. In certain (somewhat rare) geometries, the tile behind (instead of in front of) the corner being checked may be incorrectly flagged as a DRC spacing error. The fix is to ignore tiles that are behind the corner being checked. --- VERSION | 2 +- cif/CIFgen.c | 12 ++++++++++++ ext2spice/ext2hier.c | 8 ++++++++ extflat/EFhier.c | 1 + 4 files changed, 22 insertions(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 0b1f0bc3..1aa4b11f 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -8.3.105 +8.3.106 diff --git a/cif/CIFgen.c b/cif/CIFgen.c index 7cc21e3a..a03da232 100644 --- a/cif/CIFgen.c +++ b/cif/CIFgen.c @@ -1847,6 +1847,9 @@ cifBridgeCheckFunc(tile, brcs) switch (dir) { case BRIDGE_NW: + /* Ignore tile if it is not in the SE direction */ + if (LEFT(tile) < RIGHT(brcs->tile) && TOP(tile) > BOTTOM(brcs->tile)) + break; /* Ignore tile if split, and SE corner is clipped */ if (TiGetRightType(tile) == checktype || TiGetBottomType(tile) == checktype) break; @@ -1860,6 +1863,9 @@ cifBridgeCheckFunc(tile, brcs) } break; case BRIDGE_NE: + /* Ignore tile if it is not in the SW direction */ + if (RIGHT(tile) > LEFT(brcs->tile) && TOP(tile) > BOTTOM(brcs->tile)) + break; /* Ignore tile if split, and SW corner is clipped */ if (TiGetLeftType(tile) == checktype || TiGetBottomType(tile) == checktype) break; @@ -1873,6 +1879,9 @@ cifBridgeCheckFunc(tile, brcs) } break; case BRIDGE_SW: + /* Ignore tile if it is not in the NE direction */ + if (LEFT(tile) < RIGHT(brcs->tile) && BOTTOM(tile) < TOP(brcs->tile)) + break; /* Ignore tile if split, and NE corner is clipped */ if (TiGetRightType(tile) == checktype || TiGetTopType(tile) == checktype) break; @@ -1886,6 +1895,9 @@ cifBridgeCheckFunc(tile, brcs) } break; case BRIDGE_SE: + /* Ignore tile if it is not in the NW direction */ + if (RIGHT(tile) > LEFT(brcs->tile) && BOTTOM(tile) < TOP(brcs->tile)) + break; /* Ignore tile if split, and NW corner is clipped */ if (TiGetLeftType(tile) == checktype || TiGetTopType(tile) == checktype) break; diff --git a/ext2spice/ext2hier.c b/ext2spice/ext2hier.c index 332c8fac..ad53e6b5 100644 --- a/ext2spice/ext2hier.c +++ b/ext2spice/ext2hier.c @@ -405,6 +405,7 @@ subcktHierVisit(use, hierName, is_top) EFNode *snode; EFNodeName *nodeName; bool hasports = FALSE; + bool isStub; /* Avoid generating records for circuits that have no ports. */ /* These are already absorbed into the parent. All other */ @@ -431,6 +432,13 @@ subcktHierVisit(use, hierName, is_top) break; } + /* Same considerations as at line 1831 for determining if the cell */ + /* has been folded into the parent and should not be output. */ + + isStub = ((def->def_flags & DEF_ABSTRACT) && esDoBlackBox) ? TRUE : FALSE; + if ((!is_top) && (def->def_flags & DEF_NODEVICES) && (!isStub)) + return 0; + if (hasports || is_top) return subcktVisit(use, hierName, is_top); else if (def->def_flags & DEF_NODEVICES) diff --git a/extflat/EFhier.c b/extflat/EFhier.c index 53015361..b9b74b42 100644 --- a/extflat/EFhier.c +++ b/extflat/EFhier.c @@ -397,6 +397,7 @@ efHierDevKilled(hc, dev, prefix) for (n = 0; n < dev->dev_nterm; n++) { + if (dev->dev_terms[n].dterm_node == NULL) continue; suffix = dev->dev_terms[n].dterm_node->efnode_name->efnn_hier; he = HashLookOnly(&efNodeHashTable, (char *)suffix); if (he && (nn = (EFNodeName *) HashGetValue(he))