summaryrefslogtreecommitdiffstats
path: root/src/map/if/ifMap.c
diff options
context:
space:
mode:
authorAlan Mishchenko <alanmi@berkeley.edu>2012-11-20 21:34:40 -0800
committerAlan Mishchenko <alanmi@berkeley.edu>2012-11-20 21:34:40 -0800
commitb2fd119933166ad7d9e4132ebb8aaf422bfcdb8a (patch)
treef41993309b2f4a791e92b581562e24e462096bc6 /src/map/if/ifMap.c
parentffbe3bc5767c597b3ca612a12e671749f23ca34f (diff)
downloadabc-b2fd119933166ad7d9e4132ebb8aaf422bfcdb8a.tar.gz
abc-b2fd119933166ad7d9e4132ebb8aaf422bfcdb8a.tar.bz2
abc-b2fd119933166ad7d9e4132ebb8aaf422bfcdb8a.zip
DSD manager.
Diffstat (limited to 'src/map/if/ifMap.c')
-rw-r--r--src/map/if/ifMap.c52
1 files changed, 28 insertions, 24 deletions
diff --git a/src/map/if/ifMap.c b/src/map/if/ifMap.c
index ad50e1cc..ac606416 100644
--- a/src/map/if/ifMap.c
+++ b/src/map/if/ifMap.c
@@ -277,32 +277,36 @@ void If_ObjPerformMappingAnd( If_Man_t * p, If_Obj_t * pObj, int Mode, int fPrep
}
if ( p->pPars->fUseDsd )
{
- int j, iDsd[2] = { Abc_LitNotCond(pCut0->iDsd, pObj->fCompl0), Abc_LitNotCond(pCut1->iDsd, pObj->fCompl1) };
- int nFans[2] = { pCut0->nLeaves, pCut1->nLeaves };
- int Fans[2][DAU_MAX_VAR], * pFans[2] = { Fans[0], Fans[1] };
-/*
- char * pName = Dau_DsdMerge(
- Abc_NamStr(p->pNamDsd, pCut0->iDsd),
- If_CutPerm0(pCut, pCut0),
- Abc_NamStr(p->pNamDsd, pCut1->iDsd),
- If_CutPerm1(pCut, pCut1),
- pObj->fCompl0, pObj->fCompl1, pCut->nLimit );
- pCut->iDsd = Abc_NamStrFindOrAdd( p->pNamDsd, pName, NULL );
-*/
- // create fanins
- for ( j = 0; j < (int)pCut0->nLeaves; j++ )
- pFans[0][j] = Abc_Lit2Lit( p->pPerm[0], (int)pCut0->pPerm[j] );
- for ( j = 0; j < (int)pCut1->nLeaves; j++ )
- pFans[1][j] = Abc_Lit2Lit( p->pPerm[1], (int)pCut1->pPerm[j] );
- // canonicize
- if ( iDsd[0] > iDsd[1] )
+ if ( pCut0->iDsd < 0 || pCut1->iDsd < 0 )
+ pCut->iDsd = -1;
+ else
+ {
+ int j, iDsd[2] = { Abc_LitNotCond(pCut0->iDsd, pObj->fCompl0), Abc_LitNotCond(pCut1->iDsd, pObj->fCompl1) };
+ int nFans[2] = { pCut0->nLeaves, pCut1->nLeaves };
+ int Fans[2][DAU_MAX_VAR], * pFans[2] = { Fans[0], Fans[1] };
+ // create fanins
+ for ( j = 0; j < (int)pCut0->nLeaves; j++ )
+ pFans[0][j] = Abc_Lit2Lit( p->pPerm[0], (int)pCut0->pPerm[j] );
+ for ( j = 0; j < (int)pCut1->nLeaves; j++ )
+ pFans[1][j] = Abc_Lit2Lit( p->pPerm[1], (int)pCut1->pPerm[j] );
+ // canonicize
+ if ( iDsd[0] > iDsd[1] )
+ {
+ ABC_SWAP( int, iDsd[0], iDsd[1] );
+ ABC_SWAP( int, nFans[0], nFans[1] );
+ ABC_SWAP( int *, pFans[0], pFans[1] );
+ }
+ // derive new DSD
+ pCut->iDsd = Dss_ManMerge( p->pDsdMan, iDsd, nFans, pFans, p->uSharedMask, pCut->nLimit, pCut->pPerm, If_CutTruthW(pCut) );
+ }
+ if ( pCut->iDsd < 0 )
{
- ABC_SWAP( int, iDsd[0], iDsd[1] );
- ABC_SWAP( int, nFans[0], nFans[1] );
- ABC_SWAP( int *, pFans[0], pFans[1] );
+ pCut->fUseless = 1;
+ p->nCutsUselessAll++;
+ p->nCutsUseless[pCut->nLeaves]++;
}
- // derive new DSD
- pCut->iDsd = Dss_ManMerge( p->pDsdMan, iDsd, nFans, pFans, p->uSharedMask, pCut->nLimit, pCut->pPerm );
+ p->nCutsCountAll++;
+ p->nCutsCount[pCut->nLeaves]++;
}
// compute the application-specific cost and depth