abc-master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
abcUnate.c File Reference
#include "base/abc/abc.h"
#include "misc/extra/extraBdd.h"

Go to the source code of this file.

Functions

static
ABC_NAMESPACE_IMPL_START void 
Abc_NtkPrintUnateBdd (Abc_Ntk_t *pNtk, int fUseNaive, int fVerbose)
 DECLARATIONS ///. More...
 
static void Abc_NtkPrintUnateSat (Abc_Ntk_t *pNtk, int fVerbose)
 
void Abc_NtkPrintUnate (Abc_Ntk_t *pNtk, int fUseBdds, int fUseNaive, int fVerbose)
 FUNCTION DEFINITIONS ///. More...
 

Function Documentation

void Abc_NtkPrintUnate ( Abc_Ntk_t pNtk,
int  fUseBdds,
int  fUseNaive,
int  fVerbose 
)

FUNCTION DEFINITIONS ///.

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

Synopsis [Detects unate variables of the multi-output function.]

Description []

SideEffects []

SeeAlso []

Definition at line 49 of file abcUnate.c.

50 {
51  if ( fUseBdds || fUseNaive )
52  Abc_NtkPrintUnateBdd( pNtk, fUseNaive, fVerbose );
53  else
54  Abc_NtkPrintUnateSat( pNtk, fVerbose );
55 }
static void Abc_NtkPrintUnateSat(Abc_Ntk_t *pNtk, int fVerbose)
Definition: abcUnate.c:152
static ABC_NAMESPACE_IMPL_START void Abc_NtkPrintUnateBdd(Abc_Ntk_t *pNtk, int fUseNaive, int fVerbose)
DECLARATIONS ///.
Definition: abcUnate.c:68
void Abc_NtkPrintUnateBdd ( Abc_Ntk_t pNtk,
int  fUseNaive,
int  fVerbose 
)
static

DECLARATIONS ///.

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

FileName [abcUnate.c]

SystemName [ABC: Logic synthesis and verification system.]

PackageName [Network and node package.]

Synopsis []

Author [Alan Mishchenko]

Affiliation [UC Berkeley]

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

Revision [

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

]

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

Synopsis [Detects unate variables using BDDs.]

Description []

SideEffects []

SeeAlso []

Definition at line 68 of file abcUnate.c.

69 {
70  Abc_Obj_t * pNode;
72  DdManager * dd; // the BDD manager used to hold shared BDDs
73 // DdNode ** pbGlobal; // temporary storage for global BDDs
74  int TotalSupps = 0;
75  int TotalUnate = 0;
76  int i;
77  abctime clk = Abc_Clock();
78  abctime clkBdd, clkUnate;
79 
80  // compute the global BDDs
81  dd = (DdManager *)Abc_NtkBuildGlobalBdds(pNtk, 10000000, 1, 1, fVerbose);
82  if ( dd == NULL )
83  return;
84 clkBdd = Abc_Clock() - clk;
85 
86  // get information about the network
87 // dd = pNtk->pManGlob;
88 // dd = (DdManager *)Abc_NtkGlobalBddMan( pNtk );
89 // pbGlobal = (DdNode **)Vec_PtrArray( pNtk->vFuncsGlob );
90 
91  // print the size of the BDDs
92  printf( "Shared BDD size = %6d nodes.\n", Cudd_ReadKeys(dd) - Cudd_ReadDead(dd) );
93 
94  // perform naive BDD-based computation
95  if ( fUseNaive )
96  {
97  Abc_NtkForEachCo( pNtk, pNode, i )
98  {
99 // p = Extra_UnateComputeSlow( dd, pbGlobal[i] );
100  p = Extra_UnateComputeSlow( dd, (DdNode *)Abc_ObjGlobalBdd(pNode) );
101  if ( fVerbose )
103  TotalSupps += p->nVars;
104  TotalUnate += p->nUnate;
106  }
107  }
108  // perform smart BDD-based computation
109  else
110  {
111  // create ZDD variables in the manager
112  Cudd_zddVarsFromBddVars( dd, 2 );
113  Abc_NtkForEachCo( pNtk, pNode, i )
114  {
115 // p = Extra_UnateComputeFast( dd, pbGlobal[i] );
116  p = Extra_UnateComputeFast( dd, (DdNode *)Abc_ObjGlobalBdd(pNode) );
117  if ( fVerbose )
119  TotalSupps += p->nVars;
120  TotalUnate += p->nUnate;
122  }
123  }
124 clkUnate = Abc_Clock() - clk - clkBdd;
125 
126  // print stats
127  printf( "Ins/Outs = %4d/%4d. Total supp = %5d. Total unate = %5d.\n",
128  Abc_NtkCiNum(pNtk), Abc_NtkCoNum(pNtk), TotalSupps, TotalUnate );
129  ABC_PRT( "Glob BDDs", clkBdd );
130  ABC_PRT( "Unateness", clkUnate );
131  ABC_PRT( "Total ", Abc_Clock() - clk );
132 
133  // deref the PO functions
134 // Abc_NtkFreeGlobalBdds( pNtk );
135  // stop the global BDD manager
136 // Extra_StopManager( pNtk->pManGlob );
137 // pNtk->pManGlob = NULL;
138  Abc_NtkFreeGlobalBdds( pNtk, 1 );
139 }
Definition: cudd.h:278
static Llb_Mgr_t * p
Definition: llb3Image.c:950
static int Abc_NtkCiNum(Abc_Ntk_t *pNtk)
Definition: abc.h:287
#define Abc_NtkForEachCo(pNtk, pCo, i)
Definition: abc.h:519
static abctime Abc_Clock()
Definition: abc_global.h:279
void Extra_UnateInfoPrint(Extra_UnateInfo_t *)
static int Abc_NtkCoNum(Abc_Ntk_t *pNtk)
Definition: abc.h:288
static void * Abc_ObjGlobalBdd(Abc_Obj_t *pObj)
Definition: abc.h:431
ABC_DLL void * Abc_NtkFreeGlobalBdds(Abc_Ntk_t *pNtk, int fFreeMan)
Definition: abcNtbdd.c:476
Extra_UnateInfo_t * Extra_UnateComputeSlow(DdManager *dd, DdNode *bFunc)
Extra_UnateInfo_t * Extra_UnateComputeFast(DdManager *dd, DdNode *bFunc)
Definition: extraBddUnate.c:73
#define ABC_PRT(a, t)
Definition: abc_global.h:220
unsigned int Cudd_ReadKeys(DdManager *dd)
Definition: cuddAPI.c:1626
int Cudd_zddVarsFromBddVars(DdManager *dd, int multiplicity)
Definition: cuddAPI.c:519
void Extra_UnateInfoDissolve(Extra_UnateInfo_t *)
ABC_DLL void * Abc_NtkBuildGlobalBdds(Abc_Ntk_t *pNtk, int fBddSizeMax, int fDropInternal, int fReorder, int fVerbose)
Definition: abcNtbdd.c:251
unsigned int Cudd_ReadDead(DdManager *dd)
Definition: cuddAPI.c:1646
ABC_INT64_T abctime
Definition: abc_global.h:278
void Abc_NtkPrintUnateSat ( Abc_Ntk_t pNtk,
int  fVerbose 
)
static

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

Synopsis [Detects unate variables using SAT.]

Description []

SideEffects []

SeeAlso []

Definition at line 152 of file abcUnate.c.

153 {
154 }