52 if ( Ivy_ObjId(pObj) != i )
54 printf(
"Ivy_ManCheck: Node with ID %d is listed as number %d in the array of objects.\n", pObj->
Id, i );
58 if ( i == 0 || Ivy_ObjIsPi(pObj) )
60 if ( Ivy_ObjFaninId0(pObj) || Ivy_ObjFaninId1(pObj) || Ivy_ObjLevel(pObj) )
62 printf(
"Ivy_ManCheck: The AIG has non-standard constant or PI node with ID \"%d\".\n", pObj->
Id );
67 if ( Ivy_ObjIsPo(pObj) )
69 if ( Ivy_ObjFaninId1(pObj) )
71 printf(
"Ivy_ManCheck: The AIG has non-standard PO node with ID \"%d\".\n", pObj->
Id );
76 if ( Ivy_ObjIsBuf(pObj) )
78 if ( Ivy_ObjFanin1(pObj) )
80 printf(
"Ivy_ManCheck: The buffer with ID \"%d\" contains second fanin.\n", pObj->
Id );
85 if ( Ivy_ObjIsLatch(pObj) )
87 if ( Ivy_ObjFanin1(pObj) )
89 printf(
"Ivy_ManCheck: The latch with ID \"%d\" contains second fanin.\n", pObj->
Id );
94 printf(
"Ivy_ManCheck: The latch with ID \"%d\" does not have initial state.\n", pObj->
Id );
99 printf(
"Ivy_ManCheck: Latch with ID \"%d\" is not in the structural hashing table.\n", pObj->
Id );
103 if ( !Ivy_ObjFanin0(pObj) || !Ivy_ObjFanin1(pObj) )
105 printf(
"Ivy_ManCheck: The AIG has internal node \"%d\" with a NULL fanin.\n", pObj->
Id );
108 if ( Ivy_ObjFaninId0(pObj) >= Ivy_ObjFaninId1(pObj) )
110 printf(
"Ivy_ManCheck: The AIG has node \"%d\" with a wrong ordering of fanins.\n", pObj->
Id );
113 if ( Ivy_ObjLevel(pObj) != Ivy_ObjLevelNew(pObj) )
114 printf(
"Ivy_ManCheck: Node with ID \"%d\" has level %d but should have level %d.\n", pObj->
Id, Ivy_ObjLevel(pObj), Ivy_ObjLevelNew(pObj) );
117 printf(
"Ivy_ManCheck: Node with ID \"%d\" is not in the structural hashing table.\n", pObj->
Id );
118 if ( Ivy_ObjRefs(pObj) == 0 )
119 printf(
"Ivy_ManCheck: Node with ID \"%d\" has no fanouts.\n", pObj->
Id );
122 printf(
"Ivy_ManCheck: Node with ID \"%d\" has mismatch between the number of fanouts and refs.\n", pObj->
Id );
127 printf(
"Ivy_ManCheck: The number of nodes in the structural hashing table is wrong.\n" );
175 int i, k, RetValue = 1;
178 vFanouts = Vec_PtrAlloc( 100 );
182 pFanin = Ivy_ObjFanin0(pObj);
183 if ( pFanin == NULL )
186 if ( pFanout == pObj )
188 if ( k == Vec_PtrSize(vFanouts) )
190 printf(
"Node %d is a fanin of node %d but the fanout is not there.\n", pFanin->
Id, pObj->
Id );
194 pFanin = Ivy_ObjFanin1(pObj);
195 if ( pFanin == NULL )
198 if ( pFanout == pObj )
200 if ( k == Vec_PtrSize(vFanouts) )
202 printf(
"Node %d is a fanin of node %d but the fanout is not there.\n", pFanin->
Id, pObj->
Id );
208 if ( Ivy_ObjFanin0(pObj->
pPrevFan0) != Ivy_ObjFanin0(pObj) &&
209 Ivy_ObjFanin0(pObj->
pPrevFan0) != Ivy_ObjFanin1(pObj) &&
210 Ivy_ObjFanin1(pObj->
pPrevFan0) != Ivy_ObjFanin0(pObj) &&
211 Ivy_ObjFanin1(pObj->
pPrevFan0) != Ivy_ObjFanin1(pObj) )
213 printf(
"Node %d has prev %d without common fanin.\n", pObj->
Id, pObj->
pPrevFan0->
Id );
220 if ( Ivy_ObjFanin0(pObj->
pPrevFan1) != Ivy_ObjFanin0(pObj) &&
221 Ivy_ObjFanin0(pObj->
pPrevFan1) != Ivy_ObjFanin1(pObj) &&
222 Ivy_ObjFanin1(pObj->
pPrevFan1) != Ivy_ObjFanin0(pObj) &&
223 Ivy_ObjFanin1(pObj->
pPrevFan1) != Ivy_ObjFanin1(pObj) )
225 printf(
"Node %d has prev %d without common fanin.\n", pObj->
Id, pObj->
pPrevFan1->
Id );
234 if ( Ivy_ObjFanin0(pFanout) != pObj && Ivy_ObjFanin1(pFanout) != pObj )
236 printf(
"Node %d is a fanout of node %d but the fanin is not there.\n", pFanout->
Id, pObj->
Id );
240 Vec_PtrFree( vFanouts );