Maintenance and updates.

This commit is contained in:
Alan Mishchenko 2017-09-20 19:27:46 -07:00
parent 1e0bbef1ef
commit 287f9efcce
5 changed files with 35 additions and 15 deletions

View File

@ -2275,6 +2275,8 @@ Gia_Man_t * Gia_ManPerformMappingInt( Gia_Man_t * p, If_Par_t * pPars )
else
Abc_Print( 0, "Switching activity computation for designs with boxes is disabled.\n" );
}
if ( pPars->pReoMan )
pIfMan->pUserMan = pPars->pReoMan;
if ( p->pManTime )
pIfMan->pManTim = Tim_ManDup( (Tim_Man_t *)p->pManTime, pPars->fDelayOpt || pPars->fDelayOptLut || pPars->fDsdBalance || pPars->fUserRecLib || pPars->fUserSesLib );
// Tim_ManPrint( pIfMan->pManTim );
@ -2302,6 +2304,8 @@ Gia_Man_t * Gia_ManPerformMappingInt( Gia_Man_t * p, If_Par_t * pPars )
If_ManForEachCo( pIfMan, pIfObj, i )
Vec_IntPush( p->vCoArrs, (int)If_ObjArrTime(If_ObjFanin0(pIfObj)) );
}
if ( pPars->pFuncWrite )
pPars->pFuncWrite( pIfMan );
If_ManStop( pIfMan );
// transfer name
assert( pNew->pName == NULL );

View File

@ -42,8 +42,9 @@ ABC_NAMESPACE_IMPL_START
SeeAlso []
***********************************************************************/
void Gia_ManIiffTest( Gia_Man_t * pGia, int nLutSize, int nNumCuts, int fUseGates, int fUseCells, int fVerbose )
Gia_Man_t * Gia_ManIiffTest( char * pFileName, Gia_Man_t * pGia, int nLutSize, int nNumCuts, int fUseGates, int fUseCells, int fVerbose )
{
return NULL;
}
////////////////////////////////////////////////////////////////////////

View File

@ -35596,12 +35596,14 @@ usage:
***********************************************************************/
int Abc_CommandAbc9Iiff( Abc_Frame_t * pAbc, int argc, char ** argv )
{
extern void Gia_ManIiffTest( Gia_Man_t * pGia, int nLutSize, int nNumCuts, int fUseGates, int fUseCells, int fVerbose );
int nLutSize = 8;
int nNumCuts = 12;
int fUseGates = 0;
int fUseCells = 0;
int c, fVerbose = 0;
extern Gia_Man_t * Gia_ManIiffTest( char * pFileName, Gia_Man_t * pGia, int nLutSize, int nNumCuts, int fUseGates, int fUseCells, int fVerbose );
char * pFileName = NULL;
int nLutSize = 8;
int nNumCuts = 12;
int fUseGates = 0;
int fUseCells = 0;
int c, fVerbose = 0;
Gia_Man_t * pNew;
Extra_UtilGetoptReset();
while ( ( c = Extra_UtilGetopt( argc, argv, "KCgcvh" ) ) != EOF )
{
@ -35640,23 +35642,32 @@ int Abc_CommandAbc9Iiff( Abc_Frame_t * pAbc, int argc, char ** argv )
goto usage;
}
}
if ( argc == globalUtilOptind + 1 )
pFileName = argv[globalUtilOptind];
if ( pAbc->pGia == NULL )
{
Abc_Print( -1, "Abc_CommandAbc9Iiff(): There is no AIG to map.\n" );
return 1;
}
Gia_ManIiffTest( pAbc->pGia, nLutSize, nNumCuts, fUseGates, fUseCells, fVerbose );
pNew = Gia_ManIiffTest( pFileName, pAbc->pGia, nLutSize, nNumCuts, fUseGates, fUseCells, fVerbose );
if ( pNew == NULL )
{
Abc_Print( -1, "Abc_CommandAbc9Iiff(): Mapping has failed.\n" );
return 1;
}
Abc_FrameUpdateGia( pAbc, pNew );
return 0;
usage:
Abc_Print( -2, "usage: &iiff [-KC num] [-gcvh]\n" );
Abc_Print( -2, "usage: &iiff [-KC num] [-gcvh] <file>\n" );
Abc_Print( -2, "\t performs techology mapping\n" );
Abc_Print( -2, "\t-K num : the maximum LUT size [default = %d]\n", nLutSize );
Abc_Print( -2, "\t-K num : the maximum LUT size [default = %d]\n", nLutSize );
Abc_Print( -2, "\t-C num : the maximum cut count [default = %d]\n", nNumCuts );
Abc_Print( -2, "\t-g : toggle using gates [default = %s]\n", fUseGates? "yes": "no" );
Abc_Print( -2, "\t-c : toggle using cells [default = %s]\n", fUseCells? "yes": "no" );
Abc_Print( -2, "\t-g : toggle using gates [default = %s]\n", fUseGates? "yes": "no" );
Abc_Print( -2, "\t-c : toggle using cells [default = %s]\n", fUseCells? "yes": "no" );
Abc_Print( -2, "\t-v : toggle verbose output [default = %s]\n", fVerbose? "yes": "no" );
Abc_Print( -2, "\t-h : print the command usage\n");
Abc_Print( -2, "\t<file> : (optional) output file name\n");
return 1;
}

View File

@ -167,8 +167,10 @@ struct If_Par_t_
float * pTimesArr; // arrival times
float * pTimesReq; // required times
int (* pFuncCost) (If_Man_t *, If_Cut_t *); // procedure to compute the user's cost of a cut
int (* pFuncUser) (If_Man_t *, If_Obj_t *, If_Cut_t *); // procedure called for each cut when cut computation is finished
int (* pFuncCell) (If_Man_t *, unsigned *, int, int, char *); // procedure called for cut functions
int (* pFuncUser) (If_Man_t *, If_Obj_t *, If_Cut_t *); // procedure called for each cut when cut computation is finished
int (* pFuncCell) (If_Man_t *, unsigned *, int, int, char *); // procedure called for cut functions
int (* pFuncCell2) (If_Man_t *, word *, int, Vec_Str_t *, char **); // procedure called for cut functions
int (* pFuncWrite) (If_Man_t *); // procedure called for cut functions
void * pReoMan; // reordering manager
};

View File

@ -312,12 +312,14 @@ void If_ObjPerformMappingAnd( If_Man_t * p, If_Obj_t * pObj, int Mode, int fPrep
}
// run user functions
pCut->fUseless = 0;
if ( p->pPars->pFuncCell )
if ( p->pPars->pFuncCell || p->pPars->pFuncCell2 )
{
assert( p->pPars->fUseTtPerm == 0 );
assert( pCut->nLimit >= 4 && pCut->nLimit <= 16 );
if ( p->pPars->fUseDsd )
pCut->fUseless = If_DsdManCheckDec( p->pIfDsdMan, If_CutDsdLit(p, pCut) );
else if ( p->pPars->pFuncCell2 )
pCut->fUseless = !p->pPars->pFuncCell2( p, (word *)If_CutTruth(p, pCut), pCut->nLeaves, NULL, NULL );
else
pCut->fUseless = !p->pPars->pFuncCell( p, If_CutTruth(p, pCut), Abc_MaxInt(6, pCut->nLeaves), pCut->nLeaves, p->pPars->pLutStruct );
p->nCutsUselessAll += pCut->fUseless;