50 for ( pEnd = pCur; *pEnd; pEnd++ )
54 else if ( *pEnd ==
')' )
75 int fAnd = 0, fXor = 0, fPri = 0, nParts = 0;
81 pParts[nParts++] = pCur;
86 if ( *pCur >=
'a' && *pCur <=
'z' )
91 while ( (*pCur >=
'0' && *pCur <=
'9') || (*pCur >=
'A' && *pCur <=
'F') )
96 printf(
"Cannot find the opening parenthesis.\n" );
103 printf(
"Cannot find the closing parenthesis.\n" );
112 if ( *pCur !=
'*' && *pCur !=
'+' && *pCur !=
',' )
114 printf(
"Wrong separating symbol.\n" );
118 fAnd |= (*pCur ==
'*');
119 fXor |= (*pCur ==
'+');
120 fPri |= (*pCur ==
',');
124 if ( fAnd + fXor + fPri > 1 )
126 printf(
"Different types of separating symbol ennPartsed.\n" );
147 char * pEnd, * pParts[32];
148 int i, nParts, TypeExor;
166 pObj = Abc_NtkCreateNode( pNtk );
170 for ( i = 0; i < nParts; i++ )
173 if ( pFanin == NULL )
180 for ( i = 0; i < nParts; i++ )
183 if ( pFanin == NULL )
196 if ( *pCur >=
'a' && *pCur <=
'z' )
199 return Abc_NtkPi( pNtk, *pCur -
'a' );
204 while ( (*pEnd >=
'0' && *pEnd <=
'9') || (*pEnd >=
'A' && *pEnd <=
'F') )
208 printf(
"Cannot find the end of hexadecimal truth table.\n" );
237 char * pCur, * pFormCopy;
242 for ( pCur = pForm; *pCur; pCur++ )
243 if ( *pCur >=
'a' && *pCur <=
'z' )
244 nInputs = Abc_MaxInt( nInputs, *pCur -
'a' );
253 for ( i = 0; i < nInputs; i++ )
254 Abc_ObjAssignName( Abc_NtkCreatePi(pNtk), (
char *)Vec_PtrEntry(vNames, i), NULL );
261 for ( ; *pForm; pForm++ )
267 else if ( *pForm ==
')' )
272 else if ( *pForm ==
',' )
290 pTop = Abc_NtkCreatePo(pNtk);
297 fprintf( stdout,
"Io_ReadDsd(): Network check has failed.\n" );
struct Abc_Obj_t_ Abc_Obj_t
ABC_DLL char * Abc_SopFromTruthHex(char *pTruth)
ABC_DLL Abc_Ntk_t * Abc_NtkAlloc(Abc_NtkType_t Type, Abc_NtkFunc_t Func, int fUseMemMan)
DECLARATIONS ///.
ABC_DLL char * Abc_SopCreateXorSpecial(Mem_Flex_t *pMan, int nVars)
ABC_DLL void Abc_ObjAddFanin(Abc_Obj_t *pObj, Abc_Obj_t *pFanin)
ABC_DLL int Abc_NtkCheck(Abc_Ntk_t *pNtk)
FUNCTION DEFINITIONS ///.
ABC_DLL void Abc_NodeFreeNames(Vec_Ptr_t *vNames)
struct Abc_Ntk_t_ Abc_Ntk_t
ABC_DLL char * Abc_ObjAssignName(Abc_Obj_t *pObj, char *pName, char *pSuffix)
ABC_DLL char * Abc_SopCreateAnd(Mem_Flex_t *pMan, int nVars, int *pfCompl)
ABC_DLL Abc_Obj_t * Abc_NtkCreateNodeInv(Abc_Ntk_t *pNtk, Abc_Obj_t *pFanin)
ABC_DLL void Abc_NtkDelete(Abc_Ntk_t *pNtk)
ABC_DLL Vec_Ptr_t * Abc_NodeGetFakeNames(int nNames)
ABC_DLL char * Abc_SopRegister(Mem_Flex_t *pMan, const char *pName)
DECLARATIONS ///.
#define ABC_ALLOC(type, num)
#define ABC_NAMESPACE_IMPL_START
#define ABC_NAMESPACE_IMPL_END
Abc_Ntk_t * Io_ReadDsd(char *pForm)
int Io_ReadDsdStrSplit(char *pCur, char *pParts[], int *pTypeXor)
ABC_NAMESPACE_IMPL_START char * Io_ReadDsdFindEnd(char *pCur)
DECLARATIONS ///.
Abc_Obj_t * Io_ReadDsd_rec(Abc_Ntk_t *pNtk, char *pCur, char *pSop)
struct Mem_Flex_t_ Mem_Flex_t
typedefABC_NAMESPACE_HEADER_START struct Vec_Ptr_t_ Vec_Ptr_t
INCLUDES ///.