Commit 7669c996 by Alan Mishchenko

Improvements to technology mapping.

parent 3db3be2d
......@@ -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 )
......
......@@ -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 );
......
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment