summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlan Mishchenko <alanmi@berkeley.edu>2014-02-17 12:19:42 -0800
committerAlan Mishchenko <alanmi@berkeley.edu>2014-02-17 12:19:42 -0800
commiteb66ce9c3133f8149959c84a9ab71faa6249870d (patch)
tree28a8da402d4ee53458b45010b065e96a27888aed
parentadb3044f39fdfa261d828b8f3600dfbc0def2e4a (diff)
downloadabc-eb66ce9c3133f8149959c84a9ab71faa6249870d.tar.gz
abc-eb66ce9c3133f8149959c84a9ab71faa6249870d.tar.bz2
abc-eb66ce9c3133f8149959c84a9ab71faa6249870d.zip
Changes to LUT mappers.
-rw-r--r--src/base/abci/abc.c2
-rw-r--r--src/map/if/if.h5
-rw-r--r--src/map/if/ifCut.c7
-rw-r--r--src/map/if/ifMan.c15
-rw-r--r--src/map/if/ifMap.c48
-rw-r--r--src/opt/dau/dauTree.c2
6 files changed, 37 insertions, 42 deletions
diff --git a/src/base/abci/abc.c b/src/base/abci/abc.c
index b170bfc4..3ced561d 100644
--- a/src/base/abci/abc.c
+++ b/src/base/abci/abc.c
@@ -15075,7 +15075,7 @@ int Abc_CommandIf( Abc_Frame_t * pAbc, int argc, char ** argv )
if ( pPars->fUseDsd )
{
- pPars->fTruth = 1;
+ pPars->fTruth = 0;
pPars->fCutMin = 1;
pPars->fExpRed = 0;
pPars->fUsePerm = 1;
diff --git a/src/map/if/if.h b/src/map/if/if.h
index 26d582db..3c844a8b 100644
--- a/src/map/if/if.h
+++ b/src/map/if/if.h
@@ -230,8 +230,6 @@ struct If_Man_t_
int nCutsCountAll;
int nCutsUselessAll;
int nCuts5, nCuts5a;
-// Abc_Nam_t * pNamDsd;
- int iNamVar;
Dss_Man_t * pDsdMan;
Vec_Mem_t * vTtMem; // truth table memory and hash table
int nBestCutSmall[2];
@@ -256,7 +254,8 @@ struct If_Cut_t_
float Edge; // the edge flow
float Power; // the power flow
float Delay; // delay of the cut
- int iCutFunc; // DSD ID of the cut
+ int iCutFunc; // TT ID of the cut
+ int iCutDsd; // DSD ID of the cut
unsigned uSign; // cut signature
unsigned Cost : 13; // the user's cost of the cut (related to IF_COST_MAX)
unsigned fCompl : 1; // the complemented attribute
diff --git a/src/map/if/ifCut.c b/src/map/if/ifCut.c
index 9d84a496..65627dc2 100644
--- a/src/map/if/ifCut.c
+++ b/src/map/if/ifCut.c
@@ -885,7 +885,12 @@ void If_CutSort( If_Man_t * p, If_Set_t * pCutSet, If_Cut_t * pCut )
return;
}
- if ( (p->pPars->fUseDsd || p->pPars->fUseBat || p->pPars->fEnableCheck07 || p->pPars->fEnableCheck08 || p->pPars->fEnableCheck10 || p->pPars->fEnableCheck75 || p->pPars->fEnableCheck75u || p->pPars->pLutStruct || p->pPars->fUserRecLib) && !pCut->fUseless )
+ if ( !pCut->fUseless &&
+ (p->pPars->fUseDsd || p->pPars->fUseBat ||
+ p->pPars->pLutStruct || p->pPars->fUserRecLib ||
+ p->pPars->fEnableCheck07 || p->pPars->fEnableCheck08 ||
+ p->pPars->fEnableCheck10 || p->pPars->fEnableCheck75 ||
+ p->pPars->fEnableCheck75u) )
{
If_Cut_t * pFirst = pCutSet->ppCuts[0];
if ( pFirst->fUseless || If_ManSortCompare(p, pFirst, pCut) == 1 )
diff --git a/src/map/if/ifMan.c b/src/map/if/ifMan.c
index 3034df67..6334505b 100644
--- a/src/map/if/ifMan.c
+++ b/src/map/if/ifMan.c
@@ -84,13 +84,7 @@ If_Man_t * If_ManStart( If_Par_t * pPars )
p->puTemp[3] = p->puTemp[2] + p->nTruth6Words*2;
p->puTempW = p->pPars->fTruth? ABC_ALLOC( word, p->nTruth6Words ) : NULL;
if ( pPars->fUseDsd )
- {
-// p->pNamDsd = Abc_NamStart( 1000, 20 );
-// p->iNamVar = Abc_NamStrFindOrAdd( p->pNamDsd, "a", NULL );
p->pDsdMan = Dss_ManAlloc( pPars->nLutSize, pPars->nNonDecLimit );
- p->iNamVar = 2;
- }
-
// create the constant node
p->pConst1 = If_ManSetupObj( p );
p->pConst1->Type = IF_CONST1;
@@ -436,14 +430,11 @@ void If_ManSetupCutTriv( If_Man_t * p, If_Cut_t * pCut, int ObjId )
pCut->nLeaves = 1;
pCut->pLeaves[0] = p->pPars->fLiftLeaves? (ObjId << 8) : ObjId;
pCut->uSign = If_ObjCutSign( pCut->pLeaves[0] );
+ pCut->iCutFunc = p->pPars->fTruth ? 2 : -1;
+ pCut->iCutDsd = p->pPars->fUseDsd ? 2 : -1;
+ assert( pCut->pLeaves[0] < p->vObjs->nSize );
if ( p->pPars->fUseDsd )
- {
- pCut->iCutFunc = p->iNamVar;
pCut->pPerm[0] = 0;
- }
- // set up elementary truth table of the unit cut
- pCut->iCutFunc = p->pPars->fTruth ? 2 : -1;
- assert( pCut->pLeaves[0] < p->vObjs->nSize );
}
/**Function*************************************************************
diff --git a/src/map/if/ifMap.c b/src/map/if/ifMap.c
index d8f8785f..8342e118 100644
--- a/src/map/if/ifMap.c
+++ b/src/map/if/ifMap.c
@@ -186,6 +186,10 @@ void If_ObjPerformMappingAnd( If_Man_t * p, If_Obj_t * pObj, int Mode, int fPrep
If_CutCopy( p, pCutSet->ppCuts[pCutSet->nCuts++], pCut );
}
+ if ( pObj->Id == 153 )
+ {
+ int s = 0;
+ }
// generate cuts
If_ObjForEachCut( pObj->pFanin0, pCut0, i )
If_ObjForEachCut( pObj->pFanin1, pCut1, k )
@@ -211,14 +215,14 @@ void If_ObjPerformMappingAnd( If_Man_t * p, If_Obj_t * pObj, int Mode, int fPrep
// compute the truth table
pCut->fCompl = 0;
pCut->iCutFunc = -1;
+ pCut->iCutDsd = -1;
if ( p->pPars->fTruth )
{
// abctime clk = Abc_Clock();
- int RetValue = If_CutComputeTruth( p, pCut, pCut0, pCut1, pObj->fCompl0, pObj->fCompl1 );
+ If_CutComputeTruth( p, pCut, pCut0, pCut1, pObj->fCompl0, pObj->fCompl1 );
// p->timeTruth += Abc_Clock() - clk;
-
pCut->fUseless = 0;
- if ( p->pPars->pFuncCell && RetValue < 2 )
+ if ( p->pPars->pFuncCell )
{
assert( pCut->nLimit >= 4 && pCut->nLimit <= 16 );
pCut->fUseless = !p->pPars->pFuncCell( p, If_CutTruth(p, pCut), pCut->nLimit, pCut->nLeaves, p->pPars->pLutStruct );
@@ -253,29 +257,25 @@ void If_ObjPerformMappingAnd( If_Man_t * p, If_Obj_t * pObj, int Mode, int fPrep
}
if ( p->pPars->fUseDsd )
{
- if ( pCut0->iCutFunc < 0 || pCut1->iCutFunc < 0 )
- pCut->iCutFunc = -1;
- else
+ int j, iDsd[2] = { Abc_LitNotCond(pCut0->iCutDsd, pObj->fCompl0), Abc_LitNotCond(pCut1->iCutDsd, pObj->fCompl1) };
+ int nFans[2] = { pCut0->nLeaves, pCut1->nLeaves };
+ int Fans[2][DAU_MAX_VAR], * pFans[2] = { Fans[0], Fans[1] };
+ assert( pCut0->iCutDsd >= 0 && pCut1->iCutDsd >= 0 );
+ // create fanins
+ for ( j = 0; j < (int)pCut0->nLeaves; j++ )
+ pFans[0][j] = Abc_Lit2LitV( p->pPerm[0], (int)pCut0->pPerm[j] );
+ for ( j = 0; j < (int)pCut1->nLeaves; j++ )
+ pFans[1][j] = Abc_Lit2LitV( p->pPerm[1], (int)pCut1->pPerm[j] );
+ // canonicize
+ if ( iDsd[0] > iDsd[1] )
{
- int j, iDsd[2] = { Abc_LitNotCond(pCut0->iCutFunc, pObj->fCompl0), Abc_LitNotCond(pCut1->iCutFunc, 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_Lit2LitV( p->pPerm[0], (int)pCut0->pPerm[j] );
- for ( j = 0; j < (int)pCut1->nLeaves; j++ )
- pFans[1][j] = Abc_Lit2LitV( 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->iCutFunc = Dss_ManMerge( p->pDsdMan, iDsd, nFans, pFans, p->uSharedMask, pCut->nLimit, (unsigned char *)pCut->pPerm, If_CutTruthW(p, pCut) );
+ ABC_SWAP( int, iDsd[0], iDsd[1] );
+ ABC_SWAP( int, nFans[0], nFans[1] );
+ ABC_SWAP( int *, pFans[0], pFans[1] );
}
- if ( pCut->iCutFunc < 0 )
+ // derive new DSD
+ pCut->iCutDsd = Dss_ManMerge( p->pDsdMan, iDsd, nFans, pFans, p->uSharedMask, pCut->nLimit, (unsigned char *)pCut->pPerm, If_CutTruthW(p, pCut) );
+ if ( pCut->iCutDsd < 0 )
{
pCut->fUseless = 1;
p->nCutsUselessAll++;
diff --git a/src/opt/dau/dauTree.c b/src/opt/dau/dauTree.c
index e0ce4ac4..4a522d92 100644
--- a/src/opt/dau/dauTree.c
+++ b/src/opt/dau/dauTree.c
@@ -981,7 +981,7 @@ Dss_Man_t * Dss_ManAlloc( int nVars, int nNonDecLimit )
p->vCopies = Vec_IntAlloc( 32 );
p->pTtElems = Dss_ManTtElems();
p->pMemEnts = Mem_FlexStart();
- Dss_ManCacheAlloc( p );
+// Dss_ManCacheAlloc( p );
return p;
}
void Dss_ManFree( Dss_Man_t * p )