From 240a276431a4c0197186a344e139cb59c55009af Mon Sep 17 00:00:00 2001 From: Tim Edwards Date: Tue, 3 Mar 2020 10:50:45 -0500 Subject: [PATCH] Changed behavior of "equate pins" to detect placeholder cells as a different way of treating "black box" cells. Even when the "-blackbox" option is specified, any cell that has no definition will be treated as a black box. This allows comparison of a black-box netlist against a non-black-box netlist, such as a verilog netlist vs. a SPICE netlist, without forcing the black-box attribute on the SPICE netlist. Then, if the SPICE netlist contains cells without elements such as fill/decap/tap cells, they can be flattened and removed instead of forcing an error or requiring the use of "ignore". --- tcltk/tclnetgen.c | 30 +++++++++++++++++++++++------- 1 file changed, 23 insertions(+), 7 deletions(-) diff --git a/tcltk/tclnetgen.c b/tcltk/tclnetgen.c index 0062d07..96a6e03 100644 --- a/tcltk/tclnetgen.c +++ b/tcltk/tclnetgen.c @@ -2959,15 +2959,31 @@ _netcmp_equate(ClientData clientData, case PINS_IDX: if ((ElementClasses == NULL) && (auto_blackbox == FALSE)) { - if (CurrentCell == NULL) + if (CurrentCell == NULL) { Fprintf(stderr, "Equate elements: no current cell.\n"); - Fprintf(stderr, "Equate pins: cell %s and/or %s has no elements.\n", - name1, name2); - Tcl_SetObjResult(interp, Tcl_NewBooleanObj(0)); - return TCL_OK; + Tcl_SetObjResult(interp, Tcl_NewBooleanObj(0)); + return TCL_OK; + } + else if ((tp1->flags & CELL_PLACEHOLDER) || + (tp2->flags & CELL_PLACEHOLDER)) { + if (tp1->flags & CELL_PLACEHOLDER) { + Fprintf(stdout, "Warning: Equate pins: cell %s " + "has no definition, treated as a black box.\n", name1); + } + if (tp2->flags & CELL_PLACEHOLDER) { + Fprintf(stdout, "Warning: Equate pins: cell %s " + "has no definition, treated as a black box.\n", name2); + } + } + else { + Fprintf(stdout, "Equate pins: cell %s and/or %s " + "has no elements.\n", name1, name2); + Tcl_SetObjResult(interp, Tcl_NewBooleanObj(0)); + return TCL_OK; + } } - else if (ElementClasses == NULL) { - /* This has been called outside of a netlist compare, */ + if (ElementClasses == NULL) { + /* This may have been called outside of a netlist compare, */ /* probably to force name matching of pins on black-box */ /* devices. But MatchPins only works if tp1 == Circuit1 */ /* and tp2 == Circuit2, so preserve these values and */