summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlan Mishchenko <alanmi@berkeley.edu>2014-04-03 12:23:49 -0700
committerAlan Mishchenko <alanmi@berkeley.edu>2014-04-03 12:23:49 -0700
commit7669c99605b6c7ea4a3e560d99861e57da4e8f54 (patch)
treefb8dfa49bd541eaa2451ad38222ff1a072a17591
parent3db3be2d6130324f9c8d685c4dc04d7069fcab12 (diff)
downloadabc-7669c99605b6c7ea4a3e560d99861e57da4e8f54.tar.gz
abc-7669c99605b6c7ea4a3e560d99861e57da4e8f54.tar.bz2
abc-7669c99605b6c7ea4a3e560d99861e57da4e8f54.zip
Improvements to technology mapping.
-rw-r--r--src/map/if/ifCache.c1
-rw-r--r--src/map/if/ifMan.c5
-rw-r--r--src/map/if/ifMap.c11
3 files changed, 9 insertions, 8 deletions
diff --git a/src/map/if/ifCache.c b/src/map/if/ifCache.c
index f2312447..c36139d9 100644
--- a/src/map/if/ifCache.c
+++ b/src/map/if/ifCache.c
@@ -44,6 +44,7 @@ ABC_NAMESPACE_IMPL_START
***********************************************************************/
void If_ManCacheRecord( If_Man_t * p, int iDsd0, int iDsd1, int nShared, int iDsd )
{
+ assert( nShared >= 0 && nShared <= p->pPars->nLutSize );
if ( p->vCutData == NULL )
p->vCutData = Vec_IntAlloc( 10000 );
if ( iDsd0 > iDsd1 )
diff --git a/src/map/if/ifMan.c b/src/map/if/ifMan.c
index 0c526364..7874d7e0 100644
--- a/src/map/if/ifMan.c
+++ b/src/map/if/ifMan.c
@@ -167,7 +167,8 @@ void If_ManStop( If_Man_t * p )
nUnique += Vec_MemEntryNum(p->vTtMem[i]);
for ( i = 6; i <= p->pPars->nLutSize; i++ )
nMemTotal += (int)Vec_MemMemory(p->vTtMem[i]);
- printf( "Unique truth tables = %d. Memory = %.2f MB\n", nUnique, 1.0 * nMemTotal / (1<<20) );
+ printf( "Unique truth tables = %d Memory = %.2f MB ", nUnique, 1.0 * nMemTotal / (1<<20) );
+ Abc_PrintTime( 1, "Time", p->timeCache[4] );
if ( p->nCacheMisses )
{
printf( "Cache hits = %d. Cache misses = %d (%.2f %%)\n", p->nCacheHits, p->nCacheMisses, 100.0 * p->nCacheMisses / (p->nCacheHits + p->nCacheMisses) );
@@ -191,8 +192,6 @@ void If_ManStop( If_Man_t * p )
p->pIfDsdMan = NULL;
if ( p->pPars->fUseDsd && (p->nCountNonDec[0] || p->nCountNonDec[1]) )
printf( "NonDec0 = %d. NonDec1 = %d.\n", p->nCountNonDec[0], p->nCountNonDec[1] );
-// Abc_PrintTime( 1, "Truth", p->timeTruth );
-// Abc_Print( 1, "Small support = %d.\n", p->nSmallSupp );
Vec_IntFreeP( &p->vCoAttrs );
Vec_PtrFree( p->vCis );
Vec_PtrFree( p->vCos );
diff --git a/src/map/if/ifMap.c b/src/map/if/ifMap.c
index fc9c6ebe..8b81003a 100644
--- a/src/map/if/ifMap.c
+++ b/src/map/if/ifMap.c
@@ -176,7 +176,7 @@ void If_ObjPerformMappingAnd( If_Man_t * p, If_Obj_t * pObj, int Mode, int fPrep
}
else
{
- if ( !If_CutMergeOrdered( p, pCut0R, pCut1R, pCut ) )
+ if ( !If_CutMergeOrdered( p, pCut0, pCut1, pCut ) )
continue;
}
if ( pObj->fSpec && pCut->nLeaves == (unsigned)p->pPars->nLutSize )
@@ -187,19 +187,20 @@ void If_ObjPerformMappingAnd( If_Man_t * p, If_Obj_t * pObj, int Mode, int fPrep
if ( !p->pPars->fSkipCutFilter && If_CutFilter( pCutSet, pCut ) )
continue;
// compute the truth table
- pCut->fCompl = 0;
pCut->iCutFunc = -1;
pCut->iCutDsd = -1;
+ pCut->fCompl = 0;
if ( p->pPars->fTruth )
{
-// abctime clk = Abc_Clock();
+// int nShared = pCut0->nLeaves + pCut1->nLeaves - pCut->nLeaves;
+ abctime 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->fSkipCutFilter && fChange && If_CutFilter( pCutSet, pCut ) )
continue;
-// p->timeTruth += Abc_Clock() - clk;
if ( p->pPars->fUseDsd )
{
extern void If_ManCacheRecord( If_Man_t * p, int iDsd0, int iDsd1, int nShared, int iDsd );
@@ -223,7 +224,7 @@ void If_ObjPerformMappingAnd( If_Man_t * p, If_Obj_t * pObj, int Mode, int fPrep
for ( v = 0; v < (int)pCut->nLeaves; v++ )
pCut->pPerm[v] = (unsigned char)Vec_StrEntry( p->vTtPerms, truthId * p->pPars->nLutSize + v );
}
- If_ManCacheRecord( p, pCut0R->iCutDsd, pCut1R->iCutDsd, p->nShared, pCut->iCutDsd );
+// If_ManCacheRecord( p, pCut0->iCutDsd, pCut1->iCutDsd, nShared, pCut->iCutDsd );
}
// run user functions
pCut->fUseless = 0;