summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlan Mishchenko <alanmi@berkeley.edu>2014-04-03 12:57:27 -0700
committerAlan Mishchenko <alanmi@berkeley.edu>2014-04-03 12:57:27 -0700
commit71e11a3eec43738aef8c06e625882db57d29f4c3 (patch)
tree413fe85be165019016ca4a88bb75364256cc3672
parent7669c99605b6c7ea4a3e560d99861e57da4e8f54 (diff)
downloadabc-71e11a3eec43738aef8c06e625882db57d29f4c3.tar.gz
abc-71e11a3eec43738aef8c06e625882db57d29f4c3.tar.bz2
abc-71e11a3eec43738aef8c06e625882db57d29f4c3.zip
Improvements to technology mapping.
-rw-r--r--src/map/if/ifMap.c7
-rw-r--r--src/map/if/ifTruth.c16
2 files changed, 17 insertions, 6 deletions
diff --git a/src/map/if/ifMap.c b/src/map/if/ifMap.c
index 8b81003a..f04cb201 100644
--- a/src/map/if/ifMap.c
+++ b/src/map/if/ifMap.c
@@ -193,12 +193,15 @@ void If_ObjPerformMappingAnd( If_Man_t * p, If_Obj_t * pObj, int Mode, int fPrep
if ( p->pPars->fTruth )
{
// int nShared = pCut0->nLeaves + pCut1->nLeaves - pCut->nLeaves;
- abctime clk = Abc_Clock();
+ abctime clk = 0;
+ if ( p->pPars->fVerbose )
+ clk = Abc_Clock();
if ( p->pPars->fUseTtPerm )
fChange = If_CutComputeTruthPerm( p, pCut, pCut0R, pCut1R, fFunc0R, fFunc1R );
else
fChange = If_CutComputeTruth( p, pCut, pCut0, pCut1, pObj->fCompl0, pObj->fCompl1 );
- p->timeCache[4] += Abc_Clock() - clk;
+ if ( p->pPars->fVerbose )
+ p->timeCache[4] += Abc_Clock() - clk;
if ( !p->pPars->fSkipCutFilter && fChange && If_CutFilter( pCutSet, pCut ) )
continue;
if ( p->pPars->fUseDsd )
diff --git a/src/map/if/ifTruth.c b/src/map/if/ifTruth.c
index 50210a8d..ad641a47 100644
--- a/src/map/if/ifTruth.c
+++ b/src/map/if/ifTruth.c
@@ -111,7 +111,7 @@ int If_CutComputeTruth( If_Man_t * p, If_Cut_t * pCut, If_Cut_t * pCut0, If_Cut_
Abc_TtStretch( pTruth1, pCut->nLeaves, pCut1->pLeaves, pCut1->nLeaves, pCut->pLeaves, pCut->nLeaves );
fCompl = (pTruth0[0] & pTruth1[0] & 1);
Abc_TtAnd( pTruth, pTruth0, pTruth1, nWords, fCompl );
- if ( p->pPars->fCutMin )
+ if ( p->pPars->fCutMin && (pCut0->nLeaves + pCut1->nLeaves > pCut->nLeaves || pCut0->nLeaves == 0 || pCut1->nLeaves == 0) )
{
nLeavesNew = Abc_TtMinBase( pTruth, pCut->pLeaves, pCut->nLeaves, pCut->nLeaves );
if ( nLeavesNew < If_CutLeaveNum(pCut) )
@@ -149,7 +149,7 @@ int If_CutComputeTruth( If_Man_t * p, If_Cut_t * pCut, If_Cut_t * pCut0, If_Cut_
int If_CutComputeTruthPerm_int( If_Man_t * p, If_Cut_t * pCut, If_Cut_t * pCut0, If_Cut_t * pCut1, int iCutFunc0, int iCutFunc1 )
{
int fVerbose = 0;
- abctime clk;
+ abctime clk = 0;
int pPerm[IF_MAX_LUTSIZE];
int v, Place, fCompl, truthId, nLeavesNew, RetValue = 0;
int nWords = Abc_TtWordNum( pCut->nLeaves );
@@ -211,8 +211,10 @@ if ( fVerbose )
}
}
// compute canonical form
+if ( p->pPars->fVerbose )
clk = Abc_Clock();
p->uCanonPhase = Abc_TtCanonicize( pTruth, pCut->nLeaves, p->pCanonPerm );
+if ( p->pPars->fVerbose )
p->timeCache[3] += Abc_Clock() - clk;
for ( v = 0; v < (int)pCut->nLeaves; v++ )
pPerm[v] = Abc_LitNotCond( pCut->pLeaves[(int)p->pCanonPerm[v]], ((p->uCanonPhase>>v)&1) );
@@ -247,11 +249,14 @@ if ( fVerbose )
}
int If_CutComputeTruthPerm( If_Man_t * p, If_Cut_t * pCut, If_Cut_t * pCut0, If_Cut_t * pCut1, int iCutFunc0, int iCutFunc1 )
{
- abctime clk = Abc_Clock();
+ abctime clk = 0;
int i, Num, nEntriesOld, RetValue;
if ( pCut0->nLeaves + pCut1->nLeaves > pCut->nLeaves || iCutFunc0 < 2 || iCutFunc1 < 2 )
{
+if ( p->pPars->fVerbose )
+clk = Abc_Clock();
RetValue = If_CutComputeTruthPerm_int( p, pCut, pCut0, pCut1, iCutFunc0, iCutFunc1 );
+if ( p->pPars->fVerbose )
p->timeCache[0] += Abc_Clock() - clk;
return RetValue;
}
@@ -284,9 +289,11 @@ p->timeCache[0] += Abc_Clock() - clk;
}
// printf( "Found: %d(%d) %d(%d) -> %d(%d)\n", iCutFunc0, pCut0->nLeaves, iCutFunc1, pCut0->nLeaves, pCut->iCutFunc, pCut->nLeaves );
p->nCacheHits++;
-p->timeCache[1] += Abc_Clock() - clk;
+//p->timeCache[1] += Abc_Clock() - clk;
return 0;
}
+if ( p->pPars->fVerbose )
+clk = Abc_Clock();
p->nCacheMisses++;
RetValue = If_CutComputeTruthPerm_int( p, pCut, pCut0, pCut1, iCutFunc0, iCutFunc1 );
assert( RetValue == 0 );
@@ -300,6 +307,7 @@ p->timeCache[1] += Abc_Clock() - clk;
Vec_StrPush( p->vPairPerms, (char)Abc_Var2Lit((int)p->pCanonPerm[i], ((p->uCanonPhase>>i)&1)) );
for ( i = (int)pCut0->nLeaves + (int)pCut1->nLeaves; i < (int)pCut->nLimit; i++ )
Vec_StrPush( p->vPairPerms, (char)-1 );
+if ( p->pPars->fVerbose )
p->timeCache[2] += Abc_Clock() - clk;
return 0;
}