abc-master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
giaMuxes.c File Reference
#include "gia.h"
#include "misc/util/utilNam.h"
#include "misc/vec/vecWec.h"

Go to the source code of this file.

Data Structures

struct  Mux_Man_t_
 

Typedefs

typedef struct Mux_Man_t_ Mux_Man_t
 

Functions

ABC_NAMESPACE_IMPL_START void Gia_ManCountMuxXor (Gia_Man_t *p, int *pnMuxes, int *pnXors)
 DECLARATIONS ///. More...
 
void Gia_ManPrintMuxStats (Gia_Man_t *p)
 
Gia_Man_tGia_ManDupMuxes (Gia_Man_t *p, int Limit)
 
Gia_Man_tGia_ManDupNoMuxes (Gia_Man_t *p)
 
Gia_Man_tGia_ManDupMuxesTest (Gia_Man_t *p)
 
int Gia_MuxRef_rec (Gia_Man_t *p, int iObj)
 
int Gia_MuxRef (Gia_Man_t *p, int iObj)
 
int Gia_MuxDeref_rec (Gia_Man_t *p, int iObj)
 
int Gia_MuxDeref (Gia_Man_t *p, int iObj)
 
int Gia_MuxMffcSize (Gia_Man_t *p, int iObj)
 
void Gia_MuxStructPrint_rec (Gia_Man_t *p, int iObj, int fFirst)
 
void Gia_MuxStructPrint (Gia_Man_t *p, int iObj)
 
void Gia_MuxStructDump_rec (Gia_Man_t *p, int iObj, int fFirst, Vec_Str_t *vStr, int nDigitsId)
 
int Gia_MuxStructDump (Gia_Man_t *p, int iObj, Vec_Str_t *vStr, int nDigitsNum, int nDigitsId)
 
int Gia_ManMuxCompare (char **pp1, char **pp2)
 
int Gia_ManMuxCountOne (char *p)
 
Mux_Man_tMux_ManAlloc (Gia_Man_t *pGia)
 
void Mux_ManFree (Mux_Man_t *p)
 
int Gia_ManMuxProfile (Mux_Man_t *p, int fWidth)
 
void Gia_ManMuxProfiling (Gia_Man_t *p)
 

Typedef Documentation

typedef struct Mux_Man_t_ Mux_Man_t

Definition at line 420 of file giaMuxes.c.

Function Documentation

ABC_NAMESPACE_IMPL_START void Gia_ManCountMuxXor ( Gia_Man_t p,
int *  pnMuxes,
int *  pnXors 
)

DECLARATIONS ///.

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

FileName [giaMuxes.c]

SystemName [ABC: Logic synthesis and verification system.]

PackageName [Scalable AIG package.]

Synopsis [Multiplexer profiling algorithm.]

Author [Alan Mishchenko]

Affiliation [UC Berkeley]

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

Revision [

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

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

Synopsis [Counts XORs and MUXes.]

Description []

SideEffects []

SeeAlso []

Definition at line 47 of file giaMuxes.c.

48 {
49  Gia_Obj_t * pObj, * pFan0, * pFan1; int i;
50  *pnMuxes = *pnXors = 0;
51  Gia_ManForEachAnd( p, pObj, i )
52  {
53  if ( !Gia_ObjIsMuxType(pObj) )
54  continue;
55  if ( Gia_ObjRecognizeExor(pObj, &pFan0, &pFan1) )
56  (*pnXors)++;
57  else
58  (*pnMuxes)++;
59  }
60 }
int Gia_ObjRecognizeExor(Gia_Obj_t *pObj, Gia_Obj_t **ppFan0, Gia_Obj_t **ppFan1)
Definition: giaUtil.c:921
Definition: gia.h:75
#define Gia_ManForEachAnd(p, pObj, i)
Definition: gia.h:1002
int Gia_ObjIsMuxType(Gia_Obj_t *pNode)
Definition: giaUtil.c:885
Gia_Man_t* Gia_ManDupMuxes ( Gia_Man_t p,
int  Limit 
)

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

Synopsis [Derives GIA with MUXes.]

Description [Create MUX if the sum of fanin references does not exceed limit.]

SideEffects []

SeeAlso []

Definition at line 96 of file giaMuxes.c.

97 {
98  Gia_Man_t * pNew, * pTemp;
99  Gia_Obj_t * pObj, * pFan0, * pFan1, * pFanC, * pSiblNew, * pObjNew;
100  int i;
101  assert( p->pMuxes == NULL );
102  assert( Limit >= 2 );
103  ABC_FREE( p->pRefs );
104  Gia_ManCreateRefs( p );
105  // start the new manager
106  pNew = Gia_ManStart( Gia_ManObjNum(p) );
107  pNew->pName = Abc_UtilStrsav( p->pName );
108  pNew->pSpec = Abc_UtilStrsav( p->pSpec );
109  pNew->pMuxes = ABC_CALLOC( unsigned, pNew->nObjsAlloc );
110  if ( Gia_ManHasChoices(p) )
111  pNew->pSibls = ABC_CALLOC( int, pNew->nObjsAlloc );
112  Gia_ManConst0(p)->Value = 0;
113  Gia_ManHashStart( pNew );
114  Gia_ManForEachObj1( p, pObj, i )
115  {
116  if ( Gia_ObjIsCi(pObj) )
117  pObj->Value = Gia_ManAppendCi( pNew );
118  else if ( Gia_ObjIsCo(pObj) )
119  pObj->Value = Gia_ManAppendCo( pNew, Gia_ObjFanin0Copy(pObj) );
120  else if ( Gia_ObjIsBuf(pObj) )
121  pObj->Value = Gia_ManAppendBuf( pNew, Gia_ObjFanin0Copy(pObj) );
122  else if ( !Gia_ObjIsMuxType(pObj) || Gia_ObjSibl(p, Gia_ObjFaninId0(pObj, i)) || Gia_ObjSibl(p, Gia_ObjFaninId1(pObj, i)) )
123  pObj->Value = Gia_ManHashAnd( pNew, Gia_ObjFanin0Copy(pObj), Gia_ObjFanin1Copy(pObj) );
124  else if ( Gia_ObjRecognizeExor(pObj, &pFan0, &pFan1) )
125  pObj->Value = Gia_ManHashXorReal( pNew, Gia_ObjLitCopy(p, Gia_ObjToLit(p, pFan0)), Gia_ObjLitCopy(p, Gia_ObjToLit(p, pFan1)) );
126  else if ( Gia_ObjRefNum(p, Gia_ObjFanin0(pObj)) + Gia_ObjRefNum(p, Gia_ObjFanin1(pObj)) > Limit )
127  pObj->Value = Gia_ManHashAnd( pNew, Gia_ObjFanin0Copy(pObj), Gia_ObjFanin1Copy(pObj) );
128  else
129  {
130  pFanC = Gia_ObjRecognizeMux( pObj, &pFan1, &pFan0 );
131  pObj->Value = Gia_ManHashMuxReal( pNew, Gia_ObjLitCopy(p, Gia_ObjToLit(p, pFanC)), Gia_ObjLitCopy(p, Gia_ObjToLit(p, pFan1)), Gia_ObjLitCopy(p, Gia_ObjToLit(p, pFan0)) );
132  }
133  if ( !Gia_ObjSibl(p, i) )
134  continue;
135  pObjNew = Gia_ManObj( pNew, Abc_Lit2Var(pObj->Value) );
136  pSiblNew = Gia_ManObj( pNew, Abc_Lit2Var(Gia_ObjSiblObj(p, i)->Value) );
137  if ( Gia_ObjIsAnd(pObjNew) && Gia_ObjIsAnd(pSiblNew) && Gia_ObjId(pNew, pObjNew) > Gia_ObjId(pNew, pSiblNew) )
138  pNew->pSibls[Gia_ObjId(pNew, pObjNew)] = Gia_ObjId(pNew, pSiblNew);
139  }
140  Gia_ManHashStop( pNew );
141  Gia_ManSetRegNum( pNew, Gia_ManRegNum(p) );
142  // perform cleanup
143  pNew = Gia_ManCleanup( pTemp = pNew );
144  Gia_ManStop( pTemp );
145  return pNew;
146 }
int nObjsAlloc
Definition: gia.h:102
static int Gia_ObjToLit(Gia_Man_t *p, Gia_Obj_t *pObj)
Definition: gia.h:497
void Gia_ManCreateRefs(Gia_Man_t *p)
Definition: giaUtil.c:715
int Gia_ObjRecognizeExor(Gia_Obj_t *pObj, Gia_Obj_t **ppFan0, Gia_Obj_t **ppFan1)
Definition: giaUtil.c:921
static Gia_Obj_t * Gia_ObjSiblObj(Gia_Man_t *p, int Id)
Definition: gia.h:894
void Gia_ManStop(Gia_Man_t *p)
Definition: giaMan.c:77
static int Gia_ManAppendCo(Gia_Man_t *p, int iLit0)
Definition: gia.h:703
int * pSibls
Definition: gia.h:123
static int Gia_ManAppendCi(Gia_Man_t *p)
Definition: gia.h:583
unsigned * pMuxes
Definition: gia.h:104
static int Gia_ObjRefNum(Gia_Man_t *p, Gia_Obj_t *pObj)
Definition: gia.h:521
static int Gia_ObjIsBuf(Gia_Obj_t *pObj)
Definition: gia.h:427
void Gia_ManSetRegNum(Gia_Man_t *p, int nRegs)
Definition: giaMan.c:628
static Gia_Obj_t * Gia_ManObj(Gia_Man_t *p, int v)
Definition: gia.h:402
int * pRefs
Definition: gia.h:114
Definition: gia.h:75
static int Gia_ManHasChoices(Gia_Man_t *p)
Definition: gia.h:397
static int Gia_ObjSibl(Gia_Man_t *p, int Id)
Definition: gia.h:893
static Gia_Obj_t * Gia_ObjFanin0(Gia_Obj_t *pObj)
Definition: gia.h:454
char * pName
Definition: gia.h:97
static int Gia_ObjFanin1Copy(Gia_Obj_t *pObj)
Definition: gia.h:482
static int Gia_ManAppendBuf(Gia_Man_t *p, int iLit)
Definition: gia.h:694
void Gia_ManHashStart(Gia_Man_t *p)
Definition: giaHash.c:117
char * pSpec
Definition: gia.h:98
Gia_Man_t * Gia_ManStart(int nObjsMax)
DECLARATIONS ///.
Definition: giaMan.c:52
int Gia_ManHashXorReal(Gia_Man_t *p, int iLit0, int iLit1)
Definition: giaHash.c:465
static int Gia_ObjId(Gia_Man_t *p, Gia_Obj_t *pObj)
Definition: gia.h:410
static int Gia_ObjLitCopy(Gia_Man_t *p, int iLit)
Definition: gia.h:479
static int Gia_ObjFanin0Copy(Gia_Obj_t *pObj)
Definition: gia.h:481
static int Gia_ObjIsCo(Gia_Obj_t *pObj)
Definition: gia.h:421
int Gia_ObjIsMuxType(Gia_Obj_t *pNode)
Definition: giaUtil.c:885
#define ABC_FREE(obj)
Definition: abc_global.h:232
Gia_Obj_t * Gia_ObjRecognizeMux(Gia_Obj_t *pNode, Gia_Obj_t **ppNodeT, Gia_Obj_t **ppNodeE)
Definition: giaUtil.c:959
Definition: gia.h:95
static int Gia_ObjIsAnd(Gia_Obj_t *pObj)
Definition: gia.h:422
static Gia_Obj_t * Gia_ManConst0(Gia_Man_t *p)
Definition: gia.h:400
static int Abc_Lit2Var(int Lit)
Definition: abc_global.h:264
#define ABC_CALLOC(type, num)
Definition: abc_global.h:230
static Gia_Obj_t * Gia_ObjFanin1(Gia_Obj_t *pObj)
Definition: gia.h:455
#define assert(ex)
Definition: util_old.h:213
unsigned Value
Definition: gia.h:87
int Gia_ManHashMuxReal(Gia_Man_t *p, int iLitC, int iLit1, int iLit0)
Definition: giaHash.c:517
#define Gia_ManForEachObj1(p, pObj, i)
Definition: gia.h:986
static int Gia_ObjIsCi(Gia_Obj_t *pObj)
Definition: gia.h:420
Gia_Man_t * Gia_ManCleanup(Gia_Man_t *p)
Definition: giaScl.c:84
char * Abc_UtilStrsav(char *s)
Definition: starter.c:47
static int Gia_ObjFaninId1(Gia_Obj_t *pObj, int ObjId)
Definition: gia.h:461
int Gia_ManHashAnd(Gia_Man_t *p, int iLit0, int iLit1)
Definition: giaHash.c:572
static int Gia_ManObjNum(Gia_Man_t *p)
Definition: gia.h:388
void Gia_ManHashStop(Gia_Man_t *p)
Definition: giaHash.c:142
static int Gia_ObjFaninId0(Gia_Obj_t *pObj, int ObjId)
Definition: gia.h:460
static int Gia_ManRegNum(Gia_Man_t *p)
Definition: gia.h:387
Gia_Man_t* Gia_ManDupMuxesTest ( Gia_Man_t p)

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

Synopsis [Test these procedures.]

Description []

SideEffects []

SeeAlso []

Definition at line 205 of file giaMuxes.c.

206 {
207  Gia_Man_t * pNew, * pNew2;
208  pNew = Gia_ManDupMuxes( p, 2 );
209  pNew2 = Gia_ManDupNoMuxes( pNew );
210  Gia_ManPrintStats( p, NULL );
211  Gia_ManPrintStats( pNew, NULL );
212  Gia_ManPrintStats( pNew2, NULL );
213  Gia_ManStop( pNew );
214 // Gia_ManStop( pNew2 );
215  return pNew2;
216 }
void Gia_ManStop(Gia_Man_t *p)
Definition: giaMan.c:77
void Gia_ManPrintStats(Gia_Man_t *p, Gps_Par_t *pPars)
Definition: giaMan.c:389
Definition: gia.h:95
Gia_Man_t * Gia_ManDupMuxes(Gia_Man_t *p, int Limit)
Definition: giaMuxes.c:96
Gia_Man_t * Gia_ManDupNoMuxes(Gia_Man_t *p)
Definition: giaMuxes.c:159
Gia_Man_t* Gia_ManDupNoMuxes ( Gia_Man_t p)

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

Synopsis [Derives GIA without MUXes.]

Description []

SideEffects []

SeeAlso []

Definition at line 159 of file giaMuxes.c.

160 {
161  Gia_Man_t * pNew, * pTemp;
162  Gia_Obj_t * pObj;
163  int i;
164  assert( p->pMuxes != NULL );
165  // start the new manager
166  pNew = Gia_ManStart( 5000 );
167  pNew->pName = Abc_UtilStrsav( p->pName );
168  pNew->pSpec = Abc_UtilStrsav( p->pSpec );
169  Gia_ManConst0(p)->Value = 0;
170  Gia_ManHashStart( pNew );
171  Gia_ManForEachObj1( p, pObj, i )
172  {
173  if ( Gia_ObjIsCi(pObj) )
174  pObj->Value = Gia_ManAppendCi( pNew );
175  else if ( Gia_ObjIsCo(pObj) )
176  pObj->Value = Gia_ManAppendCo( pNew, Gia_ObjFanin0Copy(pObj) );
177  else if ( Gia_ObjIsBuf(pObj) )
178  pObj->Value = Gia_ManAppendBuf( pNew, Gia_ObjFanin0Copy(pObj) );
179  else if ( Gia_ObjIsMuxId(p, i) )
180  pObj->Value = Gia_ManHashMux( pNew, Gia_ObjFanin2Copy(p, pObj), Gia_ObjFanin1Copy(pObj), Gia_ObjFanin0Copy(pObj) );
181  else if ( Gia_ObjIsXor(pObj) )
182  pObj->Value = Gia_ManHashXor( pNew, Gia_ObjFanin0Copy(pObj), Gia_ObjFanin1Copy(pObj) );
183  else
184  pObj->Value = Gia_ManHashAnd( pNew, Gia_ObjFanin0Copy(pObj), Gia_ObjFanin1Copy(pObj) );
185  }
186  Gia_ManHashStop( pNew );
187  Gia_ManSetRegNum( pNew, Gia_ManRegNum(p) );
188  // perform cleanup
189  pNew = Gia_ManCleanup( pTemp = pNew );
190  Gia_ManStop( pTemp );
191  return pNew;
192 }
static int Gia_ObjFanin2Copy(Gia_Man_t *p, Gia_Obj_t *pObj)
Definition: gia.h:483
void Gia_ManStop(Gia_Man_t *p)
Definition: giaMan.c:77
static int Gia_ManAppendCo(Gia_Man_t *p, int iLit0)
Definition: gia.h:703
int Gia_ManHashXor(Gia_Man_t *p, int iLit0, int iLit1)
Definition: giaHash.c:658
static int Gia_ManAppendCi(Gia_Man_t *p)
Definition: gia.h:583
unsigned * pMuxes
Definition: gia.h:104
static int Gia_ObjIsBuf(Gia_Obj_t *pObj)
Definition: gia.h:427
void Gia_ManSetRegNum(Gia_Man_t *p, int nRegs)
Definition: giaMan.c:628
Definition: gia.h:75
static int Gia_ObjIsMuxId(Gia_Man_t *p, int iObj)
Definition: gia.h:424
char * pName
Definition: gia.h:97
static int Gia_ObjFanin1Copy(Gia_Obj_t *pObj)
Definition: gia.h:482
static int Gia_ManAppendBuf(Gia_Man_t *p, int iLit)
Definition: gia.h:694
int Gia_ManHashMux(Gia_Man_t *p, int iCtrl, int iData1, int iData0)
Definition: giaHash.c:677
void Gia_ManHashStart(Gia_Man_t *p)
Definition: giaHash.c:117
char * pSpec
Definition: gia.h:98
Gia_Man_t * Gia_ManStart(int nObjsMax)
DECLARATIONS ///.
Definition: giaMan.c:52
static int Gia_ObjIsXor(Gia_Obj_t *pObj)
Definition: gia.h:423
static int Gia_ObjFanin0Copy(Gia_Obj_t *pObj)
Definition: gia.h:481
static int Gia_ObjIsCo(Gia_Obj_t *pObj)
Definition: gia.h:421
Definition: gia.h:95
static Gia_Obj_t * Gia_ManConst0(Gia_Man_t *p)
Definition: gia.h:400
#define assert(ex)
Definition: util_old.h:213
unsigned Value
Definition: gia.h:87
#define Gia_ManForEachObj1(p, pObj, i)
Definition: gia.h:986
static int Gia_ObjIsCi(Gia_Obj_t *pObj)
Definition: gia.h:420
Gia_Man_t * Gia_ManCleanup(Gia_Man_t *p)
Definition: giaScl.c:84
char * Abc_UtilStrsav(char *s)
Definition: starter.c:47
int Gia_ManHashAnd(Gia_Man_t *p, int iLit0, int iLit1)
Definition: giaHash.c:572
void Gia_ManHashStop(Gia_Man_t *p)
Definition: giaHash.c:142
static int Gia_ManRegNum(Gia_Man_t *p)
Definition: gia.h:387
int Gia_ManMuxCompare ( char **  pp1,
char **  pp2 
)

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

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 403 of file giaMuxes.c.

404 {
405  int Diff = strcmp( *pp1, *pp2 );
406  if ( Diff < 0 )
407  return 1;
408  if ( Diff > 0)
409  return -1;
410  return 0;
411 }
int strcmp()
int Gia_ManMuxCountOne ( char *  p)

Definition at line 412 of file giaMuxes.c.

413 {
414  int Count = 0;
415  for ( ; *p; p++ )
416  Count += (*p == '[');
417  return Count;
418 }
static Llb_Mgr_t * p
Definition: llb3Image.c:950
int Gia_ManMuxProfile ( Mux_Man_t p,
int  fWidth 
)

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

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 467 of file giaMuxes.c.

468 {
469  int i, Entry, Counter, Total;
470  Vec_Int_t * vVec, * vCounts;
471  vCounts = Vec_IntStart( 1000 );
472  if ( fWidth )
473  {
474  Vec_WecForEachLevelStart( p->vTops, vVec, i, 1 )
475  Vec_IntAddToEntry( vCounts, Abc_MinInt(Vec_IntSize(vVec), 999), 1 );
476  }
477  else
478  {
479  for ( i = 1; i < Vec_WecSize(p->vTops); i++ )
480  Vec_IntAddToEntry( vCounts, Abc_MinInt(atoi(Abc_NamStr(p->pNames, i)), 999), 1 );
481  }
482  Total = Vec_IntCountPositive(vCounts);
483  if ( Total == 0 )
484  return 0;
485  printf( "The distribution of MUX tree %s:\n", fWidth ? "widths" : "sizes" );
486  Counter = 0;
487  Vec_IntForEachEntry( vCounts, Entry, i )
488  {
489  if ( !Entry ) continue;
490  if ( ++Counter == 12 )
491  printf( "\n" ), Counter = 0;
492  printf( " %d=%d", i, Entry );
493  }
494  printf( "\nSummary: " );
495  printf( "Max = %d ", Vec_IntFindMax(vCounts) );
496  printf( "Ave = %.2f", 1.0*Vec_IntSum(vCounts)/Total );
497  printf( "\n" );
498  Vec_IntFree( vCounts );
499  return 1;
500 }
static int Vec_IntCountPositive(Vec_Int_t *p)
Definition: vecInt.h:1175
Abc_Nam_t * pNames
Definition: giaMuxes.c:424
Vec_Wec_t * vTops
Definition: giaMuxes.c:425
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
Definition: bblif.c:37
static int Vec_WecSize(Vec_Wec_t *p)
Definition: vecWec.h:193
static int Abc_MinInt(int a, int b)
Definition: abc_global.h:239
static Vec_Int_t * Vec_IntStart(int nSize)
Definition: bblif.c:172
static void Vec_IntAddToEntry(Vec_Int_t *p, int i, int Addition)
Definition: bblif.c:302
static int Vec_IntFindMax(Vec_Int_t *p)
Definition: vecInt.h:996
else
Definition: sparse_int.h:55
static int Counter
char * Abc_NamStr(Abc_Nam_t *p, int NameId)
Definition: utilNam.c:479
static int Vec_IntSize(Vec_Int_t *p)
Definition: bblif.c:252
#define Vec_WecForEachLevelStart(vGlob, vVec, i, LevelStart)
Definition: vecWec.h:59
static int Vec_IntSum(Vec_Int_t *p)
Definition: vecInt.h:1137
static void Vec_IntFree(Vec_Int_t *p)
Definition: bblif.c:235
#define Vec_IntForEachEntry(vVec, Entry, i)
MACRO DEFINITIONS ///.
Definition: vecInt.h:54
void Gia_ManMuxProfiling ( Gia_Man_t p)

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

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 513 of file giaMuxes.c.

514 {
515  Mux_Man_t * pMan;
516  Gia_Man_t * pNew;
517  Gia_Obj_t * pObj;
518  Vec_Str_t * vStr;
519  Vec_Int_t * vFans, * vVec;
520  int i, Counter, fFound, iStructId, nDigitsId;
521  abctime clk = Abc_Clock();
522 
523  pNew = Gia_ManDupMuxes( p, 2 );
524  nDigitsId = Abc_Base10Log( Gia_ManObjNum(pNew) );
525 
526  pMan = Mux_ManAlloc( pNew );
527 
528  Gia_ManLevelNum( pNew );
529  Gia_ManCreateRefs( pNew );
530  Gia_ManForEachCo( pNew, pObj, i )
531  Gia_ObjRefFanin0Inc( pNew, pObj );
532 
533  vStr = Vec_StrAlloc( 1000 );
534  vFans = Gia_ManFirstFanouts( pNew );
535  Gia_ManForEachMux( pNew, pObj, i )
536  {
537  // skip MUXes in the middle of the tree (which have only one MUX fanout)
538  if ( Gia_ObjRefNumId(pNew, i) == 1 && Gia_ObjIsMuxId(pNew, Vec_IntEntry(vFans, i)) )
539  continue;
540  // this node is the root of the MUX structure - create hash key
541  Counter = Gia_MuxStructDump( pNew, i, vStr, 3, nDigitsId );
542  if ( Counter == 1 )
543  continue;
544  iStructId = Abc_NamStrFindOrAdd( pMan->pNames, Vec_StrArray(vStr), &fFound );
545  if ( !fFound )
546  Vec_WecPushLevel( pMan->vTops );
547  assert( Abc_NamObjNumMax(pMan->pNames) == Vec_WecSize(pMan->vTops) );
548  Vec_IntPush( Vec_WecEntry(pMan->vTops, iStructId), i );
549  }
550  Vec_StrFree( vStr );
551  Vec_IntFree( vFans );
552 
553  printf( "MUX structure profile for AIG \"%s\":\n", p->pName );
554  printf( "Total MUXes = %d. Total trees = %d. Unique trees = %d. Memory = %.2f MB ",
555  Gia_ManMuxNum(pNew), Vec_WecSizeSize(pMan->vTops), Vec_WecSize(pMan->vTops)-1,
556  1.0*Abc_NamMemUsed(pMan->pNames)/(1<<20) );
557  Abc_PrintTime( 1, "Time", Abc_Clock() - clk );
558 
559  if ( Gia_ManMuxProfile(pMan, 0) )
560  {
561  Gia_ManMuxProfile( pMan, 1 );
562 
563  // short the first ones
564  printf( "The first %d structures: \n", 10 );
565  Vec_WecForEachLevelStartStop( pMan->vTops, vVec, i, 1, Abc_MinInt(Vec_WecSize(pMan->vTops), 10) )
566  {
567  char * pTemp = Abc_NamStr(pMan->pNames, i);
568  printf( "%5d : ", i );
569  printf( "Occur = %4d ", Vec_IntSize(vVec) );
570  printf( "Size = %4d ", atoi(pTemp) );
571  printf( "%s\n", pTemp );
572  }
573 
574  // print trees for the first one
575  Counter = 0;
576  Vec_WecForEachLevelStart( pMan->vTops, vVec, i, 1 )
577  {
578  char * pTemp = Abc_NamStr(pMan->pNames, i);
579  if ( Vec_IntSize(vVec) > 5 && atoi(pTemp) > 5 )
580  {
581  int k, Entry;
582  printf( "For example, structure %d has %d MUXes and bit-width %d:\n", i, atoi(pTemp), Vec_IntSize(vVec) );
583  Vec_IntForEachEntry( vVec, Entry, k )
584  Gia_MuxStructPrint( pNew, Entry );
585  if ( ++Counter == 5 )
586  break;
587  }
588  }
589  }
590 
591  Mux_ManFree( pMan );
592  Gia_ManStop( pNew );
593 }
void Gia_ManCreateRefs(Gia_Man_t *p)
Definition: giaUtil.c:715
static void Gia_ObjRefFanin0Inc(Gia_Man_t *p, Gia_Obj_t *pObj)
Definition: gia.h:524
static int Gia_ManMuxNum(Gia_Man_t *p)
Definition: gia.h:391
Abc_Nam_t * pNames
Definition: giaMuxes.c:424
Vec_Wec_t * vTops
Definition: giaMuxes.c:425
int Gia_MuxStructDump(Gia_Man_t *p, int iObj, Vec_Str_t *vStr, int nDigitsNum, int nDigitsId)
Definition: giaMuxes.c:378
void Gia_ManStop(Gia_Man_t *p)
Definition: giaMan.c:77
#define Gia_ManForEachCo(p, pObj, i)
Definition: gia.h:1022
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
Definition: bblif.c:37
static char * Vec_StrArray(Vec_Str_t *p)
Definition: vecStr.h:272
Vec_Int_t * Gia_ManFirstFanouts(Gia_Man_t *p)
Definition: giaUtil.c:1635
int Abc_NamObjNumMax(Abc_Nam_t *p)
Definition: utilNam.c:186
static Vec_Int_t * Vec_WecPushLevel(Vec_Wec_t *p)
Definition: vecWec.h:284
static int Gia_ObjRefNumId(Gia_Man_t *p, int Id)
Definition: gia.h:518
int Abc_NamStrFindOrAdd(Abc_Nam_t *p, char *pStr, int *pfFound)
Definition: utilNam.c:392
static Vec_Str_t * Vec_StrAlloc(int nCap)
Definition: bblif.c:495
static abctime Abc_Clock()
Definition: abc_global.h:279
Definition: gia.h:75
static int Vec_WecSize(Vec_Wec_t *p)
Definition: vecWec.h:193
#define Gia_ManForEachMux(p, pObj, i)
Definition: gia.h:1014
int Gia_ManMuxProfile(Mux_Man_t *p, int fWidth)
Definition: giaMuxes.c:467
static void Abc_PrintTime(int level, const char *pStr, abctime time)
Definition: abc_global.h:367
#define Vec_WecForEachLevelStartStop(vGlob, vVec, i, LevelStart, LevelStop)
Definition: vecWec.h:63
static int Abc_MinInt(int a, int b)
Definition: abc_global.h:239
static int Gia_ObjIsMuxId(Gia_Man_t *p, int iObj)
Definition: gia.h:424
char * pName
Definition: gia.h:97
void Gia_MuxStructPrint(Gia_Man_t *p, int iObj)
Definition: giaMuxes.c:327
int Abc_NamMemUsed(Abc_Nam_t *p)
Definition: utilNam.c:202
static void Vec_StrFree(Vec_Str_t *p)
Definition: bblif.c:616
static int Vec_IntEntry(Vec_Int_t *p, int i)
Definition: bblif.c:268
static int Abc_Base10Log(unsigned n)
Definition: abc_global.h:252
if(last==0)
Definition: sparse_int.h:34
static void Vec_IntPush(Vec_Int_t *p, int Entry)
Definition: bblif.c:468
static int Counter
char * Abc_NamStr(Abc_Nam_t *p, int NameId)
Definition: utilNam.c:479
static Vec_Int_t * Vec_WecEntry(Vec_Wec_t *p, int i)
Definition: vecWec.h:142
static int Vec_IntSize(Vec_Int_t *p)
Definition: bblif.c:252
#define Vec_WecForEachLevelStart(vGlob, vVec, i, LevelStart)
Definition: vecWec.h:59
Mux_Man_t * Mux_ManAlloc(Gia_Man_t *pGia)
Definition: giaMuxes.c:439
Definition: gia.h:95
Gia_Man_t * Gia_ManDupMuxes(Gia_Man_t *p, int Limit)
Definition: giaMuxes.c:96
#define assert(ex)
Definition: util_old.h:213
int Gia_ManLevelNum(Gia_Man_t *p)
Definition: giaUtil.c:505
void Mux_ManFree(Mux_Man_t *p)
Definition: giaMuxes.c:449
static void Vec_IntFree(Vec_Int_t *p)
Definition: bblif.c:235
ABC_INT64_T abctime
Definition: abc_global.h:278
#define Vec_IntForEachEntry(vVec, Entry, i)
MACRO DEFINITIONS ///.
Definition: vecInt.h:54
static int Gia_ManObjNum(Gia_Man_t *p)
Definition: gia.h:388
static int Vec_WecSizeSize(Vec_Wec_t *p)
Definition: vecWec.h:202
void Gia_ManPrintMuxStats ( Gia_Man_t p)

Definition at line 61 of file giaMuxes.c.

62 {
63  int nAnds, nMuxes, nXors, nTotal;
64  if ( p->pMuxes )
65  {
67  nXors = Gia_ManXorNum(p);
68  nMuxes = Gia_ManMuxNum(p);
69  nTotal = nAnds + 3*nXors + 3*nMuxes;
70  }
71  else
72  {
73  Gia_ManCountMuxXor( p, &nMuxes, &nXors );
74  nAnds = Gia_ManAndNotBufNum(p) - 3*nMuxes - 3*nXors;
75  nTotal = Gia_ManAndNotBufNum(p);
76  }
77  Abc_Print( 1, "stats: " );
78  Abc_Print( 1, "xor =%8d %6.2f %% ", nXors, 300.0*nXors/nTotal );
79  Abc_Print( 1, "mux =%8d %6.2f %% ", nMuxes, 300.0*nMuxes/nTotal );
80  Abc_Print( 1, "and =%8d %6.2f %% ", nAnds, 100.0*nAnds/nTotal );
81  Abc_Print( 1, "obj =%8d ", Gia_ManAndNotBufNum(p) );
82  fflush( stdout );
83 }
static int Gia_ManMuxNum(Gia_Man_t *p)
Definition: gia.h:391
unsigned * pMuxes
Definition: gia.h:104
static int Gia_ManAndNotBufNum(Gia_Man_t *p)
Definition: gia.h:393
ABC_NAMESPACE_IMPL_START void Gia_ManCountMuxXor(Gia_Man_t *p, int *pnMuxes, int *pnXors)
DECLARATIONS ///.
Definition: giaMuxes.c:47
static int nMuxes
Definition: abcSat.c:36
static int Gia_ManXorNum(Gia_Man_t *p)
Definition: gia.h:390
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
int nTotal
DECLARATIONS ///.
Definition: cutTruth.c:37
int Gia_MuxDeref ( Gia_Man_t p,
int  iObj 
)

Definition at line 262 of file giaMuxes.c.

263 {
264  Gia_Obj_t * pObj = Gia_ManObj( p, iObj );
265  assert( Gia_ObjIsMuxId(p, iObj) );
266  return Gia_MuxDeref_rec( p, Gia_ObjFaninId0p(p, pObj) ) +
267  Gia_MuxDeref_rec( p, Gia_ObjFaninId1p(p, pObj) ) +
268  Gia_MuxDeref_rec( p, Gia_ObjFaninId2p(p, pObj) ) + 1;
269 }
int Gia_MuxDeref_rec(Gia_Man_t *p, int iObj)
Definition: giaMuxes.c:250
static int Gia_ObjFaninId1p(Gia_Man_t *p, Gia_Obj_t *pObj)
Definition: gia.h:464
static Gia_Obj_t * Gia_ManObj(Gia_Man_t *p, int v)
Definition: gia.h:402
Definition: gia.h:75
static int Gia_ObjIsMuxId(Gia_Man_t *p, int iObj)
Definition: gia.h:424
static int Gia_ObjFaninId0p(Gia_Man_t *p, Gia_Obj_t *pObj)
Definition: gia.h:463
static int Gia_ObjFaninId2p(Gia_Man_t *p, Gia_Obj_t *pObj)
Definition: gia.h:465
#define assert(ex)
Definition: util_old.h:213
int Gia_MuxDeref_rec ( Gia_Man_t p,
int  iObj 
)

Definition at line 250 of file giaMuxes.c.

251 {
252  Gia_Obj_t * pObj;
253  if ( !Gia_ObjIsMuxId(p, iObj) )
254  return 0;
255  pObj = Gia_ManObj( p, iObj );
256  if ( Gia_ObjRefDec(p, pObj) )
257  return 0;
258  return Gia_MuxDeref_rec( p, Gia_ObjFaninId0p(p, pObj) ) +
259  Gia_MuxDeref_rec( p, Gia_ObjFaninId1p(p, pObj) ) +
260  Gia_MuxDeref_rec( p, Gia_ObjFaninId2p(p, pObj) ) + 1;
261 }
int Gia_MuxDeref_rec(Gia_Man_t *p, int iObj)
Definition: giaMuxes.c:250
static int Gia_ObjFaninId1p(Gia_Man_t *p, Gia_Obj_t *pObj)
Definition: gia.h:464
static Gia_Obj_t * Gia_ManObj(Gia_Man_t *p, int v)
Definition: gia.h:402
Definition: gia.h:75
static int Gia_ObjIsMuxId(Gia_Man_t *p, int iObj)
Definition: gia.h:424
static int Gia_ObjRefDec(Gia_Man_t *p, Gia_Obj_t *pObj)
Definition: gia.h:523
static int Gia_ObjFaninId0p(Gia_Man_t *p, Gia_Obj_t *pObj)
Definition: gia.h:463
static int Gia_ObjFaninId2p(Gia_Man_t *p, Gia_Obj_t *pObj)
Definition: gia.h:465
int Gia_MuxMffcSize ( Gia_Man_t p,
int  iObj 
)

Definition at line 270 of file giaMuxes.c.

271 {
272  int Count1, Count2;
273  if ( !Gia_ObjIsMuxId(p, iObj) )
274  return 0;
275  Count1 = Gia_MuxDeref( p, iObj );
276  Count2 = Gia_MuxRef( p, iObj );
277  assert( Count1 == Count2 );
278  return Count1;
279 }
int Gia_MuxDeref(Gia_Man_t *p, int iObj)
Definition: giaMuxes.c:262
static int Gia_ObjIsMuxId(Gia_Man_t *p, int iObj)
Definition: gia.h:424
int Gia_MuxRef(Gia_Man_t *p, int iObj)
Definition: giaMuxes.c:242
#define assert(ex)
Definition: util_old.h:213
int Gia_MuxRef ( Gia_Man_t p,
int  iObj 
)

Definition at line 242 of file giaMuxes.c.

243 {
244  Gia_Obj_t * pObj = Gia_ManObj( p, iObj );
245  assert( Gia_ObjIsMuxId(p, iObj) );
246  return Gia_MuxRef_rec( p, Gia_ObjFaninId0p(p, pObj) ) +
247  Gia_MuxRef_rec( p, Gia_ObjFaninId1p(p, pObj) ) +
248  Gia_MuxRef_rec( p, Gia_ObjFaninId2p(p, pObj) ) + 1;
249 }
static int Gia_ObjFaninId1p(Gia_Man_t *p, Gia_Obj_t *pObj)
Definition: gia.h:464
static Gia_Obj_t * Gia_ManObj(Gia_Man_t *p, int v)
Definition: gia.h:402
Definition: gia.h:75
static int Gia_ObjIsMuxId(Gia_Man_t *p, int iObj)
Definition: gia.h:424
static int Gia_ObjFaninId0p(Gia_Man_t *p, Gia_Obj_t *pObj)
Definition: gia.h:463
static int Gia_ObjFaninId2p(Gia_Man_t *p, Gia_Obj_t *pObj)
Definition: gia.h:465
#define assert(ex)
Definition: util_old.h:213
int Gia_MuxRef_rec(Gia_Man_t *p, int iObj)
Definition: giaMuxes.c:230
int Gia_MuxRef_rec ( Gia_Man_t p,
int  iObj 
)

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

Synopsis [Returns the size of MUX structure.]

Description []

SideEffects []

SeeAlso []

Definition at line 230 of file giaMuxes.c.

231 {
232  Gia_Obj_t * pObj;
233  if ( !Gia_ObjIsMuxId(p, iObj) )
234  return 0;
235  pObj = Gia_ManObj( p, iObj );
236  if ( Gia_ObjRefInc(p, pObj) )
237  return 0;
238  return Gia_MuxRef_rec( p, Gia_ObjFaninId0p(p, pObj) ) +
239  Gia_MuxRef_rec( p, Gia_ObjFaninId1p(p, pObj) ) +
240  Gia_MuxRef_rec( p, Gia_ObjFaninId2p(p, pObj) ) + 1;
241 }
static int Gia_ObjFaninId1p(Gia_Man_t *p, Gia_Obj_t *pObj)
Definition: gia.h:464
static Gia_Obj_t * Gia_ManObj(Gia_Man_t *p, int v)
Definition: gia.h:402
Definition: gia.h:75
static int Gia_ObjIsMuxId(Gia_Man_t *p, int iObj)
Definition: gia.h:424
static int Gia_ObjRefInc(Gia_Man_t *p, Gia_Obj_t *pObj)
Definition: gia.h:522
static int Gia_ObjFaninId0p(Gia_Man_t *p, Gia_Obj_t *pObj)
Definition: gia.h:463
static int Gia_ObjFaninId2p(Gia_Man_t *p, Gia_Obj_t *pObj)
Definition: gia.h:465
int Gia_MuxRef_rec(Gia_Man_t *p, int iObj)
Definition: giaMuxes.c:230
int Gia_MuxStructDump ( Gia_Man_t p,
int  iObj,
Vec_Str_t vStr,
int  nDigitsNum,
int  nDigitsId 
)

Definition at line 378 of file giaMuxes.c.

379 {
380  int Count1, Count2;
381  assert( Gia_ObjIsMuxId(p, iObj) );
382  Count1 = Gia_MuxDeref( p, iObj );
383  Vec_StrClear( vStr );
384  Vec_StrPrintNumStar( vStr, Count1, nDigitsNum );
385  Gia_MuxStructDump_rec( p, iObj, 1, vStr, nDigitsId );
386  Vec_StrPush( vStr, '\0' );
387  Count2 = Gia_MuxRef( p, iObj );
388  assert( Count1 == Count2 );
389  return Count1;
390 }
void Gia_MuxStructDump_rec(Gia_Man_t *p, int iObj, int fFirst, Vec_Str_t *vStr, int nDigitsId)
Definition: giaMuxes.c:349
static void Vec_StrClear(Vec_Str_t *p)
Definition: vecStr.h:519
static void Vec_StrPush(Vec_Str_t *p, char Entry)
Definition: vecStr.h:535
int Gia_MuxDeref(Gia_Man_t *p, int iObj)
Definition: giaMuxes.c:262
static int Gia_ObjIsMuxId(Gia_Man_t *p, int iObj)
Definition: gia.h:424
static void Vec_StrPrintNumStar(Vec_Str_t *p, int Num, int nDigits)
Definition: vecStr.h:594
int Gia_MuxRef(Gia_Man_t *p, int iObj)
Definition: giaMuxes.c:242
#define assert(ex)
Definition: util_old.h:213
void Gia_MuxStructDump_rec ( Gia_Man_t p,
int  iObj,
int  fFirst,
Vec_Str_t vStr,
int  nDigitsId 
)

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

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 349 of file giaMuxes.c.

350 {
351  Gia_Obj_t * pObj = Gia_ManObj( p, iObj );
352  int iCtrl;
353  if ( !fFirst && (!Gia_ObjIsMuxId(p, iObj) || Gia_ObjRefNumId(p, iObj) > 0) )
354  return;
355  iCtrl = Gia_ObjFaninId2p(p, pObj);
356  Vec_StrPush( vStr, '[' );
357  Vec_StrPush( vStr, '(' );
358  if ( Gia_ObjIsMuxId(p, iCtrl) && Gia_ObjRefNumId(p, iCtrl) == 0 )
359  Gia_MuxStructDump_rec( p, iCtrl, 0, vStr, nDigitsId );
360  else
361  Vec_StrPrintNumStar( vStr, iCtrl, nDigitsId );
362  Vec_StrPush( vStr, ')' );
363  if ( Gia_ObjFaninC2(p, pObj) )
364  {
365  Gia_MuxStructDump_rec( p, Gia_ObjFaninId0p(p, pObj), 0, vStr, nDigitsId );
366  Vec_StrPush( vStr, '|' );
367  Gia_MuxStructDump_rec( p, Gia_ObjFaninId1p(p, pObj), 0, vStr, nDigitsId );
368  Vec_StrPush( vStr, ']' );
369  }
370  else
371  {
372  Gia_MuxStructDump_rec( p, Gia_ObjFaninId1p(p, pObj), 0, vStr, nDigitsId );
373  Vec_StrPush( vStr, '|' );
374  Gia_MuxStructDump_rec( p, Gia_ObjFaninId0p(p, pObj), 0, vStr, nDigitsId );
375  Vec_StrPush( vStr, ']' );
376  }
377 }
static int Gia_ObjFaninC2(Gia_Man_t *p, Gia_Obj_t *pObj)
Definition: gia.h:453
void Gia_MuxStructDump_rec(Gia_Man_t *p, int iObj, int fFirst, Vec_Str_t *vStr, int nDigitsId)
Definition: giaMuxes.c:349
static int Gia_ObjRefNumId(Gia_Man_t *p, int Id)
Definition: gia.h:518
static int Gia_ObjFaninId1p(Gia_Man_t *p, Gia_Obj_t *pObj)
Definition: gia.h:464
static void Vec_StrPush(Vec_Str_t *p, char Entry)
Definition: vecStr.h:535
static Gia_Obj_t * Gia_ManObj(Gia_Man_t *p, int v)
Definition: gia.h:402
Definition: gia.h:75
static int Gia_ObjIsMuxId(Gia_Man_t *p, int iObj)
Definition: gia.h:424
static void Vec_StrPrintNumStar(Vec_Str_t *p, int Num, int nDigits)
Definition: vecStr.h:594
static int Gia_ObjFaninId0p(Gia_Man_t *p, Gia_Obj_t *pObj)
Definition: gia.h:463
static int Gia_ObjFaninId2p(Gia_Man_t *p, Gia_Obj_t *pObj)
Definition: gia.h:465
void Gia_MuxStructPrint ( Gia_Man_t p,
int  iObj 
)

Definition at line 327 of file giaMuxes.c.

328 {
329  int Count1, Count2;
330  assert( Gia_ObjIsMuxId(p, iObj) );
331  Count1 = Gia_MuxDeref( p, iObj );
332  Gia_MuxStructPrint_rec( p, iObj, 1 );
333  Count2 = Gia_MuxRef( p, iObj );
334  assert( Count1 == Count2 );
335  printf( "\n" );
336 }
void Gia_MuxStructPrint_rec(Gia_Man_t *p, int iObj, int fFirst)
Definition: giaMuxes.c:292
int Gia_MuxDeref(Gia_Man_t *p, int iObj)
Definition: giaMuxes.c:262
static int Gia_ObjIsMuxId(Gia_Man_t *p, int iObj)
Definition: gia.h:424
int Gia_MuxRef(Gia_Man_t *p, int iObj)
Definition: giaMuxes.c:242
#define assert(ex)
Definition: util_old.h:213
void Gia_MuxStructPrint_rec ( Gia_Man_t p,
int  iObj,
int  fFirst 
)

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

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 292 of file giaMuxes.c.

293 {
294  Gia_Obj_t * pObj = Gia_ManObj( p, iObj );
295  int iCtrl;
296  if ( !fFirst && (!Gia_ObjIsMuxId(p, iObj) || Gia_ObjRefNumId(p, iObj) > 0) )
297  {
298 // printf( "%d", iObj );
299  printf( "<%02d>", Gia_ObjLevelId(p, iObj) );
300  return;
301  }
302  iCtrl = Gia_ObjFaninId2p(p, pObj);
303  printf( " [(" );
304  if ( Gia_ObjIsMuxId(p, iCtrl) && Gia_ObjRefNumId(p, iCtrl) == 0 )
305  Gia_MuxStructPrint_rec( p, iCtrl, 0 );
306  else
307  {
308  printf( "%d", iCtrl );
309  printf( "<%d>", Gia_ObjLevelId(p, iCtrl) );
310  }
311  printf( ")" );
312  if ( Gia_ObjFaninC2(p, pObj) )
313  {
314  Gia_MuxStructPrint_rec( p, Gia_ObjFaninId0p(p, pObj), 0 );
315  printf( "|" );
316  Gia_MuxStructPrint_rec( p, Gia_ObjFaninId1p(p, pObj), 0 );
317  printf( "]" );
318  }
319  else
320  {
321  Gia_MuxStructPrint_rec( p, Gia_ObjFaninId1p(p, pObj), 0 );
322  printf( "|" );
323  Gia_MuxStructPrint_rec( p, Gia_ObjFaninId0p(p, pObj), 0 );
324  printf( "]" );
325  }
326 }
static int Gia_ObjLevelId(Gia_Man_t *p, int Id)
Definition: gia.h:500
static int Gia_ObjFaninC2(Gia_Man_t *p, Gia_Obj_t *pObj)
Definition: gia.h:453
static int Gia_ObjRefNumId(Gia_Man_t *p, int Id)
Definition: gia.h:518
void Gia_MuxStructPrint_rec(Gia_Man_t *p, int iObj, int fFirst)
Definition: giaMuxes.c:292
static int Gia_ObjFaninId1p(Gia_Man_t *p, Gia_Obj_t *pObj)
Definition: gia.h:464
static Gia_Obj_t * Gia_ManObj(Gia_Man_t *p, int v)
Definition: gia.h:402
Definition: gia.h:75
static int Gia_ObjIsMuxId(Gia_Man_t *p, int iObj)
Definition: gia.h:424
static int Gia_ObjFaninId0p(Gia_Man_t *p, Gia_Obj_t *pObj)
Definition: gia.h:463
static int Gia_ObjFaninId2p(Gia_Man_t *p, Gia_Obj_t *pObj)
Definition: gia.h:465
Mux_Man_t* Mux_ManAlloc ( Gia_Man_t pGia)

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

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 439 of file giaMuxes.c.

440 {
441  Mux_Man_t * p;
442  p = ABC_CALLOC( Mux_Man_t, 1 );
443  p->pGia = pGia;
444  p->pNames = Abc_NamStart( 10000, 50 );
445  p->vTops = Vec_WecAlloc( 1000 );
446  Vec_WecPushLevel( p->vTops );
447  return p;
448 }
Abc_Nam_t * pNames
Definition: giaMuxes.c:424
static Vec_Wec_t * Vec_WecAlloc(int nCap)
FUNCTION DEFINITIONS ///.
Definition: vecWec.h:87
Vec_Wec_t * vTops
Definition: giaMuxes.c:425
static Llb_Mgr_t * p
Definition: llb3Image.c:950
static Vec_Int_t * Vec_WecPushLevel(Vec_Wec_t *p)
Definition: vecWec.h:284
Abc_Nam_t * Abc_NamStart(int nObjs, int nAveSize)
FUNCTION DEFINITIONS ///.
Definition: utilNam.c:78
Gia_Man_t * pGia
Definition: giaMuxes.c:423
#define ABC_CALLOC(type, num)
Definition: abc_global.h:230
void Mux_ManFree ( Mux_Man_t p)

Definition at line 449 of file giaMuxes.c.

450 {
451  Abc_NamStop( p->pNames );
452  Vec_WecFree( p->vTops );
453  ABC_FREE( p );
454 }
Abc_Nam_t * pNames
Definition: giaMuxes.c:424
void Abc_NamStop(Abc_Nam_t *p)
Definition: utilNam.c:110
Vec_Wec_t * vTops
Definition: giaMuxes.c:425
static void Vec_WecFree(Vec_Wec_t *p)
Definition: vecWec.h:345
#define ABC_FREE(obj)
Definition: abc_global.h:232