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

Go to the source code of this file.

Functions

ABC_NAMESPACE_IMPL_START void Saig_ManReportUselessRegisters (Aig_Man_t *pAig)
 DECLARATIONS ///. More...
 
int Saig_ManReportComplements (Aig_Man_t *p)
 

Function Documentation

int Saig_ManReportComplements ( Aig_Man_t p)

Function*************************************************************

Synopsis [Report the number of pairs of complemented registers.]

Description []

SideEffects []

SeeAlso []

Definition at line 85 of file saigScl.c.

86 {
87  Aig_Obj_t * pObj, * pFanin;
88  int i, Counter = 0;
89  assert( Aig_ManRegNum(p) > 0 );
90  Aig_ManForEachObj( p, pObj, i )
91  assert( !pObj->fMarkA );
92  Aig_ManForEachLiSeq( p, pObj, i )
93  {
94  pFanin = Aig_ObjFanin0(pObj);
95  if ( pFanin->fMarkA )
96  Counter++;
97  else
98  pFanin->fMarkA = 1;
99  }
100  // count fanins that have both attributes
101  Aig_ManForEachLiSeq( p, pObj, i )
102  {
103  pFanin = Aig_ObjFanin0(pObj);
104  pFanin->fMarkA = 0;
105  }
106  return Counter;
107 }
static Llb_Mgr_t * p
Definition: llb3Image.c:950
static Aig_Obj_t * Aig_ObjFanin0(Aig_Obj_t *pObj)
Definition: aig.h:308
unsigned int fMarkA
Definition: aig.h:79
Definition: aig.h:69
static int Counter
static int Aig_ManRegNum(Aig_Man_t *p)
Definition: aig.h:260
#define Aig_ManForEachObj(p, pObj, i)
Definition: aig.h:403
#define assert(ex)
Definition: util_old.h:213
#define Aig_ManForEachLiSeq(p, pObj, i)
Definition: aig.h:447
ABC_NAMESPACE_IMPL_START void Saig_ManReportUselessRegisters ( Aig_Man_t pAig)

DECLARATIONS ///.

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

FileName [saigScl.c]

SystemName [ABC: Logic synthesis and verification system.]

PackageName [Sequential AIG package.]

Synopsis [Sequential cleanup.]

Author [Alan Mishchenko]

Affiliation [UC Berkeley]

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

Revision [

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

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

Synopsis [Report registers useless for SEC.]

Description []

SideEffects []

SeeAlso []

Definition at line 45 of file saigScl.c.

46 {
47  Aig_Obj_t * pObj, * pDriver;
48  int i, Counter1, Counter2;
49  // set PIO numbers
50  Aig_ManSetCioIds( pAig );
51  // check how many POs are driven by a register whose ref count is 1
52  Counter1 = 0;
53  Saig_ManForEachPo( pAig, pObj, i )
54  {
55  pDriver = Aig_ObjFanin0(pObj);
56  if ( Saig_ObjIsLo(pAig, pDriver) && Aig_ObjRefs(pDriver) == 1 )
57  Counter1++;
58  }
59  // check how many PIs have ref count 1 and drive a register
60  Counter2 = 0;
61  Saig_ManForEachLi( pAig, pObj, i )
62  {
63  pDriver = Aig_ObjFanin0(pObj);
64  if ( Saig_ObjIsPi(pAig, pDriver) && Aig_ObjRefs(pDriver) == 1 )
65  Counter2++;
66  }
67  if ( Counter1 )
68  printf( "Network has %d (out of %d) registers driving POs.\n", Counter1, Saig_ManRegNum(pAig) );
69  if ( Counter2 )
70  printf( "Network has %d (out of %d) registers driven by PIs.\n", Counter2, Saig_ManRegNum(pAig) );
71 }
static int Saig_ObjIsLo(Aig_Man_t *p, Aig_Obj_t *pObj)
Definition: saig.h:84
static Aig_Obj_t * Aig_ObjFanin0(Aig_Obj_t *pObj)
Definition: aig.h:308
#define Saig_ManForEachLi(p, pObj, i)
Definition: saig.h:98
Definition: aig.h:69
void Aig_ManSetCioIds(Aig_Man_t *p)
Definition: aigUtil.c:965
static int Saig_ManRegNum(Aig_Man_t *p)
Definition: saig.h:77
#define Saig_ManForEachPo(p, pObj, i)
Definition: saig.h:93
static int Aig_ObjRefs(Aig_Obj_t *pObj)
Definition: aig.h:300
static int Saig_ObjIsPi(Aig_Man_t *p, Aig_Obj_t *pObj)
Definition: saig.h:82