diff options
author | Alan Mishchenko <alanmi@berkeley.edu> | 2011-07-15 12:27:40 +0700 |
---|---|---|
committer | Alan Mishchenko <alanmi@berkeley.edu> | 2011-07-15 12:27:40 +0700 |
commit | 96e44e313e47e5955fa6cb31af358b0958fe1e9a (patch) | |
tree | 7f8187309b34a56bfc3d2a7015b8c2951b6fd901 | |
parent | 2dd6b9789d3561f1d4d5cada11c6b77aa108cca8 (diff) | |
download | abc-96e44e313e47e5955fa6cb31af358b0958fe1e9a.tar.gz abc-96e44e313e47e5955fa6cb31af358b0958fe1e9a.tar.bz2 abc-96e44e313e47e5955fa6cb31af358b0958fe1e9a.zip |
Other changes to enable new features in the mapper (bug fix).
-rw-r--r-- | src/base/abci/abcIf.c | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/src/base/abci/abcIf.c b/src/base/abci/abcIf.c index 8e057019..34d2dd67 100644 --- a/src/base/abci/abcIf.c +++ b/src/base/abci/abcIf.c @@ -40,6 +40,7 @@ extern void Abc_NtkBddReorder( Abc_Ntk_t * pNtk, int fVerbose ); extern void Abc_NtkBidecResyn( Abc_Ntk_t * pNtk, int fVerbose ); extern void Abc_NtkCollectPoDrivers( If_Man_t * p, Abc_Ntk_t * pNtk ); +extern void Abc_NtkCreateChoiceDrivers( If_Man_t * p ); extern void Abc_NtkFreePoDrivers( If_Man_t * p, Abc_Ntk_t * pNtk ); //////////////////////////////////////////////////////////////////////// @@ -139,6 +140,7 @@ Abc_Ntk_t * Abc_NtkIf( Abc_Ntk_t * pNtk, If_Par_t * pPars ) // perform FPGA mapping if ( pPars->fEnableRealPos ) Abc_NtkCollectPoDrivers( pIfMan, pNtk ); + Abc_NtkCreateChoiceDrivers( pIfMan ); if ( !If_ManPerformMapping( pIfMan ) ) { Abc_NtkFreePoDrivers( pIfMan, pNtk ); @@ -762,6 +764,52 @@ void Abc_NtkCollectPoDrivers( If_Man_t * p, Abc_Ntk_t * pNtk ) // printf( "\n" ); } + +/**Function************************************************************* + + Synopsis [Frees PO drivers.] + + Description [] + + SideEffects [] + + SeeAlso [] + +***********************************************************************/ +void Abc_NtkCreateChoiceDrivers( If_Man_t * p ) +{ + Vec_Int_t * vVec; + If_Obj_t * pObj, * pTemp; + int i, Counter = 0; + if ( p->pDriverCuts == NULL ) + return; + If_ManForEachNode( p, pObj, i ) + { + // skip non-choice nodes + if ( pObj->pEquiv == NULL || pObj->nRefs == 0 ) + continue; + // find driver cut + vVec = NULL; + for ( pTemp = pObj; pTemp; pTemp = pTemp->pEquiv ) + if ( p->pDriverCuts[pTemp->Id] != NULL ) + { + vVec = Vec_IntDup( p->pDriverCuts[pTemp->Id] ); + break; + } + if ( vVec == NULL ) + continue; + // transfer driver cut to the root node + for ( pTemp = pObj; pTemp; pTemp = pTemp->pEquiv ) + { + Vec_IntFreeP( &p->pDriverCuts[pTemp->Id] ); + p->pDriverCuts[pTemp->Id] = Vec_IntDup( vVec ); + } + Vec_IntFree( vVec ); + Counter++; + } +// printf( "Choice driver cut updates = %d.\n", Counter ); +} + /**Function************************************************************* Synopsis [Frees PO drivers.] |