Corrected a problem that is very similar to the last issue, which
is that when the "class ignore" command is used, then ports of a parent cell need to be checked for being disconnected if they connect only to ports of an ignored/deleted child cell.
This commit is contained in:
parent
06386bee1b
commit
db457c562b
|
|
@ -440,10 +440,25 @@ void RemoveShorted(char *class, int file)
|
||||||
RecurseCellFileHashTable(removeshorted, file);
|
RecurseCellFileHashTable(removeshorted, file);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Structure used to keep track of nodes needing checking */
|
||||||
|
|
||||||
|
struct linkednode {
|
||||||
|
int node;
|
||||||
|
struct linkednode *next;
|
||||||
|
};
|
||||||
|
|
||||||
|
/* Remove instances of a deleted class from the database. */
|
||||||
|
/* NOTE: This treats deleted classes as not existing, so it */
|
||||||
|
/* needs to take care of disconnected ports in the same manner */
|
||||||
|
/* as flattenInstancesOf() in disconnecting the port of a */
|
||||||
|
/* parent cell if it connected to nothing other than the */
|
||||||
|
/* deleted instance. */
|
||||||
|
|
||||||
int deleteclass(struct hashlist *p, int file)
|
int deleteclass(struct hashlist *p, int file)
|
||||||
{
|
{
|
||||||
struct nlist *ptr;
|
struct nlist *ptr;
|
||||||
struct objlist *ob, *lob, *nob;
|
struct objlist *ob, *lob, *nob;
|
||||||
|
struct linkednode *checknodes = NULL, *newlnode, *chknode;
|
||||||
|
|
||||||
ptr = (struct nlist *)(p->ptr);
|
ptr = (struct nlist *)(p->ptr);
|
||||||
|
|
||||||
|
|
@ -456,6 +471,12 @@ int deleteclass(struct hashlist *p, int file)
|
||||||
if ((*matchfunc)(ob->model.class, OldCell->name)) {
|
if ((*matchfunc)(ob->model.class, OldCell->name)) {
|
||||||
HashDelete(ob->instance.name, &(ptr->instdict));
|
HashDelete(ob->instance.name, &(ptr->instdict));
|
||||||
while (1) {
|
while (1) {
|
||||||
|
if (ob->type >= FIRSTPIN) {
|
||||||
|
newlnode = (struct linkednode *)MALLOC(sizeof(struct linkednode));
|
||||||
|
newlnode->node = ob->node;
|
||||||
|
newlnode->next = checknodes;
|
||||||
|
checknodes = newlnode;
|
||||||
|
}
|
||||||
FreeObjectAndHash(ob, ptr);
|
FreeObjectAndHash(ob, ptr);
|
||||||
ob = nob;
|
ob = nob;
|
||||||
if (ob == NULL) break;
|
if (ob == NULL) break;
|
||||||
|
|
@ -477,6 +498,27 @@ int deleteclass(struct hashlist *p, int file)
|
||||||
ob = nob;
|
ob = nob;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
while (checknodes != NULL) {
|
||||||
|
struct objlist *portnode = NULL;
|
||||||
|
|
||||||
|
chknode = checknodes;
|
||||||
|
checknodes = checknodes->next;
|
||||||
|
|
||||||
|
for (ob = ptr->cell; ob != NULL; ob = ob->next) {
|
||||||
|
if ((ob->type != PORT) && (portnode == NULL))
|
||||||
|
break;
|
||||||
|
else if ((ob->type == PORT) && (ob->node == chknode->node))
|
||||||
|
portnode = ob;
|
||||||
|
else if ((ob->type >= FIRSTPIN) && (ob->node == chknode->node))
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if ((ob == NULL) && (portnode != NULL)) {
|
||||||
|
/* Port became disconnected when child was deleted */
|
||||||
|
portnode->node = -1;
|
||||||
|
}
|
||||||
|
FREE(chknode);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Remove all instances of class "class" from the database */
|
/* Remove all instances of class "class" from the database */
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue