src/aig/bdc/bdc.h File Reference

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  Bdc_Par_t_

Typedefs

typedef struct Bdc_Man_t_ Bdc_Man_t
typedef struct Bdc_Par_t_ Bdc_Par_t

Functions

Bdc_Man_tBdc_ManAlloc (Bdc_Par_t *pPars)
void Bdc_ManFree (Bdc_Man_t *p)
int Bdc_ManDecompose (Bdc_Man_t *p, unsigned *puFunc, unsigned *puCare, int nVars, Vec_Ptr_t *vDivs, int nNodesLimit)

Typedef Documentation

typedef struct Bdc_Man_t_ Bdc_Man_t

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

FileName [bdc.h]

SystemName [ABC: Logic synthesis and verification system.]

PackageName [Truth-table-based bi-decomposition engine.]

Synopsis [External declarations.]

Author [Alan Mishchenko]

Affiliation [UC Berkeley]

Date [Ver. 1.0. Started - January 30, 2007.]

Revision [

Id
bdc.h,v 1.00 2007/01/30 00:00:00 alanmi Exp

] INCLUDES /// PARAMETERS /// BASIC TYPES ///

Definition at line 40 of file bdc.h.

typedef struct Bdc_Par_t_ Bdc_Par_t

Definition at line 41 of file bdc.h.


Function Documentation

Bdc_Man_t* Bdc_ManAlloc ( Bdc_Par_t pPars  ) 

MACRO DEFINITIONS /// FUNCTION DECLARATIONS ///

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

FileName [bdcCore.c]

SystemName [ABC: Logic synthesis and verification system.]

PackageName [Truth-table-based bi-decomposition engine.]

Synopsis [The gateway to bi-decomposition.]

Author [Alan Mishchenko]

Affiliation [UC Berkeley]

Date [Ver. 1.0. Started - January 30, 2007.]

Revision [

Id
bdcCore.c,v 1.00 2007/01/30 00:00:00 alanmi Exp

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

Synopsis [Allocate resynthesis manager.]

Description []

SideEffects []

SeeAlso []

Definition at line 42 of file bdcCore.c.

00043 {
00044     Bdc_Man_t * p;
00045     unsigned * pData;
00046     int i, k, nBits;
00047     p = ALLOC( Bdc_Man_t, 1 );
00048     memset( p, 0, sizeof(Bdc_Man_t) );
00049     assert( pPars->nVarsMax > 3 && pPars->nVarsMax < 16 );
00050     p->pPars = pPars;
00051     p->nWords = Kit_TruthWordNum( pPars->nVarsMax );
00052     p->nDivsLimit = 200;
00053     p->nNodesLimit = 0; // will be set later
00054     // memory
00055     p->vMemory = Vec_IntStart( 1 << 16 );
00056     // internal nodes
00057     p->nNodesAlloc = 512;
00058     p->pNodes = ALLOC( Bdc_Fun_t, p->nNodesAlloc );
00059     // set up hash table
00060     p->nTableSize = (1 << p->pPars->nVarsMax);
00061     p->pTable = ALLOC( Bdc_Fun_t *, p->nTableSize );
00062     memset( p->pTable, 0, sizeof(Bdc_Fun_t *) * p->nTableSize );
00063     p->vSpots = Vec_IntAlloc( 256 );
00064     // truth tables
00065     p->vTruths = Vec_PtrAllocSimInfo( pPars->nVarsMax + 5, p->nWords );
00066     // set elementary truth tables
00067     nBits = (1 << pPars->nVarsMax);
00068     Kit_TruthFill( Vec_PtrEntry(p->vTruths, 0), p->nVars );
00069     for ( k = 0; k < pPars->nVarsMax; k++ )
00070     {
00071         pData = Vec_PtrEntry( p->vTruths, k+1 );
00072         Kit_TruthClear( pData, p->nVars );
00073         for ( i = 0; i < nBits; i++ )
00074             if ( i & (1 << k) )
00075                 pData[i>>5] |= (1 << (i&31));
00076     }
00077     p->puTemp1 = Vec_PtrEntry( p->vTruths, pPars->nVarsMax + 1 );
00078     p->puTemp2 = Vec_PtrEntry( p->vTruths, pPars->nVarsMax + 2 );
00079     p->puTemp3 = Vec_PtrEntry( p->vTruths, pPars->nVarsMax + 3 );
00080     p->puTemp4 = Vec_PtrEntry( p->vTruths, pPars->nVarsMax + 4 );
00081     // start the internal ISFs
00082     p->pIsfOL = &p->IsfOL;  Bdc_IsfStart( p, p->pIsfOL );
00083     p->pIsfOR = &p->IsfOR;  Bdc_IsfStart( p, p->pIsfOR );
00084     p->pIsfAL = &p->IsfAL;  Bdc_IsfStart( p, p->pIsfAL );
00085     p->pIsfAR = &p->IsfAR;  Bdc_IsfStart( p, p->pIsfAR );   
00086     return p;
00087 }

int Bdc_ManDecompose ( Bdc_Man_t p,
unsigned *  puFunc,
unsigned *  puCare,
int  nVars,
Vec_Ptr_t vDivs,
int  nNodesMax 
)

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

Synopsis [Performs decomposition of one function.]

Description []

SideEffects []

SeeAlso []

Definition at line 162 of file bdcCore.c.

00163 {
00164     Bdc_Isf_t Isf, * pIsf = &Isf;
00165     // set current manager parameters
00166     p->nVars = nVars;
00167     p->nWords = Kit_TruthWordNum( nVars );
00168     Bdc_ManPrepare( p, vDivs );
00169     p->nNodesLimit = (p->nNodes + nNodesMax < p->nNodesAlloc)? p->nNodes + nNodesMax : p->nNodesAlloc;
00170     // copy the function
00171     Bdc_IsfStart( p, pIsf );
00172     Bdc_IsfClean( pIsf );
00173     pIsf->uSupp = Kit_TruthSupport( puFunc, p->nVars ) | Kit_TruthSupport( puCare, p->nVars );
00174     Kit_TruthAnd( pIsf->puOn, puCare, puFunc, p->nVars );
00175     Kit_TruthSharp( pIsf->puOff, puCare, puFunc, p->nVars );
00176     // call decomposition
00177     Bdc_SuppMinimize( p, pIsf );
00178     p->pRoot = Bdc_ManDecompose_rec( p, pIsf );
00179     if ( p->pRoot == NULL )
00180         return -1;
00181     return p->nNodesNew;
00182 }

void Bdc_ManFree ( Bdc_Man_t p  ) 

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

Synopsis [Deallocate resynthesis manager.]

Description []

SideEffects []

SeeAlso []

Definition at line 100 of file bdcCore.c.

00101 {
00102     Vec_IntFree( p->vMemory );
00103     Vec_IntFree( p->vSpots );
00104     Vec_PtrFree( p->vTruths );
00105     free( p->pNodes );
00106     free( p->pTable );
00107     free( p );
00108 }


Generated on Tue Jan 5 12:18:13 2010 for abc70930 by  doxygen 1.6.1