From 6f8ec21a11b0bc6c85464dc31063d37cad214311 Mon Sep 17 00:00:00 2001 From: Tim Edwards Date: Wed, 31 Oct 2018 14:33:24 -0400 Subject: [PATCH] Two improvements: (1) Command extension "ext2spice lvs" sets up all the settings normally used for LVS (hierarchy on, cthresh infinite, subcircuit top auto, etc.). (2) Extract and extract unique ignore cells marked as abstract views (property LEFview is set) when checking for unconnected nets with the same name label. --- ext2spice/ext2spice.c | 27 +++++++++++++++++++++++++-- extract/ExtBasic.c | 14 ++++++++------ extract/ExtUnique.c | 6 ++++++ 3 files changed, 39 insertions(+), 8 deletions(-) diff --git a/ext2spice/ext2spice.c b/ext2spice/ext2spice.c index a2fafc7a..a7b909b9 100644 --- a/ext2spice/ext2spice.c +++ b/ext2spice/ext2spice.c @@ -211,7 +211,8 @@ Exttospice_Init(interp) #define EXTTOSPC_BLACKBOX 11 #define EXTTOSPC_RENUMBER 12 #define EXTTOSPC_MERGENAMES 13 -#define EXTTOSPC_HELP 14 +#define EXTTOSPC_LVS 14 +#define EXTTOSPC_HELP 15 void CmdExtToSpice(w, cmd) @@ -262,6 +263,7 @@ CmdExtToSpice(w, cmd) "renumber [on|off] on = number instances X1, X2, etc.\n" " off = keep instance ID names", "global [on|off] on = merge unconnected global nets by name", + "lvs apply typical default settings for LVS", "help print help information", NULL }; @@ -418,6 +420,27 @@ CmdExtToSpice(w, cmd) esMergeNames = FALSE; break; + case EXTTOSPC_LVS: + /* Apply default command settings for LVS */ + /* hierarchy = on */ + /* format = ngspice */ + /* cthresh = infinite */ + /* rthresh = infinite */ + /* renumber = off */ + /* scale = off */ + /* blackbox = on */ + /* subcircuit top = auto */ + + esDoHierarchy = TRUE; + esFormat = NGSPICE; + LocCapThreshold = (EFCapValue)INFINITE_THRESHOLD_F; + LocResistThreshold = INFINITE_THRESHOLD; + esDoRenumber = FALSE; + esScale = 0.0; + esDoBlackBox = TRUE; + esDoSubckt = 2; + break; + case EXTTOSPC_SUBCIRCUITS: if (cmd->tx_argc == 2) { @@ -489,7 +512,7 @@ CmdExtToSpice(w, cmd) if (idx < 0) { Tcl_SetResult(magicinterp, "Bad format type. Formats are:" - "spice2, spice3, and hspice.", NULL); + "spice2, spice3, hspice, and ngspice.", NULL); return; } else diff --git a/extract/ExtBasic.c b/extract/ExtBasic.c index a4ad9ea6..3b3bbdc3 100644 --- a/extract/ExtBasic.c +++ b/extract/ExtBasic.c @@ -262,11 +262,17 @@ extBasic(def, outFile) if (!SigInterruptPending) ExtLabelRegions(def, ExtCurStyle->exts_nodeConn, &nodeList, &TiPlaneRect); + /* Check for "LEFview", for which special output handling */ + /* can be specified in ext2spice. */ + + DBPropGet(def, "LEFview", &isabstract); + /* * Make sure all geometry with the same label is part of the - * same electrical node. + * same electrical node. However: Unconnected labels are allowed + * on abstract views. */ - if (!SigInterruptPending && (ExtDoWarn & EXTWARN_DUP)) + if (!SigInterruptPending && (ExtDoWarn & EXTWARN_DUP) && !isabstract) extFindDuplicateLabels(def, nodeList); /* @@ -306,10 +312,6 @@ extBasic(def, outFile) } } - /* Check for "LEFview", for which special output handling */ - /* can be specified in ext2spice. */ - - DBPropGet(def, "LEFview", &isabstract); if (isabstract) fprintf(outFile, "abstract\n"); /* Output each node, along with its resistance and capacitance to substrate */ diff --git a/extract/ExtUnique.c b/extract/ExtUnique.c index 150306ea..d928ad12 100644 --- a/extract/ExtUnique.c +++ b/extract/ExtUnique.c @@ -85,8 +85,14 @@ extUniqueCell(def, option) Label *lab; char *text; int nwarn; + bool isabstract; nwarn = 0; + + /* Check for "LEFview", as we do not care about unique names in abstract views */ + DBPropGet(def, "LEFview", &isabstract); + if (isabstract) return nwarn; + HashInit(&labelHash, 32, HT_STRINGKEYS); TxPrintf("Processing %s\n", def->cd_name); TxFlush();