48 int i, k, nRange, nBeg, nEnd, nBits = 0;
51 output = fopen(
"abc_blast_input.info",
"w");
55 nRange = Wlc_ObjRange(pObj);
59 for ( k = 0; k < nRange; k++ )
61 int index = nEnd > nBeg ? nBeg + k : nEnd + k;
63 fprintf(output,
"%s[%d] : %c \n",
Wlc_ObjName(pNtk, Wlc_ObjId(pNtk, pObj)), index , c );
71 nRange = Wlc_ObjRange(pObj);
75 for ( k = 0; k < nRange; k++ )
77 int index = nEnd > nBeg ? nBeg + k : nEnd + k;
78 fprintf(output,
"%s[%d] : o \n",
Wlc_ObjName(pNtk, Wlc_ObjId(pNtk, pObj)), index);
100 int i, k, nNum, nRange, nBits = 0;
105 nRange = Wlc_ObjRange(pObj);
106 for ( k = 0; k < nRange; k++ )
108 nNum = Vec_IntEntry(vCounts, nBits + k);
117 printf(
"%s[%d:%d] : ",
Wlc_ObjName(pNtk, Wlc_ObjId(pNtk, pObj)), pObj->
End, pObj->
Beg );
118 for ( k = 0; k < nRange; k++ )
120 nNum = Vec_IntEntry( vCounts, nBits + k );
123 printf(
" [%d] -> %d", k, nNum );
129 assert( Vec_IntSize(vCounts) == nBits );
152 int i, k, nNum, nRange, nBits = 0;
168 pMainObj = Abc_NtkCreatePi( pMainNtk );
171 if (vNamesIn != NULL && i < Vec_PtrSize(vNamesIn)) {
180 if ( Abc_NtkPiNum(pMainNtk) != nInputs )
182 printf(
"Mismatch between number of inputs and the number of literals in the invariant.\n" );
193 nRange = Wlc_ObjRange(pObj);
194 for ( k = 0; k < nRange; k++ )
196 nNum = Vec_IntEntry(vCounts, nBits + k);
206 for ( k = 0; k < nRange; k++ )
208 nNum = Vec_IntEntry( vCounts, nBits + k );
212 pMainObj = Abc_NtkCreatePi( pMainNtk );
222 assert( pNtk == NULL || Vec_IntSize(vCounts) == nBits );
224 pMainObj = Abc_NtkCreateNode( pMainNtk );
228 Vec_IntFree( vCounts );
231 pMainTemp = Abc_NtkCreatePo( pMainNtk );
250 int nRegs = Gia_ManRegNum(pGia);
252 if ( Abc_NtkPoNum(pNtk) != 1 )
253 printf(
"The number of outputs is other than 1.\n" );
254 else if ( Abc_NtkNodeNum(pNtk) != 1 )
255 printf(
"The number of internal nodes is other than 1.\n" );
259 Abc_Obj_t * pFanin, * pNode = Abc_ObjFanin0( Abc_NtkCo(pNtk, 0) );
260 char * pName, * pCube, * pSop = (
char *)pNode->
pData;
261 Vec_Int_t * vFanins = Vec_IntAlloc( Abc_ObjFaninNum(pNode) );
262 int i, k, Value, nLits, Counter = 0;
277 assert( Abc_ObjIsCi(pFanin) );
284 if ( Counter++ == 0 )
285 printf(
"Cannot read input name \"%s\" of fanin %d.\n", pName, i );
291 for ( k = (
int)
strlen(pName)-1; k >= 0; k-- )
292 if ( pName[k] <
'0' || pName[k] >
'9' )
294 if ( k == (
int)
strlen(pName)-1 )
296 if ( Counter++ == 0 )
297 printf(
"Cannot read input name \"%s\" of fanin %d.\n", pName, i );
301 Value = atoi(pName + k + 1);
303 Vec_IntPush( vFanins, Value );
306 printf(
"Cannot read names for %d inputs of the invariant.\n", Counter );
309 assert( Vec_IntSize(vFanins) == Abc_ObjFaninNum(pNode) );
310 vRes = Vec_IntAlloc( 1000 );
318 Vec_IntPush( vRes, nLits );
321 Vec_IntPush( vRes, Abc_Var2Lit(Vec_IntEntry(vFanins, k), (
int)Value ==
'0') );
323 Vec_IntPush( vRes, nRegs );
324 Vec_IntFree( vFanins );
struct Abc_Obj_t_ Abc_Obj_t
ABC_DLL Abc_Ntk_t * Abc_NtkAlloc(Abc_NtkType_t Type, Abc_NtkFunc_t Func, int fUseMemMan)
DECLARATIONS ///.
ABC_DLL void Abc_ObjAddFanin(Abc_Obj_t *pObj, Abc_Obj_t *pFanin)
#define Abc_ObjForEachFanin(pObj, pFanin, i)
#define Abc_CubeForEachVar(pCube, Value, i)
ABC_DLL char * Abc_ObjName(Abc_Obj_t *pNode)
DECLARATIONS ///.
struct Abc_Ntk_t_ Abc_Ntk_t
ABC_DLL char * Abc_ObjAssignName(Abc_Obj_t *pObj, char *pName, char *pSuffix)
#define Abc_SopForEachCube(pSop, nFanins, pCube)
#define Abc_NtkForEachPi(pNtk, pPi, i)
ABC_DLL int Abc_SopGetVarNum(char *pSop)
ABC_DLL void Abc_NtkDelete(Abc_Ntk_t *pNtk)
ABC_DLL int Abc_SopGetCubeNum(char *pSop)
ABC_DLL char * Abc_SopRegister(Mem_Flex_t *pMan, const char *pName)
DECLARATIONS ///.
#define ABC_NAMESPACE_IMPL_START
#define ABC_NAMESPACE_IMPL_END
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
struct Vec_Str_t_ Vec_Str_t
struct Gia_Man_t_ Gia_Man_t
struct Mem_Flex_t_ Mem_Flex_t
Vec_Str_t * Pdr_InvPrintStr(Vec_Int_t *vInv, Vec_Int_t *vCounts)
Vec_Int_t * Pdr_InvCounts(Vec_Int_t *vInv)
int Abc_NamStrFind(Abc_Nam_t *p, char *pStr)
void Abc_NamStop(Abc_Nam_t *p)
int Abc_NamStrFindOrAdd(Abc_Nam_t *p, char *pStr, int *pfFound)
Abc_Nam_t * Abc_NamStart(int nObjs, int nAveSize)
FUNCTION DEFINITIONS ///.
typedefABC_NAMESPACE_HEADER_START struct Abc_Nam_t_ Abc_Nam_t
INCLUDES ///.
#define Vec_IntForEachEntry(vVec, Entry, i)
MACRO DEFINITIONS ///.
typedefABC_NAMESPACE_HEADER_START struct Vec_Ptr_t_ Vec_Ptr_t
INCLUDES ///.
#define Vec_PtrForEachEntry(Type, vVec, pEntry, i)
MACRO DEFINITIONS ///.
Vec_Int_t * Wlc_NtkGetPut(Abc_Ntk_t *pNtk, Gia_Man_t *pGia)
Abc_Ntk_t * Wlc_NtkGetInv(Wlc_Ntk_t *pNtk, Vec_Int_t *vInv, Vec_Ptr_t *vNamesIn)
void Wlc_NtkPrintInvStats(Wlc_Ntk_t *pNtk, Vec_Int_t *vCounts, int fVerbose)
ABC_NAMESPACE_IMPL_START void Wlc_NtkPrintInputInfo(Wlc_Ntk_t *pNtk)
DECLARATIONS ///.
#define Wlc_NtkForEachPo(p, pPo, i)
#define Wlc_NtkForEachCi(p, pCi, i)
struct Wlc_Ntk_t_ Wlc_Ntk_t
char * Wlc_ObjName(Wlc_Ntk_t *p, int iObj)
struct Wlc_Obj_t_ Wlc_Obj_t
BASIC TYPES ///.