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

Go to the source code of this file.

Functions

ABC_NAMESPACE_IMPL_START int Nwk_ManCheck (Nwk_Man_t *p)
 DECLARATIONS ///. More...
 

Function Documentation

ABC_NAMESPACE_IMPL_START int Nwk_ManCheck ( Nwk_Man_t p)

DECLARATIONS ///.

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

FileName [nwkCheck.c]

SystemName [ABC: Logic synthesis and verification system.]

PackageName [Logic network representation.]

Synopsis [Consistency checking procedures.]

Author [Alan Mishchenko]

Affiliation [UC Berkeley]

Date [Ver. 1.0. Started - June 20, 2005.]

Revision [

Id:
nwkCheck.c,v 1.00 2005/06/20 00:00:00 alanmi Exp

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

Synopsis [Checking the logic network for consistency.]

Description []

SideEffects []

SeeAlso []

Definition at line 45 of file nwkCheck.c.

46 {
47  Nwk_Obj_t * pObj, * pNext;
48  int i, k, m;
49  // check if the nodes have duplicated fanins
50  Nwk_ManForEachNode( p, pObj, i )
51  {
52  for ( k = 0; k < pObj->nFanins; k++ )
53  for ( m = k + 1; m < pObj->nFanins; m++ )
54  if ( pObj->pFanio[k] == pObj->pFanio[m] )
55  printf( "Node %d has duplicated fanin %d.\n", pObj->Id, pObj->pFanio[k]->Id );
56  }
57  // check if all nodes are in the correct fanin/fanout relationship
58  Nwk_ManForEachObj( p, pObj, i )
59  {
60  Nwk_ObjForEachFanin( pObj, pNext, k )
61  if ( Nwk_ObjFanoutNum(pNext) < 100 && Nwk_ObjFindFanout( pNext, pObj ) == -1 )
62  printf( "Nwk_ManCheck(): Object %d has fanin %d which does not have a corresponding fanout.\n", pObj->Id, pNext->Id );
63  Nwk_ObjForEachFanout( pObj, pNext, k )
64  if ( Nwk_ObjFindFanin( pNext, pObj ) == -1 )
65  printf( "Nwk_ManCheck(): Object %d has fanout %d which does not have a corresponding fanin.\n", pObj->Id, pNext->Id );
66  }
67  return 1;
68 }
ABC_DLL int Nwk_ObjFindFanout(Nwk_Obj_t *pObj, Nwk_Obj_t *pFanout)
Definition: nwkFanio.c:106
static int Nwk_ObjFanoutNum(Nwk_Obj_t *p)
Definition: nwk.h:138
typedefABC_NAMESPACE_HEADER_START struct Nwk_Obj_t_ Nwk_Obj_t
INCLUDES ///.
Definition: nwk.h:49
#define Nwk_ObjForEachFanout(pObj, pFanout, i)
Definition: nwk.h:201
ABC_DLL int Nwk_ObjFindFanin(Nwk_Obj_t *pObj, Nwk_Obj_t *pFanin)
Definition: nwkFanio.c:85
if(last==0)
Definition: sparse_int.h:34
ABC_NAMESPACE_IMPL_START int Nwk_ManCheck(Nwk_Man_t *p)
DECLARATIONS ///.
Definition: nwkCheck.c:45
#define Nwk_ObjForEachFanin(pObj, pFanin, i)
Definition: nwk.h:199
#define Nwk_ManForEachObj(p, pObj, i)
Definition: nwk.h:189
#define Nwk_ManForEachNode(p, pObj, i)
Definition: nwk.h:192