abc-master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
hopCheck.c File Reference
#include "hop.h"

Go to the source code of this file.

Functions

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

Function Documentation

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
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
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 }
static Hop_Obj_t * Hop_ObjFanin1(Hop_Obj_t *pObj)
Definition: hop.h:183
static Llb_Mgr_t * p
Definition: llb3Image.c:950
#define Hop_ManForEachNode(p, pObj, i)
Definition: hop.h:265
#define Hop_ManForEachPi(p, pObj, i)
ITERATORS ///.
Definition: hop.h:259
#define Hop_ManForEachPo(p, pObj, i)
Definition: hop.h:262
static int Hop_ManPoNum(Hop_Man_t *p)
Definition: hop.h:146
static int Hop_ManObjNum(Hop_Man_t *p)
Definition: hop.h:151
Definition: hop.h:65
static int Hop_ManAndNum(Hop_Man_t *p)
Definition: hop.h:147
static Hop_Obj_t * Hop_ObjFanin0(Hop_Obj_t *pObj)
Definition: hop.h:182
static int Hop_ManExorNum(Hop_Man_t *p)
Definition: hop.h:148
int Hop_TableCountEntries(Hop_Man_t *p)
Definition: hopTable.c:145
Hop_Obj_t * Hop_TableLookup(Hop_Man_t *p, Hop_Obj_t *pGhost)
FUNCTION DEFINITIONS ///.
Definition: hopTable.c:71
static int Hop_ManPiNum(Hop_Man_t *p)
Definition: hop.h:145