Commit 6e774ef5 by Alan Mishchenko

Cleaing AIG manager by removing pointers to HAIG.

parent a50a3815
...@@ -3283,10 +3283,6 @@ SOURCE=.\src\aig\saig\saigDup.c ...@@ -3283,10 +3283,6 @@ SOURCE=.\src\aig\saig\saigDup.c
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=.\src\aig\saig\saigHaig.c
# End Source File
# Begin Source File
SOURCE=.\src\aig\saig\saigInd.c SOURCE=.\src\aig\saig\saigInd.c
# End Source File # End Source File
# Begin Source File # Begin Source File
......
...@@ -66,7 +66,7 @@ typedef enum { ...@@ -66,7 +66,7 @@ typedef enum {
} Aig_Type_t; } Aig_Type_t;
// the AIG node // the AIG node
struct Aig_Obj_t_ // 9 words struct Aig_Obj_t_ // 8 words
{ {
union { union {
Aig_Obj_t * pNext; // strashing table Aig_Obj_t * pNext; // strashing table
...@@ -74,7 +74,6 @@ struct Aig_Obj_t_ // 9 words ...@@ -74,7 +74,6 @@ struct Aig_Obj_t_ // 9 words
}; };
Aig_Obj_t * pFanin0; // fanin Aig_Obj_t * pFanin0; // fanin
Aig_Obj_t * pFanin1; // fanin Aig_Obj_t * pFanin1; // fanin
Aig_Obj_t * pHaig; // pointer to the HAIG node
unsigned int Type : 3; // object type unsigned int Type : 3; // object type
unsigned int fPhase : 1; // value under 000...0 pattern unsigned int fPhase : 1; // value under 000...0 pattern
unsigned int fMarkA : 1; // multipurpose mask unsigned int fMarkA : 1; // multipurpose mask
...@@ -156,7 +155,6 @@ struct Aig_Man_t_ ...@@ -156,7 +155,6 @@ struct Aig_Man_t_
Vec_Ptr_t * vSeqModelVec; // vector of counter-examples (for sequential miters) Vec_Ptr_t * vSeqModelVec; // vector of counter-examples (for sequential miters)
Aig_Man_t * pManExdc; Aig_Man_t * pManExdc;
Vec_Ptr_t * vOnehots; Vec_Ptr_t * vOnehots;
Aig_Man_t * pManHaig;
int fCreatePios; int fCreatePios;
Vec_Int_t * vEquPairs; Vec_Int_t * vEquPairs;
Vec_Vec_t * vClockDoms; Vec_Vec_t * vClockDoms;
...@@ -326,7 +324,6 @@ static inline Aig_Obj_t * Aig_ObjEquiv( Aig_Man_t * p, Aig_Obj_t * pObj ) { ...@@ -326,7 +324,6 @@ static inline Aig_Obj_t * Aig_ObjEquiv( Aig_Man_t * p, Aig_Obj_t * pObj ) {
static inline void Aig_ObjSetEquiv( Aig_Man_t * p, Aig_Obj_t * pObj, Aig_Obj_t * pEqu ) { assert(p->pEquivs); p->pEquivs[pObj->Id] = pEqu; } static inline void Aig_ObjSetEquiv( Aig_Man_t * p, Aig_Obj_t * pObj, Aig_Obj_t * pEqu ) { assert(p->pEquivs); p->pEquivs[pObj->Id] = pEqu; }
static inline Aig_Obj_t * Aig_ObjRepr( Aig_Man_t * p, Aig_Obj_t * pObj ) { return p->pReprs? p->pReprs[pObj->Id] : NULL; } static inline Aig_Obj_t * Aig_ObjRepr( Aig_Man_t * p, Aig_Obj_t * pObj ) { return p->pReprs? p->pReprs[pObj->Id] : NULL; }
static inline void Aig_ObjSetRepr( Aig_Man_t * p, Aig_Obj_t * pObj, Aig_Obj_t * pRepr ) { assert(p->pReprs); p->pReprs[pObj->Id] = pRepr; } static inline void Aig_ObjSetRepr( Aig_Man_t * p, Aig_Obj_t * pObj, Aig_Obj_t * pRepr ) { assert(p->pReprs); p->pReprs[pObj->Id] = pRepr; }
static inline Aig_Obj_t * Aig_ObjHaig( Aig_Obj_t * pObj ) { assert( Aig_Regular(pObj)->pHaig ); return Aig_NotCond( Aig_Regular(pObj)->pHaig, Aig_IsComplement(pObj) ); }
static inline int Aig_ObjWhatFanin( Aig_Obj_t * pObj, Aig_Obj_t * pFanin ) static inline int Aig_ObjWhatFanin( Aig_Obj_t * pObj, Aig_Obj_t * pFanin )
{ {
if ( Aig_ObjFanin0(pObj) == pFanin ) return 0; if ( Aig_ObjFanin0(pObj) == pFanin ) return 0;
......
...@@ -100,7 +100,6 @@ Aig_Man_t * Aig_ManStartFrom( Aig_Man_t * p ) ...@@ -100,7 +100,6 @@ Aig_Man_t * Aig_ManStartFrom( Aig_Man_t * p )
{ {
pObjNew = Aig_ObjCreateCi( pNew ); pObjNew = Aig_ObjCreateCi( pNew );
pObjNew->Level = pObj->Level; pObjNew->Level = pObj->Level;
pObjNew->pHaig = pObj->pHaig;
pObj->pData = pObjNew; pObj->pData = pObjNew;
} }
return pNew; return pNew;
...@@ -127,7 +126,6 @@ Aig_Obj_t * Aig_ManDup_rec( Aig_Man_t * pNew, Aig_Man_t * p, Aig_Obj_t * pObj ) ...@@ -127,7 +126,6 @@ Aig_Obj_t * Aig_ManDup_rec( Aig_Man_t * pNew, Aig_Man_t * p, Aig_Obj_t * pObj )
return (Aig_Obj_t *)(pObj->pData = Aig_ObjChild0Copy(pObj)); return (Aig_Obj_t *)(pObj->pData = Aig_ObjChild0Copy(pObj));
Aig_ManDup_rec( pNew, p, Aig_ObjFanin1(pObj) ); Aig_ManDup_rec( pNew, p, Aig_ObjFanin1(pObj) );
pObjNew = Aig_Oper( pNew, Aig_ObjChild0Copy(pObj), Aig_ObjChild1Copy(pObj), Aig_ObjType(pObj) ); pObjNew = Aig_Oper( pNew, Aig_ObjChild0Copy(pObj), Aig_ObjChild1Copy(pObj), Aig_ObjType(pObj) );
Aig_Regular(pObjNew)->pHaig = pObj->pHaig;
return (Aig_Obj_t *)(pObj->pData = pObjNew); return (Aig_Obj_t *)(pObj->pData = pObjNew);
} }
...@@ -361,27 +359,6 @@ int Aig_ManCoCleanup( Aig_Man_t * p ) ...@@ -361,27 +359,6 @@ int Aig_ManCoCleanup( Aig_Man_t * p )
/**Function************************************************************* /**Function*************************************************************
Synopsis [Performs one iteration of AIG rewriting.]
Description []
SideEffects []
SeeAlso []
***********************************************************************/
int Aig_ManHaigCounter( Aig_Man_t * pAig )
{
Aig_Obj_t * pObj;
int Counter, i;
Counter = 0;
Aig_ManForEachNode( pAig, pObj, i )
Counter += (pObj->pHaig != NULL);
return Counter;
}
/**Function*************************************************************
Synopsis [Stops the AIG manager.] Synopsis [Stops the AIG manager.]
Description [] Description []
......
...@@ -49,12 +49,6 @@ Aig_Obj_t * Aig_ObjCreateCi( Aig_Man_t * p ) ...@@ -49,12 +49,6 @@ Aig_Obj_t * Aig_ObjCreateCi( Aig_Man_t * p )
pObj->Type = AIG_OBJ_CI; pObj->Type = AIG_OBJ_CI;
Vec_PtrPush( p->vCis, pObj ); Vec_PtrPush( p->vCis, pObj );
p->nObjs[AIG_OBJ_CI]++; p->nObjs[AIG_OBJ_CI]++;
if ( p->pManHaig && p->fCreatePios )
{
p->pManHaig->nRegs++;
pObj->pHaig = Aig_ObjCreateCi( p->pManHaig );
// printf( "Creating PI HAIG node %d equivalent to PI %d.\n", pObj->pHaig->Id, pObj->Id );
}
return pObj; return pObj;
} }
...@@ -77,11 +71,6 @@ Aig_Obj_t * Aig_ObjCreateCo( Aig_Man_t * p, Aig_Obj_t * pDriver ) ...@@ -77,11 +71,6 @@ Aig_Obj_t * Aig_ObjCreateCo( Aig_Man_t * p, Aig_Obj_t * pDriver )
Vec_PtrPush( p->vCos, pObj ); Vec_PtrPush( p->vCos, pObj );
Aig_ObjConnect( p, pObj, pDriver, NULL ); Aig_ObjConnect( p, pObj, pDriver, NULL );
p->nObjs[AIG_OBJ_CO]++; p->nObjs[AIG_OBJ_CO]++;
if ( p->pManHaig && p->fCreatePios )
{
pObj->pHaig = Aig_ObjCreateCo( p->pManHaig, Aig_ObjHaig( pDriver ) );
// printf( "Creating PO HAIG node %d equivalent to PO %d.\n", pObj->pHaig->Id, pObj->Id );
}
return pObj; return pObj;
} }
...@@ -111,14 +100,6 @@ Aig_Obj_t * Aig_ObjCreate( Aig_Man_t * p, Aig_Obj_t * pGhost ) ...@@ -111,14 +100,6 @@ Aig_Obj_t * Aig_ObjCreate( Aig_Man_t * p, Aig_Obj_t * pGhost )
// update node counters of the manager // update node counters of the manager
p->nObjs[Aig_ObjType(pObj)]++; p->nObjs[Aig_ObjType(pObj)]++;
assert( pObj->pData == NULL ); assert( pObj->pData == NULL );
if ( p->pManHaig )
{
pGhost->pFanin0 = Aig_ObjHaig( pGhost->pFanin0 );
pGhost->pFanin1 = Aig_ObjHaig( pGhost->pFanin1 );
pObj->pHaig = Aig_ObjCreate( p->pManHaig, pGhost );
assert( !Aig_IsComplement(pObj->pHaig) );
// printf( "Creating HAIG node %d equivalent to node %d.\n", pObj->pHaig->Id, pObj->Id );
}
// create the power counter // create the power counter
if ( p->vProbs ) if ( p->vProbs )
{ {
...@@ -384,14 +365,6 @@ void Aig_ObjPrint( Aig_Man_t * p, Aig_Obj_t * pObj ) ...@@ -384,14 +365,6 @@ void Aig_ObjPrint( Aig_Man_t * p, Aig_Obj_t * pObj )
} }
return; return;
} }
if ( fHaig )
{
if ( pObj->pHaig == NULL )
printf( " HAIG node not given" );
else
printf( " HAIG node = %d%s", Aig_Regular(pObj->pHaig)->Id, (Aig_IsComplement(pObj->pHaig)? "\'" : " ") );
return;
}
// there are choices // there are choices
if ( p->pEquivs && p->pEquivs[pObj->Id] ) if ( p->pEquivs && p->pEquivs[pObj->Id] )
{ {
...@@ -511,19 +484,6 @@ void Aig_ObjReplace( Aig_Man_t * p, Aig_Obj_t * pObjOld, Aig_Obj_t * pObjNew, in ...@@ -511,19 +484,6 @@ void Aig_ObjReplace( Aig_Man_t * p, Aig_Obj_t * pObjOld, Aig_Obj_t * pObjNew, in
printf( "Aig_ObjReplace(): Internal error!\n" ); printf( "Aig_ObjReplace(): Internal error!\n" );
exit(1); exit(1);
} }
// map the HAIG nodes
if ( p->pManHaig != NULL )
{
// printf( "Setting HAIG node %d equivalent to HAIG node %d (over = %d).\n",
// pObjNewR->pHaig->Id, pObjOld->pHaig->Id, pObjNewR->pHaig->pHaig != NULL );
assert( pObjNewR->pHaig != NULL );
assert( !Aig_IsComplement(pObjNewR->pHaig) );
assert( p->pManHaig->vEquPairs != NULL );
Vec_IntPush( p->pManHaig->vEquPairs, pObjNewR->pHaig->Id );
Vec_IntPush( p->pManHaig->vEquPairs, pObjOld->pHaig->Id );
}
else
pObjOld->pHaig = pObjNewR->pHaig? pObjNewR->pHaig : pObjOld->pHaig;
// recursively delete the old node - but leave the object there // recursively delete the old node - but leave the object there
pObjNewR->nRefs++; pObjNewR->nRefs++;
Aig_ObjDelete_rec( p, pObjOld, 0 ); Aig_ObjDelete_rec( p, pObjOld, 0 );
......
...@@ -1493,8 +1493,6 @@ void Aig_ManChoiceConstructiveOne( Aig_Man_t * pNew, Aig_Man_t * pPrev, Aig_Man_ ...@@ -1493,8 +1493,6 @@ void Aig_ManChoiceConstructiveOne( Aig_Man_t * pNew, Aig_Man_t * pPrev, Aig_Man_
// make sure the nodes of pThis point to pPrev // make sure the nodes of pThis point to pPrev
Aig_ManForEachObj( pPrev, pObj, i ) Aig_ManForEachObj( pPrev, pObj, i )
pObj->fMarkB = 1; pObj->fMarkB = 1;
Aig_ManForEachObj( pThis, pObj, i )
assert( pObj->pHaig == NULL || (!Aig_IsComplement(pObj->pHaig) && pObj->pHaig->fMarkB) );
Aig_ManForEachObj( pPrev, pObj, i ) Aig_ManForEachObj( pPrev, pObj, i )
pObj->fMarkB = 0; pObj->fMarkB = 0;
// remap nodes of pThis on top of pNew using pPrev // remap nodes of pThis on top of pNew using pPrev
...@@ -1506,13 +1504,7 @@ void Aig_ManChoiceConstructiveOne( Aig_Man_t * pNew, Aig_Man_t * pPrev, Aig_Man_ ...@@ -1506,13 +1504,7 @@ void Aig_ManChoiceConstructiveOne( Aig_Man_t * pNew, Aig_Man_t * pPrev, Aig_Man_
pObj->pData = Aig_ManCo(pNew, i); pObj->pData = Aig_ManCo(pNew, i);
// go through the nodes in the topological order // go through the nodes in the topological order
Aig_ManForEachNode( pThis, pObj, i ) Aig_ManForEachNode( pThis, pObj, i )
{
pObj->pData = Aig_And( pNew, Aig_ObjChild0Copy(pObj), Aig_ObjChild1Copy(pObj) ); pObj->pData = Aig_And( pNew, Aig_ObjChild0Copy(pObj), Aig_ObjChild1Copy(pObj) );
if ( pObj->pHaig == NULL )
continue;
// pObj->pData and pObj->pHaig->pData are equivalent
Aig_ObjSetRepr_( pNew, Aig_Regular((Aig_Obj_t *)pObj->pData), Aig_Regular((Aig_Obj_t *)pObj->pHaig->pData) );
}
// set the inputs of POs as equivalent // set the inputs of POs as equivalent
Aig_ManForEachCo( pThis, pObj, i ) Aig_ManForEachCo( pThis, pObj, i )
{ {
......
...@@ -7,7 +7,6 @@ SRC += src/aig/saig/saigBmc.c \ ...@@ -7,7 +7,6 @@ SRC += src/aig/saig/saigBmc.c \
src/aig/saig/saigConstr2.c \ src/aig/saig/saigConstr2.c \
src/aig/saig/saigDual.c \ src/aig/saig/saigDual.c \
src/aig/saig/saigDup.c \ src/aig/saig/saigDup.c \
src/aig/saig/saigHaig.c \
src/aig/saig/saigInd.c \ src/aig/saig/saigInd.c \
src/aig/saig/saigIoa.c \ src/aig/saig/saigIoa.c \
src/aig/saig/saigIso.c \ src/aig/saig/saigIso.c \
......
...@@ -215,7 +215,6 @@ struct Abc_Ntk_t_ ...@@ -215,7 +215,6 @@ struct Abc_Ntk_t_
void * pExcare; // the EXDC network (if given) void * pExcare; // the EXDC network (if given)
void * pData; // misc void * pData; // misc
Abc_Ntk_t * pCopy; // copy of this network Abc_Ntk_t * pCopy; // copy of this network
void * pHaig; // history AIG
float * pLutTimes; // arrivals/requireds/slacks using LUT-delay model float * pLutTimes; // arrivals/requireds/slacks using LUT-delay model
Vec_Ptr_t * vOnehots; // names of one-hot-encoded registers Vec_Ptr_t * vOnehots; // names of one-hot-encoded registers
Vec_Int_t * vObjPerm; // permutation saved Vec_Int_t * vObjPerm; // permutation saved
......
...@@ -344,9 +344,6 @@ Abc_Obj_t * Abc_AigAndCreate( Abc_Aig_t * pMan, Abc_Obj_t * p0, Abc_Obj_t * p1 ) ...@@ -344,9 +344,6 @@ Abc_Obj_t * Abc_AigAndCreate( Abc_Aig_t * pMan, Abc_Obj_t * p0, Abc_Obj_t * p1 )
// add the node to the list of updated nodes // add the node to the list of updated nodes
if ( pMan->vAddedCells ) if ( pMan->vAddedCells )
Vec_PtrPush( pMan->vAddedCells, pAnd ); Vec_PtrPush( pMan->vAddedCells, pAnd );
// create HAIG
// if ( pAnd->pNtk->pHaig )
// pAnd->pEquiv = Hop_And( pAnd->pNtk->pHaig, Abc_ObjChild0Equiv(pAnd), Abc_ObjChild1Equiv(pAnd) );
return pAnd; return pAnd;
} }
...@@ -387,9 +384,6 @@ Abc_Obj_t * Abc_AigAndCreateFrom( Abc_Aig_t * pMan, Abc_Obj_t * p0, Abc_Obj_t * ...@@ -387,9 +384,6 @@ Abc_Obj_t * Abc_AigAndCreateFrom( Abc_Aig_t * pMan, Abc_Obj_t * p0, Abc_Obj_t *
// add the node to the list of updated nodes // add the node to the list of updated nodes
// if ( pMan->vAddedCells ) // if ( pMan->vAddedCells )
// Vec_PtrPush( pMan->vAddedCells, pAnd ); // Vec_PtrPush( pMan->vAddedCells, pAnd );
// create HAIG
// if ( pAnd->pNtk->pHaig )
// pAnd->pEquiv = Hop_And( pAnd->pNtk->pHaig, Abc_ObjChild0Equiv(pAnd), Abc_ObjChild1Equiv(pAnd) );
return pAnd; return pAnd;
} }
...@@ -858,9 +852,6 @@ void Abc_AigReplace( Abc_Aig_t * pMan, Abc_Obj_t * pOld, Abc_Obj_t * pNew, int f ...@@ -858,9 +852,6 @@ void Abc_AigReplace( Abc_Aig_t * pMan, Abc_Obj_t * pOld, Abc_Obj_t * pNew, int f
Vec_PtrPush( pMan->vStackReplaceOld, pOld ); Vec_PtrPush( pMan->vStackReplaceOld, pOld );
Vec_PtrPush( pMan->vStackReplaceNew, pNew ); Vec_PtrPush( pMan->vStackReplaceNew, pNew );
assert( !Abc_ObjIsComplement(pOld) ); assert( !Abc_ObjIsComplement(pOld) );
// create HAIG
// if ( pOld->pNtk->pHaig )
// Hop_ObjCreateChoice( pOld->pEquiv, Abc_ObjRegular(pNew)->pEquiv );
// process the replacements // process the replacements
while ( Vec_PtrSize(pMan->vStackReplaceOld) ) while ( Vec_PtrSize(pMan->vStackReplaceOld) )
{ {
......
...@@ -1070,9 +1070,6 @@ void Abc_NtkDelete( Abc_Ntk_t * pNtk ) ...@@ -1070,9 +1070,6 @@ void Abc_NtkDelete( Abc_Ntk_t * pNtk )
// int LargePiece = (4 << ABC_NUM_STEPS); // int LargePiece = (4 << ABC_NUM_STEPS);
if ( pNtk == NULL ) if ( pNtk == NULL )
return; return;
// free the HAIG
// if ( pNtk->pHaig )
// Abc_NtkHaigStop( pNtk );
// free EXDC Ntk // free EXDC Ntk
if ( pNtk->pExdc ) if ( pNtk->pExdc )
Abc_NtkDelete( pNtk->pExdc ); Abc_NtkDelete( pNtk->pExdc );
......
...@@ -277,9 +277,6 @@ Abc_Obj_t * Abc_NodeBalance_rec( Abc_Ntk_t * pNtkNew, Abc_Obj_t * pNodeOld, Vec_ ...@@ -277,9 +277,6 @@ Abc_Obj_t * Abc_NodeBalance_rec( Abc_Ntk_t * pNtkNew, Abc_Obj_t * pNodeOld, Vec_
// if ( Abc_ObjRegular(pNodeOld->pCopy) == Abc_AigConst1(pNtkNew) ) // if ( Abc_ObjRegular(pNodeOld->pCopy) == Abc_AigConst1(pNtkNew) )
// printf( "Constant node\n" ); // printf( "Constant node\n" );
// assert( pNodeOld->Level >= Abc_ObjRegular(pNodeOld->pCopy)->Level ); // assert( pNodeOld->Level >= Abc_ObjRegular(pNodeOld->pCopy)->Level );
// update HAIG
// if ( Abc_ObjRegular(pNodeOld->pCopy)->pNtk->pHaig )
// Hop_ObjCreateChoice( pNodeOld->pEquiv, Abc_ObjRegular(pNodeOld->pCopy)->pEquiv );
return pNodeOld->pCopy; return pNodeOld->pCopy;
} }
......
...@@ -31,129 +31,6 @@ ABC_NAMESPACE_IMPL_START ...@@ -31,129 +31,6 @@ ABC_NAMESPACE_IMPL_START
/// FUNCTION DEFINITIONS /// /// FUNCTION DEFINITIONS ///
//////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////
#if 0
/**Function*************************************************************
Synopsis [Start history AIG.]
Description []
SideEffects []
SeeAlso []
***********************************************************************/
int Abc_NtkHaigStart( Abc_Ntk_t * pNtk )
{
Hop_Man_t * p;
Abc_Obj_t * pObj, * pTemp;
int i;
assert( Abc_NtkIsStrash(pNtk) );
// check if the package is already started
if ( pNtk->pHaig )
{
Abc_NtkHaigStop( pNtk );
assert( pNtk->pHaig == NULL );
printf( "Warning: Previous history AIG was removed.\n" );
}
// make sure the data is clean
Abc_NtkForEachObj( pNtk, pObj, i )
assert( pObj->pEquiv == NULL );
// start the HOP package
p = Hop_ManStart();
p->vObjs = Vec_PtrAlloc( 4096 );
Vec_PtrPush( p->vObjs, Hop_ManConst1(p) );
// map the constant node
Abc_AigConst1(pNtk)->pEquiv = Hop_ManConst1(p);
// map the CIs
Abc_NtkForEachCi( pNtk, pObj, i )
pObj->pEquiv = Hop_ObjCreatePi(p);
// map the internal nodes
Abc_NtkForEachNode( pNtk, pObj, i )
pObj->pEquiv = Hop_And( p, Abc_ObjChild0Equiv(pObj), Abc_ObjChild1Equiv(pObj) );
// map the choice nodes
if ( Abc_NtkGetChoiceNum( pNtk ) )
{
// print warning about choice nodes
printf( "Warning: The choice nodes in the original AIG are converted into HAIG.\n" );
Abc_NtkForEachNode( pNtk, pObj, i )
{
if ( !Abc_AigNodeIsChoice( pObj ) )
continue;
for ( pTemp = pObj->pData; pTemp; pTemp = pTemp->pData )
Hop_ObjCreateChoice( pObj->pEquiv, pTemp->pEquiv );
}
}
// make sure everything is okay
if ( !Hop_ManCheck(p) )
{
printf( "Abc_NtkHaigStart: Check for History AIG has failed.\n" );
Hop_ManStop(p);
return 0;
}
pNtk->pHaig = p;
return 1;
}
/**Function*************************************************************
Synopsis [Stops history AIG.]
Description []
SideEffects []
SeeAlso []
***********************************************************************/
int Abc_NtkHaigStop( Abc_Ntk_t * pNtk )
{
Abc_Obj_t * pObj;
int i;
assert( Abc_NtkIsStrash(pNtk) );
if ( pNtk->pHaig == NULL )
{
printf( "Warning: History AIG is not allocated.\n" );
return 1;
}
Abc_NtkForEachObj( pNtk, pObj, i )
pObj->pEquiv = NULL;
Hop_ManStop( pNtk->pHaig );
pNtk->pHaig = NULL;
return 1;
}
/**Function*************************************************************
Synopsis [Transfers the HAIG to the new network.]
Description []
SideEffects []
SeeAlso []
***********************************************************************/
void Abc_NtkHaigTranfer( Abc_Ntk_t * pNtkOld, Abc_Ntk_t * pNtkNew )
{
Abc_Obj_t * pObj;
int i;
if ( pNtkOld->pHaig == NULL )
return;
// transfer the package
assert( pNtkNew->pHaig == NULL );
pNtkNew->pHaig = pNtkOld->pHaig;
pNtkOld->pHaig = NULL;
// transfer constant pointer
Abc_AigConst1(pNtkOld)->pCopy->pEquiv = Abc_AigConst1(pNtkOld)->pEquiv;
// transfer the CI pointers
Abc_NtkForEachCi( pNtkOld, pObj, i )
pObj->pCopy->pEquiv = pObj->pEquiv;
}
#endif
/**Function************************************************************* /**Function*************************************************************
...@@ -642,64 +519,6 @@ int Abc_NtkHaigResetReprs( Hop_Man_t * p ) ...@@ -642,64 +519,6 @@ int Abc_NtkHaigResetReprs( Hop_Man_t * p )
return nFanouts; return nFanouts;
} }
#if 0
/**Function*************************************************************
Synopsis [Stops history AIG.]
Description []
SideEffects []
SeeAlso []
***********************************************************************/
Abc_Ntk_t * Abc_NtkHaigUse( Abc_Ntk_t * pNtk )
{
Hop_Man_t * pMan, * pManTemp;
Abc_Ntk_t * pNtkAig;
Abc_Obj_t * pObj;
int i;
// check if HAIG is available
assert( Abc_NtkIsStrash(pNtk) );
if ( pNtk->pHaig == NULL )
{
printf( "Warning: History AIG is not available.\n" );
return NULL;
}
// convert HOP package into AIG with choices
// print HAIG stats
// Hop_ManPrintStats( pMan ); // USES DATA!!!
// add the POs
Abc_NtkForEachCo( pNtk, pObj, i )
Hop_ObjCreatePo( pNtk->pHaig, Abc_ObjChild0Equiv(pObj) );
// clean the old network
Abc_NtkForEachObj( pNtk, pObj, i )
pObj->pEquiv = NULL;
pMan = pNtk->pHaig;
pNtk->pHaig = 0;
// iteratively reconstruct the HOP manager to create choice nodes
while ( Abc_NtkHaigResetReprs( pMan ) )
{
pMan = Abc_NtkHaigReconstruct( pManTemp = pMan );
Hop_ManStop( pManTemp );
}
// traverse in the topological order and create new AIG
pNtkAig = Abc_NtkHaigRecreateAig( pNtk, pMan );
Hop_ManStop( pMan );
// free HAIG
return pNtkAig;
}
#endif
/**Function************************************************************* /**Function*************************************************************
Synopsis [Transform HOP manager into the one without loops.] Synopsis [Transform HOP manager into the one without loops.]
......
...@@ -1000,7 +1000,6 @@ Hop_Man_t * Abc_NtkPartStartHop( Abc_Ntk_t * pNtk ) ...@@ -1000,7 +1000,6 @@ Hop_Man_t * Abc_NtkPartStartHop( Abc_Ntk_t * pNtk )
Abc_Ntk_t * Abc_NtkPartStitchChoices( Abc_Ntk_t * pNtk, Vec_Ptr_t * vParts ) Abc_Ntk_t * Abc_NtkPartStitchChoices( Abc_Ntk_t * pNtk, Vec_Ptr_t * vParts )
{ {
extern Abc_Ntk_t * Abc_NtkHopRemoveLoops( Abc_Ntk_t * pNtk, Hop_Man_t * pMan ); extern Abc_Ntk_t * Abc_NtkHopRemoveLoops( Abc_Ntk_t * pNtk, Hop_Man_t * pMan );
Hop_Man_t * pMan; Hop_Man_t * pMan;
Vec_Ptr_t * vNodes; Vec_Ptr_t * vNodes;
Abc_Ntk_t * pNtkNew, * pNtkTemp; Abc_Ntk_t * pNtkNew, * pNtkTemp;
......
...@@ -21,7 +21,7 @@ SRC += src/base/abci/abc.c \ ...@@ -21,7 +21,7 @@ SRC += src/base/abci/abc.c \
src/base/abci/abcFraig.c \ src/base/abci/abcFraig.c \
src/base/abci/abcFxu.c \ src/base/abci/abcFxu.c \
src/base/abci/abcGen.c \ src/base/abci/abcGen.c \
src/base/abci/abcHaig.c \ src/base/abci/abcHaig.c \
src/base/abci/abcIf.c \ src/base/abci/abcIf.c \
src/base/abci/abcIfif.c \ src/base/abci/abcIfif.c \
src/base/abci/abcIfMux.c \ src/base/abci/abcIfMux.c \
......
...@@ -532,19 +532,6 @@ Aig_Obj_t * Dar_Balance_rec( Aig_Man_t * pNew, Aig_Obj_t * pObjOld, Vec_Vec_t * ...@@ -532,19 +532,6 @@ Aig_Obj_t * Dar_Balance_rec( Aig_Man_t * pNew, Aig_Obj_t * pObjOld, Vec_Vec_t *
// make sure the balanced node is not assigned // make sure the balanced node is not assigned
// assert( pObjOld->Level >= Aig_Regular(pObjNew)->Level ); // assert( pObjOld->Level >= Aig_Regular(pObjNew)->Level );
assert( pObjOld->pData == NULL ); assert( pObjOld->pData == NULL );
if ( pNew->pManHaig != NULL )
{
Aig_Obj_t * pObjNewR = Aig_Regular(pObjNew);
// printf( "Balancing HAIG node %d equivalent to HAIG node %d (over = %d).\n",
// pObjNewR->pHaig->Id, pObjOld->pHaig->Id, pObjNewR->pHaig->pHaig != NULL );
assert( pObjNewR->pHaig != NULL );
assert( !Aig_IsComplement(pObjNewR->pHaig) );
assert( pNew->pManHaig->vEquPairs != NULL );
Vec_IntPush( pNew->pManHaig->vEquPairs, pObjNewR->pHaig->Id );
Vec_IntPush( pNew->pManHaig->vEquPairs, pObjOld->pHaig->Id );
}
else
Aig_Regular(pObjNew)->pHaig = pObjOld->pHaig;
return (Aig_Obj_t *)(pObjOld->pData = pObjNew); return (Aig_Obj_t *)(pObjOld->pData = pObjNew);
} }
...@@ -574,12 +561,6 @@ Aig_Man_t * Dar_ManBalance( Aig_Man_t * p, int fUpdateLevel ) ...@@ -574,12 +561,6 @@ Aig_Man_t * Dar_ManBalance( Aig_Man_t * p, int fUpdateLevel )
pNew->nConstrs = p->nConstrs; pNew->nConstrs = p->nConstrs;
if ( p->vFlopNums ) if ( p->vFlopNums )
pNew->vFlopNums = Vec_IntDup( p->vFlopNums ); pNew->vFlopNums = Vec_IntDup( p->vFlopNums );
// pass the HAIG manager
if ( p->pManHaig != NULL )
{
pNew->pManHaig = p->pManHaig; p->pManHaig = NULL;
Aig_ManConst1(pNew)->pHaig = Aig_ManConst1(pNew->pManHaig);
}
// map the PI nodes // map the PI nodes
Aig_ManCleanData( p ); Aig_ManCleanData( p );
Aig_ManConst1(p)->pData = Aig_ManConst1(pNew); Aig_ManConst1(p)->pData = Aig_ManConst1(pNew);
...@@ -598,7 +579,6 @@ Aig_Man_t * Dar_ManBalance( Aig_Man_t * p, int fUpdateLevel ) ...@@ -598,7 +579,6 @@ Aig_Man_t * Dar_ManBalance( Aig_Man_t * p, int fUpdateLevel )
// copy the PI // copy the PI
pObjNew = Aig_ObjCreateCi(pNew); pObjNew = Aig_ObjCreateCi(pNew);
pObj->pData = pObjNew; pObj->pData = pObjNew;
pObjNew->pHaig = pObj->pHaig;
// set the arrival time of the new PI // set the arrival time of the new PI
arrTime = Tim_ManGetCiArrival( (Tim_Man_t *)p->pManTime, Aig_ObjCioId(pObj) ); arrTime = Tim_ManGetCiArrival( (Tim_Man_t *)p->pManTime, Aig_ObjCioId(pObj) );
pObjNew->Level = (int)arrTime; pObjNew->Level = (int)arrTime;
...@@ -614,7 +594,6 @@ Aig_Man_t * Dar_ManBalance( Aig_Man_t * p, int fUpdateLevel ) ...@@ -614,7 +594,6 @@ Aig_Man_t * Dar_ManBalance( Aig_Man_t * p, int fUpdateLevel )
Tim_ManSetCoArrival( (Tim_Man_t *)p->pManTime, Aig_ObjCioId(pObj), arrTime ); Tim_ManSetCoArrival( (Tim_Man_t *)p->pManTime, Aig_ObjCioId(pObj), arrTime );
// create PO // create PO
pObjNew = Aig_ObjCreateCo( pNew, pObjNew ); pObjNew = Aig_ObjCreateCo( pNew, pObjNew );
pObjNew->pHaig = pObj->pHaig;
} }
else else
assert( 0 ); assert( 0 );
...@@ -629,7 +608,6 @@ Aig_Man_t * Dar_ManBalance( Aig_Man_t * p, int fUpdateLevel ) ...@@ -629,7 +608,6 @@ Aig_Man_t * Dar_ManBalance( Aig_Man_t * p, int fUpdateLevel )
pObjNew = Aig_ObjCreateCi(pNew); pObjNew = Aig_ObjCreateCi(pNew);
pObjNew->Level = pObj->Level; pObjNew->Level = pObj->Level;
pObj->pData = pObjNew; pObj->pData = pObjNew;
pObjNew->pHaig = pObj->pHaig;
} }
Aig_ManForEachCo( p, pObj, i ) Aig_ManForEachCo( p, pObj, i )
{ {
...@@ -637,7 +615,6 @@ Aig_Man_t * Dar_ManBalance( Aig_Man_t * p, int fUpdateLevel ) ...@@ -637,7 +615,6 @@ Aig_Man_t * Dar_ManBalance( Aig_Man_t * p, int fUpdateLevel )
pObjNew = Dar_Balance_rec( pNew, Aig_Regular(pDriver), vStore, 0, fUpdateLevel ); pObjNew = Dar_Balance_rec( pNew, Aig_Regular(pDriver), vStore, 0, fUpdateLevel );
pObjNew = Aig_NotCond( pObjNew, Aig_IsComplement(pDriver) ); pObjNew = Aig_NotCond( pObjNew, Aig_IsComplement(pDriver) );
pObjNew = Aig_ObjCreateCo( pNew, pObjNew ); pObjNew = Aig_ObjCreateCo( pNew, pObjNew );
pObjNew->pHaig = pObj->pHaig;
} }
} }
Vec_VecFree( vStore ); Vec_VecFree( vStore );
......
...@@ -134,27 +134,6 @@ Aig_Man_t * Dar_ManRwsat( Aig_Man_t * pAig, int fBalance, int fVerbose ) ...@@ -134,27 +134,6 @@ Aig_Man_t * Dar_ManRwsat( Aig_Man_t * pAig, int fBalance, int fVerbose )
/**Function************************************************************* /**Function*************************************************************
Synopsis [Performs one iteration of AIG rewriting.]
Description []
SideEffects []
SeeAlso []
***********************************************************************/
void Dar_ManHaigPrintStats( Aig_Man_t * pAig )
{
Aig_Obj_t * pObj;
int Counter, i;
Counter = 0;
Aig_ManForEachNode( pAig, pObj, i )
Counter += (pObj->pHaig != NULL);
printf( "Total nodes = %6d. Equiv nodes = %6d.\n", Aig_ManNodeNum(pAig), Counter );
}
/**Function*************************************************************
Synopsis [Reproduces script "compress".] Synopsis [Reproduces script "compress".]
Description [] Description []
...@@ -352,34 +331,20 @@ Vec_Ptr_t * Dar_ManChoiceSynthesis( Aig_Man_t * pAig, int fBalance, int fUpdateL ...@@ -352,34 +331,20 @@ Vec_Ptr_t * Dar_ManChoiceSynthesis( Aig_Man_t * pAig, int fBalance, int fUpdateL
//alias resyn2 "b; rw; rf; b; rw; rwz; b; rfz; rwz; b" //alias resyn2 "b; rw; rf; b; rw; rwz; b; rfz; rwz; b"
{ {
Vec_Ptr_t * vAigs; Vec_Ptr_t * vAigs;
Aig_Obj_t * pObj;
int i;
vAigs = Vec_PtrAlloc( 3 ); vAigs = Vec_PtrAlloc( 3 );
pAig = Aig_ManDupDfs(pAig); pAig = Aig_ManDupDfs(pAig);
Vec_PtrPush( vAigs, pAig ); Vec_PtrPush( vAigs, pAig );
Aig_ManForEachObj( pAig, pObj, i )
pObj->pHaig = pObj;
pAig = Dar_ManCompress(pAig, fBalance, fUpdateLevel, fPower, fVerbose); pAig = Dar_ManCompress(pAig, fBalance, fUpdateLevel, fPower, fVerbose);
Vec_PtrPush( vAigs, pAig ); Vec_PtrPush( vAigs, pAig );
//Aig_ManPrintStats( pAig ); //Aig_ManPrintStats( pAig );
Aig_ManForEachObj( pAig, pObj, i )
{
pObj->pNext = pObj->pHaig;
pObj->pHaig = pObj;
}
pAig = Dar_ManCompress2(pAig, fBalance, fUpdateLevel, 1, fPower, fVerbose); pAig = Dar_ManCompress2(pAig, fBalance, fUpdateLevel, 1, fPower, fVerbose);
Vec_PtrPush( vAigs, pAig ); Vec_PtrPush( vAigs, pAig );
//Aig_ManPrintStats( pAig ); //Aig_ManPrintStats( pAig );
pAig = (Aig_Man_t *)Vec_PtrEntry( vAigs, 1 ); pAig = (Aig_Man_t *)Vec_PtrEntry( vAigs, 1 );
Aig_ManForEachObj( pAig, pObj, i )
pObj->pHaig = pObj->pNext;
return vAigs; return vAigs;
} }
......
...@@ -273,7 +273,6 @@ Aig_Obj_t * Fra_LcrManDup_rec( Aig_Man_t * pNew, Aig_Man_t * p, Aig_Obj_t * pObj ...@@ -273,7 +273,6 @@ Aig_Obj_t * Fra_LcrManDup_rec( Aig_Man_t * pNew, Aig_Man_t * p, Aig_Obj_t * pObj
return (Aig_Obj_t *)(pObj->pData = Aig_ObjChild0Copy(pObj)); return (Aig_Obj_t *)(pObj->pData = Aig_ObjChild0Copy(pObj));
Fra_LcrManDup_rec( pNew, p, Aig_ObjFanin1(pObj) ); Fra_LcrManDup_rec( pNew, p, Aig_ObjFanin1(pObj) );
pObjNew = Aig_Oper( pNew, Aig_ObjChild0Copy(pObj), Aig_ObjChild1Copy(pObj), Aig_ObjType(pObj) ); pObjNew = Aig_Oper( pNew, Aig_ObjChild0Copy(pObj), Aig_ObjChild1Copy(pObj), Aig_ObjType(pObj) );
Aig_Regular(pObjNew)->pHaig = pObj->pHaig;
return (Aig_Obj_t *)(pObj->pData = pObjNew); return (Aig_Obj_t *)(pObj->pData = pObjNew);
} }
......
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