From 17c2bff72be959734a7e4498eb339af2579a1280 Mon Sep 17 00:00:00 2001 From: Tim Edwards Date: Sat, 16 Jul 2016 14:27:31 -0400 Subject: [PATCH] Added command option "property default" which acts similarly to "permute default" by (1) handling the usual case for MOSFETs (resistors and adding in parallel not yet implemented), and (2) being done automatically when no setup script is specified. --- tcltk/netgen.tcl.in | 1 + tcltk/tclnetgen.c | 29 +++++++++++++++++++++++++++++ 2 files changed, 30 insertions(+) diff --git a/tcltk/netgen.tcl.in b/tcltk/netgen.tcl.in index c076ae2..18bab90 100644 --- a/tcltk/netgen.tcl.in +++ b/tcltk/netgen.tcl.in @@ -126,6 +126,7 @@ proc netgen::lvs { name1 name2 {setupfile setup.tcl} {logfile comp.out}} { } } else { netgen::permute default ;# transistors and resistors + netgen::property default } puts stdout "Comparison output logged to file $logfile" diff --git a/tcltk/tclnetgen.c b/tcltk/tclnetgen.c index 99734c4..2c8c9a6 100644 --- a/tcltk/tclnetgen.c +++ b/tcltk/tclnetgen.c @@ -231,6 +231,7 @@ Command netcmp_cmds[] = { "transistor: enable transistor permutations\n " "(none): enable transistor and resistor permutations"}, {"property", _netcmp_property, + "default: apply property defaults\n " "| [...]\n " ": name of a device type (capacitor, etc.)\n " ": name of a device model\n " @@ -2963,6 +2964,8 @@ _netcmp_equate(ClientData clientData, /* remove --- delete existing property */ /* tolerance --- set property tolerance */ /* merge --- set property merge behavior */ +/* or */ +/* netgen::property default */ /* Formerly: (none) */ /* Results: */ /* Side Effects: */ @@ -3005,6 +3008,32 @@ _netcmp_property(ClientData clientData, Tcl_WrongNumArgs(interp, 1, objv, "valid_cellname ?option?"); return TCL_ERROR; } + + /* Check for special command "property default" */ + if ((objc == 2) && (!strcmp(Tcl_GetString(objv[1]), "default"))) { + + /* For each FET device, do "merge {w add_critical}" and */ + /* "remove as ad ps pd". This allows parallel devices */ + /* to be added by width, and prevents attempts to */ + /* compare source/drain area and perimeter. */ + + tp = FirstCell(); + while (tp != NULL) { + switch (tp->class) { + case CLASS_NMOS: case CLASS_PMOS: case CLASS_FET3: + case CLASS_NMOS4: case CLASS_PMOS4: case CLASS_FET4: + case CLASS_FET: + PropertyMerge(tp->name, tp->file, "w", MERGE_ADD_CRIT); + PropertyDelete(tp->name, tp->file, "as"); + PropertyDelete(tp->name, tp->file, "ad"); + PropertyDelete(tp->name, tp->file, "ps"); + PropertyDelete(tp->name, tp->file, "pd"); + break; + } + tp = NextCell(); + } + } + result = CommonParseCell(interp, objv[1], &tp, &fnum); if (result != TCL_OK) return result;