diff options
Diffstat (limited to 'src/temp/player')
-rw-r--r-- | src/temp/player/player.h | 4 | ||||
-rw-r--r-- | src/temp/player/playerAbc.c | 18 | ||||
-rw-r--r-- | src/temp/player/playerBuild.c | 12 | ||||
-rw-r--r-- | src/temp/player/playerCore.c | 1 | ||||
-rw-r--r-- | src/temp/player/playerUtil.c | 4 |
5 files changed, 25 insertions, 14 deletions
diff --git a/src/temp/player/player.h b/src/temp/player/player.h index 9ecad35b..cf0e8e01 100644 --- a/src/temp/player/player.h +++ b/src/temp/player/player.h @@ -40,8 +40,8 @@ typedef struct Pla_Obj_t_ Pla_Obj_t; struct Pla_Obj_t_ { unsigned fFixed : 1; // fixed node - unsigned Depth : 7; // the depth in terms of LUTs/PLAs - unsigned nRefs : 24; // the number of references + unsigned Depth : 31; // the depth in terms of LUTs/PLAs + int nRefs; // the number of references Vec_Int_t vSupp[2]; // supports in two frames Esop_Cube_t * pCover[2]; // esops in two frames }; diff --git a/src/temp/player/playerAbc.c b/src/temp/player/playerAbc.c index 9cc342d9..24273ffe 100644 --- a/src/temp/player/playerAbc.c +++ b/src/temp/player/playerAbc.c @@ -45,8 +45,10 @@ static Abc_Ntk_t * Ivy_ManToAbc( Abc_Ntk_t * pNtkOld, Ivy_Man_t * p ); ***********************************************************************/ void * Abc_NtkPlayer( void * pNtk, int nLutMax, int nPlaMax, int fVerbose ) { + int fUseRewriting = 1; Ivy_Man_t * pMan, * pManExt; Abc_Ntk_t * pNtkAig; + if ( !Abc_NtkIsStrash(pNtk) ) return NULL; // convert to the new AIG manager @@ -60,6 +62,14 @@ void * Abc_NtkPlayer( void * pNtk, int nLutMax, int nPlaMax, int fVerbose ) } if ( fVerbose ) Ivy_ManPrintStats( pMan ); + if ( fUseRewriting ) + { + // simplify + pMan = Ivy_ManResyn( pManExt = pMan, 1 ); + Ivy_ManStop( pManExt ); + if ( fVerbose ) + Ivy_ManPrintStats( pMan ); + } // perform decomposition/mapping into PLAs/LUTs pManExt = Pla_ManDecompose( pMan, nLutMax, nPlaMax, fVerbose ); Ivy_ManStop( pMan ); @@ -150,10 +160,10 @@ Abc_Ntk_t * Ivy_ManToAbc( Abc_Ntk_t * pNtkOld, Ivy_Man_t * pMan ) pObjNew = Abc_NtkCreateNode( pNtkNew ); Vec_IntForEachEntry( vIvyFanins, Fanin, k ) { - pIvyFanin = Ivy_ObjObj( pIvyNode, Ivy_FanId(Fanin) ); + pIvyFanin = Ivy_ObjObj( pIvyNode, Ivy_EdgeId(Fanin) ); pFaninNew = Abc_NtkObj( pNtkNew, pIvyFanin->TravId ); Abc_ObjAddFanin( pObjNew, pFaninNew ); - pCompls[k] = Ivy_FanCompl(Fanin); + pCompls[k] = Ivy_EdgeIsComplement(Fanin); assert( Ivy_ObjIsAndMulti(pIvyNode) || nFanins == 1 || pCompls[k] == 0 ); // EXOR/LUT cannot have complemented fanins } assert( k <= PLAYER_FANIN_LIMIT ); @@ -176,10 +186,10 @@ Abc_Ntk_t * Ivy_ManToAbc( Abc_Ntk_t * pNtkOld, Ivy_Man_t * pMan ) // get the old fanin of the PO node vIvyFanins = Ivy_ObjGetFanins( Ivy_ManPo(pMan, i) ); Fanin = Vec_IntEntry( vIvyFanins, 0 ); - pIvyFanin = Ivy_ManObj( pMan, Ivy_FanId(Fanin) ); + pIvyFanin = Ivy_ManObj( pMan, Ivy_EdgeId(Fanin) ); // get the new ABC node corresponding to the old fanin pFaninNew = Abc_NtkObj( pNtkNew, pIvyFanin->TravId ); - if ( Ivy_FanCompl(Fanin) ) // complement + if ( Ivy_EdgeIsComplement(Fanin) ) // complement { // pFaninNew = Abc_NodeCreateInv(pNtkNew, pFaninNew); if ( Abc_ObjIsCi(pFaninNew) ) diff --git a/src/temp/player/playerBuild.c b/src/temp/player/playerBuild.c index a7b06f03..b23c0c16 100644 --- a/src/temp/player/playerBuild.c +++ b/src/temp/player/playerBuild.c @@ -62,7 +62,7 @@ Ivy_Man_t * Pla_ManToAig( Ivy_Man_t * pOld ) { pObjNew = Pla_ManToAig_rec( pNew, Ivy_ObjFanin0(pObjOld) ); Ivy_ObjStartFanins( Ivy_ManPo(pNew, i), 1 ); - Ivy_ObjAddFanin( Ivy_ManPo(pNew, i), Ivy_FanCreate(pObjNew->Id, Ivy_ObjFaninC0(pObjOld)) ); + Ivy_ObjAddFanin( Ivy_ManPo(pNew, i), Ivy_EdgeCreate(pObjNew->Id, Ivy_ObjFaninC0(pObjOld)) ); } // compute the LUT functions Pla_ManToAigLutFuncs( pNew, pOld ); @@ -118,7 +118,7 @@ Ivy_Obj_t * Pla_ManToAig_rec( Ivy_Man_t * pNew, Ivy_Obj_t * pObjOld ) Vec_IntForEachEntry( vSupp, Entry, i ) { pFaninOld = Ivy_ObjObj( pObjOld, Entry ); - Ivy_ObjAddFanin( Ivy_ManObj(pNew, ObjNewId), Ivy_FanCreate(pFaninOld->TravId, 0) ); + Ivy_ObjAddFanin( Ivy_ManObj(pNew, ObjNewId), Ivy_EdgeCreate(pFaninOld->TravId, 0) ); } // get the new object pObjNew = Ivy_ManObj(pNew, ObjNewId); @@ -140,7 +140,7 @@ Ivy_Obj_t * Pla_ManToAig_rec( Ivy_Man_t * pNew, Ivy_Obj_t * pObjOld ) Esop_CoverForEachCube( pCover, pCube ) { pFaninNew = Ivy_ManToAigCube( pNew, pObjOld, pCube, vSupp ); - Ivy_ObjAddFanin( Ivy_ManObj(pNew, ObjNewId), Ivy_FanCreate(pFaninNew->Id, 0) ); + Ivy_ObjAddFanin( Ivy_ManObj(pNew, ObjNewId), Ivy_EdgeCreate(pFaninNew->Id, 0) ); } // get the new object pObjNew = Ivy_ManObj(pNew, ObjNewId); @@ -168,7 +168,7 @@ Ivy_Obj_t * Ivy_ManToAigConst( Ivy_Man_t * pNew, int fConst1 ) Ivy_Obj_t * pObjNew; pObjNew = Ivy_ObjCreateExt( pNew, IVY_ANDM ); Ivy_ObjStartFanins( pObjNew, 1 ); - Ivy_ObjAddFanin( pObjNew, Ivy_FanCreate(0, !fConst1) ); + Ivy_ObjAddFanin( pObjNew, Ivy_EdgeCreate(0, !fConst1) ); return pObjNew; } @@ -201,7 +201,7 @@ Ivy_Obj_t * Ivy_ManToAigCube( Ivy_Man_t * pNew, Ivy_Obj_t * pObjOld, Esop_Cube_t if ( Value == 3 ) continue; pFaninOld = Ivy_ObjObj( pObjOld, Vec_IntEntry(vSupp, i) ); - Ivy_ObjAddFanin( pObjNew, Ivy_FanCreate( pFaninOld->TravId, Value==1 ) ); + Ivy_ObjAddFanin( pObjNew, Ivy_EdgeCreate( pFaninOld->TravId, Value==1 ) ); } assert( Ivy_ObjFaninNum(pObjNew) == (int)pCube->nLits ); return pObjNew; @@ -262,7 +262,7 @@ int Pla_ManToAigLutFuncs( Ivy_Man_t * pNew, Ivy_Man_t * pOld ) // point it to the constant 1 node vFanins = Ivy_ObjGetFanins( pObjNew ); Vec_IntClear( vFanins ); - Vec_IntPush( vFanins, Ivy_FanCreate(0, 1) ); + Vec_IntPush( vFanins, Ivy_EdgeCreate(0, 1) ); } memcpy( pTruth, pComputed, sizeof(unsigned) * 8 ); // Extra_PrintBinary( stdout, pTruth, 16 ); printf( "\n" ); diff --git a/src/temp/player/playerCore.c b/src/temp/player/playerCore.c index 3cd3d8a8..258a3336 100644 --- a/src/temp/player/playerCore.c +++ b/src/temp/player/playerCore.c @@ -221,6 +221,7 @@ int Pla_ManDecomposeNode( Pla_Man_t * p, Ivy_Obj_t * pObj ) if ( pStr1->fFixed == 0 ) Pla_ManCountDecNodes( p, pStr1 ); pStr1->fFixed = 1; } + assert( pStr->Depth ); // free some of the covers to save memory assert( pStr0->nRefs > 0 ); diff --git a/src/temp/player/playerUtil.c b/src/temp/player/playerUtil.c index 1b361839..ced2d6b7 100644 --- a/src/temp/player/playerUtil.c +++ b/src/temp/player/playerUtil.c @@ -309,7 +309,7 @@ void Pla_ManComputeStats( Ivy_Man_t * p, Vec_Int_t * vNodes ) vFanins = Ivy_ObjGetFanins( pObj ); Vec_IntForEachEntry( vFanins, Fanin, k ) { - pFanin = Ivy_ManObj(p, Ivy_FanId(Fanin)); + pFanin = Ivy_ManObj(p, Ivy_EdgeId(Fanin)); pObj->Level = IVY_MAX( pObj->Level, pFanin->Level ); } pObj->Level += 1; @@ -335,7 +335,7 @@ void Pla_ManComputeStats( Ivy_Man_t * p, Vec_Int_t * vNodes ) Ivy_ManForEachPo( p, pObj, i ) { Fanin = Ivy_ObjReadFanin(pObj, 0); - pFanin = Ivy_ManObj( p, Ivy_FanId(Fanin) ); + pFanin = Ivy_ManObj( p, Ivy_EdgeId(Fanin) ); pObj->Level = pFanin->Level; Delay = IVY_MAX( Delay, (int)pObj->Level ); } |