70 vId2Name = Vec_IntAlloc( 0 );
71 Vec_IntFill( vId2Name, pGia ? Gia_ManObjNum(pGia) : Aig_ManObjNumMax(pAig), ~0 );
75 pNode = Abc_ObjFanin0(pNet)->
pCopy;
76 if ( pNode && (pAnd = Abc_ObjRegular(pNode->
pCopy)) &&
81 Vec_IntWriteEntry( vId2Name, Aig_ObjId(pObjAig), Abc_ObjId(pNet) );
83 Vec_IntWriteEntry( vId2Name, Abc_Lit2Var(pObjAig->
iData), Abc_ObjId(pNet) );
89 pNet = Abc_ObjFanin0(pNode);
91 if ( pNode && (pAnd = Abc_ObjRegular(pNode->
pCopy)) &&
96 Vec_IntWriteEntry( vId2Name, Aig_ObjId(pObjAig), Abc_ObjId(pNet) );
98 Vec_IntWriteEntry( vId2Name, Abc_Lit2Var(pObjAig->
iData), Abc_ObjId(pNet) );
104 pNet = Abc_ObjFanout0(pNode);
105 pNode = pNode->
pCopy;
106 if ( pNode && (pAnd = Abc_ObjRegular(pNode->
pCopy)) &&
111 Vec_IntWriteEntry( vId2Name, Aig_ObjId(pObjAig), Abc_ObjId(pNet) );
113 Vec_IntWriteEntry( vId2Name, Abc_Lit2Var(pObjAig->
iData), Abc_ObjId(pNet) );
134 if ( Vec_IntEntry(vId2Name, Id) == ~0 )
157 if ( pName1 == NULL || pName2 == NULL )
159 fprintf( pFile,
"%s=%s%s\n", pName1, fPol?
"~":
"", pName2 );
177 if ( pName1 == NULL )
179 fprintf( pFile,
"%s=%s%s\n", pName1, fPol?
"~":
"",
"const0" );
196 static char Buffer[1000];
198 sprintf( Buffer,
"%s_bmc%s", pNameGeneric, pName +
strlen(pNameGeneric) );
219 char * pFileNameOut = pData->pFileNameOut;
223 if ( pData->fDumpBmc )
228 pFile = fopen( pFileNameOut,
"wb" );
232 if ( !Gia_ObjHasRepr(pGia, i) )
234 pRepr = Gia_ManObj( pGia,Gia_ObjRepr(pGia, i) );
235 if ( pData->fFlopOnly )
237 if ( !Gia_ObjIsRo(pGia, pObj) || !(Gia_ObjIsRo(pGia, pRepr)||Gia_ObjIsConst0(pRepr)) )
240 else if ( pData->fFfNdOnly )
242 if ( !Gia_ObjIsRo(pGia, pObj) && !(Gia_ObjIsRo(pGia, pRepr)||Gia_ObjIsConst0(pRepr)) )
245 if ( Gia_ObjRepr(pGia, i) == 0 )
249 Gia_ObjPhase(pRepr) ^ Gia_ObjPhase(pObj) );
252 printf(
"%d pairs of sequentially equivalent nodes are written into file \"%s\".\n", Counter, pFileNameOut );
272 char * pFileNameOut = pData->pFileNameOut;
276 if ( pData->fDumpBmc )
281 pFile = fopen( pFileNameOut,
"wb" );
284 if ( (pRepr = Aig_ObjRepr(pAig, pObj)) == NULL )
286 if ( pData->fFlopOnly )
288 if ( !Saig_ObjIsLo(pAig, pObj) || !(Saig_ObjIsLo(pAig, pRepr)||pRepr==Aig_ManConst1(pAig)) )
291 else if ( pData->fFfNdOnly )
293 if ( !Saig_ObjIsLo(pAig, pObj) && !(Saig_ObjIsLo(pAig, pRepr)||pRepr==Aig_ManConst1(pAig)) )
296 if ( pRepr == Aig_ManConst1(pAig) )
300 Aig_ObjPhase(pRepr) ^ Aig_ObjPhase(pObj) );
303 printf(
"%d pairs of sequentially equivalent nodes are written into file \"%s\".\n", Counter, pFileNameOut );
318Abc_Ntk_t *
Abc_NtkTestScorr(
char * pFileNameIn,
char * pFileNameOut,
int nStepsMax,
int nBTLimit,
int fNewAlgo,
int fFlopOnly,
int fFfNdOnly,
int fVerbose )
326 Abc_Ntk_t * pNetlist, * pLogic, * pStrash, * pResult;
331 pFile = fopen( pFileNameIn,
"rb" );
334 printf(
"Input file \"%s\" cannot be opened.\n", pFileNameIn );
339 pFile = fopen( pFileNameOut,
"wb" );
342 printf(
"Output file \"%s\" cannot be opened.\n", pFileNameOut );
348 if ( pNetlist == NULL )
350 printf(
"Reading input file \"%s\" has failed.\n", pFileNameIn );
354 if ( pLogic == NULL )
357 printf(
"Deriving logic network from input file %s has failed.\n", pFileNameIn );
364 pFile = fopen( pFileNameInit,
"rb" );
367 printf(
"Init file \"%s\" cannot be opened.\n", pFileNameInit );
373 printf(
"Initial state was derived from file \"%s\".\n", pFileNameInit );
376 if ( pStrash == NULL )
380 printf(
"Deriving strashed network from input file %s has failed.\n", pFileNameIn );
396 pData->pNetlist = pNetlist;
400 pData->pFileNameOut = pFileNameOut;
401 pData->fFlopOnly = fFlopOnly;
402 pData->fFfNdOnly = fFfNdOnly;
404 pCorPars->
pData = pData;
417 pSswPars->nBTLimit = nBTLimit;
418 pSswPars->nStepsMax = nStepsMax;
419 pSswPars->fVerbose = fVerbose;
422 pData->pNetlist = pNetlist;
426 pData->pFileNameOut = pFileNameOut;
427 pData->fFlopOnly = fFlopOnly;
428 pData->fFfNdOnly = fFfNdOnly;
430 pSswPars->pData = pData;
438 Vec_IntFree( vId2Name );
464 pSswPars->nBTLimit = pCorPars->
nBTLimit;
465 pSswPars->nFramesK = pCorPars->
nFrames;
467 pSswPars->fVerbose = pCorPars->
fVerbose;
Abc_Ntk_t * Abc_NtkFromDarSeqSweep(Abc_Ntk_t *pNtkOld, Aig_Man_t *pMan)
char * Abc_NtkBmcFileName(char *pName)
Vec_Int_t * Abc_NtkMapGiaIntoNameId(Abc_Ntk_t *pNetlist, Aig_Man_t *pAig, Gia_Man_t *pGia)
FUNCTION DEFINITIONS ///.
char * Abc_NtkTestScorrGetName(Abc_Ntk_t *pNetlist, Vec_Int_t *vId2Name, int Id)
int Abc_NtkTestScorrWriteEquivPair(Abc_Ntk_t *pNetlist, Vec_Int_t *vId2Name, int Id1, int Id2, FILE *pFile, int fPol)
typedefABC_NAMESPACE_IMPL_START struct Tst_Dat_t_ Tst_Dat_t
DECLARATIONS ///.
int Abc_NtkTestScorrWriteEquivGia(Tst_Dat_t *pData)
int Abc_NtkTestScorrWriteEquivConst(Abc_Ntk_t *pNetlist, Vec_Int_t *vId2Name, int Id1, FILE *pFile, int fPol)
Abc_Ntk_t * Abc_NtkTestScorr(char *pFileNameIn, char *pFileNameOut, int nStepsMax, int nBTLimit, int fNewAlgo, int fFlopOnly, int fFfNdOnly, int fVerbose)
int Abc_NtkTestScorrWriteEquivAig(Tst_Dat_t *pData)
Gia_Man_t * Cec_ManScorrCorrespondence(Gia_Man_t *p, Cec_ParCor_t *pCorPars)
struct Abc_Obj_t_ Abc_Obj_t
#define Abc_NtkForEachCo(pNtk, pCo, i)
#define Abc_NtkForEachNet(pNtk, pNet, i)
ABC_DLL Abc_Ntk_t * Abc_NtkToLogic(Abc_Ntk_t *pNtk)
FUNCTION DEFINITIONS ///.
ABC_DLL void Abc_NtkConvertDcLatches(Abc_Ntk_t *pNtk)
struct Abc_Ntk_t_ Abc_Ntk_t
ABC_DLL Abc_Ntk_t * Abc_NtkStrash(Abc_Ntk_t *pNtk, int fAllNodes, int fCleanup, int fRecord)
#define Abc_NtkForEachCi(pNtk, pCi, i)
ABC_DLL void Abc_NtkDelete(Abc_Ntk_t *pNtk)
#define ABC_NAMESPACE_IMPL_START
#define ABC_NAMESPACE_IMPL_END
#define Aig_ManForEachObj(p, pObj, i)
void Aig_ManStop(Aig_Man_t *p)
struct Aig_Obj_t_ Aig_Obj_t
typedefABC_NAMESPACE_HEADER_START struct Aig_Man_t_ Aig_Man_t
INCLUDES ///.
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
void Cec_ManCorSetDefaultParams(Cec_ParCor_t *p)
Gia_Man_t * Cec_ManLSCorrespondence(Gia_Man_t *pAig, Cec_ParCor_t *pPars)
struct Cec_ParCor_t_ Cec_ParCor_t
Aig_Man_t * Gia_ManToAigSimple(Gia_Man_t *p)
Gia_Man_t * Gia_ManFromAig(Aig_Man_t *p)
INCLUDES ///.
void Gia_ManReprFromAigRepr(Aig_Man_t *pAig, Gia_Man_t *pGia)
Gia_Man_t * Gia_ManFromAigSimple(Aig_Man_t *p)
Aig_Man_t * Abc_NtkToDar(Abc_Ntk_t *pNtk, int fExors, int fRegisters)
void Gia_ManStop(Gia_Man_t *p)
struct Gia_Obj_t_ Gia_Obj_t
struct Gia_Man_t_ Gia_Man_t
#define Gia_ManForEachObj(p, pObj, i)
MACRO DEFINITIONS ///.
void Gia_ManSetPhase(Gia_Man_t *p)
void Io_ReadBenchInit(Abc_Ntk_t *pNtk, char *pFileName)
Abc_Ntk_t * Io_ReadNetlist(char *pFileName, Io_FileType_t FileType, int fCheck)
Io_FileType_t Io_ReadFileType(char *pFileName)
DECLARATIONS ///.
char * Nm_ManFindNameById(Nm_Man_t *p, int ObjId)
void Ssw_ManSetDefaultParams(Ssw_Pars_t *p)
DECLARATIONS ///.
typedefABC_NAMESPACE_HEADER_START struct Ssw_Pars_t_ Ssw_Pars_t
INCLUDES ///.
Aig_Man_t * Ssw_SignalCorrespondence(Aig_Man_t *pAig, Ssw_Pars_t *pPars)