2222
2323ABC_NAMESPACE_IMPL_START
2424
25+ static inline int Cec_ParCorShouldStop ( Cec_ParCor_t * pPars )
26+ {
27+ if ( pPars == NULL || pPars -> pFunc == NULL )
28+ return 0 ;
29+ return ((int (* )(void * ))pPars -> pFunc )( pPars -> pData );
30+ }
31+
2532
2633////////////////////////////////////////////////////////////////////////
2734/// DECLARATIONS ///
@@ -808,6 +815,8 @@ void Cec_ManLSCorrespondenceBmc( Gia_Man_t * pAig, Cec_ParCor_t * pPars, int nPr
808815 fChanges = 1 ;
809816 for ( i = 0 ; fChanges && (!pPars -> nLimitMax || i < pPars -> nLimitMax ); i ++ )
810817 {
818+ if ( Cec_ParCorShouldStop ( pPars ) )
819+ break ;
811820 abctime clkBmc = Abc_Clock ();
812821 fChanges = 0 ;
813822 pSrm = Gia_ManCorrSpecReduceInit ( pAig , pPars -> nFrames , nPrefs , !pPars -> fLatchCorr , & vOutputs , pPars -> fUseRings );
@@ -836,6 +845,8 @@ void Cec_ManLSCorrespondenceBmc( Gia_Man_t * pAig, Cec_ParCor_t * pPars, int nPr
836845 Vec_StrFree ( vStatus );
837846 Gia_ManStop ( pSrm );
838847 Vec_IntFree ( vOutputs );
848+ if ( Cec_ParCorShouldStop ( pPars ) )
849+ break ;
839850 }
840851 Cec_ManSimStop ( pSim );
841852}
@@ -975,10 +986,10 @@ int Cec_ManLSCorrespondenceClasses( Gia_Man_t * pAig, Cec_ParCor_t * pPars )
975986 // check the base case
976987 if ( fRunBmcFirst && (!pPars -> fLatchCorr || pPars -> nFrames > 1 ) )
977988 Cec_ManLSCorrespondenceBmc ( pAig , pPars , 0 );
978- if ( pPars -> pFunc )
989+ if ( Cec_ParCorShouldStop ( pPars ) )
979990 {
980- (( int ( * )( void * )) pPars -> pFunc )( pPars -> pData );
981- (( int ( * )( void * )) pPars -> pFunc )( pPars -> pData ) ;
991+ Cec_ManSimStop ( pSim );
992+ return 1 ;
982993 }
983994 if ( pPars -> nStepsMax == 0 )
984995 {
@@ -989,6 +1000,11 @@ int Cec_ManLSCorrespondenceClasses( Gia_Man_t * pAig, Cec_ParCor_t * pPars )
9891000 // perform refinement of equivalence classes
9901001 for ( r = 0 ; r < nIterMax ; r ++ )
9911002 {
1003+ if ( Cec_ParCorShouldStop ( pPars ) )
1004+ {
1005+ Cec_ManSimStop ( pSim );
1006+ return 1 ;
1007+ }
9921008 if ( pPars -> nStepsMax == r )
9931009 {
9941010 Cec_ManSimStop ( pSim );
@@ -1036,8 +1052,11 @@ int Cec_ManLSCorrespondenceClasses( Gia_Man_t * pAig, Cec_ParCor_t * pPars )
10361052 Vec_StrFree ( vStatus );
10371053 Vec_IntFree ( vOutputs );
10381054//Gia_ManEquivPrintClasses( pAig, 1, 0 );
1039- if ( pPars -> pFunc )
1040- ((int (* )(void * ))pPars -> pFunc )( pPars -> pData );
1055+ if ( Cec_ParCorShouldStop ( pPars ) )
1056+ {
1057+ Cec_ManSimStop ( pSim );
1058+ return 1 ;
1059+ }
10411060 // quit if const is no longer there
10421061 if ( pPars -> fStopWhenGone && Gia_ManPoNum (pAig ) == 1 && !Gia_ObjIsConst ( pAig , Gia_ObjFaninId0p (pAig , Gia_ManPo (pAig , 0 )) ) )
10431062 {
@@ -1448,4 +1467,3 @@ Gia_Man_t * Gia_ManDupStopsTest( Gia_Man_t * p )
14481467
14491468
14501469ABC_NAMESPACE_IMPL_END
1451-
0 commit comments