summaryrefslogtreecommitdiffstats
path: root/src/aig/nwk/nwkMap.c
diff options
context:
space:
mode:
authorAlan Mishchenko <alanmi@berkeley.edu>2008-04-11 08:01:00 -0700
committerAlan Mishchenko <alanmi@berkeley.edu>2008-04-11 08:01:00 -0700
commit651a32cdc379d2341c631b719ed9af16ce5a66c9 (patch)
tree9c4ffb213ac4a958db8134e21c5e83bafe48005b /src/aig/nwk/nwkMap.c
parentc645bac3663c265470024b44ed91b0afdbe59b88 (diff)
downloadabc-651a32cdc379d2341c631b719ed9af16ce5a66c9.tar.gz
abc-651a32cdc379d2341c631b719ed9af16ce5a66c9.tar.bz2
abc-651a32cdc379d2341c631b719ed9af16ce5a66c9.zip
Version abc80411
Diffstat (limited to 'src/aig/nwk/nwkMap.c')
-rw-r--r--src/aig/nwk/nwkMap.c22
1 files changed, 19 insertions, 3 deletions
diff --git a/src/aig/nwk/nwkMap.c b/src/aig/nwk/nwkMap.c
index 6c1e1330..f5b2b7f8 100644
--- a/src/aig/nwk/nwkMap.c
+++ b/src/aig/nwk/nwkMap.c
@@ -56,7 +56,7 @@ void Nwk_ManSetIfParsDefault( If_Par_t * pPars )
pPars->fPreprocess = 1;
pPars->fArea = 0;
pPars->fFancy = 0;
- pPars->fExpRed = 0;
+ pPars->fExpRed = 1; ////
pPars->fLatchPaths = 0;
pPars->fEdge = 1;
pPars->fCutMin = 0;
@@ -244,16 +244,25 @@ Hop_Obj_t * Nwk_NodeIfToHop( Hop_Man_t * pHopMan, If_Man_t * pIfMan, If_Obj_t *
***********************************************************************/
Nwk_Man_t * Nwk_ManFromIf( If_Man_t * pIfMan, Aig_Man_t * p, Vec_Ptr_t * vAigToIf )
{
+ Vec_Ptr_t * vIfToAig;
Nwk_Man_t * pNtk;
Nwk_Obj_t * pObjNew;
- Aig_Obj_t * pObj;
+ Aig_Obj_t * pObj, * pObjRepr;
If_Obj_t * pIfObj;
If_Cut_t * pCutBest;
int i, k, nLeaves, * ppLeaves;
assert( Aig_ManPiNum(p) == If_ManCiNum(pIfMan) );
assert( Aig_ManPoNum(p) == If_ManCoNum(pIfMan) );
assert( Aig_ManNodeNum(p) == If_ManAndNum(pIfMan) );
+ Aig_ManCleanData( p );
If_ManCleanCutData( pIfMan );
+ // create mapping of IF to AIG
+ vIfToAig = Vec_PtrStart( If_ManObjNum(pIfMan) );
+ Aig_ManForEachObj( p, pObj, i )
+ {
+ pIfObj = Vec_PtrEntry( vAigToIf, i );
+ Vec_PtrWriteEntry( vIfToAig, pIfObj->Id, pObj );
+ }
// construct the network
pNtk = Nwk_ManAlloc();
pNtk->pName = Aig_UtilStrsav( p->pName );
@@ -271,7 +280,10 @@ Nwk_Man_t * Nwk_ManFromIf( If_Man_t * pIfMan, Aig_Man_t * p, Vec_Ptr_t * vAigToI
// create node
pObjNew = Nwk_ManCreateNode( pNtk, nLeaves, pIfObj->nRefs );
for ( k = 0; k < nLeaves; k++ )
- Nwk_ObjAddFanin( pObjNew, Aig_ManObj(p, ppLeaves[k])->pData );
+ {
+ pObjRepr = Vec_PtrEntry( vIfToAig, ppLeaves[k] );
+ Nwk_ObjAddFanin( pObjNew, pObjRepr->pData );
+ }
// get the functionality
pObjNew->pFunc = Nwk_NodeIfToHop( pNtk->pManHop, pIfMan, pIfObj );
}
@@ -292,7 +304,9 @@ Nwk_Man_t * Nwk_ManFromIf( If_Man_t * pIfMan, Aig_Man_t * p, Vec_Ptr_t * vAigToI
assert( 0 );
pObj->pData = pObjNew;
}
+ Vec_PtrFree( vIfToAig );
pNtk->pManTime = Tim_ManDup( pIfMan->pManTim, 0 );
+ assert( Nwk_ManCheck( pNtk ) );
return pNtk;
}
@@ -328,6 +342,8 @@ Nwk_Man_t * Nwk_MappingIf( Aig_Man_t * p, Tim_Man_t * pManTime, If_Par_t * pPars
}
// transform the result of mapping into the new network
pNtk = Nwk_ManFromIf( pIfMan, p, vAigToIf );
+ if ( pPars->fBidec && pPars->nLutSize <= 8 )
+ Nwk_ManBidecResyn( pNtk, 0 );
If_ManStop( pIfMan );
Vec_PtrFree( vAigToIf );
return pNtk;