ABC: A System for Sequential Synthesis and Verification
 
Loading...
Searching...
No Matches
hopCheck.c File Reference
#include "hop.h"
Include dependency graph for hopCheck.c:

Go to the source code of this file.

Functions

ABC_NAMESPACE_IMPL_START int Hop_ManCheck (Hop_Man_t *p)
 DECLARATIONS ///.
 

Function Documentation

◆ Hop_ManCheck()

ABC_NAMESPACE_IMPL_START int Hop_ManCheck ( Hop_Man_t * p)

DECLARATIONS ///.

CFile****************************************************************

FileName [hopCheck.c]

SystemName [ABC: Logic synthesis and verification system.]

PackageName [Minimalistic And-Inverter Graph package.]

Synopsis [AIG checking procedures.]

Author [Alan Mishchenko]

Affiliation [UC Berkeley]

Date [Ver. 1.0. Started - May 11, 2006.]

Revision [

Id
hopCheck.c,v 1.00 2006/05/11 00:00:00 alanmi Exp

] FUNCTION DEFINITIONS /// Function*************************************************************

Synopsis [Checks the consistency of the AIG manager.]

Description []

SideEffects []

SeeAlso []

Definition at line 45 of file hopCheck.c.

46{
47 Hop_Obj_t * pObj, * pObj2;
48 int i;
49 // check primary inputs
50 Hop_ManForEachPi( p, pObj, i )
51 {
52 if ( Hop_ObjFanin0(pObj) || Hop_ObjFanin1(pObj) )
53 {
54 printf( "Hop_ManCheck: The PI node \"%p\" has fanins.\n", pObj );
55 return 0;
56 }
57 }
58 // check primary outputs
59 Hop_ManForEachPo( p, pObj, i )
60 {
61 if ( !Hop_ObjFanin0(pObj) )
62 {
63 printf( "Hop_ManCheck: The PO node \"%p\" has NULL fanin.\n", pObj );
64 return 0;
65 }
66 if ( Hop_ObjFanin1(pObj) )
67 {
68 printf( "Hop_ManCheck: The PO node \"%p\" has second fanin.\n", pObj );
69 return 0;
70 }
71 }
72 // check internal nodes
73 Hop_ManForEachNode( p, pObj, i )
74 {
75 if ( !Hop_ObjFanin0(pObj) || !Hop_ObjFanin1(pObj) )
76 {
77 printf( "Hop_ManCheck: The AIG has internal node \"%p\" with a NULL fanin.\n", pObj );
78 return 0;
79 }
80 if ( Hop_ObjFanin0(pObj)->Id >= Hop_ObjFanin1(pObj)->Id )
81 {
82 printf( "Hop_ManCheck: The AIG has node \"%p\" with a wrong ordering of fanins.\n", pObj );
83 return 0;
84 }
85 pObj2 = Hop_TableLookup( p, pObj );
86 if ( pObj2 != pObj )
87 {
88 printf( "Hop_ManCheck: Node \"%p\" is not in the structural hashing table.\n", pObj );
89 return 0;
90 }
91 }
92 // count the total number of nodes
93 if ( Hop_ManObjNum(p) != 1 + Hop_ManPiNum(p) + Hop_ManPoNum(p) + Hop_ManAndNum(p) + Hop_ManExorNum(p) )
94 {
95 printf( "Hop_ManCheck: The number of created nodes is wrong.\n" );
96 return 0;
97 }
98 // count the number of nodes in the table
99 if ( Hop_TableCountEntries(p) != Hop_ManAndNum(p) + Hop_ManExorNum(p) )
100 {
101 printf( "Hop_ManCheck: The number of nodes in the structural hashing table is wrong.\n" );
102 return 0;
103 }
104// if ( !Hop_ManIsAcyclic(p) )
105// return 0;
106 return 1;
107}
Cube * p
Definition exorList.c:222
int Hop_TableCountEntries(Hop_Man_t *p)
Definition hopTable.c:145
#define Hop_ManForEachPi(p, pObj, i)
ITERATORS ///.
Definition hop.h:259
#define Hop_ManForEachNode(p, pObj, i)
Definition hop.h:265
Hop_Obj_t * Hop_TableLookup(Hop_Man_t *p, Hop_Obj_t *pGhost)
FUNCTION DEFINITIONS ///.
Definition hopTable.c:71
#define Hop_ManForEachPo(p, pObj, i)
Definition hop.h:262
struct Hop_Obj_t_ Hop_Obj_t
Definition hop.h:50
Here is the call graph for this function:
Here is the caller graph for this function: