Commit 6ad7dae1 by Alan Mishchenko

Changes to LUT mappers.

parent eb66ce9c
......@@ -2319,6 +2319,10 @@ SOURCE=.\src\map\if\ifDec75.c
# End Source File
# Begin Source File
SOURCE=.\src\map\if\ifDsd.c
# End Source File
# Begin Source File
SOURCE=.\src\map\if\ifLibBox.c
# End Source File
# Begin Source File
......
......@@ -15075,7 +15075,7 @@ int Abc_CommandIf( Abc_Frame_t * pAbc, int argc, char ** argv )
if ( pPars->fUseDsd )
{
pPars->fTruth = 0;
pPars->fTruth = 1;
pPars->fCutMin = 1;
pPars->fExpRed = 0;
pPars->fUsePerm = 1;
......@@ -78,6 +78,7 @@ typedef struct If_Cut_t_ If_Cut_t;
typedef struct If_Set_t_ If_Set_t;
typedef struct If_LibLut_t_ If_LibLut_t;
typedef struct If_LibBox_t_ If_LibBox_t;
typedef struct If_DsdMan_t_ If_DsdMan_t;
typedef struct Ifif_Par_t_ Ifif_Par_t;
struct Ifif_Par_t_
......@@ -230,7 +231,7 @@ struct If_Man_t_
int nCutsCountAll;
int nCutsUselessAll;
int nCuts5, nCuts5a;
Dss_Man_t * pDsdMan;
If_DsdMan_t * pIfDsdMan;
Vec_Mem_t * vTtMem; // truth table memory and hash table
int nBestCutSmall[2];
......@@ -265,7 +266,6 @@ struct If_Cut_t_
unsigned nLeaves : 8; // the number of leaves
int * pLeaves; // array of fanins
char * pPerm; // permutation
// unsigned * pTruth; // the truth table
};
// set of priority cut
......@@ -513,6 +513,11 @@ extern int If_CluCheckExt( void * p, word * pTruth, int nVars, int n
char * pLut0, char * pLut1, word * pFunc0, word * pFunc1 );
extern int If_CluCheckExt3( void * p, word * pTruth, int nVars, int nLutLeaf, int nLutLeaf2, int nLutRoot,
char * pLut0, char * pLut1, char * pLut2, word * pFunc0, word * pFunc1, word * pFunc2 );
/*=== ifDsd.c =============================================================*/
extern If_DsdMan_t * If_DsdManAlloc( int nLutSize );
extern void If_DsdManPrint( If_DsdMan_t * p, char * pFileName );
extern void If_DsdManFree( If_DsdMan_t * p );
extern int If_DsdManCompute( If_DsdMan_t * p, word * pTruth, int nLeaves, unsigned char * pPerm );
/*=== ifLib.c =============================================================*/
extern If_LibLut_t * If_LibLutRead( char * FileName );
extern If_LibLut_t * If_LibLutDup( If_LibLut_t * p );
......
......@@ -21,7 +21,6 @@
#include "if.h"
#include "misc/extra/extra.h"
#include "bool/kit/kit.h"
#include "misc/util/utilTruth.h"
ABC_NAMESPACE_IMPL_START
......
......@@ -22,7 +22,6 @@
#include "misc/extra/extra.h"
#include "bool/kit/kit.h"
#include "opt/dau/dau.h"
#include "misc/util/utilTruth.h"
ABC_NAMESPACE_IMPL_START
......
......@@ -84,7 +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->pDsdMan = Dss_ManAlloc( pPars->nLutSize, pPars->nNonDecLimit );
p->pIfDsdMan = If_DsdManAlloc( pPars->nLutSize );
// create the constant node
p->pConst1 = If_ManSetupObj( p );
p->pConst1->Type = IF_CONST1;
......@@ -154,19 +154,8 @@ void If_ManStop( If_Man_t * p )
Abc_Print( 1, "Statistics about 5-cuts: Total = %d Non-decomposable = %d (%.2f %%)\n", p->nCuts5, p->nCuts5-p->nCuts5a, 100.0*(p->nCuts5-p->nCuts5a)/p->nCuts5 );
if ( p->pPars->fUseDsd )
{
/*
if ( p->pPars->fVerbose )
Abc_Print( 1, "Number of unique entries in the DSD table = %d. Memory = %.1f MB.\n",
Abc_NamObjNumMax(p->pNamDsd), 1.0*Abc_NamMemAlloc(p->pNamDsd)/(1<<20) );
Abc_PrintTime( 1, "Time0", s_TimeComp[0] );
Abc_PrintTime( 1, "Time1", s_TimeComp[1] );
Abc_PrintTime( 1, "Time2", s_TimeComp[2] );
Abc_PrintTime( 1, "Time3", s_TimeComp[3] );
// Abc_NamPrint( p->pNamDsd );
Abc_NamStop( p->pNamDsd );
*/
Dss_ManPrint( NULL, p->pDsdMan );
Dss_ManFree( p->pDsdMan );
If_DsdManPrint( p->pIfDsdMan, NULL );
If_DsdManFree( p->pIfDsdMan );
}
// Abc_PrintTime( 1, "Truth", p->timeTruth );
// Abc_Print( 1, "Small support = %d.\n", p->nSmallSupp );
......
......@@ -186,10 +186,6 @@ 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 )
......@@ -256,34 +252,7 @@ void If_ObjPerformMappingAnd( If_Man_t * p, If_Obj_t * pObj, int Mode, int fPrep
}
}
if ( p->pPars->fUseDsd )
{
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] )
{
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->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++;
p->nCutsUseless[pCut->nLeaves]++;
}
p->nCutsCountAll++;
p->nCutsCount[pCut->nLeaves]++;
}
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);
......
......@@ -19,7 +19,6 @@
***********************************************************************/
#include "if.h"
#include "misc/util/utilTruth.h"
ABC_NAMESPACE_IMPL_START
......
......@@ -6,6 +6,7 @@ SRC += src/map/if/ifCom.c \
src/map/if/ifDec10.c \
src/map/if/ifDec16.c \
src/map/if/ifDec75.c \
src/map/if/ifDsd.c \
src/map/if/ifLibBox.c \
src/map/if/ifLibLut.c \
src/map/if/ifMan.c \
......
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