31#define MIO_SYMB_AND '*'
32#define MIO_SYMB_AND2 '&'
33#define MIO_SYMB_OR '+'
34#define MIO_SYMB_OR2 '|'
35#define MIO_SYMB_XOR '^'
36#define MIO_SYMB_NOT '!'
37#define MIO_SYMB_AFTNOT '\''
38#define MIO_SYMB_OPEN '('
39#define MIO_SYMB_CLOSE ')'
59 if ( pName == NULL )
return NULL;
84 Buffer = Abc_UtilStrsav( pFormula );
87 for ( pTemp = Buffer; *pTemp; pTemp++ )
97 pTemp =
strtok( Buffer,
" " );
100 for ( i = 0; i < nPins; i++ )
101 if (
strcmp( pTemp, pPinNames[i] ) == 0 )
105 pPinNames[nPins++] = Abc_UtilStrsav(pTemp);
108 pTemp =
strtok( NULL,
" " );
127 char * pPinNames[100];
128 char * pPinNamesCopy[100];
150 pGate->
vExpr = Exp_Const0();
158 pGate->
vExpr = Exp_Const1();
165 printf(
"Cannot parse formula \"%s\" of gate \"%s\".\n", pGate->
pForm, pGate->
pName );
176 printf(
"Cannot read formula \"%s\" of gate \"%s\".\n", pGate->
pForm, pGate->
pName );
191 ppPin = &pPin->
pNext;
192 for ( i = 1; i < nPins; i++ )
197 (*ppPin)->pName = pPinNames[i];
199 ppPin = &((*ppPin)->pNext);
204 pPin->
pName = pPinNames[0];
213 for ( i = 0; i < nPins; i++ )
215 if ( pPinNames[i] &&
strcmp( pPinNames[i], pPin->
pName ) == 0 )
221 pPinNamesCopy[iPin++] = pPin->
pName;
226 printf(
"Cannot find pin name \"%s\" in the formula \"%s\" of gate \"%s\".\n",
234 for ( i = 0; i < nPins; i++ )
237 printf(
"Name \"%s\" appears in the formula \"%s\" of gate \"%s\" but there is no such pin.\n",
243 memcpy( pPinNames, pPinNamesCopy, nPins *
sizeof(
char *) );
270 pGate->
uTruth = Exp_Truth6( nPins, pGate->
vExpr, NULL );
271 else if ( nPins <= 8 )
274 Exp_Truth8( nPins, pGate->
vExpr, NULL, pGate->
pTruth );
#define ABC_CALLOC(type, num)
#define ABC_NAMESPACE_IMPL_START
#define ABC_NAMESPACE_IMPL_END
unsigned __int64 word
DECLARATIONS ///.
char * Mem_FlexEntryFetch(Mem_Flex_t *p, int nBytes)
int Mio_GateCollectNames(char *pFormula, char *pPinNames[])
char * Mio_SopRegister(Mem_Flex_t *pMan, char *pName)
FUNCTION DEFINITIONS ///.
int Mio_GateParseFormula(Mio_Gate_t *pGate)
int Mio_LibraryParseFormulas(Mio_Library_t *pLib)
FUNCTION DEFINITIONS ///.
#define MIO_STRING_CONST1
#define MIO_STRING_CONST0
Mio_Pin_t * Mio_PinDup(Mio_Pin_t *pPin)
char * Mio_LibDeriveSop(int nVars, Vec_Int_t *vExpr, Vec_Str_t *vStr)
struct Mio_LibraryStruct_t_ Mio_Library_t
#define Mio_LibraryForEachGate(Lib, Gate)
GLOBAL VARIABLES ///.
struct Mio_PinStruct_t_ Mio_Pin_t
#define Mio_GateForEachPin(Gate, Pin)
struct Mio_GateStruct_t_ Mio_Gate_t
Vec_Int_t * Mio_ParseFormula(char *pFormInit, char **ppVarNames, int nVars)
struct Mem_Flex_t_ Mem_Flex_t