diff options
author | Alan Mishchenko <alanmi@berkeley.edu> | 2017-09-20 19:27:46 -0700 |
---|---|---|
committer | Alan Mishchenko <alanmi@berkeley.edu> | 2017-09-20 19:27:46 -0700 |
commit | 287f9efcceb540fb09f5d81250699a9277967ec5 (patch) | |
tree | 4a25d1867783a12fcbc1db2769f27f9337dd7f55 | |
parent | 1e0bbef1ef6a6ff7f0293e0926a8ff2b396e0a3e (diff) | |
download | abc-287f9efcceb540fb09f5d81250699a9277967ec5.tar.gz abc-287f9efcceb540fb09f5d81250699a9277967ec5.tar.bz2 abc-287f9efcceb540fb09f5d81250699a9277967ec5.zip |
Maintenance and updates.
-rw-r--r-- | src/aig/gia/giaIf.c | 4 | ||||
-rw-r--r-- | src/aig/gia/giaIiff.c | 3 | ||||
-rw-r--r-- | src/base/abci/abc.c | 33 | ||||
-rw-r--r-- | src/map/if/if.h | 6 | ||||
-rw-r--r-- | src/map/if/ifMap.c | 4 |
5 files changed, 35 insertions, 15 deletions
diff --git a/src/aig/gia/giaIf.c b/src/aig/gia/giaIf.c index f2d63060..16b9d6b7 100644 --- a/src/aig/gia/giaIf.c +++ b/src/aig/gia/giaIf.c @@ -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 ); diff --git a/src/aig/gia/giaIiff.c b/src/aig/gia/giaIiff.c index d19e93e3..6be38b94 100644 --- a/src/aig/gia/giaIiff.c +++ b/src/aig/gia/giaIiff.c @@ -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; } //////////////////////////////////////////////////////////////////////// diff --git a/src/base/abci/abc.c b/src/base/abci/abc.c index 8ceb8659..f34290db 100644 --- a/src/base/abci/abc.c +++ b/src/base/abci/abc.c @@ -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; } diff --git a/src/map/if/if.h b/src/map/if/if.h index 0dd5e01c..7cc852af 100644 --- a/src/map/if/if.h +++ b/src/map/if/if.h @@ -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 }; diff --git a/src/map/if/ifMap.c b/src/map/if/ifMap.c index 51865851..6c25921a 100644 --- a/src/map/if/ifMap.c +++ b/src/map/if/ifMap.c @@ -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; |