abc/src/proof/ssw/sswCore.c

541 lines
19 KiB
C
Raw Normal View History

2008-09-01 17:01:00 +02:00
/**CFile****************************************************************
FileName [sswCore.c]
SystemName [ABC: Logic synthesis and verification system.]
PackageName [Inductive prover with constraints.]
Synopsis [The core procedures.]
Author [Alan Mishchenko]
Affiliation [UC Berkeley]
Date [Ver. 1.0. Started - September 1, 2008.]
Revision [$Id: sswCore.c,v 1.00 2008/09/01 00:00:00 alanmi Exp $]
***********************************************************************/
#include "sswInt.h"
2010-11-01 09:35:04 +01:00
ABC_NAMESPACE_IMPL_START
2008-09-01 17:01:00 +02:00
////////////////////////////////////////////////////////////////////////
/// DECLARATIONS ///
////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////
/// FUNCTION DEFINITIONS ///
////////////////////////////////////////////////////////////////////////
/**Function*************************************************************
Synopsis [This procedure sets default parameters.]
Description []
SideEffects []
SeeAlso []
***********************************************************************/
void Ssw_ManSetDefaultParams( Ssw_Pars_t * p )
{
memset( p, 0, sizeof(Ssw_Pars_t) );
2008-10-05 17:01:00 +02:00
p->nPartSize = 0; // size of the partition
p->nOverSize = 0; // size of the overlap between partitions
p->nFramesK = 1; // the induction depth
2008-10-13 17:01:00 +02:00
p->nFramesAddSim = 2; // additional frames to simulate
2010-11-01 09:35:04 +01:00
p->fConstrs = 0; // treat the last nConstrs POs as seq constraints
p->fMergeFull = 0; // enables full merge when constraints are used
2008-10-05 17:01:00 +02:00
p->nBTLimit = 1000; // conflict limit at a node
p->nBTLimitGlobal = 5000000; // conflict limit for all runs
p->nMinDomSize = 100; // min clock domain considered for optimization
2009-02-20 17:01:00 +01:00
p->nItersStop = -1; // stop after the given number of iterations
2009-01-18 17:01:00 +01:00
p->nResimDelta = 1000; // the internal of nodes to resimulate
2010-11-01 09:35:04 +01:00
p->nStepsMax = -1; // (scorr only) the max number of induction steps
2008-10-05 17:01:00 +02:00
p->fPolarFlip = 0; // uses polarity adjustment
p->fLatchCorr = 0; // performs register correspondence
2011-04-19 08:27:51 +02:00
p->fConstCorr = 0; // performs constant correspondence
2010-11-01 09:35:04 +01:00
p->fOutputCorr = 0; // perform 'PO correspondence'
2008-10-05 17:01:00 +02:00
p->fSemiFormal = 0; // enable semiformal filtering
2009-01-18 17:01:00 +01:00
p->fDynamic = 0; // dynamic partitioning
p->fLocalSim = 0; // local simulation
2008-10-05 17:01:00 +02:00
p->fVerbose = 0; // verbose stats
p->fEquivDump = 0; // enables dumping equivalences
p->fEquivDump2 = 0; // enables dumping equivalences
2008-09-19 17:01:00 +02:00
// latch correspondence
2008-10-05 17:01:00 +02:00
p->fLatchCorrOpt = 0; // performs optimized register correspondence
p->nSatVarMax = 1000; // the max number of SAT variables
p->nRecycleCalls = 50; // calls to perform before recycling SAT solver
2008-10-14 17:01:00 +02:00
// signal correspondence
p->nSatVarMax2 = 5000; // the max number of SAT variables
p->nRecycleCalls2 = 250; // calls to perform before recycling SAT solver
2008-09-19 17:01:00 +02:00
// return values
2008-10-05 17:01:00 +02:00
p->nIters = 0; // the number of iterations performed
2008-09-01 17:01:00 +02:00
}
2008-09-21 17:01:00 +02:00
/**Function*************************************************************
Synopsis [This procedure sets default parameters.]
Description []
SideEffects []
SeeAlso []
***********************************************************************/
void Ssw_ManSetDefaultParamsLcorr( Ssw_Pars_t * p )
{
Ssw_ManSetDefaultParams( p );
p->fLatchCorrOpt = 1;
p->nBTLimit = 10000;
}
2010-11-01 09:35:04 +01:00
/**Function*************************************************************
Synopsis [Reports improvements for property cones.]
Description []
SideEffects []
SeeAlso []
***********************************************************************/
void Ssw_ReportConeReductions( Ssw_Man_t * p, Aig_Man_t * pAigInit, Aig_Man_t * pAigStop )
{
Aig_Man_t * pAig1, * pAig2, * pAux;
pAig1 = Aig_ManDupOneOutput( pAigInit, 0, 1 );
pAig1 = Aig_ManScl( pAux = pAig1, 1, 1, 0, -1, -1, 0, 0 );
2010-11-01 09:35:04 +01:00
Aig_ManStop( pAux );
pAig2 = Aig_ManDupOneOutput( pAigStop, 0, 1 );
pAig2 = Aig_ManScl( pAux = pAig2, 1, 1, 0, -1, -1, 0, 0 );
2010-11-01 09:35:04 +01:00
Aig_ManStop( pAux );
2012-10-29 23:28:30 +01:00
2010-11-01 09:35:04 +01:00
p->nNodesBegC = Aig_ManNodeNum(pAig1);
p->nNodesEndC = Aig_ManNodeNum(pAig2);
p->nRegsBegC = Aig_ManRegNum(pAig1);
p->nRegsEndC = Aig_ManRegNum(pAig2);
Aig_ManStop( pAig1 );
Aig_ManStop( pAig2 );
}
/**Function*************************************************************
Synopsis [Reports one node.]
Description []
SideEffects []
SeeAlso []
***********************************************************************/
void Ssw_ReportOneOutput( Aig_Man_t * p, Aig_Obj_t * pObj )
{
if ( pObj == Aig_ManConst1(p) )
2012-10-29 23:28:30 +01:00
Abc_Print( 1, "1" );
2010-11-01 09:35:04 +01:00
else if ( pObj == Aig_ManConst0(p) )
2012-10-29 23:28:30 +01:00
Abc_Print( 1, "0" );
else
Abc_Print( 1, "X" );
2010-11-01 09:35:04 +01:00
}
/**Function*************************************************************
Synopsis [Reports improvements for property cones.]
Description []
SideEffects []
SeeAlso []
***********************************************************************/
void Ssw_ReportOutputs( Aig_Man_t * pAig )
{
Aig_Obj_t * pObj;
int i;
Saig_ManForEachPo( pAig, pObj, i )
{
if ( i < Saig_ManPoNum(pAig)-Saig_ManConstrNum(pAig) )
2012-10-29 23:28:30 +01:00
Abc_Print( 1, "o" );
2010-11-01 09:35:04 +01:00
else
2012-10-29 23:28:30 +01:00
Abc_Print( 1, "c" );
2010-11-01 09:35:04 +01:00
Ssw_ReportOneOutput( pAig, Aig_ObjChild0(pObj) );
}
2012-10-29 23:28:30 +01:00
Abc_Print( 1, "\n" );
2010-11-01 09:35:04 +01:00
}
/**Function*************************************************************
Synopsis [Remove from-equivs that are in the cone of constraints.]
Description []
SideEffects []
SeeAlso []
***********************************************************************/
void Ssw_ManUpdateEquivs( Ssw_Man_t * p, Aig_Man_t * pAig, int fVerbose )
{
Vec_Ptr_t * vCones;
Aig_Obj_t ** pArray;
Aig_Obj_t * pObj;
int i, nTotal = 0, nRemoved = 0;
// collect the nodes in the cone of constraints
pArray = (Aig_Obj_t **)Vec_PtrArray(pAig->vCos);
2010-11-01 09:35:04 +01:00
pArray += Saig_ManPoNum(pAig) - Saig_ManConstrNum(pAig);
vCones = Aig_ManDfsNodes( pAig, pArray, Saig_ManConstrNum(pAig) );
// remove all the node that are equiv to something and are in the cones
Aig_ManForEachObj( pAig, pObj, i )
{
if ( !Aig_ObjIsCi(pObj) && !Aig_ObjIsNode(pObj) )
2010-11-01 09:35:04 +01:00
continue;
if ( pAig->pReprs[i] != NULL )
nTotal++;
if ( !Aig_ObjIsTravIdCurrent(pAig, pObj) )
continue;
if ( pAig->pReprs[i] )
{
if ( p->pPars->fConstrs && !p->pPars->fMergeFull )
{
pAig->pReprs[i] = NULL;
nRemoved++;
}
}
}
// collect statistics
p->nConesTotal = Aig_ManCiNum(pAig) + Aig_ManNodeNum(pAig);
2010-11-01 09:35:04 +01:00
p->nConesConstr = Vec_PtrSize(vCones);
p->nEquivsTotal = nTotal;
p->nEquivsConstr = nRemoved;
Vec_PtrFree( vCones );
}
2008-09-01 17:01:00 +02:00
/**Function*************************************************************
Synopsis [Performs computation of signal correspondence with constraints.]
Description []
SideEffects []
SeeAlso []
***********************************************************************/
2008-09-15 17:01:00 +02:00
Aig_Man_t * Ssw_SignalCorrespondenceRefine( Ssw_Man_t * p )
2008-09-01 17:01:00 +02:00
{
2008-10-14 17:01:00 +02:00
int nSatProof, nSatCallsSat, nRecycles, nSatFailsReal, nUniques;
2008-09-05 17:01:00 +02:00
Aig_Man_t * pAigNew;
int RetValue, nIter = -1;
abctime clk, clkTotal = Abc_Clock();
2008-09-09 17:01:00 +02:00
// get the starting stats
p->nLitsBeg = Ssw_ClassesLitNum( p->ppClasses );
2008-09-15 17:01:00 +02:00
p->nNodesBeg = Aig_ManNodeNum(p->pAig);
p->nRegsBeg = Aig_ManRegNum(p->pAig);
2008-09-01 17:01:00 +02:00
// refine classes using BMC
2008-09-15 17:01:00 +02:00
if ( p->pPars->fVerbose )
2008-09-09 17:01:00 +02:00
{
2012-10-29 23:28:30 +01:00
Abc_Print( 1, "Before BMC: " );
2008-09-05 17:01:00 +02:00
Ssw_ClassesPrint( p->ppClasses, 0 );
2008-09-09 17:01:00 +02:00
}
2017-11-05 04:23:22 +01:00
if ( !p->pPars->fLatchCorr || p->pPars->nFramesK > 1 )
2012-10-29 23:28:30 +01:00
{
2008-10-13 17:01:00 +02:00
p->pMSat = Ssw_SatStart( 0 );
2012-10-29 23:28:30 +01:00
if ( p->pPars->fConstrs )
2010-11-01 09:35:04 +01:00
Ssw_ManSweepBmcConstr( p );
else
Ssw_ManSweepBmc( p );
2008-10-13 17:01:00 +02:00
Ssw_SatStop( p->pMSat );
p->pMSat = NULL;
2008-09-19 17:01:00 +02:00
Ssw_ManCleanup( p );
}
2008-09-15 17:01:00 +02:00
if ( p->pPars->fVerbose )
2008-09-09 17:01:00 +02:00
{
2012-10-29 23:28:30 +01:00
Abc_Print( 1, "After BMC: " );
2008-09-05 17:01:00 +02:00
Ssw_ClassesPrint( p->ppClasses, 0 );
2008-09-09 17:01:00 +02:00
}
2008-09-22 17:01:00 +02:00
// apply semi-formal filtering
2008-10-13 17:01:00 +02:00
/*
2008-09-22 17:01:00 +02:00
if ( p->pPars->fSemiFormal )
{
Aig_Man_t * pSRed;
2008-10-13 17:01:00 +02:00
Ssw_FilterUsingSemi( p, 0, 2000, p->pPars->fVerbose );
// Ssw_FilterUsingSemi( p, 1, 100000, p->pPars->fVerbose );
2008-09-22 17:01:00 +02:00
pSRed = Ssw_SpeculativeReduction( p );
Aig_ManDumpBlif( pSRed, "srm.blif", NULL, NULL );
Aig_ManStop( pSRed );
}
2008-10-13 17:01:00 +02:00
*/
2010-11-01 09:35:04 +01:00
if ( p->pPars->pFunc )
{
((int (*)(void *))p->pPars->pFunc)( p->pPars->pData );
((int (*)(void *))p->pPars->pFunc)( p->pPars->pData );
}
if ( p->pPars->nStepsMax == 0 )
{
2012-10-29 23:28:30 +01:00
Abc_Print( 1, "Stopped signal correspondence after BMC.\n" );
2010-11-01 09:35:04 +01:00
goto finalize;
}
2008-09-01 17:01:00 +02:00
// refine classes using induction
2008-10-14 17:01:00 +02:00
nSatProof = nSatCallsSat = nRecycles = nSatFailsReal = nUniques = 0;
2008-09-01 17:01:00 +02:00
for ( nIter = 0; ; nIter++ )
{
2010-11-01 09:35:04 +01:00
if ( p->pPars->nStepsMax == nIter )
{
2012-10-29 23:28:30 +01:00
Abc_Print( 1, "Stopped signal correspondence after %d refiment iterations.\n", nIter );
2010-11-01 09:35:04 +01:00
goto finalize;
}
2009-03-13 16:01:00 +01:00
if ( p->pPars->nItersStop >= 0 && p->pPars->nItersStop == nIter )
{
Aig_Man_t * pSRed = Ssw_SpeculativeReduction( p );
Aig_ManDumpBlif( pSRed, "srm.blif", NULL, NULL );
Aig_ManStop( pSRed );
2012-10-29 23:28:30 +01:00
Abc_Print( 1, "Iterative refinement is stopped before iteration %d.\n", nIter );
Abc_Print( 1, "The network is reduced using candidate equivalences.\n" );
Abc_Print( 1, "Speculatively reduced miter is saved in file \"%s\".\n", "srm.blif" );
Abc_Print( 1, "If the miter is SAT, the reduced result is incorrect.\n" );
2009-03-13 16:01:00 +01:00
break;
}
clk = Abc_Clock();
2008-10-13 17:01:00 +02:00
p->pMSat = Ssw_SatStart( 0 );
2008-09-19 17:01:00 +02:00
if ( p->pPars->fLatchCorrOpt )
2008-09-21 17:01:00 +02:00
{
2008-09-19 17:01:00 +02:00
RetValue = Ssw_ManSweepLatch( p );
2008-09-21 17:01:00 +02:00
if ( p->pPars->fVerbose )
{
2012-10-29 23:28:30 +01:00
Abc_Print( 1, "%3d : C =%7d. Cl =%7d. Pr =%6d. Cex =%5d. R =%4d. F =%4d. ",
nIter, Ssw_ClassesCand1Num(p->ppClasses), Ssw_ClassesClassNum(p->ppClasses),
p->nSatProof-nSatProof, p->nSatCallsSat-nSatCallsSat,
2008-09-21 17:01:00 +02:00
p->nRecycles-nRecycles, p->nSatFailsReal-nSatFailsReal );
ABC_PRT( "T", Abc_Clock() - clk );
2012-10-29 23:28:30 +01:00
}
2008-09-21 17:01:00 +02:00
}
2008-09-19 17:01:00 +02:00
else
2008-09-01 17:01:00 +02:00
{
2012-10-29 23:28:30 +01:00
if ( p->pPars->fConstrs )
2010-11-01 09:35:04 +01:00
RetValue = Ssw_ManSweepConstr( p );
else if ( p->pPars->fDynamic )
2008-10-14 17:01:00 +02:00
RetValue = Ssw_ManSweepDyn( p );
else
RetValue = Ssw_ManSweep( p );
2010-11-01 09:35:04 +01:00
2008-10-13 17:01:00 +02:00
p->pPars->nConflicts += p->pMSat->pSat->stats.conflicts;
2008-09-21 17:01:00 +02:00
if ( p->pPars->fVerbose )
{
2012-10-29 23:28:30 +01:00
Abc_Print( 1, "%3d : C =%7d. Cl =%7d. LR =%6d. NR =%6d. ",
nIter, Ssw_ClassesCand1Num(p->ppClasses), Ssw_ClassesClassNum(p->ppClasses),
2008-10-14 17:01:00 +02:00
p->nConstrReduced, Aig_ManNodeNum(p->pFrames) );
2010-11-01 09:35:04 +01:00
if ( p->pPars->fDynamic )
2008-10-14 17:01:00 +02:00
{
2012-10-29 23:28:30 +01:00
Abc_Print( 1, "Cex =%5d. ", p->nSatCallsSat-nSatCallsSat );
Abc_Print( 1, "R =%4d. ", p->nRecycles-nRecycles );
2008-10-14 17:01:00 +02:00
}
2012-10-29 23:28:30 +01:00
Abc_Print( 1, "F =%5d. %s ", p->nSatFailsReal-nSatFailsReal,
(Saig_ManPoNum(p->pAig)==1 && Ssw_ObjIsConst1Cand(p->pAig,Aig_ObjFanin0(Aig_ManCo(p->pAig,0))))? "+" : "-" );
ABC_PRT( "T", Abc_Clock() - clk );
2012-10-29 23:28:30 +01:00
}
2008-10-29 16:01:00 +01:00
// if ( p->pPars->fDynamic && p->nSatCallsSat-nSatCallsSat < 100 )
// p->pPars->nBTLimit = 10000;
if ( p->pPars->fStopWhenGone && Saig_ManPoNum(p->pAig) == 1 && !Ssw_ObjIsConst1Cand(p->pAig,Aig_ObjFanin0(Aig_ManCo(p->pAig,0))) )
{
printf( "Iterative refinement is stopped after iteration %d\n", nIter );
printf( "because the property output is no longer a candidate constant.\n" );
// prepare to quite
p->nLitsEnd = p->nLitsBeg;
p->nNodesEnd = p->nNodesBeg;
p->nRegsEnd = p->nRegsBeg;
// cleanup
Ssw_SatStop( p->pMSat );
p->pMSat = NULL;
Ssw_ManCleanup( p );
// cleanup
Aig_ManSetPhase( p->pAig );
Aig_ManCleanMarkB( p->pAig );
return Aig_ManDupSimple( p->pAig );
}
2008-09-21 17:01:00 +02:00
}
2008-10-14 17:01:00 +02:00
nSatProof = p->nSatProof;
nSatCallsSat = p->nSatCallsSat;
nRecycles = p->nRecycles;
nSatFailsReal = p->nSatFailsReal;
nUniques = p->nUniques;
2012-01-21 13:30:10 +01:00
p->nVarsMax = Abc_MaxInt( p->nVarsMax, p->pMSat->nSatVars );
p->nCallsMax = Abc_MaxInt( p->nCallsMax, p->pMSat->nSolverCalls );
2008-10-13 17:01:00 +02:00
Ssw_SatStop( p->pMSat );
p->pMSat = NULL;
2008-09-05 17:01:00 +02:00
Ssw_ManCleanup( p );
2012-10-29 23:28:30 +01:00
if ( !RetValue )
2008-09-01 17:01:00 +02:00
break;
2010-11-01 09:35:04 +01:00
if ( p->pPars->pFunc )
((int (*)(void *))p->pPars->pFunc)( p->pPars->pData );
2012-10-29 23:28:30 +01:00
}
2010-11-01 09:35:04 +01:00
finalize:
2008-09-09 17:01:00 +02:00
p->pPars->nIters = nIter + 1;
p->timeTotal = Abc_Clock() - clkTotal;
2010-11-01 09:35:04 +01:00
Ssw_ManUpdateEquivs( p, p->pAig, p->pPars->fVerbose );
2008-09-15 17:01:00 +02:00
pAigNew = Aig_ManDupRepr( p->pAig, 0 );
2008-09-05 17:01:00 +02:00
Aig_ManSeqCleanup( pAigNew );
2009-03-29 17:01:00 +02:00
//Ssw_ClassesPrint( p->ppClasses, 1 );
2008-09-09 17:01:00 +02:00
// get the final stats
p->nLitsEnd = Ssw_ClassesLitNum( p->ppClasses );
p->nNodesEnd = Aig_ManNodeNum(pAigNew);
p->nRegsEnd = Aig_ManRegNum(pAigNew);
2010-11-01 09:35:04 +01:00
// cleanup
Aig_ManSetPhase( p->pAig );
Aig_ManCleanMarkB( p->pAig );
2008-09-15 17:01:00 +02:00
return pAigNew;
}
/**Function*************************************************************
Synopsis [Performs computation of signal correspondence with constraints.]
Description []
2012-10-29 23:28:30 +01:00
2008-09-15 17:01:00 +02:00
SideEffects []
SeeAlso []
***********************************************************************/
Aig_Man_t * Ssw_SignalCorrespondence( Aig_Man_t * pAig, Ssw_Pars_t * pPars )
{
Ssw_Pars_t Pars;
Aig_Man_t * pAigNew;
Ssw_Man_t * p;
2008-09-19 17:01:00 +02:00
assert( Aig_ManRegNum(pAig) > 0 );
2008-09-15 17:01:00 +02:00
// reset random numbers
Aig_ManRandom( 1 );
// if parameters are not given, create them
if ( pPars == NULL )
Ssw_ManSetDefaultParams( pPars = &Pars );
// consider the case of empty AIG
if ( Aig_ManNodeNum(pAig) == 0 )
{
pPars->nIters = 0;
// Ntl_ManFinalize() needs the following to satisfy an assertion
Aig_ManReprStart( pAig,Aig_ManObjNumMax(pAig) );
return Aig_ManDupOrdered(pAig);
}
// check and update parameters
2008-09-19 17:01:00 +02:00
if ( pPars->fLatchCorrOpt )
2008-09-21 17:01:00 +02:00
{
2008-09-19 17:01:00 +02:00
pPars->fLatchCorr = 1;
2009-01-18 17:01:00 +01:00
pPars->nFramesAddSim = 0;
if ( (pAig->vClockDoms && Vec_VecSize(pAig->vClockDoms) > 0) )
return Ssw_SignalCorrespondencePart( pAig, pPars );
2008-09-21 17:01:00 +02:00
}
2008-09-19 17:01:00 +02:00
else
{
assert( pPars->nFramesK > 0 );
// perform partitioning
if ( (pPars->nPartSize > 0 && pPars->nPartSize < Aig_ManRegNum(pAig))
|| (pAig->vClockDoms && Vec_VecSize(pAig->vClockDoms) > 0) )
return Ssw_SignalCorrespondencePart( pAig, pPars );
}
2009-04-24 17:01:00 +02:00
if ( pPars->fScorrGia )
{
if ( pPars->fLatchCorrOpt )
{
extern Aig_Man_t * Cec_LatchCorrespondence( Aig_Man_t * pAig, int nConfs, int fUseCSat );
return Cec_LatchCorrespondence( pAig, pPars->nBTLimit, pPars->fUseCSat );
}
else
{
extern Aig_Man_t * Cec_SignalCorrespondence( Aig_Man_t * pAig, int nConfs, int fUseCSat );
return Cec_SignalCorrespondence( pAig, pPars->nBTLimit, pPars->fUseCSat );
}
2009-04-24 17:01:00 +02:00
}
2012-10-29 23:28:30 +01:00
2008-09-15 17:01:00 +02:00
// start the induction manager
p = Ssw_ManCreate( pAig, pPars );
// compute candidate equivalence classes
// p->pPars->nConstrs = 1;
2010-11-01 09:35:04 +01:00
if ( p->pPars->fConstrs )
{
// create trivial equivalence classes with all nodes being candidates for constant 1
p->ppClasses = Ssw_ClassesPrepareSimple( pAig, pPars->fLatchCorr, pPars->nMaxLevs );
Ssw_ClassesSetData( p->ppClasses, NULL, NULL, Ssw_SmlObjIsConstBit, Ssw_SmlObjsAreEqualBit );
// derive phase bits to satisfy the constraints
if ( Ssw_ManSetConstrPhases( pAig, p->pPars->nFramesK + 1, &p->vInits ) != 0 )
{
2012-10-29 23:28:30 +01:00
Abc_Print( 1, "Ssw_SignalCorrespondence(): The init state does not satisfy the constraints!\n" );
2010-11-01 09:35:04 +01:00
p->pPars->fVerbose = 0;
Ssw_ManStop( p );
return NULL;
}
// perform simulation of the first timeframes
Ssw_ManRefineByConstrSim( p );
}
else
2008-09-15 17:01:00 +02:00
{
// perform one round of seq simulation and generate candidate equivalence classes
2011-04-19 08:27:51 +02:00
p->ppClasses = Ssw_ClassesPrepare( pAig, pPars->nFramesK, pPars->fLatchCorr, pPars->fConstCorr, pPars->fOutputCorr, pPars->nMaxLevs, pPars->fVerbose );
2008-09-22 17:01:00 +02:00
// p->ppClasses = Ssw_ClassesPrepareTargets( pAig );
2008-10-14 17:01:00 +02:00
if ( pPars->fLatchCorrOpt )
p->pSml = Ssw_SmlStart( pAig, 0, 2, 1 );
else if ( pPars->fDynamic )
p->pSml = Ssw_SmlStart( pAig, 0, p->nFrames + p->pPars->nFramesAddSim, 1 );
else
p->pSml = Ssw_SmlStart( pAig, 0, 1 + p->pPars->nFramesAddSim, 1 );
2010-11-01 09:35:04 +01:00
Ssw_ClassesSetData( p->ppClasses, p->pSml, (unsigned(*)(void *,Aig_Obj_t *))Ssw_SmlObjHashWord, (int(*)(void *,Aig_Obj_t *))Ssw_SmlObjIsConstWord, (int(*)(void *,Aig_Obj_t *,Aig_Obj_t *))Ssw_SmlObjsAreEqualWord );
2008-09-15 17:01:00 +02:00
}
2010-11-01 09:35:04 +01:00
// allocate storage
2009-01-18 17:01:00 +01:00
if ( p->pPars->fLocalSim )
2009-02-15 17:01:00 +01:00
p->pVisited = ABC_CALLOC( int, Ssw_SmlNumFrames( p->pSml ) * Aig_ManObjNumMax(p->pAig) );
2008-09-15 17:01:00 +02:00
// perform refinement of classes
2012-10-29 23:28:30 +01:00
pAigNew = Ssw_SignalCorrespondenceRefine( p );
2010-11-01 09:35:04 +01:00
// Ssw_ReportOutputs( pAigNew );
if ( pPars->fConstrs && pPars->fVerbose )
Ssw_ReportConeReductions( p, pAig, pAigNew );
2008-09-09 17:01:00 +02:00
// cleanup
Ssw_ManStop( p );
2008-09-05 17:01:00 +02:00
return pAigNew;
2008-09-01 17:01:00 +02:00
}
2008-09-21 17:01:00 +02:00
/**Function*************************************************************
Synopsis [Performs computation of latch correspondence.]
Description []
SideEffects []
SeeAlso []
***********************************************************************/
Aig_Man_t * Ssw_LatchCorrespondence( Aig_Man_t * pAig, Ssw_Pars_t * pPars )
{
2010-11-01 09:35:04 +01:00
Aig_Man_t * pRes;
2008-09-21 17:01:00 +02:00
Ssw_Pars_t Pars;
if ( pPars == NULL )
Ssw_ManSetDefaultParamsLcorr( pPars = &Pars );
2010-11-01 09:35:04 +01:00
pRes = Ssw_SignalCorrespondence( pAig, pPars );
// if ( pPars->fConstrs && pPars->fVerbose )
// Ssw_ReportConeReductions( pAig, pRes );
return pRes;
2008-09-21 17:01:00 +02:00
}
2008-09-10 17:01:00 +02:00
2008-09-01 17:01:00 +02:00
////////////////////////////////////////////////////////////////////////
/// END OF FILE ///
////////////////////////////////////////////////////////////////////////
2010-11-01 09:35:04 +01:00
ABC_NAMESPACE_IMPL_END