@@ -656,12 +656,18 @@ void Abc_LutCascadeDerive( word * p, int nVars, int nBVars, int Myu, word * pRem
656656}
657657
658658// performs decomposition of one stage
659- static inline int Abc_LutCascadeDecStage ( char * pGuide , int Iter , Vec_Wrd_t * vFuncs [3 ], Vec_Int_t * vVarIDs , int nRVars , int nRails , int nLutSize , int nJRatio , int fVerbose , Vec_Wrd_t * vCas , int * pMyu )
659+ static inline int Abc_LutCascadeDecStage ( char * pGuide , int Iter , Vec_Wrd_t * vFuncs [3 ], Vec_Int_t * vVarIDs , int nRVars , int nRails , int nLutSize , int nJRatio , int nZParam , int fVerbose , Vec_Wrd_t * vCas , int * pMyu )
660660{
661661 extern word Abc_TtFindBVarsSVars ( word * p , int nVars , int nRVars , int nRails , int nLutSize , int fVerbose , int * pMyu , int nJRatio );
662+ extern word Abc_TtFindBVarsSVars2 ( word * p , int nVars , int nRVars , int nRails , int nLutSize , int fVerbose , int * pMyu , int nJRatio );
662663 assert ( Vec_IntSize (vVarIDs ) > nLutSize );
663664 assert ( Vec_IntSize (vVarIDs ) <= 24 );
664- word Guide = pGuide ? 0 : Abc_TtFindBVarsSVars ( Vec_WrdArray (vFuncs [0 ]), Vec_IntSize (vVarIDs ), nRVars , nRails , nLutSize , fVerbose , pMyu , nJRatio );
665+ //word Guide = pGuide ? 0 : Abc_TtFindBVarsSVars( Vec_WrdArray(vFuncs[0]), Vec_IntSize(vVarIDs), nRVars, nRails, nLutSize, fVerbose, pMyu, nJRatio );
666+ word Guide = pGuide ? 0 : Abc_TtFindBVarsSVars2 ( Vec_WrdArray (vFuncs [0 ]), Vec_IntSize (vVarIDs ), nRVars , nRails , nLutSize , fVerbose , pMyu , nZParam );
667+ // if ( nZParam )
668+ // Guide = pGuide ? 0 : Abc_TtFindBVarsSVars2( Vec_WrdArray(vFuncs[0]), Vec_IntSize(vVarIDs), nRVars, nRails, nLutSize, fVerbose, pMyu, nZParam );
669+ // else
670+ // Guide = pGuide ? 0 : Abc_TtFindBVarsSVars( Vec_WrdArray(vFuncs[0]), Vec_IntSize(vVarIDs), nRVars, nRails, nLutSize, fVerbose, pMyu, nJRatio );
665671 if ( !pGuide && !Guide ) {
666672 if ( fVerbose )
667673 printf ( "The function is not decomposable with %d rails.\n" , nRails );
@@ -716,15 +722,15 @@ static inline int Abc_LutCascadeDecStage( char * pGuide, int Iter, Vec_Wrd_t * v
716722 Vec_IntShrink ( vVarIDs , nFVars + nSVars + nEVars );
717723 return nEVars ;
718724}
719- word * Abc_LutCascadeDec ( char * pGuide , word * pTruth , int nVarsOrig , Vec_Int_t * vVarIDs , int nRails , int nLutSize , int nStages , int nJRatio , int fVerbose , int * pnStages , int * pMyu )
725+ word * Abc_LutCascadeDec ( char * pGuide , word * pTruth , int nVarsOrig , Vec_Int_t * vVarIDs , int nRails , int nLutSize , int nStages , int nJRatio , int nZParam , int fVerbose , int * pnStages , int * pMyu )
720726{
721727 word * pRes = NULL ; int i , nRVars = 0 , nVars = Vec_IntSize (vVarIDs );
722728 Vec_Wrd_t * vFuncs [3 ] = { Vec_WrdStart (Abc_TtWordNum (nVars )), Vec_WrdAlloc (0 ), Vec_WrdAlloc (0 ) };
723729 Abc_TtCopy ( Vec_WrdArray (vFuncs [0 ]), pTruth , Abc_TtWordNum (nVars ), 0 );
724730 Vec_Wrd_t * vCas = Vec_WrdAlloc ( 100 ); Vec_WrdPush ( vCas , nVarsOrig );
725731 if ( pnStages ) * pnStages = 0 ;
726732 for ( i = 0 ; Vec_IntSize (vVarIDs ) > nLutSize ; i ++ ) {
727- nRVars = Abc_LutCascadeDecStage ( pGuide , i , vFuncs , vVarIDs , nRVars , nRails , nLutSize , nJRatio , fVerbose , vCas , i ? NULL : pMyu );
733+ nRVars = Abc_LutCascadeDecStage ( pGuide , i , vFuncs , vVarIDs , nRVars , nRails , nLutSize , nJRatio , nZParam , fVerbose , vCas , i ? NULL : pMyu );
728734 if ( i + 2 > nStages ) {
729735 if ( fVerbose )
730736 printf ( "The length of the cascade (%d) exceeds the max allowed number of stages (%d).\n" , i + 2 , nStages );
@@ -836,7 +842,7 @@ Abc_Ntk_t * Abc_NtkLutCascade( Abc_Ntk_t * pNtk, int nLutSize, int nStages, int
836842 Gia_ManStop ( pGia );
837843 return pNew ;
838844}
839- Abc_Ntk_t * Abc_NtkLutCascade2 ( Abc_Ntk_t * pNtk , int nLutSize , int nStages , int nRails , int nIters , int nJRatio , int Seed , int fVerbose , char * pGuide )
845+ Abc_Ntk_t * Abc_NtkLutCascade2 ( Abc_Ntk_t * pNtk , int nLutSize , int nStages , int nRails , int nIters , int nJRatio , int nZParam , int Seed , int fVerbose , int fVeryVerbose , char * pGuide )
840846{
841847 extern Gia_Man_t * Abc_NtkStrashToGia ( Abc_Ntk_t * pNtk );
842848 int i , nWords = Abc_TtWordNum (Abc_NtkCiNum (pNtk ));
@@ -864,7 +870,7 @@ Abc_Ntk_t * Abc_NtkLutCascade2( Abc_Ntk_t * pNtk, int nLutSize, int nStages, int
864870 printf ( ".\n" );
865871 }
866872
867- word * pLuts = Abc_LutCascadeDec ( pGuide , pTruth1 , Abc_NtkCiNum (pNtk ), vVarIDs , nRails , nLutSize , nStages , Iter >= nIters ? 1 : 0 , fVerbose , NULL , NULL );
873+ word * pLuts = Abc_LutCascadeDec ( pGuide , pTruth1 , Abc_NtkCiNum (pNtk ), vVarIDs , nRails , nLutSize , nStages , Iter >= nIters ? 1 : 0 , nZParam , fVeryVerbose , NULL , NULL );
868874 pNew = pLuts ? Abc_NtkLutCascadeFromLuts ( pLuts , Abc_NtkCiNum (pNtk ), pNtk , nLutSize , fVerbose ) : NULL ;
869875 Vec_IntFree ( vVarIDs );
870876
@@ -1377,7 +1383,7 @@ Vec_Wrd_t * Abc_NtkLutCasReadTruths( char * pFileName, int nVarsOrig )
13771383 SeeAlso []
13781384
13791385***********************************************************************/
1380- void Abc_NtkLutCascadeFile ( char * pFileName , int nVarsOrig , int nLutSize , int nStages , int nRails , int nIters , int nJRatio , int Seed , int fVerbose , int fVeryVerbose , int fPrintMyu )
1386+ void Abc_NtkLutCascadeFile ( char * pFileName , int nVarsOrig , int nLutSize , int nStages , int nRails , int nIters , int nJRatio , int nZParam , int Seed , int fVerbose , int fVeryVerbose , int fPrintMyu )
13811387{
13821388 abctime clkStart = Abc_Clock ();
13831389 int i , Sum = 0 , nStageCount = 0 , MyuMin = 0 , nTotalLuts = 0 , nWords = Abc_TtWordNum (nVarsOrig );
@@ -1425,7 +1431,7 @@ void Abc_NtkLutCascadeFile( char * pFileName, int nVarsOrig, int nLutSize, int n
14251431 printf ( "Decomposing %d-var function into %d-rail cascade of %d-LUTs.\n" , nVars , nRails , nLutSize );
14261432 }
14271433
1428- word * pLuts = Abc_LutCascadeDec ( NULL , pTruth , nVarsOrig , vVarIDs , nRails , nLutSize , nStages , (int )(Iter >= nIters ), fVeryVerbose , & nStageCount , & MyuMin );
1434+ word * pLuts = Abc_LutCascadeDec ( NULL , pTruth , nVarsOrig , vVarIDs , nRails , nLutSize , nStages , (int )(Iter >= nIters ), nZParam , fVeryVerbose , & nStageCount , & MyuMin );
14291435 Vec_IntFree ( vVarIDs );
14301436 if ( MyuMin < 50 ) MyuStats [MyuMin ]++ , IterReal ++ ;
14311437 if ( pLuts == NULL ) {
0 commit comments