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

Go to the source code of this file.

Functions

ABC_NAMESPACE_IMPL_START
Lpk_Man_t
Lpk_ManStart (Lpk_Par_t *pPars)
 DECLARATIONS ///. More...
 
void Lpk_ManStop (Lpk_Man_t *p)
 

Function Documentation

ABC_NAMESPACE_IMPL_START Lpk_Man_t* Lpk_ManStart ( Lpk_Par_t pPars)

DECLARATIONS ///.

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

FileName [lpkMan.c]

SystemName [ABC: Logic synthesis and verification system.]

PackageName [Fast Boolean matching for LUT structures.]

Synopsis []

Author [Alan Mishchenko]

Affiliation [UC Berkeley]

Date [Ver. 1.0. Started - April 28, 2007.]

Revision [

Id:
lpkMan.c,v 1.00 2007/04/28 00:00:00 alanmi Exp

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

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 45 of file lpkMan.c.

46 {
47  Lpk_Man_t * p;
48  int i, nWords;
49  assert( pPars->nLutsMax <= 16 );
50  assert( pPars->nVarsMax > 0 && pPars->nVarsMax <= 16 );
51  p = ABC_ALLOC( Lpk_Man_t, 1 );
52  memset( p, 0, sizeof(Lpk_Man_t) );
53  p->pPars = pPars;
55  p->vTtElems = Vec_PtrAllocTruthTables( pPars->nVarsMax );
56  p->vTtNodes = Vec_PtrAllocSimInfo( 1024, Abc_TruthWordNum(pPars->nVarsMax) );
57  p->vCover = Vec_IntAlloc( 1 << 12 );
58  p->vLeaves = Vec_PtrAlloc( 32 );
59  for ( i = 0; i < 8; i++ )
60  p->vSets[i] = Vec_IntAlloc(100);
61  p->pDsdMan = Kit_DsdManAlloc( pPars->nVarsMax, 64 );
62  p->vMemory = Vec_IntAlloc( 1024 * 32 );
63  p->vBddDir = Vec_IntAlloc( 256 );
64  p->vBddInv = Vec_IntAlloc( 256 );
65  // allocate temporary storage for truth tables
66  nWords = Kit_TruthWordNum(pPars->nVarsMax);
67  p->ppTruths[0][0] = ABC_ALLOC( unsigned, 32 * nWords );
68  p->ppTruths[1][0] = p->ppTruths[0][0] + 1 * nWords;
69  for ( i = 1; i < 2; i++ )
70  p->ppTruths[1][i] = p->ppTruths[1][0] + i * nWords;
71  p->ppTruths[2][0] = p->ppTruths[1][0] + 2 * nWords;
72  for ( i = 1; i < 4; i++ )
73  p->ppTruths[2][i] = p->ppTruths[2][0] + i * nWords;
74  p->ppTruths[3][0] = p->ppTruths[2][0] + 4 * nWords;
75  for ( i = 1; i < 8; i++ )
76  p->ppTruths[3][i] = p->ppTruths[3][0] + i * nWords;
77  p->ppTruths[4][0] = p->ppTruths[3][0] + 8 * nWords;
78  for ( i = 1; i < 16; i++ )
79  p->ppTruths[4][i] = p->ppTruths[4][0] + i * nWords;
80  return p;
81 }
char * memset()
Lpk_Par_t * pPars
Definition: lpkInt.h:72
static int Kit_TruthWordNum(int nVars)
Definition: kit.h:224
static Llb_Mgr_t * p
Definition: llb3Image.c:950
Vec_Int_t * vBddDir
Definition: lpkInt.h:100
Vec_Int_t * vSets[8]
Definition: lpkInt.h:105
Vec_Int_t * vCover
Definition: lpkInt.h:87
#define ABC_ALLOC(type, num)
Definition: abc_global.h:229
Kit_DsdMan_t * Kit_DsdManAlloc(int nVars, int nNodes)
DECLARATIONS ///.
Definition: kitDsd.c:45
static int Abc_TruthWordNum(int nVars)
Definition: abc_global.h:256
int nWords
Definition: abcNpn.c:127
Vec_Ptr_t * vTtNodes
Definition: lpkInt.h:98
for(p=first;p->value< newval;p=p->next)
static Vec_Ptr_t * Vec_PtrAllocTruthTables(int nVars)
Definition: vecPtr.h:1065
static Vec_Int_t * Vec_IntAlloc(int nCap)
FUNCTION DEFINITIONS ///.
Definition: bblif.c:149
unsigned * ppTruths[5][16]
Definition: lpkInt.h:103
int nCutsMax
Definition: lpkInt.h:79
Vec_Ptr_t * vTtElems
Definition: lpkInt.h:97
Vec_Int_t * vBddInv
Definition: lpkInt.h:101
Vec_Int_t * vMemory
Definition: lpkInt.h:99
Vec_Ptr_t * vLeaves
Definition: lpkInt.h:95
Kit_DsdMan_t * pDsdMan
Definition: lpkInt.h:106
static Vec_Ptr_t * Vec_PtrAlloc(int nCap)
FUNCTION DEFINITIONS ///.
Definition: vecPtr.h:83
#define assert(ex)
Definition: util_old.h:213
#define LPK_CUTS_MAX
Definition: lpkInt.h:48
static Vec_Ptr_t * Vec_PtrAllocSimInfo(int nEntries, int nWords)
Definition: vecPtr.h:929
void Lpk_ManStop ( Lpk_Man_t p)

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

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 94 of file lpkMan.c.

95 {
96  int i;
97  ABC_FREE( p->ppTruths[0][0] );
98  Vec_IntFree( p->vBddDir );
99  Vec_IntFree( p->vBddInv );
100  Vec_IntFree( p->vMemory );
101  Kit_DsdManFree( p->pDsdMan );
102  for ( i = 0; i < 8; i++ )
103  Vec_IntFree(p->vSets[i]);
104  if ( p->pIfMan )
105  {
106  void * pPars = p->pIfMan->pPars;
107  If_ManStop( p->pIfMan );
108  ABC_FREE( pPars );
109  }
110  if ( p->vLevels )
111  Vec_VecFree( p->vLevels );
112  if ( p->vVisited )
113  Vec_VecFree( p->vVisited );
114  Vec_PtrFree( p->vLeaves );
115  Vec_IntFree( p->vCover );
116  Vec_PtrFree( p->vTtElems );
117  Vec_PtrFree( p->vTtNodes );
118  ABC_FREE( p );
119 }
Vec_Vec_t * vVisited
Definition: lpkInt.h:84
Vec_Int_t * vBddDir
Definition: lpkInt.h:100
Vec_Int_t * vSets[8]
Definition: lpkInt.h:105
Vec_Int_t * vCover
Definition: lpkInt.h:87
static void Vec_VecFree(Vec_Vec_t *p)
Definition: vecVec.h:347
Vec_Ptr_t * vTtNodes
Definition: lpkInt.h:98
unsigned * ppTruths[5][16]
Definition: lpkInt.h:103
Vec_Vec_t * vLevels
Definition: lpkInt.h:88
Vec_Ptr_t * vTtElems
Definition: lpkInt.h:97
Vec_Int_t * vBddInv
Definition: lpkInt.h:101
If_Man_t * pIfMan
Definition: lpkInt.h:86
Vec_Int_t * vMemory
Definition: lpkInt.h:99
Vec_Ptr_t * vLeaves
Definition: lpkInt.h:95
Kit_DsdMan_t * pDsdMan
Definition: lpkInt.h:106
If_Par_t * pPars
Definition: if.h:184
#define ABC_FREE(obj)
Definition: abc_global.h:232
void Kit_DsdManFree(Kit_DsdMan_t *p)
Definition: kitDsd.c:71
static void Vec_IntFree(Vec_Int_t *p)
Definition: bblif.c:235
void If_ManStop(If_Man_t *p)
Definition: ifMan.c:205
static void Vec_PtrFree(Vec_Ptr_t *p)
Definition: vecPtr.h:223