Commit a1cdcb0b by Alan Mishchenko

Updating code to support barrier buffers.

parent e5b9817a
...@@ -107,6 +107,7 @@ struct Aig_Man_t_ ...@@ -107,6 +107,7 @@ struct Aig_Man_t_
int nTruePos; // the number of true primary outputs int nTruePos; // the number of true primary outputs
int nAsserts; // the number of asserts among POs (asserts are first POs) int nAsserts; // the number of asserts among POs (asserts are first POs)
int nConstrs; // the number of constraints (model checking only) int nConstrs; // the number of constraints (model checking only)
int nBarBufs; // the number of barrier buffers
// AIG node counters // AIG node counters
int nObjs[AIG_OBJ_VOID];// the number of objects by type int nObjs[AIG_OBJ_VOID];// the number of objects by type
int nDeleted; // the number of deleted objects int nDeleted; // the number of deleted objects
......
...@@ -55,6 +55,7 @@ Aig_Man_t * Aig_ManDupSimple( Aig_Man_t * p ) ...@@ -55,6 +55,7 @@ Aig_Man_t * Aig_ManDupSimple( Aig_Man_t * p )
pNew->pSpec = Abc_UtilStrsav( p->pSpec ); pNew->pSpec = Abc_UtilStrsav( p->pSpec );
pNew->nAsserts = p->nAsserts; pNew->nAsserts = p->nAsserts;
pNew->nConstrs = p->nConstrs; pNew->nConstrs = p->nConstrs;
pNew->nBarBufs = p->nBarBufs;
if ( p->vFlopNums ) if ( p->vFlopNums )
pNew->vFlopNums = Vec_IntDup( p->vFlopNums ); pNew->vFlopNums = Vec_IntDup( p->vFlopNums );
// create the PIs // create the PIs
...@@ -192,6 +193,7 @@ Aig_Man_t * Aig_ManDupSimpleDfs( Aig_Man_t * p ) ...@@ -192,6 +193,7 @@ Aig_Man_t * Aig_ManDupSimpleDfs( Aig_Man_t * p )
pNew->pSpec = Abc_UtilStrsav( p->pSpec ); pNew->pSpec = Abc_UtilStrsav( p->pSpec );
pNew->nAsserts = p->nAsserts; pNew->nAsserts = p->nAsserts;
pNew->nConstrs = p->nConstrs; pNew->nConstrs = p->nConstrs;
pNew->nBarBufs = p->nBarBufs;
if ( p->vFlopNums ) if ( p->vFlopNums )
pNew->vFlopNums = Vec_IntDup( p->vFlopNums ); pNew->vFlopNums = Vec_IntDup( p->vFlopNums );
// create the PIs // create the PIs
...@@ -283,6 +285,7 @@ Aig_Man_t * Aig_ManDupOrdered( Aig_Man_t * p ) ...@@ -283,6 +285,7 @@ Aig_Man_t * Aig_ManDupOrdered( Aig_Man_t * p )
pNew->pSpec = Abc_UtilStrsav( p->pSpec ); pNew->pSpec = Abc_UtilStrsav( p->pSpec );
pNew->nAsserts = p->nAsserts; pNew->nAsserts = p->nAsserts;
pNew->nConstrs = p->nConstrs; pNew->nConstrs = p->nConstrs;
pNew->nBarBufs = p->nBarBufs;
if ( p->vFlopNums ) if ( p->vFlopNums )
pNew->vFlopNums = Vec_IntDup( p->vFlopNums ); pNew->vFlopNums = Vec_IntDup( p->vFlopNums );
// create the PIs // create the PIs
...@@ -351,6 +354,7 @@ Aig_Man_t * Aig_ManDupCof( Aig_Man_t * p, int iInput, int Value ) ...@@ -351,6 +354,7 @@ Aig_Man_t * Aig_ManDupCof( Aig_Man_t * p, int iInput, int Value )
pNew->pSpec = Abc_UtilStrsav( p->pSpec ); pNew->pSpec = Abc_UtilStrsav( p->pSpec );
pNew->nAsserts = p->nAsserts; pNew->nAsserts = p->nAsserts;
pNew->nConstrs = p->nConstrs; pNew->nConstrs = p->nConstrs;
pNew->nBarBufs = p->nBarBufs;
if ( p->vFlopNums ) if ( p->vFlopNums )
pNew->vFlopNums = Vec_IntDup( p->vFlopNums ); pNew->vFlopNums = Vec_IntDup( p->vFlopNums );
// create the PIs // create the PIs
...@@ -416,6 +420,7 @@ Aig_Man_t * Aig_ManDupTrim( Aig_Man_t * p ) ...@@ -416,6 +420,7 @@ Aig_Man_t * Aig_ManDupTrim( Aig_Man_t * p )
pNew->pName = Abc_UtilStrsav( p->pName ); pNew->pName = Abc_UtilStrsav( p->pName );
pNew->pSpec = Abc_UtilStrsav( p->pSpec ); pNew->pSpec = Abc_UtilStrsav( p->pSpec );
pNew->nConstrs = p->nConstrs; pNew->nConstrs = p->nConstrs;
pNew->nBarBufs = p->nBarBufs;
// create the PIs // create the PIs
Aig_ManCleanData( p ); Aig_ManCleanData( p );
// duplicate internal nodes // duplicate internal nodes
...@@ -466,6 +471,7 @@ Aig_Man_t * Aig_ManDupExor( Aig_Man_t * p ) ...@@ -466,6 +471,7 @@ Aig_Man_t * Aig_ManDupExor( Aig_Man_t * p )
pNew->pSpec = Abc_UtilStrsav( p->pSpec ); pNew->pSpec = Abc_UtilStrsav( p->pSpec );
pNew->nAsserts = p->nAsserts; pNew->nAsserts = p->nAsserts;
pNew->nConstrs = p->nConstrs; pNew->nConstrs = p->nConstrs;
pNew->nBarBufs = p->nBarBufs;
if ( p->vFlopNums ) if ( p->vFlopNums )
pNew->vFlopNums = Vec_IntDup( p->vFlopNums ); pNew->vFlopNums = Vec_IntDup( p->vFlopNums );
// create the PIs // create the PIs
...@@ -565,6 +571,7 @@ Aig_Man_t * Aig_ManDupDfs( Aig_Man_t * p ) ...@@ -565,6 +571,7 @@ Aig_Man_t * Aig_ManDupDfs( Aig_Man_t * p )
pNew->pSpec = Abc_UtilStrsav( p->pSpec ); pNew->pSpec = Abc_UtilStrsav( p->pSpec );
pNew->nAsserts = p->nAsserts; pNew->nAsserts = p->nAsserts;
pNew->nConstrs = p->nConstrs; pNew->nConstrs = p->nConstrs;
pNew->nBarBufs = p->nBarBufs;
if ( p->vFlopNums ) if ( p->vFlopNums )
pNew->vFlopNums = Vec_IntDup( p->vFlopNums ); pNew->vFlopNums = Vec_IntDup( p->vFlopNums );
// duplicate representation of choice nodes // duplicate representation of choice nodes
...@@ -695,6 +702,7 @@ Aig_Man_t * Aig_ManDupDfsGuided( Aig_Man_t * p, Vec_Ptr_t * vPios ) ...@@ -695,6 +702,7 @@ Aig_Man_t * Aig_ManDupDfsGuided( Aig_Man_t * p, Vec_Ptr_t * vPios )
pNew->pSpec = Abc_UtilStrsav( p->pSpec ); pNew->pSpec = Abc_UtilStrsav( p->pSpec );
pNew->nAsserts = p->nAsserts; pNew->nAsserts = p->nAsserts;
pNew->nConstrs = p->nConstrs; pNew->nConstrs = p->nConstrs;
pNew->nBarBufs = p->nBarBufs;
if ( p->vFlopNums ) if ( p->vFlopNums )
pNew->vFlopNums = Vec_IntDup( p->vFlopNums ); pNew->vFlopNums = Vec_IntDup( p->vFlopNums );
// duplicate representation of choice nodes // duplicate representation of choice nodes
...@@ -764,6 +772,7 @@ Aig_Man_t * Aig_ManDupLevelized( Aig_Man_t * p ) ...@@ -764,6 +772,7 @@ Aig_Man_t * Aig_ManDupLevelized( Aig_Man_t * p )
pNew->pSpec = Abc_UtilStrsav( p->pSpec ); pNew->pSpec = Abc_UtilStrsav( p->pSpec );
pNew->nAsserts = p->nAsserts; pNew->nAsserts = p->nAsserts;
pNew->nConstrs = p->nConstrs; pNew->nConstrs = p->nConstrs;
pNew->nBarBufs = p->nBarBufs;
if ( p->vFlopNums ) if ( p->vFlopNums )
pNew->vFlopNums = Vec_IntDup( p->vFlopNums ); pNew->vFlopNums = Vec_IntDup( p->vFlopNums );
// duplicate representation of choice nodes // duplicate representation of choice nodes
...@@ -918,6 +927,7 @@ Aig_Man_t * Aig_ManDupRepres( Aig_Man_t * p ) ...@@ -918,6 +927,7 @@ Aig_Man_t * Aig_ManDupRepres( Aig_Man_t * p )
pNew->pName = Abc_UtilStrsav( p->pName ); pNew->pName = Abc_UtilStrsav( p->pName );
pNew->pSpec = Abc_UtilStrsav( p->pSpec ); pNew->pSpec = Abc_UtilStrsav( p->pSpec );
pNew->nConstrs = p->nConstrs; pNew->nConstrs = p->nConstrs;
pNew->nBarBufs = p->nBarBufs;
if ( p->vFlopNums ) if ( p->vFlopNums )
pNew->vFlopNums = Vec_IntDup( p->vFlopNums ); pNew->vFlopNums = Vec_IntDup( p->vFlopNums );
// map the const and primary inputs // map the const and primary inputs
...@@ -992,6 +1002,7 @@ Aig_Man_t * Aig_ManDupRepresDfs( Aig_Man_t * p ) ...@@ -992,6 +1002,7 @@ Aig_Man_t * Aig_ManDupRepresDfs( Aig_Man_t * p )
pNew->pName = Abc_UtilStrsav( p->pName ); pNew->pName = Abc_UtilStrsav( p->pName );
pNew->pSpec = Abc_UtilStrsav( p->pSpec ); pNew->pSpec = Abc_UtilStrsav( p->pSpec );
pNew->nConstrs = p->nConstrs; pNew->nConstrs = p->nConstrs;
pNew->nBarBufs = p->nBarBufs;
if ( p->vFlopNums ) if ( p->vFlopNums )
pNew->vFlopNums = Vec_IntDup( p->vFlopNums ); pNew->vFlopNums = Vec_IntDup( p->vFlopNums );
// map the const and primary inputs // map the const and primary inputs
......
...@@ -274,6 +274,7 @@ Aig_Man_t * Aig_ManDupRepr( Aig_Man_t * p, int fOrdered ) ...@@ -274,6 +274,7 @@ Aig_Man_t * Aig_ManDupRepr( Aig_Man_t * p, int fOrdered )
pNew->pName = Abc_UtilStrsav( p->pName ); pNew->pName = Abc_UtilStrsav( p->pName );
pNew->pSpec = Abc_UtilStrsav( p->pSpec ); pNew->pSpec = Abc_UtilStrsav( p->pSpec );
pNew->nConstrs = p->nConstrs; pNew->nConstrs = p->nConstrs;
pNew->nBarBufs = p->nBarBufs;
if ( p->vFlopNums ) if ( p->vFlopNums )
pNew->vFlopNums = Vec_IntDup( p->vFlopNums ); pNew->vFlopNums = Vec_IntDup( p->vFlopNums );
// map the const and primary inputs // map the const and primary inputs
......
...@@ -54,6 +54,7 @@ Aig_Man_t * Aig_ManRemap( Aig_Man_t * p, Vec_Ptr_t * vMap ) ...@@ -54,6 +54,7 @@ Aig_Man_t * Aig_ManRemap( Aig_Man_t * p, Vec_Ptr_t * vMap )
pNew->pSpec = Abc_UtilStrsav( p->pSpec ); pNew->pSpec = Abc_UtilStrsav( p->pSpec );
pNew->nAsserts = p->nAsserts; pNew->nAsserts = p->nAsserts;
pNew->nConstrs = p->nConstrs; pNew->nConstrs = p->nConstrs;
pNew->nBarBufs = p->nBarBufs;
assert( p->vFlopNums == NULL || Vec_IntSize(p->vFlopNums) == p->nRegs ); assert( p->vFlopNums == NULL || Vec_IntSize(p->vFlopNums) == p->nRegs );
if ( p->vFlopNums ) if ( p->vFlopNums )
pNew->vFlopNums = Vec_IntDup( p->vFlopNums ); pNew->vFlopNums = Vec_IntDup( p->vFlopNums );
......
...@@ -508,7 +508,7 @@ static inline void Abc_ObjSetMvVar( Abc_Obj_t * pObj, void * pV) { Vec_At ...@@ -508,7 +508,7 @@ static inline void Abc_ObjSetMvVar( Abc_Obj_t * pObj, void * pV) { Vec_At
#define Abc_NtkForEachCo( pNtk, pCo, i ) \ #define Abc_NtkForEachCo( pNtk, pCo, i ) \
for ( i = 0; (i < Abc_NtkCoNum(pNtk)) && (((pCo) = Abc_NtkCo(pNtk, i)), 1); i++ ) for ( i = 0; (i < Abc_NtkCoNum(pNtk)) && (((pCo) = Abc_NtkCo(pNtk, i)), 1); i++ )
#define Abc_NtkForEachLiPo( pNtk, pCo, i ) \ #define Abc_NtkForEachLiPo( pNtk, pCo, i ) \
for ( i = 0; (i < Abc_NtkCoNum(pNtk)) && (((pCo) = Abc_NtkCo(pNtk, i < pNtk->nBarBufs ? Abc_NtkCoNum(pNtk) - pNtk->nBarBufs + i : i - pNtk->nBarBufs)), 1); i++ ) for ( i = 0; (i < Abc_NtkCoNum(pNtk)) && (((pCo) = Abc_NtkCo(pNtk, i < pNtk->nBarBufs ? Abc_NtkCoNum(pNtk) - pNtk->nBarBufs + i : i - pNtk->nBarBufs)), 1); i++ )
// fanin and fanouts // fanin and fanouts
#define Abc_ObjForEachFanin( pObj, pFanin, i ) \ #define Abc_ObjForEachFanin( pObj, pFanin, i ) \
for ( i = 0; (i < Abc_ObjFaninNum(pObj)) && (((pFanin) = Abc_ObjFanin(pObj, i)), 1); i++ ) for ( i = 0; (i < Abc_ObjFaninNum(pObj)) && (((pFanin) = Abc_ObjFanin(pObj, i)), 1); i++ )
......
...@@ -256,7 +256,7 @@ Abc_Ntk_t * Abc_NtkFromBarBufs( Abc_Ntk_t * pNtkBase, Abc_Ntk_t * pNtk ) ...@@ -256,7 +256,7 @@ Abc_Ntk_t * Abc_NtkFromBarBufs( Abc_Ntk_t * pNtkBase, Abc_Ntk_t * pNtk )
Abc_Ntk_t * pNtkNew, * pTemp; Abc_Ntk_t * pNtkNew, * pTemp;
Vec_Ptr_t * vLiMaps, * vLoMaps; Vec_Ptr_t * vLiMaps, * vLoMaps;
Abc_Obj_t * pObj, * pLiMap, * pLoMap; Abc_Obj_t * pObj, * pLiMap, * pLoMap;
int i; int i, k;
assert( pNtkBase->pDesign != NULL ); assert( pNtkBase->pDesign != NULL );
assert( Abc_NtkIsNetlist(pNtk) ); assert( Abc_NtkIsNetlist(pNtk) );
assert( Abc_NtkIsNetlist(pNtkBase) ); assert( Abc_NtkIsNetlist(pNtkBase) );
...@@ -271,8 +271,8 @@ Abc_Ntk_t * Abc_NtkFromBarBufs( Abc_Ntk_t * pNtkBase, Abc_Ntk_t * pNtk ) ...@@ -271,8 +271,8 @@ Abc_Ntk_t * Abc_NtkFromBarBufs( Abc_Ntk_t * pNtkBase, Abc_Ntk_t * pNtk )
Vec_PtrForEachEntry( Abc_Ntk_t *, pNtkBase->pDesign->vModules, pTemp, i ) Vec_PtrForEachEntry( Abc_Ntk_t *, pNtkBase->pDesign->vModules, pTemp, i )
pTemp->pCopy = Abc_NtkStartFrom( pTemp, pNtk->ntkType, pNtk->ntkFunc ); pTemp->pCopy = Abc_NtkStartFrom( pTemp, pNtk->ntkType, pNtk->ntkFunc );
// update box models // update box models
Vec_PtrForEachEntry( Abc_Ntk_t *, pNtkBase->pDesign->vTops, pTemp, i ) Vec_PtrForEachEntry( Abc_Ntk_t *, pNtkBase->pDesign->vModules, pTemp, i )
Abc_NtkForEachBox( pTemp, pObj, i ) Abc_NtkForEachBox( pTemp, pObj, k )
if ( Abc_ObjIsWhitebox(pObj) || Abc_ObjIsBlackbox(pObj) ) if ( Abc_ObjIsWhitebox(pObj) || Abc_ObjIsBlackbox(pObj) )
pObj->pCopy->pData = Abc_ObjModel(pObj)->pCopy; pObj->pCopy->pData = Abc_ObjModel(pObj)->pCopy;
// create the design // create the design
......
...@@ -158,6 +158,7 @@ Aig_Man_t * Abc_NtkToDarBmc( Abc_Ntk_t * pNtk, Vec_Int_t ** pvMap ) ...@@ -158,6 +158,7 @@ Aig_Man_t * Abc_NtkToDarBmc( Abc_Ntk_t * pNtk, Vec_Int_t ** pvMap )
// create network // create network
pMan = Aig_ManStart( Abc_NtkNodeNum(pNtk) + 100 ); pMan = Aig_ManStart( Abc_NtkNodeNum(pNtk) + 100 );
pMan->nConstrs = pNtk->nConstrs; pMan->nConstrs = pNtk->nConstrs;
pMan->nBarBufs = pNtk->nBarBufs;
pMan->pName = Extra_UtilStrsav( pNtk->pName ); pMan->pName = Extra_UtilStrsav( pNtk->pName );
// transfer the pointers to the basic nodes // transfer the pointers to the basic nodes
...@@ -277,6 +278,7 @@ Aig_Man_t * Abc_NtkToDar( Abc_Ntk_t * pNtk, int fExors, int fRegisters ) ...@@ -277,6 +278,7 @@ Aig_Man_t * Abc_NtkToDar( Abc_Ntk_t * pNtk, int fExors, int fRegisters )
pMan = Aig_ManStart( Abc_NtkNodeNum(pNtk) + 100 ); pMan = Aig_ManStart( Abc_NtkNodeNum(pNtk) + 100 );
pMan->fCatchExor = fExors; pMan->fCatchExor = fExors;
pMan->nConstrs = pNtk->nConstrs; pMan->nConstrs = pNtk->nConstrs;
pMan->nBarBufs = pNtk->nBarBufs;
pMan->pName = Extra_UtilStrsav( pNtk->pName ); pMan->pName = Extra_UtilStrsav( pNtk->pName );
// transfer the pointers to the basic nodes // transfer the pointers to the basic nodes
...@@ -359,6 +361,7 @@ Aig_Man_t * Abc_NtkToDarChoices( Abc_Ntk_t * pNtk ) ...@@ -359,6 +361,7 @@ Aig_Man_t * Abc_NtkToDarChoices( Abc_Ntk_t * pNtk )
pMan = Aig_ManStart( Abc_NtkNodeNum(pNtk) + 100 ); pMan = Aig_ManStart( Abc_NtkNodeNum(pNtk) + 100 );
pMan->pName = Extra_UtilStrsav( pNtk->pName ); pMan->pName = Extra_UtilStrsav( pNtk->pName );
pMan->nConstrs = pNtk->nConstrs; pMan->nConstrs = pNtk->nConstrs;
pMan->nBarBufs = pNtk->nBarBufs;
if ( Abc_NtkGetChoiceNum(pNtk) ) if ( Abc_NtkGetChoiceNum(pNtk) )
{ {
pMan->pEquivs = ABC_ALLOC( Aig_Obj_t *, Abc_NtkObjNum(pNtk) ); pMan->pEquivs = ABC_ALLOC( Aig_Obj_t *, Abc_NtkObjNum(pNtk) );
...@@ -473,6 +476,7 @@ Abc_Ntk_t * Abc_NtkFromDarSeqSweep( Abc_Ntk_t * pNtkOld, Aig_Man_t * pMan ) ...@@ -473,6 +476,7 @@ Abc_Ntk_t * Abc_NtkFromDarSeqSweep( Abc_Ntk_t * pNtkOld, Aig_Man_t * pMan )
// perform strashing // perform strashing
pNtkNew = Abc_NtkStartFromNoLatches( pNtkOld, ABC_NTK_STRASH, ABC_FUNC_AIG ); pNtkNew = Abc_NtkStartFromNoLatches( pNtkOld, ABC_NTK_STRASH, ABC_FUNC_AIG );
pNtkNew->nConstrs = pMan->nConstrs; pNtkNew->nConstrs = pMan->nConstrs;
pNtkNew->nBarBufs = pMan->nBarBufs;
// consider the case of target enlargement // consider the case of target enlargement
if ( Abc_NtkCiNum(pNtkNew) < Aig_ManCiNum(pMan) - Aig_ManRegNum(pMan) ) if ( Abc_NtkCiNum(pNtkNew) < Aig_ManCiNum(pMan) - Aig_ManRegNum(pMan) )
{ {
...@@ -592,6 +596,7 @@ Abc_Ntk_t * Abc_NtkFromAigPhase( Aig_Man_t * pMan ) ...@@ -592,6 +596,7 @@ Abc_Ntk_t * Abc_NtkFromAigPhase( Aig_Man_t * pMan )
// perform strashing // perform strashing
pNtkNew = Abc_NtkAlloc( ABC_NTK_STRASH, ABC_FUNC_AIG, 1 ); pNtkNew = Abc_NtkAlloc( ABC_NTK_STRASH, ABC_FUNC_AIG, 1 );
pNtkNew->nConstrs = pMan->nConstrs; pNtkNew->nConstrs = pMan->nConstrs;
pNtkNew->nBarBufs = pMan->nBarBufs;
// duplicate the name and the spec // duplicate the name and the spec
// pNtkNew->pName = Extra_UtilStrsav(pMan->pName); // pNtkNew->pName = Extra_UtilStrsav(pMan->pName);
// pNtkNew->pSpec = Extra_UtilStrsav(pMan->pSpec); // pNtkNew->pSpec = Extra_UtilStrsav(pMan->pSpec);
...@@ -821,6 +826,7 @@ Abc_Ntk_t * Abc_NtkAfterTrim( Aig_Man_t * pMan, Abc_Ntk_t * pNtkOld ) ...@@ -821,6 +826,7 @@ Abc_Ntk_t * Abc_NtkAfterTrim( Aig_Man_t * pMan, Abc_Ntk_t * pNtkOld )
// perform strashing // perform strashing
pNtkNew = Abc_NtkAlloc( ABC_NTK_STRASH, ABC_FUNC_AIG, 1 ); pNtkNew = Abc_NtkAlloc( ABC_NTK_STRASH, ABC_FUNC_AIG, 1 );
pNtkNew->nConstrs = pMan->nConstrs; pNtkNew->nConstrs = pMan->nConstrs;
pNtkNew->nBarBufs = pMan->nBarBufs;
// duplicate the name and the spec // duplicate the name and the spec
// pNtkNew->pName = Extra_UtilStrsav(pMan->pName); // pNtkNew->pName = Extra_UtilStrsav(pMan->pName);
// pNtkNew->pSpec = Extra_UtilStrsav(pMan->pSpec); // pNtkNew->pSpec = Extra_UtilStrsav(pMan->pSpec);
...@@ -964,6 +970,7 @@ Abc_Ntk_t * Abc_NtkFromDarSeq( Abc_Ntk_t * pNtkOld, Aig_Man_t * pMan ) ...@@ -964,6 +970,7 @@ Abc_Ntk_t * Abc_NtkFromDarSeq( Abc_Ntk_t * pNtkOld, Aig_Man_t * pMan )
// perform strashing // perform strashing
pNtkNew = Abc_NtkStartFromNoLatches( pNtkOld, ABC_NTK_STRASH, ABC_FUNC_AIG ); pNtkNew = Abc_NtkStartFromNoLatches( pNtkOld, ABC_NTK_STRASH, ABC_FUNC_AIG );
pNtkNew->nConstrs = pMan->nConstrs; pNtkNew->nConstrs = pMan->nConstrs;
pNtkNew->nBarBufs = pMan->nBarBufs;
// transfer the pointers to the basic nodes // transfer the pointers to the basic nodes
Aig_ManConst1(pMan)->pData = Abc_AigConst1(pNtkNew); Aig_ManConst1(pMan)->pData = Abc_AigConst1(pNtkNew);
Aig_ManForEachCi( pMan, pObj, i ) Aig_ManForEachCi( pMan, pObj, i )
......
...@@ -562,6 +562,7 @@ Aig_Man_t * Dar_ManBalance( Aig_Man_t * p, int fUpdateLevel ) ...@@ -562,6 +562,7 @@ Aig_Man_t * Dar_ManBalance( Aig_Man_t * p, int fUpdateLevel )
pNew->pSpec = Abc_UtilStrsav( p->pSpec ); pNew->pSpec = Abc_UtilStrsav( p->pSpec );
pNew->nAsserts = p->nAsserts; pNew->nAsserts = p->nAsserts;
pNew->nConstrs = p->nConstrs; pNew->nConstrs = p->nConstrs;
pNew->nBarBufs = p->nBarBufs;
pNew->Time2Quit = p->Time2Quit; pNew->Time2Quit = p->Time2Quit;
if ( p->vFlopNums ) if ( p->vFlopNums )
pNew->vFlopNums = Vec_IntDup( p->vFlopNums ); pNew->vFlopNums = Vec_IntDup( p->vFlopNums );
...@@ -619,18 +620,45 @@ Aig_Man_t * Dar_ManBalance( Aig_Man_t * p, int fUpdateLevel ) ...@@ -619,18 +620,45 @@ Aig_Man_t * Dar_ManBalance( Aig_Man_t * p, int fUpdateLevel )
pObjNew->Level = pObj->Level; pObjNew->Level = pObj->Level;
pObj->pData = pObjNew; pObj->pData = pObjNew;
} }
Aig_ManForEachCo( p, pObj, i ) if ( p->nBarBufs == 0 )
{ {
pDriver = Aig_ObjReal_rec( Aig_ObjChild0(pObj) ); Aig_ManForEachCo( p, pObj, i )
pObjNew = Dar_Balance_rec( pNew, Aig_Regular(pDriver), vStore, 0, fUpdateLevel );
if ( pObjNew == NULL )
{ {
Vec_VecFree( vStore ); pDriver = Aig_ObjReal_rec( Aig_ObjChild0(pObj) );
Aig_ManStop( pNew ); pObjNew = Dar_Balance_rec( pNew, Aig_Regular(pDriver), vStore, 0, fUpdateLevel );
return NULL; if ( pObjNew == NULL )
{
Vec_VecFree( vStore );
Aig_ManStop( pNew );
return NULL;
}
pObjNew = Aig_NotCond( pObjNew, Aig_IsComplement(pDriver) );
pObjNew = Aig_ObjCreateCo( pNew, pObjNew );
}
}
else
{
Vec_Ptr_t * vLits = Vec_PtrStart( Aig_ManCoNum(p) );
Aig_ManForEachCo( p, pObj, i )
{
int k = i < p->nBarBufs ? Aig_ManCoNum(p) - p->nBarBufs + i : i - p->nBarBufs;
pObj = Aig_ManCo( p, k );
pDriver = Aig_ObjReal_rec( Aig_ObjChild0(pObj) );
pObjNew = Dar_Balance_rec( pNew, Aig_Regular(pDriver), vStore, 0, fUpdateLevel );
if ( pObjNew == NULL )
{
Vec_VecFree( vStore );
Aig_ManStop( pNew );
return NULL;
}
pObjNew = Aig_NotCond( pObjNew, Aig_IsComplement(pDriver) );
Vec_PtrWriteEntry( vLits, k, pObjNew );
if ( i < p->nBarBufs )
Aig_ManCi(pNew, Aig_ManCiNum(p) - p->nBarBufs + i)->Level = Aig_Regular(pObjNew)->Level;
} }
pObjNew = Aig_NotCond( pObjNew, Aig_IsComplement(pDriver) ); Aig_ManForEachCo( p, pObj, i )
pObjNew = Aig_ObjCreateCo( pNew, pObjNew ); Aig_ObjCreateCo( pNew, (Aig_Obj_t *)Vec_PtrEntry(vLits, i) );
Vec_PtrFree(vLits);
} }
} }
Vec_VecFree( vStore ); Vec_VecFree( vStore );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment