diff options
author | Alan Mishchenko <alanmi@berkeley.edu> | 2007-01-24 08:01:00 -0800 |
---|---|---|
committer | Alan Mishchenko <alanmi@berkeley.edu> | 2007-01-24 08:01:00 -0800 |
commit | 1c26e2d29768c64315447969f137e3bf9ffa7dac (patch) | |
tree | c8aaab3a85e0065b39adc66358f4aa29bb8b1929 /src/base | |
parent | b1a913fb5e85ba04646632f3d771ad79bfd8a720 (diff) | |
download | abc-1c26e2d29768c64315447969f137e3bf9ffa7dac.tar.gz abc-1c26e2d29768c64315447969f137e3bf9ffa7dac.tar.bz2 abc-1c26e2d29768c64315447969f137e3bf9ffa7dac.zip |
Version abc70124
Diffstat (limited to 'src/base')
-rw-r--r-- | src/base/abc/abc.h | 6 | ||||
-rw-r--r-- | src/base/abc/abcFunc.c | 5 | ||||
-rw-r--r-- | src/base/abci/abc.c | 45 |
3 files changed, 28 insertions, 28 deletions
diff --git a/src/base/abc/abc.h b/src/base/abc/abc.h index d843bca6..39360034 100644 --- a/src/base/abc/abc.h +++ b/src/base/abc/abc.h @@ -241,9 +241,9 @@ static inline unsigned Abc_InfoRandom() { return (( static inline void Abc_InfoClear( unsigned * p, int nWords ) { memset( p, 0, sizeof(unsigned) * nWords ); } static inline void Abc_InfoFill( unsigned * p, int nWords ) { memset( p, 0xff, sizeof(unsigned) * nWords );} static inline void Abc_InfoNot( unsigned * p, int nWords ) { int i; for ( i = nWords - 1; i >= 0; i-- ) p[i] = ~p[i]; } -static inline int Abc_InfoIsZero( unsigned * p, int nWords ) { int i; for ( i = nWords - 1; i >= 0; i-- ) if ( p[i] ) return 0; return 1; } -static inline int Abc_InfoIsOne( unsigned * p, int nWords ) { int i; for ( i = nWords - 1; i >= 0; i-- ) if ( !p[i] ) return 0; return 1; } -static inline void Abc_InfoCopy( unsigned * p, unsigned * q, int nWords ) { int i; for ( i = nWords - 1; i >= 0; i-- ) p[i] = q[i]; } +static inline int Abc_InfoIsZero( unsigned * p, int nWords ) { int i; for ( i = nWords - 1; i >= 0; i-- ) if ( p[i] ) return 0; return 1; } +static inline int Abc_InfoIsOne( unsigned * p, int nWords ) { int i; for ( i = nWords - 1; i >= 0; i-- ) if ( ~p[i] ) return 0; return 1; } +static inline void Abc_InfoCopy( unsigned * p, unsigned * q, int nWords ) { int i; for ( i = nWords - 1; i >= 0; i-- ) p[i] = q[i]; } static inline void Abc_InfoAnd( unsigned * p, unsigned * q, int nWords ) { int i; for ( i = nWords - 1; i >= 0; i-- ) p[i] &= q[i]; } static inline void Abc_InfoOr( unsigned * p, unsigned * q, int nWords ) { int i; for ( i = nWords - 1; i >= 0; i-- ) p[i] |= q[i]; } static inline void Abc_InfoXor( unsigned * p, unsigned * q, int nWords ) { int i; for ( i = nWords - 1; i >= 0; i-- ) p[i] ^= q[i]; } diff --git a/src/base/abc/abcFunc.c b/src/base/abc/abcFunc.c index 421a64cf..5e13807a 100644 --- a/src/base/abc/abcFunc.c +++ b/src/base/abc/abcFunc.c @@ -830,10 +830,13 @@ Abc_Obj_t * Abc_ConvertAigToAig( Abc_Ntk_t * pNtkAig, Abc_Obj_t * pObjOld ) pRoot = pObjOld->pData; // check the case of a constant if ( Hop_ObjIsConst1( Hop_Regular(pRoot) ) ) - return Abc_ObjNotCond( Abc_AigConst1(pNtkAig->pManFunc), Hop_IsComplement(pRoot) ); + return Abc_ObjNotCond( Abc_AigConst1(pNtkAig), Hop_IsComplement(pRoot) ); // assign the fanin nodes Abc_ObjForEachFanin( pObjOld, pFanin, i ) + { + assert( pFanin->pCopy != NULL ); Hop_ManPi(pHopMan, i)->pData = pFanin->pCopy; + } // construct the AIG Abc_ConvertAigToAig_rec( pNtkAig, Hop_Regular(pRoot) ); Hop_ConeUnmark_rec( Hop_Regular(pRoot) ); diff --git a/src/base/abci/abc.c b/src/base/abci/abc.c index a6552951..b20d2c8c 100644 --- a/src/base/abci/abc.c +++ b/src/base/abci/abc.c @@ -25,6 +25,7 @@ #include "cut.h" #include "fpga.h" #include "if.h" +#include "res.h" //////////////////////////////////////////////////////////////////////// /// DECLARATIONS /// @@ -2565,23 +2566,19 @@ int Abc_CommandMfs( Abc_Frame_t * pAbc, int argc, char ** argv ) { FILE * pOut, * pErr; Abc_Ntk_t * pNtk; + Res_Par_t Pars, * pPars = &Pars; int c; - int nWindow; - int nSimWords; - int fVerbose; - int fVeryVerbose; - // external functions - extern int Abc_NtkResynthesize( Abc_Ntk_t * pNtk, int nWindow, int nSimWords, int fVerbose, int fVeryVerbose ); pNtk = Abc_FrameReadNtk(pAbc); pOut = Abc_FrameReadOut(pAbc); pErr = Abc_FrameReadErr(pAbc); // set defaults - nWindow = 33; - nSimWords = 8; - fVerbose = 1; - fVeryVerbose = 0; + pPars->nWindow = 33; + pPars->nCands = 3; + pPars->nSimWords = 8; + pPars->fVerbose = 1; + pPars->fVeryVerbose = 0; Extra_UtilGetoptReset(); while ( ( c = Extra_UtilGetopt( argc, argv, "WSvwh" ) ) != EOF ) { @@ -2593,9 +2590,9 @@ int Abc_CommandMfs( Abc_Frame_t * pAbc, int argc, char ** argv ) fprintf( pErr, "Command line switch \"-W\" should be followed by an integer.\n" ); goto usage; } - nWindow = atoi(argv[globalUtilOptind]); + pPars->nWindow = atoi(argv[globalUtilOptind]); globalUtilOptind++; - if ( nWindow < 1 || nWindow > 99 ) + if ( pPars->nWindow < 1 || pPars->nWindow > 99 ) goto usage; break; case 'S': @@ -2604,16 +2601,16 @@ int Abc_CommandMfs( Abc_Frame_t * pAbc, int argc, char ** argv ) fprintf( pErr, "Command line switch \"-S\" should be followed by an integer.\n" ); goto usage; } - nSimWords = atoi(argv[globalUtilOptind]); + pPars->nSimWords = atoi(argv[globalUtilOptind]); globalUtilOptind++; - if ( nSimWords < 2 || nSimWords > 256 ) + if ( pPars->nSimWords < 1 || pPars->nSimWords > 256 ) goto usage; break; case 'v': - fVerbose ^= 1; + pPars->fVerbose ^= 1; break; case 'w': - fVeryVerbose ^= 1; + pPars->fVeryVerbose ^= 1; break; case 'h': goto usage; @@ -2634,7 +2631,7 @@ int Abc_CommandMfs( Abc_Frame_t * pAbc, int argc, char ** argv ) } // modify the current network - if ( !Abc_NtkResynthesize( pNtk, nWindow, nSimWords, fVerbose, fVeryVerbose ) ) + if ( !Abc_NtkResynthesize( pNtk, pPars ) ) { fprintf( pErr, "Resynthesis has failed.\n" ); return 1; @@ -2642,13 +2639,13 @@ int Abc_CommandMfs( Abc_Frame_t * pAbc, int argc, char ** argv ) return 0; usage: - fprintf( pErr, "usage: mfs [-W <NM>] [-S <n>] [-vwh]\n" ); - fprintf( pErr, "\t performs resubstitution-based resynthesis with don't-cares\n" ); - fprintf( pErr, "\t-W <NM> : specifies the windowing paramters (00 < NM <= 99) [default = %d%d]\n", nWindow/10, nWindow%10 ); - fprintf( pErr, "\t-S <n> : specifies the number of simulation words (2 <= n <= 256) [default = %d]\n", nSimWords ); - fprintf( pErr, "\t-v : toggle verbose printout [default = %s]\n", fVerbose? "yes": "no" ); - fprintf( pErr, "\t-w : toggle printout subgraph statistics [default = %s]\n", fVeryVerbose? "yes": "no" ); - fprintf( pErr, "\t-h : print the command usage\n"); + fprintf( pErr, "usage: mfs [-W <NM>] [-S <num>] [-vwh]\n" ); + fprintf( pErr, "\t performs resubstitution-based resynthesis with don't-cares\n" ); + fprintf( pErr, "\t-W <NM> : specifies the windowing paramters (00 < NM <= 99) [default = %d%d]\n", pPars->nWindow/10, pPars->nWindow%10 ); + fprintf( pErr, "\t-S <num> : specifies the number of simulation words (1 <= n <= 256) [default = %d]\n", pPars->nSimWords ); + fprintf( pErr, "\t-v : toggle verbose printout [default = %s]\n", pPars->fVerbose? "yes": "no" ); + fprintf( pErr, "\t-w : toggle printout subgraph statistics [default = %s]\n", pPars->fVeryVerbose? "yes": "no" ); + fprintf( pErr, "\t-h : print the command usage\n"); return 1; } |