ABC: A System for Sequential Synthesis and Verification
 
Loading...
Searching...
No Matches
ssw.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  Ssw_Pars_t_
 
struct  Ssw_RarPars_t_
 

Typedefs

typedef typedefABC_NAMESPACE_HEADER_START struct Ssw_Pars_t_ Ssw_Pars_t
 INCLUDES ///.
 
typedef struct Ssw_RarPars_t_ Ssw_RarPars_t
 
typedef struct Ssw_Sml_t_ Ssw_Sml_t
 

Functions

int Ssw_BmcDynamic (Aig_Man_t *pAig, int nFramesMax, int nConfLimit, int fVerbose, int *piFrame)
 MACRO DEFINITIONS ///.
 
int Ssw_ManSetConstrPhases (Aig_Man_t *p, int nFrames, Vec_Int_t **pvInits)
 
void Ssw_ManSetDefaultParams (Ssw_Pars_t *p)
 DECLARATIONS ///.
 
void Ssw_ManSetDefaultParamsLcorr (Ssw_Pars_t *p)
 
Aig_Man_tSsw_SignalCorrespondence (Aig_Man_t *pAig, Ssw_Pars_t *pPars)
 
Aig_Man_tSsw_LatchCorrespondence (Aig_Man_t *pAig, Ssw_Pars_t *pPars)
 
int Ssw_SecWithSimilarityPairs (Aig_Man_t *p0, Aig_Man_t *p1, Vec_Int_t *vPairs, Ssw_Pars_t *pPars)
 
int Ssw_SecWithSimilarity (Aig_Man_t *p0, Aig_Man_t *p1, Ssw_Pars_t *pPars)
 
Aig_Man_tSsw_SignalCorrespondencePart (Aig_Man_t *pAig, Ssw_Pars_t *pPars)
 
int Ssw_MiterStatus (Aig_Man_t *p, int fVerbose)
 DECLARATIONS ///.
 
int Ssw_SecWithPairs (Aig_Man_t *pAig1, Aig_Man_t *pAig2, Vec_Int_t *vIds1, Vec_Int_t *vIds2, Ssw_Pars_t *pPars)
 
int Ssw_SecGeneral (Aig_Man_t *pAig1, Aig_Man_t *pAig2, Ssw_Pars_t *pPars)
 
int Ssw_SecGeneralMiter (Aig_Man_t *pMiter, Ssw_Pars_t *pPars)
 
void Ssw_RarSetDefaultParams (Ssw_RarPars_t *p)
 FUNCTION DEFINITIONS ///.
 
int Ssw_RarSignalFilter (Aig_Man_t *pAig, Ssw_RarPars_t *pPars)
 
int Ssw_RarSimulate (Aig_Man_t *pAig, Ssw_RarPars_t *pPars)
 
Ssw_Sml_tSsw_SmlSimulateComb (Aig_Man_t *pAig, int nWords)
 
Ssw_Sml_tSsw_SmlSimulateSeq (Aig_Man_t *pAig, int nPref, int nFrames, int nWords)
 
void Ssw_SmlUnnormalize (Ssw_Sml_t *p)
 
void Ssw_SmlStop (Ssw_Sml_t *p)
 
int Ssw_SmlNumFrames (Ssw_Sml_t *p)
 
int Ssw_SmlNumWordsTotal (Ssw_Sml_t *p)
 
unsigned * Ssw_SmlSimInfo (Ssw_Sml_t *p, Aig_Obj_t *pObj)
 
int Ssw_SmlObjsAreEqualWord (Ssw_Sml_t *p, Aig_Obj_t *pObj0, Aig_Obj_t *pObj1)
 
void Ssw_SmlInitializeSpecial (Ssw_Sml_t *p, Vec_Int_t *vInit)
 
int Ssw_SmlCheckNonConstOutputs (Ssw_Sml_t *p)
 
Vec_Ptr_tSsw_SmlSimDataPointers (Ssw_Sml_t *p)
 

Typedef Documentation

◆ Ssw_Pars_t

typedef typedefABC_NAMESPACE_HEADER_START struct Ssw_Pars_t_ Ssw_Pars_t

INCLUDES ///.

CFile****************************************************************

FileName [ssw.h]

SystemName [ABC: Logic synthesis and verification system.]

PackageName [Inductive prover with constraints.]

Synopsis [External declarations.]

Author [Alan Mishchenko]

Affiliation [UC Berkeley]

Date [Ver. 1.0. Started - September 1, 2008.]

Revision [

Id
ssw.h,v 1.00 2008/09/01 00:00:00 alanmi Exp

] PARAMETERS /// BASIC TYPES ///

Definition at line 40 of file ssw.h.

◆ Ssw_RarPars_t

typedef struct Ssw_RarPars_t_ Ssw_RarPars_t

Definition at line 94 of file ssw.h.

◆ Ssw_Sml_t

typedef struct Ssw_Sml_t_ Ssw_Sml_t

Definition at line 120 of file ssw.h.

Function Documentation

◆ Ssw_BmcDynamic()

int Ssw_BmcDynamic ( Aig_Man_t * pAig,
int nFramesMax,
int nConfLimit,
int fVerbose,
int * piFrame )
extern

MACRO DEFINITIONS ///.

FUNCTION DECLARATIONS ///

Function*************************************************************

Synopsis [Performs BMC for the given AIG.]

Description []

SideEffects []

SeeAlso []

Definition at line 126 of file sswBmc.c.

127{
128 Ssw_Frm_t * pFrm;
129 Ssw_Sat_t * pSat;
130 Aig_Obj_t * pObj, * pObjFrame;
131 int status, Lit, i, f, RetValue;
132 abctime clkPart;
133
134 // start managers
135 assert( Saig_ManRegNum(pAig) > 0 );
136 Aig_ManSetCioIds( pAig );
137 pSat = Ssw_SatStart( 0 );
138 pFrm = Ssw_FrmStart( pAig );
139 pFrm->pFrames = Aig_ManStart( Aig_ManObjNumMax(pAig) * 3 );
140 // report statistics
141 if ( fVerbose )
142 {
143 Abc_Print( 1, "AIG: PI/PO/Reg = %d/%d/%d. Node = %6d. Lev = %5d.\n",
144 Saig_ManPiNum(pAig), Saig_ManPoNum(pAig), Saig_ManRegNum(pAig),
145 Aig_ManNodeNum(pAig), Aig_ManLevelNum(pAig) );
146 fflush( stdout );
147 }
148 // perform dynamic unrolling
149 RetValue = -1;
150 for ( f = 0; f < nFramesMax; f++ )
151 {
152 clkPart = Abc_Clock();
153 Saig_ManForEachPo( pAig, pObj, i )
154 {
155 // unroll the circuit for this output
156 Ssw_BmcUnroll_rec( pFrm, pObj, f );
157 pObjFrame = Ssw_ObjFrame_( pFrm, pObj, f );
158 Ssw_CnfNodeAddToSolver( pSat, Aig_Regular(pObjFrame) );
159 status = sat_solver_simplify(pSat->pSat);
160 assert( status );
161 // solve
162 Lit = toLitCond( Ssw_ObjSatNum(pSat,pObjFrame), Aig_IsComplement(pObjFrame) );
163 if ( fVerbose )
164 {
165 Abc_Print( 1, "Solving output %2d of frame %3d ... \r",
166 i % Saig_ManPoNum(pAig), i / Saig_ManPoNum(pAig) );
167 }
168 status = sat_solver_solve( pSat->pSat, &Lit, &Lit + 1, (ABC_INT64_T)nConfLimit, (ABC_INT64_T)0, (ABC_INT64_T)0, (ABC_INT64_T)0 );
169 if ( status == l_False )
170 {
171/*
172 Lit = lit_neg( Lit );
173 RetValue = sat_solver_addclause( pSat->pSat, &Lit, &Lit + 1 );
174 assert( RetValue );
175 if ( pSat->pSat->qtail != pSat->pSat->qhead )
176 {
177 RetValue = sat_solver_simplify(pSat->pSat);
178 assert( RetValue );
179 }
180*/
181 RetValue = 1;
182 continue;
183 }
184 else if ( status == l_True )
185 {
186 pAig->pSeqModel = Ssw_BmcGetCounterExample( pFrm, pSat, i, f );
187 if ( piFrame )
188 *piFrame = f;
189 RetValue = 0;
190 break;
191 }
192 else
193 {
194 if ( piFrame )
195 *piFrame = f;
196 RetValue = -1;
197 break;
198 }
199 }
200 if ( fVerbose )
201 {
202 Abc_Print( 1, "Solved %2d outputs of frame %3d. ", Saig_ManPoNum(pAig), f );
203 Abc_Print( 1, "Conf =%8.0f. Var =%8d. AIG=%9d. ",
204 (double)pSat->pSat->stats.conflicts,
205 pSat->nSatVars, Aig_ManNodeNum(pFrm->pFrames) );
206 ABC_PRT( "T", Abc_Clock() - clkPart );
207 clkPart = Abc_Clock();
208 fflush( stdout );
209 }
210 if ( RetValue != 1 )
211 break;
212 }
213
214 Ssw_SatStop( pSat );
215 Ssw_FrmStop( pFrm );
216 return RetValue;
217}
ABC_INT64_T abctime
Definition abc_global.h:332
#define ABC_PRT(a, t)
Definition abc_global.h:255
void Aig_ManSetCioIds(Aig_Man_t *p)
Definition aigUtil.c:978
int Aig_ManLevelNum(Aig_Man_t *p)
Definition aigDfs.c:500
struct Aig_Obj_t_ Aig_Obj_t
Definition aig.h:51
Aig_Man_t * Aig_ManStart(int nNodesMax)
DECLARATIONS ///.
Definition aigMan.c:47
#define l_True
Definition bmcBmcS.c:35
#define l_False
Definition bmcBmcS.c:36
#define sat_solver_solve
Definition cecSatG2.c:45
#define Saig_ManForEachPo(p, pObj, i)
Definition saig.h:93
int sat_solver_simplify(sat_solver *s)
Definition satSolver.c:1515
ABC_NAMESPACE_IMPL_START Ssw_Frm_t * Ssw_FrmStart(Aig_Man_t *pAig)
DECLARATIONS ///.
Definition sswAig.c:45
void Ssw_FrmStop(Ssw_Frm_t *p)
Definition sswAig.c:70
Abc_Cex_t * Ssw_BmcGetCounterExample(Ssw_Frm_t *pFrm, Ssw_Sat_t *pSat, int iPo, int iFrame)
Definition sswBmc.c:90
ABC_NAMESPACE_IMPL_START Aig_Obj_t * Ssw_BmcUnroll_rec(Ssw_Frm_t *pFrm, Aig_Obj_t *pObj, int f)
DECLARATIONS ///.
Definition sswBmc.c:45
void Ssw_SatStop(Ssw_Sat_t *p)
Definition sswCnf.c:81
void Ssw_CnfNodeAddToSolver(Ssw_Sat_t *p, Aig_Obj_t *pObj)
Definition sswCnf.c:351
ABC_NAMESPACE_IMPL_START Ssw_Sat_t * Ssw_SatStart(int fPolarFlip)
DECLARATIONS ///.
Definition sswCnf.c:45
struct Ssw_Frm_t_ Ssw_Frm_t
Definition sswInt.h:48
struct Ssw_Sat_t_ Ssw_Sat_t
Definition sswInt.h:49
Aig_Man_t * pFrames
Definition sswInt.h:161
sat_solver * pSat
Definition sswInt.h:147
int nSatVars
Definition sswInt.h:148
stats_t stats
Definition satSolver.h:163
ABC_INT64_T conflicts
Definition satVec.h:156
#define assert(ex)
Definition util_old.h:213
Here is the call graph for this function:

◆ Ssw_LatchCorrespondence()

Aig_Man_t * Ssw_LatchCorrespondence ( Aig_Man_t * pAig,
Ssw_Pars_t * pPars )
extern

Function*************************************************************

Synopsis [Performs computation of latch correspondence.]

Description []

SideEffects []

SeeAlso []

Definition at line 545 of file sswCore.c.

546{
547 Aig_Man_t * pRes;
548 Ssw_Pars_t Pars;
549 if ( pPars == NULL )
550 Ssw_ManSetDefaultParamsLcorr( pPars = &Pars );
551 pRes = Ssw_SignalCorrespondence( pAig, pPars );
552// if ( pPars->fConstrs && pPars->fVerbose )
553// Ssw_ReportConeReductions( pAig, pRes );
554 return pRes;
555}
typedefABC_NAMESPACE_HEADER_START struct Aig_Man_t_ Aig_Man_t
INCLUDES ///.
Definition aig.h:50
void Ssw_ManSetDefaultParamsLcorr(Ssw_Pars_t *p)
Definition sswCore.c:93
Aig_Man_t * Ssw_SignalCorrespondence(Aig_Man_t *pAig, Ssw_Pars_t *pPars)
Definition sswCore.c:436
typedefABC_NAMESPACE_HEADER_START struct Ssw_Pars_t_ Ssw_Pars_t
INCLUDES ///.
Definition ssw.h:40
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Ssw_ManSetConstrPhases()

int Ssw_ManSetConstrPhases ( Aig_Man_t * p,
int nFrames,
Vec_Int_t ** pvInits )
extern

Function*************************************************************

Synopsis [Finds one satisfiable assignment of the timeframes.]

Description []

SideEffects []

SeeAlso []

Definition at line 100 of file sswConstr.c.

101{
102 Aig_Man_t * pFrames;
103 sat_solver * pSat;
104 Cnf_Dat_t * pCnf;
105 Aig_Obj_t * pObj;
106 int i, RetValue;
107 if ( pvInits )
108 *pvInits = NULL;
109// assert( p->nConstrs > 0 );
110 // derive the timeframes
111 pFrames = Ssw_FramesWithConstraints( p, nFrames );
112 // create CNF
113 pCnf = Cnf_Derive( pFrames, 0 );
114 // create SAT solver
115 pSat = (sat_solver *)Cnf_DataWriteIntoSolver( pCnf, 1, 0 );
116 if ( pSat == NULL )
117 {
118 Cnf_DataFree( pCnf );
119 Aig_ManStop( pFrames );
120 return 1;
121 }
122 // solve
123 RetValue = sat_solver_solve( pSat, NULL, NULL,
124 (ABC_INT64_T)1000000, (ABC_INT64_T)0, (ABC_INT64_T)0, (ABC_INT64_T)0 );
125 if ( RetValue == l_True && pvInits )
126 {
127 *pvInits = Vec_IntAlloc( 1000 );
128 Aig_ManForEachCi( pFrames, pObj, i )
129 Vec_IntPush( *pvInits, sat_solver_var_value(pSat, pCnf->pVarNums[Aig_ObjId(pObj)]) );
130
131// Aig_ManForEachCi( pFrames, pObj, i )
132// Abc_Print( 1, "%d", Vec_IntEntry(*pvInits, i) );
133// Abc_Print( 1, "\n" );
134 }
135 sat_solver_delete( pSat );
136 Cnf_DataFree( pCnf );
137 Aig_ManStop( pFrames );
138 if ( RetValue == l_False )
139 return 1;
140 if ( RetValue == l_True )
141 return 0;
142 return -1;
143}
void Aig_ManStop(Aig_Man_t *p)
Definition aigMan.c:187
#define Aig_ManForEachCi(p, pObj, i)
ITERATORS ///.
Definition aig.h:393
#define sat_solver
Definition cecSatG2.c:34
Cnf_Dat_t * Cnf_Derive(Aig_Man_t *pAig, int nOutputs)
Definition cnfCore.c:165
struct Cnf_Dat_t_ Cnf_Dat_t
Definition cnf.h:52
void Cnf_DataFree(Cnf_Dat_t *p)
Definition cnfMan.c:207
Cube * p
Definition exorList.c:222
void * Cnf_DataWriteIntoSolver(Cnf_Dat_t *p, int nFrames, int fInit)
Definition cnfMan.c:579
void sat_solver_delete(sat_solver *s)
Definition satSolver.c:1341
ABC_NAMESPACE_IMPL_START Aig_Man_t * Ssw_FramesWithConstraints(Aig_Man_t *p, int nFrames)
DECLARATIONS ///.
Definition sswConstr.c:47
int * pVarNums
Definition cnf.h:63
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Ssw_ManSetDefaultParams()

void Ssw_ManSetDefaultParams ( Ssw_Pars_t * p)
extern

DECLARATIONS ///.

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

] FUNCTION DEFINITIONS /// Function*************************************************************

Synopsis [This procedure sets default parameters.]

Description []

SideEffects []

SeeAlso []

Definition at line 45 of file sswCore.c.

46{
47 memset( p, 0, sizeof(Ssw_Pars_t) );
48 p->nPartSize = 0; // size of the partition
49 p->nOverSize = 0; // size of the overlap between partitions
50 p->nFramesK = 1; // the induction depth
51 p->nFramesAddSim = 2; // additional frames to simulate
52 p->fConstrs = 0; // treat the last nConstrs POs as seq constraints
53 p->fMergeFull = 0; // enables full merge when constraints are used
54 p->nBTLimit = 1000; // conflict limit at a node
55 p->nBTLimitGlobal = 5000000; // conflict limit for all runs
56 p->nMinDomSize = 100; // min clock domain considered for optimization
57 p->nItersStop = -1; // stop after the given number of iterations
58 p->nResimDelta = 1000; // the internal of nodes to resimulate
59 p->nStepsMax = -1; // (scorr only) the max number of induction steps
60 p->fPolarFlip = 0; // uses polarity adjustment
61 p->fLatchCorr = 0; // performs register correspondence
62 p->fConstCorr = 0; // performs constant correspondence
63 p->fOutputCorr = 0; // perform 'PO correspondence'
64 p->fSemiFormal = 0; // enable semiformal filtering
65 p->fDynamic = 0; // dynamic partitioning
66 p->fLocalSim = 0; // local simulation
67 p->fVerbose = 0; // verbose stats
68 p->fEquivDump = 0; // enables dumping equivalences
69 p->fEquivDump2 = 0; // enables dumping equivalences
70
71 // latch correspondence
72 p->fLatchCorrOpt = 0; // performs optimized register correspondence
73 p->nSatVarMax = 1000; // the max number of SAT variables
74 p->nRecycleCalls = 50; // calls to perform before recycling SAT solver
75 // signal correspondence
76 p->nSatVarMax2 = 5000; // the max number of SAT variables
77 p->nRecycleCalls2 = 250; // calls to perform before recycling SAT solver
78 // return values
79 p->nIters = 0; // the number of iterations performed
80}
char * memset()
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Ssw_ManSetDefaultParamsLcorr()

void Ssw_ManSetDefaultParamsLcorr ( Ssw_Pars_t * p)
extern

Function*************************************************************

Synopsis [This procedure sets default parameters.]

Description []

SideEffects []

SeeAlso []

Definition at line 93 of file sswCore.c.

94{
96 p->fLatchCorrOpt = 1;
97 p->nBTLimit = 10000;
98}
ABC_NAMESPACE_IMPL_START void Ssw_ManSetDefaultParams(Ssw_Pars_t *p)
DECLARATIONS ///.
Definition sswCore.c:45
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Ssw_MiterStatus()

int Ssw_MiterStatus ( Aig_Man_t * p,
int fVerbose )
extern

DECLARATIONS ///.

CFile****************************************************************

FileName [sswPairs.c]

SystemName [ABC: Logic synthesis and verification system.]

PackageName [Inductive prover with constraints.]

Synopsis [Calls to the SAT solver.]

Author [Alan Mishchenko]

Affiliation [UC Berkeley]

Date [Ver. 1.0. Started - September 1, 2008.]

Revision [

Id
sswPairs.c,v 1.00 2008/09/01 00:00:00 alanmi Exp

] FUNCTION DEFINITIONS /// Function*************************************************************

Synopsis [Reports the status of the miter.]

Description []

SideEffects []

SeeAlso []

Definition at line 45 of file sswPairs.c.

46{
47 Aig_Obj_t * pObj, * pChild;
48 int i, CountConst0 = 0, CountNonConst0 = 0, CountUndecided = 0;
49// if ( p->pData )
50// return 0;
51 Saig_ManForEachPo( p, pObj, i )
52 {
53 pChild = Aig_ObjChild0(pObj);
54 // check if the output is constant 0
55 if ( pChild == Aig_ManConst0(p) )
56 {
57 CountConst0++;
58 continue;
59 }
60 // check if the output is constant 1
61 if ( pChild == Aig_ManConst1(p) )
62 {
63 CountNonConst0++;
64 continue;
65 }
66 // check if the output is a primary input
67 if ( p->nRegs == 0 && Aig_ObjIsCi(Aig_Regular(pChild)) )
68 {
69 CountNonConst0++;
70 continue;
71 }
72 // check if the output can be not constant 0
73 if ( Aig_Regular(pChild)->fPhase != (unsigned)Aig_IsComplement(pChild) )
74 {
75 CountNonConst0++;
76 continue;
77 }
78 CountUndecided++;
79 }
80
81 if ( fVerbose )
82 {
83 Abc_Print( 1, "Miter has %d outputs. ", Saig_ManPoNum(p) );
84 Abc_Print( 1, "Const0 = %d. ", CountConst0 );
85 Abc_Print( 1, "NonConst0 = %d. ", CountNonConst0 );
86 Abc_Print( 1, "Undecided = %d. ", CountUndecided );
87 Abc_Print( 1, "\n" );
88 }
89
90 if ( CountNonConst0 )
91 return 0;
92 if ( CountUndecided )
93 return -1;
94 return 1;
95}
Here is the caller graph for this function:

◆ Ssw_RarSetDefaultParams()

void Ssw_RarSetDefaultParams ( Ssw_RarPars_t * p)
extern

FUNCTION DEFINITIONS ///.

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 102 of file sswRarity.c.

103{
104 memset( p, 0, sizeof(Ssw_RarPars_t) );
105 p->nFrames = 20;
106 p->nWords = 50;
107 p->nBinSize = 8;
108 p->nRounds = 0;
109 p->nRestart = 0;
110 p->nRandSeed = 0;
111 p->TimeOut = 0;
112 p->TimeOutGap = 0;
113 p->fSolveAll = 0;
114 p->fDropSatOuts = 0;
115 p->fSetLastState = 0;
116 p->fVerbose = 0;
117 p->fNotVerbose = 0;
118}
struct Ssw_RarPars_t_ Ssw_RarPars_t
Definition ssw.h:94
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Ssw_RarSignalFilter()

int Ssw_RarSignalFilter ( Aig_Man_t * pAig,
Ssw_RarPars_t * pPars )
extern

Function*************************************************************

Synopsis [Filter equivalence classes of nodes.]

Description []

SideEffects []

SeeAlso []

Definition at line 1221 of file sswRarity.c.

1222{
1223 Ssw_RarMan_t * p;
1224 int r, f = -1, i, k;
1225 abctime clkTotal = Abc_Clock();
1226 abctime nTimeToStop = pPars->TimeOut ? pPars->TimeOut * CLOCKS_PER_SEC + Abc_Clock(): 0;
1227 int nNumRestart = 0;
1228 int nSavedSeed = pPars->nRandSeed;
1229 int RetValue = -1;
1230 assert( Aig_ManRegNum(pAig) > 0 );
1231 assert( Aig_ManConstrNum(pAig) == 0 );
1232 // consider the case of empty AIG
1233 if ( Aig_ManNodeNum(pAig) == 0 )
1234 return -1;
1235 // check trivially SAT miters
1236 if ( pPars->fMiter && Ssw_RarCheckTrivial( pAig, 1 ) )
1237 return 0;
1238 if ( pPars->fVerbose )
1239 Abc_Print( 1, "Rarity equiv filtering with %d words, %d frames, %d rounds, %d seed, and %d sec timeout.\n",
1240 pPars->nWords, pPars->nFrames, pPars->nRounds, pPars->nRandSeed, pPars->TimeOut );
1241 // reset random numbers
1242 Ssw_RarManPrepareRandom( nSavedSeed );
1243
1244 // create manager
1245 p = Ssw_RarManStart( pAig, pPars );
1246 // compute starting state if needed
1247 assert( p->vInits == NULL );
1248 if ( pPars->pCex )
1249 {
1250 p->vInits = Ssw_RarFindStartingState( pAig, pPars->pCex );
1251 Abc_Print( 1, "Beginning simulation from the state derived using the counter-example.\n" );
1252 }
1253 else
1254 p->vInits = Vec_IntStart( Aig_ManRegNum(pAig) );
1255 // duplicate the array
1256 for ( i = 1; i < pPars->nWords; i++ )
1257 for ( k = 0; k < Aig_ManRegNum(pAig); k++ )
1258 Vec_IntPush( p->vInits, Vec_IntEntry(p->vInits, k) );
1259 assert( Vec_IntSize(p->vInits) == Aig_ManRegNum(pAig) * pPars->nWords );
1260
1261 // create trivial equivalence classes with all nodes being candidates for constant 1
1262 if ( pAig->pReprs == NULL )
1263 p->ppClasses = Ssw_ClassesPrepareSimple( pAig, pPars->fLatchOnly, 0 );
1264 else
1265 p->ppClasses = Ssw_ClassesPrepareFromReprs( pAig );
1267 // print the stats
1268 if ( pPars->fVerbose )
1269 {
1270 Abc_Print( 1, "Initial : " );
1271 Ssw_ClassesPrint( p->ppClasses, 0 );
1272 }
1273 // refine classes using BMC
1274 for ( r = 0; !pPars->nRounds || (nNumRestart * pPars->nRestart + r < pPars->nRounds); r++ )
1275 {
1276 // start filtering equivalence classes
1277 if ( Ssw_ClassesCand1Num(p->ppClasses) == 0 && Ssw_ClassesClassNum(p->ppClasses) == 0 )
1278 {
1279 Abc_Print( 1, "All equivalences are refined away.\n" );
1280 break;
1281 }
1282 // simulate
1283 for ( f = 0; f < pPars->nFrames; f++ )
1284 {
1285 Ssw_RarManSimulate( p, f ? NULL : p->vInits, 1, !r && !f );
1286 if ( pPars->fMiter && Ssw_RarManCheckNonConstOutputs(p, -1, 0) )
1287 {
1288 if ( !pPars->fVerbose )
1289 Abc_Print( 1, "%s", Abc_FrameIsBatchMode() ? "\n" : "\r" );
1290// Abc_Print( 1, "Simulation asserted a PO in frame f: %d <= f < %d.\n", r * pPars->nFrames, (r+1) * pPars->nFrames );
1291 if ( pPars->fVerbose )
1292 Abc_Print( 1, "Simulated %d frames for %d rounds with %d restarts.\n", pPars->nFrames, nNumRestart * pPars->nRestart + r, nNumRestart );
1293 Ssw_RarManPrepareRandom( nSavedSeed );
1294 Abc_CexFree( pAig->pSeqModel );
1295 pAig->pSeqModel = Ssw_RarDeriveCex( p, r * p->pPars->nFrames + f, p->iFailPo, p->iFailPat, 1 );
1296 // print final report
1297 Abc_Print( 1, "Output %d of miter \"%s\" was asserted in frame %d. ", pAig->pSeqModel->iPo, pAig->pName, pAig->pSeqModel->iFrame );
1298 Abc_PrintTime( 1, "Time", Abc_Clock() - clkTotal );
1299 RetValue = 0;
1300 goto finish;
1301 }
1302 // check timeout
1303 if ( pPars->TimeOut && Abc_Clock() > nTimeToStop )
1304 {
1305 if ( pPars->fVerbose ) Abc_Print( 1, "\n" );
1306 Abc_Print( 1, "Simulated %d frames for %d rounds with %d restarts. ", pPars->nFrames, nNumRestart * pPars->nRestart + r, nNumRestart );
1307 Abc_Print( 1, "Reached timeout (%d sec).\n", pPars->TimeOut );
1308 goto finish;
1309 }
1310 }
1311 // get initialization patterns
1312 if ( pPars->pCex == NULL && pPars->nRestart && r == pPars->nRestart )
1313 {
1314 r = -1;
1315 nSavedSeed = (nSavedSeed + 1) % 1000;
1316 Ssw_RarManPrepareRandom( nSavedSeed );
1317 Vec_IntFill( p->vInits, Aig_ManRegNum(pAig) * pPars->nWords, 0 );
1318 nNumRestart++;
1319 Vec_IntClear( p->vPatBests );
1320 // clean rarity info
1321// memset( p->pRarity, 0, sizeof(int) * (1 << nBinSize) * p->nGroups );
1322 }
1323 else
1324 Ssw_RarTransferPatterns( p, p->vInits );
1325 // printout
1326 if ( pPars->fVerbose )
1327 {
1328 Abc_Print( 1, "Round %3d: ", r );
1329 Ssw_ClassesPrint( p->ppClasses, 0 );
1330 }
1331 else
1332 {
1333 Abc_Print( 1, "." );
1334 }
1335 }
1336finish:
1337 // report
1338 if ( r == pPars->nRounds && f == pPars->nFrames )
1339 {
1340 if ( !pPars->fVerbose )
1341 Abc_Print( 1, "%s", Abc_FrameIsBatchMode() ? "\n" : "\r" );
1342 Abc_Print( 1, "Simulation of %d frames for %d rounds with %d restarts did not assert POs. ", pPars->nFrames, nNumRestart * pPars->nRestart + r, nNumRestart );
1343 Abc_PrintTime( 1, "Time", Abc_Clock() - clkTotal );
1344 }
1345 // cleanup
1346 Ssw_RarManStop( p );
1347 return RetValue;
1348}
ABC_DLL int Abc_FrameIsBatchMode()
Definition mainFrame.c:110
Ssw_Cla_t * Ssw_ClassesPrepareFromReprs(Aig_Man_t *pAig)
Definition sswClass.c:768
int Ssw_ClassesCand1Num(Ssw_Cla_t *p)
Definition sswClass.c:259
Ssw_Cla_t * Ssw_ClassesPrepareSimple(Aig_Man_t *pAig, int fLatchCorr, int nMaxLevs)
Definition sswClass.c:724
int Ssw_ClassesClassNum(Ssw_Cla_t *p)
Definition sswClass.c:275
void Ssw_ClassesPrint(Ssw_Cla_t *p, int fVeryVerbose)
Definition sswClass.c:414
void Ssw_ClassesSetData(Ssw_Cla_t *p, void *pManData, unsigned(*pFuncNodeHash)(void *, Aig_Obj_t *), int(*pFuncNodeIsConst)(void *, Aig_Obj_t *), int(*pFuncNodesAreEqual)(void *, Aig_Obj_t *, Aig_Obj_t *))
Definition sswClass.c:167
unsigned Ssw_RarManObjHashWord(void *pMan, Aig_Obj_t *pObj)
Definition sswRarity.c:530
int Ssw_RarCheckTrivial(Aig_Man_t *pAig, int fVerbose)
Definition sswRarity.c:941
void Ssw_RarManSimulate(Ssw_RarMan_t *p, Vec_Int_t *vInit, int fUpdate, int fFirst)
Definition sswRarity.c:651
Abc_Cex_t * Ssw_RarDeriveCex(Ssw_RarMan_t *p, int iFrame, int iPo, int iPatFinal, int fVerbose)
Definition sswRarity.c:177
int Ssw_RarManObjsAreEqual(void *pMan, Aig_Obj_t *pObj0, Aig_Obj_t *pObj1)
Definition sswRarity.c:506
typedefABC_NAMESPACE_IMPL_START struct Ssw_RarMan_t_ Ssw_RarMan_t
DECLARATIONS ///.
Definition sswRarity.c:33
void Ssw_RarManPrepareRandom(int nRandSeed)
Definition sswRarity.c:131
int Ssw_RarManObjIsConst(void *pMan, Aig_Obj_t *pObj)
Definition sswRarity.c:483
int Ssw_RarManCheckNonConstOutputs(Ssw_RarMan_t *p, int iFrame, abctime Time)
Definition sswRarity.c:597
int nRestart
Definition ssw.h:101
int nRounds
Definition ssw.h:100
int nRandSeed
Definition ssw.h:102
int fVerbose
Definition ssw.h:107
int fLatchOnly
Definition ssw.h:113
int TimeOut
Definition ssw.h:103
int fMiter
Definition ssw.h:111
int nFrames
Definition ssw.h:97
Abc_Cex_t * pCex
Definition ssw.h:116
int nWords
Definition ssw.h:98
void Abc_CexFree(Abc_Cex_t *p)
Definition utilCex.c:382
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Ssw_RarSimulate()

int Ssw_RarSimulate ( Aig_Man_t * pAig,
Ssw_RarPars_t * pPars )
extern

Function*************************************************************

Synopsis [Perform sequential simulation.]

Description []

SideEffects []

SeeAlso []

Definition at line 973 of file sswRarity.c.

974{
975 int fTryBmc = 0;
976 int fMiter = 1;
977 Ssw_RarMan_t * p;
978 int r, f = -1;
979 abctime clk, clkTotal = Abc_Clock();
980 abctime nTimeToStop = pPars->TimeOut ? pPars->TimeOut * CLOCKS_PER_SEC + Abc_Clock(): 0;
981 abctime timeLastSolved = 0;
982 int nNumRestart = 0;
983 int nSavedSeed = pPars->nRandSeed;
984 int RetValue = -1;
985 int iFrameFail = -1;
986 assert( Aig_ManRegNum(pAig) > 0 );
987 assert( Aig_ManConstrNum(pAig) == 0 );
988 ABC_FREE( pAig->pSeqModel );
989 // consider the case of empty AIG
990// if ( Aig_ManNodeNum(pAig) == 0 )
991// return -1;
992 // check trivially SAT miters
993// if ( fMiter && Ssw_RarCheckTrivial( pAig, fVerbose ) )
994// return 0;
995 if ( pPars->fVerbose )
996 Abc_Print( 1, "Rarity simulation with %d words, %d frames, %d rounds, %d restart, %d seed, and %d sec timeout.\n",
997 pPars->nWords, pPars->nFrames, pPars->nRounds, pPars->nRestart, pPars->nRandSeed, pPars->TimeOut );
998 // reset random numbers
999 Ssw_RarManPrepareRandom( nSavedSeed );
1000
1001 // create manager
1002 p = Ssw_RarManStart( pAig, pPars );
1003 p->vInits = Vec_IntStart( Aig_ManRegNum(pAig) * pPars->nWords );
1004
1005 // perform simulation rounds
1006 pPars->nSolved = 0;
1007 timeLastSolved = Abc_Clock();
1008 for ( r = 0; !pPars->nRounds || (nNumRestart * pPars->nRestart + r < pPars->nRounds); r++ )
1009 {
1010 clk = Abc_Clock();
1011 if ( fTryBmc )
1012 {
1013 Aig_Man_t * pNewAig = Saig_ManDupWithPhase( pAig, p->vInits );
1014 Saig_BmcPerform( pNewAig, 0, 100, 2000, 3, 0, 0, 1 /*fVerbose*/, 0, &iFrameFail, 0, 0 );
1015// if ( pNewAig->pSeqModel != NULL )
1016// Abc_Print( 1, "BMC has found a counter-example in frame %d.\n", iFrameFail );
1017 Aig_ManStop( pNewAig );
1018 }
1019 // simulate
1020 for ( f = 0; f < pPars->nFrames; f++ )
1021 {
1022 Ssw_RarManSimulate( p, f ? NULL : p->vInits, 0, 0 );
1023 if ( fMiter )
1024 {
1025 int Status = Ssw_RarManCheckNonConstOutputs(p, r * p->pPars->nFrames + f, Abc_Clock() - clkTotal);
1026 if ( Status == 2 )
1027 {
1028 Abc_Print( 1, "Quitting due to callback on fail.\n" );
1029 goto finish;
1030 }
1031 if ( Status == 1 ) // found CEX
1032 {
1033 RetValue = 0;
1034 if ( !pPars->fSolveAll )
1035 {
1036 if ( pPars->fVerbose ) Abc_Print( 1, "\n" );
1037 // Abc_Print( 1, "Simulation asserted a PO in frame f: %d <= f < %d.\n", r * nFrames, (r+1) * nFrames );
1038 Ssw_RarManPrepareRandom( nSavedSeed );
1039 if ( pPars->fVerbose )
1040 Abc_Print( 1, "Simulated %d frames for %d rounds with %d restarts.\n", pPars->nFrames, nNumRestart * pPars->nRestart + r, nNumRestart );
1041 pAig->pSeqModel = Ssw_RarDeriveCex( p, r * p->pPars->nFrames + f, p->iFailPo, p->iFailPat, pPars->fVerbose );
1042 // print final report
1043 if ( !pPars->fSilent ) {
1044 Abc_Print( 1, "Output %d of miter \"%s\" was asserted in frame %d. ", pAig->pSeqModel->iPo, pAig->pName, pAig->pSeqModel->iFrame );
1045 Abc_PrintTime( 1, "Time", Abc_Clock() - clkTotal );
1046 }
1047 goto finish;
1048 }
1049 timeLastSolved = Abc_Clock();
1050 }
1051 // else - did not find a counter example
1052 }
1053 // check timeout
1054 if ( pPars->TimeOut && Abc_Clock() > nTimeToStop )
1055 {
1056 if ( !pPars->fSilent )
1057 {
1058 if ( pPars->fVerbose && !pPars->fSolveAll ) Abc_Print( 1, "\n" );
1059 Abc_Print( 1, "Simulated %d frames for %d rounds with %d restarts and solved %d outputs. ", pPars->nFrames, nNumRestart * pPars->nRestart + r, nNumRestart, pPars->nSolved );
1060 Abc_Print( 1, "Reached timeout (%d sec).\n", pPars->TimeOut );
1061 }
1062 goto finish;
1063 }
1064 if ( pPars->TimeOutGap && timeLastSolved && Abc_Clock() > timeLastSolved + pPars->TimeOutGap * CLOCKS_PER_SEC )
1065 {
1066 if ( !pPars->fSilent )
1067 {
1068 if ( pPars->fVerbose && !pPars->fSolveAll ) Abc_Print( 1, "\n" );
1069 Abc_Print( 1, "Simulated %d frames for %d rounds with %d restarts and solved %d outputs. ", pPars->nFrames, nNumRestart * pPars->nRestart + r, nNumRestart, pPars->nSolved );
1070 Abc_Print( 1, "Reached gap timeout (%d sec).\n", pPars->TimeOutGap );
1071 }
1072 goto finish;
1073 }
1074 // check if all outputs are solved by now
1075 if ( pPars->fSolveAll && p->vCexes && Vec_PtrCountZero(p->vCexes) == 0 )
1076 goto finish;
1077 }
1078 // get initialization patterns
1079 if ( pPars->nRestart && r == pPars->nRestart )
1080 {
1081 r = -1;
1082 nSavedSeed = (nSavedSeed + 1) % 1000;
1083 Ssw_RarManPrepareRandom( nSavedSeed );
1084 Vec_IntFill( p->vInits, Aig_ManRegNum(pAig) * pPars->nWords, 0 );
1085 nNumRestart++;
1086 Vec_IntClear( p->vPatBests );
1087 // clean rarity info
1088// memset( p->pRarity, 0, sizeof(int) * (1 << nBinSize) * p->nGroups );
1089 }
1090 else
1091 Ssw_RarTransferPatterns( p, p->vInits );
1092 // printout
1093 if ( pPars->fVerbose )
1094 {
1095 if ( pPars->fSolveAll )
1096 {
1097 Abc_Print( 1, "Starts =%6d ", nNumRestart );
1098 Abc_Print( 1, "Rounds =%6d ", nNumRestart * pPars->nRestart + ((r==-1)?0:r) );
1099 Abc_Print( 1, "Frames =%6d ", (nNumRestart * pPars->nRestart + r) * pPars->nFrames );
1100 Abc_Print( 1, "CEX =%6d (%6.2f %%) ", pPars->nSolved, 100.0*pPars->nSolved/Saig_ManPoNum(p->pAig) );
1101 Abc_PrintTime( 1, "Time", Abc_Clock() - clkTotal );
1102 }
1103 else
1104 Abc_Print( 1, "." );
1105 }
1106
1107 }
1108finish:
1109 if ( pPars->fSetLastState && p->vInits )
1110 {
1111 assert( Vec_IntSize(p->vInits) % Aig_ManRegNum(pAig) == 0 );
1112 Vec_IntShrink( p->vInits, Aig_ManRegNum(pAig) );
1113 pAig->pData = p->vInits; p->vInits = NULL;
1114 }
1115 if ( pPars->nSolved )
1116 {
1117/*
1118 if ( !pPars->fSilent )
1119 {
1120 if ( pPars->fVerbose && !pPars->fSolveAll ) Abc_Print( 1, "\n" );
1121 Abc_Print( 1, "Simulation of %d frames for %d rounds with %d restarts asserted %d (out of %d) POs. ", pPars->nFrames, nNumRestart * pPars->nRestart + r, nNumRestart, pPars->nSolved, Saig_ManPoNum(p->pAig) );
1122 Abc_PrintTime( 1, "Time", Abc_Clock() - clkTotal );
1123 }
1124*/
1125 }
1126 else if ( r == pPars->nRounds && f == pPars->nFrames )
1127 {
1128 if ( !pPars->fSilent )
1129 {
1130 if ( pPars->fVerbose ) Abc_Print( 1, "\n" );
1131 Abc_Print( 1, "Simulation of %d frames for %d rounds with %d restarts did not assert POs. ", pPars->nFrames, nNumRestart * pPars->nRestart + r, nNumRestart );
1132 Abc_PrintTime( 1, "Time", Abc_Clock() - clkTotal );
1133 }
1134 }
1135 // cleanup
1136 Ssw_RarManStop( p );
1137 return RetValue;
1138}
#define ABC_FREE(obj)
Definition abc_global.h:267
int Saig_BmcPerform(Aig_Man_t *pAig, int nStart, int nFramesMax, int nNodesMax, int nTimeOut, int nConfMaxOne, int nConfMaxAll, int fVerbose, int fVerbOverwrite, int *piFrames, int fSilent, int fUseSatoko)
Definition bmcBmc2.c:811
Aig_Man_t * Saig_ManDupWithPhase(Aig_Man_t *pAig, Vec_Int_t *vInit)
Definition saigDup.c:482
int TimeOutGap
Definition ssw.h:104
int nSolved
Definition ssw.h:115
int fSolveAll
Definition ssw.h:105
int fSilent
Definition ssw.h:109
int fSetLastState
Definition ssw.h:106
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Ssw_SecGeneral()

int Ssw_SecGeneral ( Aig_Man_t * pAig1,
Aig_Man_t * pAig2,
Ssw_Pars_t * pPars )
extern

Function*************************************************************

Synopsis [Runs inductive SEC for the miter of two AIGs.]

Description []

SideEffects []

SeeAlso []

Definition at line 415 of file sswPairs.c.

416{
417 Aig_Man_t * pAigRes, * pMiter;
418 int RetValue;
419 abctime clk = Abc_Clock();
420 // try the new AIGs
421 Abc_Print( 1, "Performing general verification without node pairs.\n" );
422 pMiter = Saig_ManCreateMiter( pAig1, pAig2, 0 );
423 Aig_ManCleanup( pMiter );
424 pAigRes = Ssw_SignalCorrespondence( pMiter, pPars );
425 Aig_ManStop( pMiter );
426 // report the results
427 RetValue = Ssw_MiterStatus( pAigRes, 1 );
428 if ( RetValue == 1 )
429 Abc_Print( 1, "Verification successful. " );
430 else if ( RetValue == 0 )
431 Abc_Print( 1, "Verification failed with a counter-example. " );
432 else
433 Abc_Print( 1, "Verification UNDECIDED. The number of remaining regs = %d (total = %d). ",
434 Aig_ManRegNum(pAigRes), Aig_ManRegNum(pAig1) + Aig_ManRegNum(pAig2) );
435 ABC_PRT( "Time", Abc_Clock() - clk );
436 // cleanup
437 Aig_ManStop( pAigRes );
438 return RetValue;
439}
int Aig_ManCleanup(Aig_Man_t *p)
Definition aigMan.c:265
Aig_Man_t * Saig_ManCreateMiter(Aig_Man_t *p1, Aig_Man_t *p2, int Oper)
Definition saigMiter.c:100
ABC_NAMESPACE_IMPL_START int Ssw_MiterStatus(Aig_Man_t *p, int fVerbose)
DECLARATIONS ///.
Definition sswPairs.c:45
Aig_Man_t * Ssw_SignalCorrespondence(Aig_Man_t *pAig, Ssw_Pars_t *pPars)
Definition sswCore.c:436
Here is the call graph for this function:

◆ Ssw_SecGeneralMiter()

int Ssw_SecGeneralMiter ( Aig_Man_t * pMiter,
Ssw_Pars_t * pPars )
extern

Function*************************************************************

Synopsis [Runs inductive SEC for the miter of two AIGs.]

Description []

SideEffects []

SeeAlso []

Definition at line 452 of file sswPairs.c.

453{
454 Aig_Man_t * pAigRes;
455 int RetValue;
456 abctime clk = Abc_Clock();
457 // try the new AIGs
458// Abc_Print( 1, "Performing general verification without node pairs.\n" );
459 pAigRes = Ssw_SignalCorrespondence( pMiter, pPars );
460 // report the results
461 RetValue = Ssw_MiterStatus( pAigRes, 1 );
462 if ( RetValue == 1 )
463 Abc_Print( 1, "Verification successful. " );
464 else if ( RetValue == 0 )
465 Abc_Print( 1, "Verification failed with a counter-example. " );
466 else
467 Abc_Print( 1, "Verification UNDECIDED. The number of remaining regs = %d (total = %d). ",
468 Aig_ManRegNum(pAigRes), Aig_ManRegNum(pMiter) );
469 ABC_PRT( "Time", Abc_Clock() - clk );
470 // cleanup
471 Aig_ManStop( pAigRes );
472 return RetValue;
473}
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Ssw_SecWithPairs()

int Ssw_SecWithPairs ( Aig_Man_t * pAig1,
Aig_Man_t * pAig2,
Vec_Int_t * vIds1,
Vec_Int_t * vIds2,
Ssw_Pars_t * pPars )
extern

Function*************************************************************

Synopsis [Runs inductive SEC for the miter of two AIGs with node pairs defined.]

Description []

SideEffects []

SeeAlso []

Definition at line 380 of file sswPairs.c.

381{
382 Aig_Man_t * pAigRes;
383 int RetValue;
384 abctime clk = Abc_Clock();
385 assert( vIds1 != NULL && vIds2 != NULL );
386 // try the new AIGs
387 Abc_Print( 1, "Performing specialized verification with node pairs.\n" );
388 pAigRes = Ssw_SignalCorrespondenceWithPairs( pAig1, pAig2, vIds1, vIds2, pPars );
389 // report the results
390 RetValue = Ssw_MiterStatus( pAigRes, 1 );
391 if ( RetValue == 1 )
392 Abc_Print( 1, "Verification successful. " );
393 else if ( RetValue == 0 )
394 Abc_Print( 1, "Verification failed with a counter-example. " );
395 else
396 Abc_Print( 1, "Verification UNDECIDED. The number of remaining regs = %d (total = %d). ",
397 Aig_ManRegNum(pAigRes), Aig_ManRegNum(pAig1) + Aig_ManRegNum(pAig2) );
398 ABC_PRT( "Time", Abc_Clock() - clk );
399 // cleanup
400 Aig_ManStop( pAigRes );
401 return RetValue;
402}
Aig_Man_t * Ssw_SignalCorrespondenceWithPairs(Aig_Man_t *pAig1, Aig_Man_t *pAig2, Vec_Int_t *vIds1, Vec_Int_t *vIds2, Ssw_Pars_t *pPars)
Definition sswPairs.c:272
Here is the call graph for this function:

◆ Ssw_SecWithSimilarity()

int Ssw_SecWithSimilarity ( Aig_Man_t * p0,
Aig_Man_t * p1,
Ssw_Pars_t * pPars )
extern

Function*************************************************************

Synopsis [Solves SEC with structural similarity.]

Description []

SideEffects []

SeeAlso []

Definition at line 542 of file sswIslands.c.

543{
544 Vec_Int_t * vPairs;
545 Aig_Man_t * pPart0, * pPart1;
546 int RetValue;
547 if ( pPars->fVerbose )
548 Abc_Print( 1, "Performing sequential verification using structural similarity.\n" );
549 // consider the case when a miter is given
550 if ( p1 == NULL )
551 {
552 if ( pPars->fVerbose )
553 {
554 Aig_ManPrintStats( p0 );
555 }
556 // demiter the miter
557 if ( !Saig_ManDemiterSimpleDiff( p0, &pPart0, &pPart1 ) )
558 {
559 Abc_Print( 1, "Demitering has failed.\n" );
560 return -1;
561 }
562 }
563 else
564 {
565 pPart0 = Aig_ManDupSimple( p0 );
566 pPart1 = Aig_ManDupSimple( p1 );
567 }
568 if ( pPars->fVerbose )
569 {
570// Aig_ManPrintStats( pPart0 );
571// Aig_ManPrintStats( pPart1 );
572 if ( p1 == NULL )
573 {
574// Aig_ManDumpBlif( pPart0, "part0.blif", NULL, NULL );
575// Aig_ManDumpBlif( pPart1, "part1.blif", NULL, NULL );
576// Abc_Print( 1, "The result of demitering is written into files \"%s\" and \"%s\".\n", "part0.blif", "part1.blif" );
577 }
578 }
579 assert( Aig_ManRegNum(pPart0) > 0 );
580 assert( Aig_ManRegNum(pPart1) > 0 );
581 assert( Saig_ManPiNum(pPart0) == Saig_ManPiNum(pPart1) );
582 assert( Saig_ManPoNum(pPart0) == Saig_ManPoNum(pPart1) );
583 // derive pairs
584// vPairs = Saig_StrSimPerformMatching_hack( pPart0, pPart1 );
585 vPairs = Saig_StrSimPerformMatching( pPart0, pPart1, 0, pPars->fVerbose, NULL );
586 RetValue = Ssw_SecWithSimilarityPairs( pPart0, pPart1, vPairs, pPars );
587 Aig_ManStop( pPart0 );
588 Aig_ManStop( pPart1 );
589 Vec_IntFree( vPairs );
590 return RetValue;
591}
Aig_Man_t * Aig_ManDupSimple(Aig_Man_t *p)
DECLARATIONS ///.
Definition aigDup.c:46
void Aig_ManPrintStats(Aig_Man_t *p)
Definition aigMan.c:379
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
Definition bblif.c:37
Vec_Int_t * Saig_StrSimPerformMatching(Aig_Man_t *p0, Aig_Man_t *p1, int nDist, int fVerbose, Aig_Man_t **ppMiter)
Definition saigStrSim.c:873
int Saig_ManDemiterSimpleDiff(Aig_Man_t *p, Aig_Man_t **ppAig0, Aig_Man_t **ppAig1)
Definition saigMiter.c:660
int Ssw_SecWithSimilarityPairs(Aig_Man_t *p0, Aig_Man_t *p1, Vec_Int_t *vPairs, Ssw_Pars_t *pPars)
Definition sswIslands.c:478
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Ssw_SecWithSimilarityPairs()

int Ssw_SecWithSimilarityPairs ( Aig_Man_t * p0,
Aig_Man_t * p1,
Vec_Int_t * vPairs,
Ssw_Pars_t * pPars )
extern

Function*************************************************************

Synopsis [Solves SEC with structural similarity.]

Description [The first two arguments are pointers to the AIG managers. The third argument is the array of pairs of IDs of structurally equivalent nodes from the first and second managers, respectively.]

SideEffects [The managers will be updated by adding "islands of difference".]

SeeAlso []

Definition at line 478 of file sswIslands.c.

479{
480 Ssw_Pars_t Pars;
481 Aig_Man_t * pAigRes;
482 int RetValue;
483 abctime clk = Abc_Clock();
484 // derive parameters if not given
485 if ( pPars == NULL )
486 Ssw_ManSetDefaultParams( pPars = &Pars );
487 // reduce the AIG with pairs
488 pAigRes = Ssw_SecWithSimilaritySweep( p0, p1, vPairs, pPars );
489 // report the result of verification
490 RetValue = Ssw_MiterStatus( pAigRes, 1 );
491 if ( RetValue == 1 )
492 Abc_Print( 1, "Verification successful. " );
493 else if ( RetValue == 0 )
494 Abc_Print( 1, "Verification failed with a counter-example. " );
495 else
496 Abc_Print( 1, "Verification UNDECIDED. The number of remaining regs = %d (total = %d). ",
497 Aig_ManRegNum(pAigRes), Aig_ManRegNum(p0)+Aig_ManRegNum(p1) );
498 ABC_PRT( "Time", Abc_Clock() - clk );
499 Aig_ManStop( pAigRes );
500 return RetValue;
501}
Aig_Man_t * Ssw_SecWithSimilaritySweep(Aig_Man_t *p0, Aig_Man_t *p1, Vec_Int_t *vPairs, Ssw_Pars_t *pPars)
Definition sswIslands.c:419
void Ssw_ManSetDefaultParams(Ssw_Pars_t *p)
DECLARATIONS ///.
Definition sswCore.c:45
int Ssw_MiterStatus(Aig_Man_t *p, int fVerbose)
DECLARATIONS ///.
Definition sswPairs.c:45
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Ssw_SignalCorrespondence()

Aig_Man_t * Ssw_SignalCorrespondence ( Aig_Man_t * pAig,
Ssw_Pars_t * pPars )
extern

Function*************************************************************

Synopsis [Performs computation of signal correspondence with constraints.]

Description []

SideEffects []

SeeAlso []

Definition at line 436 of file sswCore.c.

437{
438 Ssw_Pars_t Pars;
439 Aig_Man_t * pAigNew;
440 Ssw_Man_t * p;
441 assert( Aig_ManRegNum(pAig) > 0 );
442 // reset random numbers
443 Aig_ManRandom( 1 );
444 // if parameters are not given, create them
445 if ( pPars == NULL )
446 Ssw_ManSetDefaultParams( pPars = &Pars );
447/*
448 // consider the case of empty AIG
449 if ( Aig_ManNodeNum(pAig) == 0 )
450 {
451 pPars->nIters = 0;
452 // Ntl_ManFinalize() needs the following to satisfy an assertion
453 Aig_ManReprStart( pAig,Aig_ManObjNumMax(pAig) );
454 return Aig_ManDupOrdered(pAig);
455 }
456*/
457 // check and update parameters
458 if ( pPars->fLatchCorrOpt )
459 {
460 pPars->fLatchCorr = 1;
461 pPars->nFramesAddSim = 0;
462 if ( (pAig->vClockDoms && Vec_VecSize(pAig->vClockDoms) > 0) )
463 return Ssw_SignalCorrespondencePart( pAig, pPars );
464 }
465 else
466 {
467 assert( pPars->nFramesK > 0 );
468 // perform partitioning
469 if ( (pPars->nPartSize > 0 && pPars->nPartSize < Aig_ManRegNum(pAig))
470 || (pAig->vClockDoms && Vec_VecSize(pAig->vClockDoms) > 0) )
471 return Ssw_SignalCorrespondencePart( pAig, pPars );
472 }
473
474 if ( pPars->fScorrGia )
475 {
476 if ( pPars->fLatchCorrOpt )
477 {
478 extern Aig_Man_t * Cec_LatchCorrespondence( Aig_Man_t * pAig, int nConfs, int fUseCSat );
479 return Cec_LatchCorrespondence( pAig, pPars->nBTLimit, pPars->fUseCSat );
480 }
481 else
482 {
483 extern Aig_Man_t * Cec_SignalCorrespondence( Aig_Man_t * pAig, int nConfs, int fUseCSat );
484 return Cec_SignalCorrespondence( pAig, pPars->nBTLimit, pPars->fUseCSat );
485 }
486 }
487
488 // start the induction manager
489 p = Ssw_ManCreate( pAig, pPars );
490 // compute candidate equivalence classes
491// p->pPars->nConstrs = 1;
492 if ( p->pPars->fConstrs )
493 {
494 // create trivial equivalence classes with all nodes being candidates for constant 1
495 p->ppClasses = Ssw_ClassesPrepareSimple( pAig, pPars->fLatchCorr, pPars->nMaxLevs );
497 // derive phase bits to satisfy the constraints
498 if ( Ssw_ManSetConstrPhases( pAig, p->pPars->nFramesK + 1, &p->vInits ) != 0 )
499 {
500 Abc_Print( 1, "Ssw_SignalCorrespondence(): The init state does not satisfy the constraints!\n" );
501 p->pPars->fVerbose = 0;
502 Ssw_ManStop( p );
503 return NULL;
504 }
505 // perform simulation of the first timeframes
507 }
508 else
509 {
510 // perform one round of seq simulation and generate candidate equivalence classes
511 p->ppClasses = Ssw_ClassesPrepare( pAig, pPars->nFramesK, pPars->fLatchCorr, pPars->fConstCorr, pPars->fOutputCorr, pPars->nMaxLevs, pPars->fVerbose );
512// p->ppClasses = Ssw_ClassesPrepareTargets( pAig );
513 if ( pPars->fLatchCorrOpt )
514 p->pSml = Ssw_SmlStart( pAig, 0, 2, 1 );
515 else if ( pPars->fDynamic )
516 p->pSml = Ssw_SmlStart( pAig, 0, p->nFrames + p->pPars->nFramesAddSim, 1 );
517 else
518 p->pSml = Ssw_SmlStart( pAig, 0, 1 + p->pPars->nFramesAddSim, 1 );
519 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 );
520 }
521 // allocate storage
522 if ( p->pPars->fLocalSim && p->pSml )
523 p->pVisited = ABC_CALLOC( int, Ssw_SmlNumFrames( p->pSml ) * Aig_ManObjNumMax(p->pAig) );
524 // perform refinement of classes
526// Ssw_ReportOutputs( pAigNew );
527 if ( pPars->fConstrs && pPars->fVerbose )
528 Ssw_ReportConeReductions( p, pAig, pAigNew );
529 // cleanup
530 Ssw_ManStop( p );
531 return pAigNew;
532}
#define ABC_CALLOC(type, num)
Definition abc_global.h:265
unsigned Aig_ManRandom(int fReset)
Definition aigUtil.c:1170
Aig_Man_t * Cec_LatchCorrespondence(Aig_Man_t *pAig, int nConfs, int fUseCSat)
Definition cecCec.c:528
Aig_Man_t * Cec_SignalCorrespondence(Aig_Man_t *pAig, int nConfs, int fUseCSat)
Definition cecCec.c:554
Ssw_Cla_t * Ssw_ClassesPrepare(Aig_Man_t *pAig, int nFramesK, int fLatchCorr, int fConstCorr, int fOutputCorr, int nMaxLevs, int fVerbose)
Definition sswClass.c:596
void Ssw_ManRefineByConstrSim(Ssw_Man_t *p)
Definition sswConstr.c:247
Aig_Man_t * Ssw_SignalCorrespondenceRefine(Ssw_Man_t *p)
Definition sswCore.c:235
void Ssw_ReportConeReductions(Ssw_Man_t *p, Aig_Man_t *pAigInit, Aig_Man_t *pAigStop)
Definition sswCore.c:111
typedefABC_NAMESPACE_HEADER_START struct Ssw_Man_t_ Ssw_Man_t
INCLUDES ///.
Definition sswInt.h:47
Ssw_Sml_t * Ssw_SmlStart(Aig_Man_t *pAig, int nPref, int nFrames, int nWordsFrame)
Definition sswSim.c:1148
void Ssw_ManStop(Ssw_Man_t *p)
Definition sswMan.c:189
int Ssw_SmlObjIsConstBit(void *p, Aig_Obj_t *pObj)
Definition sswSim.c:147
int Ssw_SmlObjsAreEqualBit(void *p, Aig_Obj_t *pObj0, Aig_Obj_t *pObj1)
Definition sswSim.c:163
Ssw_Man_t * Ssw_ManCreate(Aig_Man_t *pAig, Ssw_Pars_t *pPars)
DECLARATIONS ///.
Definition sswMan.c:45
unsigned Ssw_SmlObjHashWord(Ssw_Sml_t *p, Aig_Obj_t *pObj)
FUNCTION DEFINITIONS ///.
Definition sswSim.c:63
int Ssw_SmlObjIsConstWord(Ssw_Sml_t *p, Aig_Obj_t *pObj)
Definition sswSim.c:102
int Ssw_ManSetConstrPhases(Aig_Man_t *p, int nFrames, Vec_Int_t **pvInits)
Definition sswConstr.c:100
int Ssw_SmlObjsAreEqualWord(Ssw_Sml_t *p, Aig_Obj_t *pObj0, Aig_Obj_t *pObj1)
Definition sswSim.c:124
Aig_Man_t * Ssw_SignalCorrespondencePart(Aig_Man_t *pAig, Ssw_Pars_t *pPars)
Definition sswPart.c:214
int Ssw_SmlNumFrames(Ssw_Sml_t *p)
Definition sswSim.c:1288
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Ssw_SignalCorrespondencePart()

Aig_Man_t * Ssw_SignalCorrespondencePart ( Aig_Man_t * pAig,
Ssw_Pars_t * pPars )
extern

Function*************************************************************

Synopsis [Performs partitioned sequential SAT sweeping.]

Description []

SideEffects []

SeeAlso []

Definition at line 214 of file sswPart.c.

215{
216 int fPrintParts = 1;
217 char Buffer[100];
218 Aig_Man_t * pTemp, * pNew;
219 Vec_Ptr_t * vResult;
220 Vec_Int_t * vPart;
221 int * pMapBack;
222 int i, nCountPis, nCountRegs;
223 int nClasses, nPartSize, fVerbose;
224 abctime clk = Abc_Clock();
225 if ( pPars->fConstrs )
226 {
227 Abc_Print( 1, "Cannot use partitioned computation with constraints.\n" );
228 return NULL;
229 }
230 // save parameters
231 nPartSize = pPars->nPartSize; pPars->nPartSize = 0;
232 fVerbose = pPars->fVerbose; pPars->fVerbose = 0;
233 // generate partitions
234 if ( pAig->vClockDoms )
235 {
236 // divide large clock domains into separate partitions
237 vResult = Vec_PtrAlloc( 100 );
238 Vec_PtrForEachEntry( Vec_Int_t *, (Vec_Ptr_t *)pAig->vClockDoms, vPart, i )
239 {
240 if ( nPartSize && Vec_IntSize(vPart) > nPartSize )
241 Aig_ManPartDivide( vResult, vPart, nPartSize, pPars->nOverSize );
242 else
243 Vec_PtrPush( vResult, Vec_IntDup(vPart) );
244 }
245 }
246 else
247 vResult = Aig_ManRegPartitionSimple( pAig, nPartSize, pPars->nOverSize );
248// vResult = Aig_ManPartitionSmartRegisters( pAig, nPartSize, 0 );
249// vResult = Aig_ManRegPartitionSmart( pAig, nPartSize );
250 if ( fPrintParts )
251 {
252 // print partitions
253 Abc_Print( 1, "Simple partitioning. %d partitions are saved:\n", Vec_PtrSize(vResult) );
254 Vec_PtrForEachEntry( Vec_Int_t *, vResult, vPart, i )
255 {
256// extern void Ioa_WriteAiger( Aig_Man_t * pMan, char * pFileName, int fWriteSymbols, int fCompact );
257 sprintf( Buffer, "part%03d.aig", i );
258 pTemp = Aig_ManRegCreatePart( pAig, vPart, &nCountPis, &nCountRegs, NULL );
259 Ioa_WriteAiger( pTemp, Buffer, 0, 0 );
260 Abc_Print( 1, "part%03d.aig : Reg = %4d. PI = %4d. (True = %4d. Regs = %4d.) And = %5d.\n",
261 i, Vec_IntSize(vPart), Aig_ManCiNum(pTemp)-Vec_IntSize(vPart), nCountPis, nCountRegs, Aig_ManNodeNum(pTemp) );
262 Aig_ManStop( pTemp );
263 }
264 }
265
266 // perform SSW with partitions
267 Aig_ManReprStart( pAig, Aig_ManObjNumMax(pAig) );
268 Vec_PtrForEachEntry( Vec_Int_t *, vResult, vPart, i )
269 {
270 pTemp = Aig_ManRegCreatePart( pAig, vPart, &nCountPis, &nCountRegs, &pMapBack );
271 Aig_ManSetRegNum( pTemp, pTemp->nRegs );
272 // create the projection of 1-hot registers
273 if ( pAig->vOnehots )
274 pTemp->vOnehots = Aig_ManRegProjectOnehots( pAig, pTemp, pAig->vOnehots, fVerbose );
275 // run SSW
276 if (nCountPis>0) {
277 pNew = Ssw_SignalCorrespondence( pTemp, pPars );
278 nClasses = Aig_TransferMappedClasses( pAig, pTemp, pMapBack );
279 if ( fVerbose )
280 Abc_Print( 1, "%3d : Reg = %4d. PI = %4d. (True = %4d. Regs = %4d.) And = %5d. It = %3d. Cl = %5d.\n",
281 i, Vec_IntSize(vPart), Aig_ManCiNum(pTemp)-Vec_IntSize(vPart), nCountPis, nCountRegs, Aig_ManNodeNum(pTemp), pPars->nIters, nClasses );
282 Aig_ManStop( pNew );
283 }
284 Aig_ManStop( pTemp );
285 ABC_FREE( pMapBack );
286 }
287 // remap the AIG
288 pNew = Aig_ManDupRepr( pAig, 0 );
289 Aig_ManSeqCleanup( pNew );
290// Aig_ManPrintStats( pAig );
291// Aig_ManPrintStats( pNew );
292 Vec_VecFree( (Vec_Vec_t *)vResult );
293 pPars->nPartSize = nPartSize;
294 pPars->fVerbose = fVerbose;
295 if ( fVerbose )
296 {
297 ABC_PRT( "Total time", Abc_Clock() - clk );
298 }
299 return pNew;
300}
Aig_Man_t * Aig_ManDupRepr(Aig_Man_t *p, int fOrdered)
Definition aigRepr.c:267
int Aig_ManSeqCleanup(Aig_Man_t *p)
Definition aigScl.c:158
void Aig_ManSetRegNum(Aig_Man_t *p, int nRegs)
Definition aigMan.c:438
void Aig_ManReprStart(Aig_Man_t *p, int nIdMax)
DECLARATIONS ///.
Definition aigRepr.c:45
void Aig_ManPartDivide(Vec_Ptr_t *vResult, Vec_Int_t *vDomain, int nPartSize, int nOverSize)
Definition aigPartReg.c:513
Aig_Man_t * Aig_ManRegCreatePart(Aig_Man_t *pAig, Vec_Int_t *vPart, int *pnCountPis, int *pnCountRegs, int **ppMapBack)
Definition aigPartReg.c:308
Vec_Ptr_t * Aig_ManRegPartitionSimple(Aig_Man_t *pAig, int nPartSize, int nOverSize)
Definition aigPartReg.c:474
int Aig_TransferMappedClasses(Aig_Man_t *pAig, Aig_Man_t *pPart, int *pMapBack)
Definition aigRepr.c:533
Vec_Ptr_t * Aig_ManRegProjectOnehots(Aig_Man_t *pAig, Aig_Man_t *pPart, Vec_Ptr_t *vOnehots, int fVerbose)
Definition aigPartReg.c:248
void Ioa_WriteAiger(Aig_Man_t *pMan, char *pFileName, int fWriteSymbols, int fCompact)
char * sprintf()
typedefABC_NAMESPACE_HEADER_START struct Vec_Ptr_t_ Vec_Ptr_t
INCLUDES ///.
Definition vecPtr.h:42
#define Vec_PtrForEachEntry(Type, vVec, pEntry, i)
MACRO DEFINITIONS ///.
Definition vecPtr.h:55
typedefABC_NAMESPACE_HEADER_START struct Vec_Vec_t_ Vec_Vec_t
INCLUDES ///.
Definition vecVec.h:42
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Ssw_SmlCheckNonConstOutputs()

int Ssw_SmlCheckNonConstOutputs ( Ssw_Sml_t * p)
extern

Function*************************************************************

Synopsis [Check if any of the POs becomes non-constant.]

Description []

SideEffects []

SeeAlso []

Definition at line 980 of file sswSim.c.

981{
982 Aig_Obj_t * pObj;
983 int i;
984 Saig_ManForEachPo( p->pAig, pObj, i )
985 {
986 if ( p->pAig->nConstrs && i >= Saig_ManPoNum(p->pAig) - p->pAig->nConstrs )
987 return 0;
988 if ( !Ssw_SmlNodeIsZero(p, pObj) )
989 return 1;
990 }
991 return 0;
992}
int Ssw_SmlNodeIsZero(Ssw_Sml_t *p, Aig_Obj_t *pObj)
Definition sswSim.c:294
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Ssw_SmlInitializeSpecial()

void Ssw_SmlInitializeSpecial ( Ssw_Sml_t * p,
Vec_Int_t * vInit )
extern

Function*************************************************************

Synopsis [Assings random simulation info for the PIs.]

Description []

SideEffects []

SeeAlso []

Definition at line 928 of file sswSim.c.

929{
930 Aig_Obj_t * pObj;
931 int Entry, i, nRegs;
932 nRegs = Aig_ManRegNum(p->pAig);
933 assert( nRegs > 0 );
934 assert( nRegs <= Aig_ManCiNum(p->pAig) );
935 assert( Vec_IntSize(vInit) == nRegs * p->nWordsFrame );
936 // assign random info for primary inputs
937 Saig_ManForEachPi( p->pAig, pObj, i )
938 Ssw_SmlAssignRandom( p, pObj );
939 // assign the initial state for the latches
940 Vec_IntForEachEntry( vInit, Entry, i )
941 Ssw_SmlObjAssignConstWord( p, Saig_ManLo(p->pAig, i % nRegs), Entry, 0, i / nRegs );
942}
#define Saig_ManForEachPi(p, pObj, i)
Definition saig.h:91
void Ssw_SmlAssignRandom(Ssw_Sml_t *p, Aig_Obj_t *pObj)
Definition sswSim.c:513
void Ssw_SmlObjAssignConstWord(Ssw_Sml_t *p, Aig_Obj_t *pObj, int fConst1, int iFrame, int iWord)
Definition sswSim.c:582
#define Vec_IntForEachEntry(vVec, Entry, i)
MACRO DEFINITIONS ///.
Definition vecInt.h:54
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Ssw_SmlNumFrames()

int Ssw_SmlNumFrames ( Ssw_Sml_t * p)
extern

Function*************************************************************

Synopsis [Returns the number of frames simulated in the manager.]

Description []

SideEffects []

SeeAlso []

Definition at line 1288 of file sswSim.c.

1289{
1290 return p->nFrames;
1291}
Here is the caller graph for this function:

◆ Ssw_SmlNumWordsTotal()

int Ssw_SmlNumWordsTotal ( Ssw_Sml_t * p)
extern

Function*************************************************************

Synopsis [Returns the total number of simulation words.]

Description []

SideEffects []

SeeAlso []

Definition at line 1304 of file sswSim.c.

1305{
1306 return p->nWordsTotal;
1307}

◆ Ssw_SmlObjsAreEqualWord()

int Ssw_SmlObjsAreEqualWord ( Ssw_Sml_t * p,
Aig_Obj_t * pObj0,
Aig_Obj_t * pObj1 )
extern

Function*************************************************************

Synopsis [Returns 1 if simulation infos are equal.]

Description []

SideEffects []

SeeAlso []

Definition at line 124 of file sswSim.c.

125{
126 unsigned * pSims0, * pSims1;
127 int i;
128 pSims0 = Ssw_ObjSim(p, pObj0->Id);
129 pSims1 = Ssw_ObjSim(p, pObj1->Id);
130 for ( i = p->nWordsPref; i < p->nWordsTotal; i++ )
131 if ( pSims0[i] != pSims1[i] )
132 return 0;
133 return 1;
134}
int Id
Definition aig.h:85
Here is the caller graph for this function:

◆ Ssw_SmlSimDataPointers()

Vec_Ptr_t * Ssw_SmlSimDataPointers ( Ssw_Sml_t * p)
extern

Function*************************************************************

Synopsis [Get simulation data.]

Description []

SideEffects []

SeeAlso []

Definition at line 1189 of file sswSim.c.

1190{
1191 Vec_Ptr_t * vSimInfo;
1192 Aig_Obj_t * pObj;
1193 int i;
1194 vSimInfo = Vec_PtrStart( Aig_ManObjNumMax(p->pAig) );
1195 Aig_ManForEachObj( p->pAig, pObj, i )
1196 Vec_PtrWriteEntry( vSimInfo, i, Ssw_ObjSim(p, i) );
1197 return vSimInfo;
1198}
#define Aig_ManForEachObj(p, pObj, i)
Definition aig.h:403

◆ Ssw_SmlSimInfo()

unsigned * Ssw_SmlSimInfo ( Ssw_Sml_t * p,
Aig_Obj_t * pObj )
extern

Function*************************************************************

Synopsis [Returns the pointer to the simulation info of the node.]

Description [The simulation info is normalized unless procedure Ssw_SmlUnnormalize() is called in advance.]

SideEffects []

SeeAlso []

Definition at line 1321 of file sswSim.c.

1322{
1323 assert( !Aig_IsComplement(pObj) );
1324 return Ssw_ObjSim( p, pObj->Id );
1325}

◆ Ssw_SmlSimulateComb()

Ssw_Sml_t * Ssw_SmlSimulateComb ( Aig_Man_t * pAig,
int nWords )
extern

Function*************************************************************

Synopsis [Performs simulation of the uninitialized circuit.]

Description []

SideEffects []

SeeAlso []

Definition at line 1228 of file sswSim.c.

1229{
1230 Ssw_Sml_t * p;
1231 p = Ssw_SmlStart( pAig, 0, 1, nWords );
1232 Ssw_SmlInitialize( p, 0 );
1234 return p;
1235}
int nWords
Definition abcNpn.c:127
Ssw_Sml_t * Ssw_SmlStart(Aig_Man_t *pAig, int nPref, int nFrames, int nWordsFrame)
Definition sswSim.c:1148
void Ssw_SmlInitialize(Ssw_Sml_t *p, int fInit)
Definition sswSim.c:895
void Ssw_SmlSimulateOne(Ssw_Sml_t *p)
Definition sswSim.c:1005
struct Ssw_Sml_t_ Ssw_Sml_t
Definition ssw.h:120
Here is the call graph for this function:

◆ Ssw_SmlSimulateSeq()

Ssw_Sml_t * Ssw_SmlSimulateSeq ( Aig_Man_t * pAig,
int nPref,
int nFrames,
int nWords )
extern

Function*************************************************************

Synopsis [Performs simulation of the initialized circuit.]

Description []

SideEffects []

SeeAlso []

Definition at line 1248 of file sswSim.c.

1249{
1250 Ssw_Sml_t * p;
1251 p = Ssw_SmlStart( pAig, nPref, nFrames, nWords );
1252 Ssw_SmlInitialize( p, 1 );
1254 p->fNonConstOut = Ssw_SmlCheckNonConstOutputs( p );
1255 return p;
1256}
int Ssw_SmlCheckNonConstOutputs(Ssw_Sml_t *p)
Definition sswSim.c:980
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Ssw_SmlStop()

void Ssw_SmlStop ( Ssw_Sml_t * p)
extern

Function*************************************************************

Synopsis [Deallocates simulation manager.]

Description []

SideEffects []

SeeAlso []

Definition at line 1211 of file sswSim.c.

1212{
1213 ABC_FREE( p );
1214}
Here is the caller graph for this function:

◆ Ssw_SmlUnnormalize()

void Ssw_SmlUnnormalize ( Ssw_Sml_t * p)
extern

Function*************************************************************

Synopsis [Converts simulation information to be not normallized.]

Description []

SideEffects []

SeeAlso []

Definition at line 1044 of file sswSim.c.

1045{
1046 Aig_Obj_t * pObj;
1047 unsigned * pSims;
1048 int i, k;
1049 // convert constant 1
1050 pSims = Ssw_ObjSim( p, 0 );
1051 for ( i = 0; i < p->nWordsFrame; i++ )
1052 pSims[i] = ~pSims[i];
1053 // convert internal nodes
1054 Aig_ManForEachNode( p->pAig, pObj, k )
1055 {
1056 if ( pObj->fPhase == 0 )
1057 continue;
1058 pSims = Ssw_ObjSim( p, pObj->Id );
1059 for ( i = 0; i < p->nWordsFrame; i++ )
1060 pSims[i] = ~pSims[i];
1061 }
1062 // PIs/POs are always stored in their natural state
1063}
#define Aig_ManForEachNode(p, pObj, i)
Definition aig.h:413
unsigned int fPhase
Definition aig.h:78