mirror of
https://github.com/RTimothyEdwards/netgen.git
synced 2026-08-22 22:17:22 +02:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
eefdb61e14 | ||
|
|
1d1ad3c833 | ||
|
|
4166408576 | ||
|
|
2b15b731bb | ||
|
|
9ad6ad3338 | ||
|
|
0fb5efd914 |
+8
-2
@@ -6393,9 +6393,13 @@ struct nlist *addproxies(struct hashlist *p, void *clientdata)
|
||||
/* circuit pair has been matched with automorphisms, */
|
||||
/* then some pins may be matched arbitrarily. */
|
||||
/* */
|
||||
/* Return 1 on success, 0 on failure. */
|
||||
/* If "dolist" is 1, append the list representing the */
|
||||
/* output (if any) to variable tcl_out, if it exists. */
|
||||
/* */
|
||||
/* Return codes: */
|
||||
/* 2: Neither cell had pins, so matching is unnecessary */
|
||||
/* 1: Exact match */
|
||||
/* 0: Inexact match resolved by proxy pin insertion */
|
||||
/*------------------------------------------------------*/
|
||||
|
||||
int MatchPins(struct nlist *tc1, struct nlist *tc2, int dolist)
|
||||
@@ -6432,7 +6436,7 @@ int MatchPins(struct nlist *tc1, struct nlist *tc2, int dolist)
|
||||
if (haspins == 0) {
|
||||
// Neither cell has any ports, so this is probably a top-level
|
||||
// cell and there is nothing to do.
|
||||
return 1;
|
||||
return 2;
|
||||
}
|
||||
|
||||
cover = (char *)CALLOC(numnodes, sizeof(char));
|
||||
@@ -6675,6 +6679,7 @@ int MatchPins(struct nlist *tc1, struct nlist *tc2, int dolist)
|
||||
if (ob1 && ob1->next && ob1->next->type != PORT)
|
||||
break;
|
||||
}
|
||||
if (ob1 == NULL) ob1 = tc1->cell; /* No ports */
|
||||
|
||||
/* Assign non-matching pins in tc2 with real node */
|
||||
/* connections in the cell to the end. Create pins */
|
||||
@@ -6760,6 +6765,7 @@ int MatchPins(struct nlist *tc1, struct nlist *tc2, int dolist)
|
||||
if (ob2 && ob2->next && ob2->next->type != PORT)
|
||||
break;
|
||||
}
|
||||
if (ob2 == NULL) ob2 = tc2->cell; /* No ports */
|
||||
|
||||
/* If cell 2 has fewer nodes than cell 1, then add dummy (unconnected) */
|
||||
/* pins to cell 2. If these correspond to numbers missing in the match */
|
||||
|
||||
+14
-3
@@ -2910,15 +2910,26 @@ _netcmp_equate(ClientData clientData,
|
||||
Circuit1 = tp1;
|
||||
Circuit2 = tp2;
|
||||
}
|
||||
if (MatchPins(tp1, tp2, dolist)) {
|
||||
|
||||
// Check for and remove duplicate pins. Normally this is called
|
||||
// from "compare", but since "equate pins" may be called outside
|
||||
// of and before "compare", pin uniqueness needs to be ensured.
|
||||
|
||||
UniquePins(tp1->name, tp1->file);
|
||||
UniquePins(tp2->name, tp2->file);
|
||||
|
||||
result = MatchPins(tp1, tp2, dolist);
|
||||
if (result == 2) {
|
||||
Fprintf(stdout, "Cells have no pins; pin matching not needed.\n");
|
||||
}
|
||||
else if (result > 0) {
|
||||
Fprintf(stdout, "Cell pin lists are equivalent.\n");
|
||||
Tcl_SetObjResult(interp, Tcl_NewBooleanObj(1));
|
||||
}
|
||||
else {
|
||||
Fprintf(stdout, "Cell pin lists for %s and %s altered to match.\n",
|
||||
name1, name2);
|
||||
Tcl_SetObjResult(interp, Tcl_NewBooleanObj(0));
|
||||
}
|
||||
Tcl_SetObjResult(interp, Tcl_NewIntObj(result));
|
||||
if (ElementClasses == NULL) {
|
||||
/* Recover temporarily set global variables (see above) */
|
||||
Circuit1 = SaveC1;
|
||||
|
||||
Reference in New Issue
Block a user