summaryrefslogtreecommitdiffstats
path: root/src/map/if/ifMap.c
diff options
context:
space:
mode:
authorAlan Mishchenko <alanmi@berkeley.edu>2014-02-25 22:41:34 -0800
committerAlan Mishchenko <alanmi@berkeley.edu>2014-02-25 22:41:34 -0800
commitcaa2227b1127802e4b35f296106ca19e113ea601 (patch)
tree9fb8f4f2099f829063e96b1b74ea26c803fa50eb /src/map/if/ifMap.c
parent15a1c4b96507b524959d171a26b796d6263ea284 (diff)
downloadabc-caa2227b1127802e4b35f296106ca19e113ea601.tar.gz
abc-caa2227b1127802e4b35f296106ca19e113ea601.tar.bz2
abc-caa2227b1127802e4b35f296106ca19e113ea601.zip
Changes to LUT mappers.
Diffstat (limited to 'src/map/if/ifMap.c')
-rw-r--r--src/map/if/ifMap.c22
1 files changed, 20 insertions, 2 deletions
diff --git a/src/map/if/ifMap.c b/src/map/if/ifMap.c
index c22d8604..34e83139 100644
--- a/src/map/if/ifMap.c
+++ b/src/map/if/ifMap.c
@@ -217,6 +217,7 @@ void If_ObjPerformMappingAnd( If_Man_t * p, If_Obj_t * pObj, int Mode, int fPrep
// abctime clk = Abc_Clock();
If_CutComputeTruth( p, pCut, pCut0, pCut1, pObj->fCompl0, pObj->fCompl1 );
// p->timeTruth += Abc_Clock() - clk;
+ // run user functions
pCut->fUseless = 0;
if ( p->pPars->pFuncCell )
{
@@ -250,9 +251,26 @@ void If_ObjPerformMappingAnd( If_Man_t * p, If_Obj_t * pObj, int Mode, int fPrep
p->nCuts5a++;
}
}
+ if ( p->pPars->fUseDsd )
+ {
+ int truthId = Abc_Lit2Var(pCut->iCutFunc);
+ if ( Vec_IntSize(p->vDsds) <= truthId || Vec_IntEntry(p->vDsds, truthId) == -1 )
+ {
+ pCut->iCutDsd = If_DsdManCompute( p->pIfDsdMan, If_CutTruthW(p, pCut), pCut->nLeaves, (unsigned char *)pCut->pPerm, p->pPars->pLutStruct );
+ while ( Vec_IntSize(p->vDsds) <= truthId )
+ Vec_IntPush( p->vDsds, -1 );
+ Vec_IntWriteEntry( p->vDsds, truthId, Abc_LitNotCond(pCut->iCutDsd, Abc_LitIsCompl(pCut->iCutFunc)) );
+ }
+ else
+ pCut->iCutDsd = Abc_LitNotCond( Vec_IntEntry(p->vDsds, truthId), Abc_LitIsCompl(pCut->iCutFunc) );
+ if ( p->pPars->pLutStruct )
+ {
+ int Value = If_DsdManCheckDec( p->pIfDsdMan, pCut->iCutDsd );
+ if ( Value != (int)pCut->fUseless )
+ printf( "Difference\n" );
+ }
+ }
}
- if ( p->pPars->fUseDsd && Abc_Lit2Var(pCut->iCutFunc) == Vec_MemEntryNum(p->vTtMem)-1 )
- pCut->iCutDsd = If_DsdManCompute( p->pIfDsdMan, If_CutTruthW(p, pCut), pCut->nLeaves, (unsigned char *)pCut->pPerm );
// compute the application-specific cost and depth
pCut->fUser = (p->pPars->pFuncCost != NULL);