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;
83 strcpy( Buffer, pFormula );
86 for ( pTemp = Buffer; *pTemp; pTemp++ )
96 pTemp =
strtok( Buffer,
" " );
99 for ( i = 0; i < nPins; i++ )
100 if (
strcmp( pTemp, pPinNames[i] ) == 0 )
107 pTemp =
strtok( NULL,
" " );
125 char * pPinNames[100];
126 char * pPinNamesCopy[100];
163 printf(
"Cannot parse formula \"%s\" of gate \"%s\".\n", pGate->
pForm, pGate->
pName );
174 printf(
"Cannot read formula \"%s\" of gate \"%s\".\n", pGate->
pForm, pGate->
pName );
189 ppPin = &pPin->
pNext;
190 for ( i = 1; i < nPins; i++ )
195 (*ppPin)->pName = pPinNames[i];
197 ppPin = &((*ppPin)->pNext);
202 pPin->
pName = pPinNames[0];
211 for ( i = 0; i < nPins; i++ )
213 if ( pPinNames[i] &&
strcmp( pPinNames[i], pPin->
pName ) == 0 )
219 pPinNamesCopy[iPin++] = pPin->
pName;
224 printf(
"Cannot find pin name \"%s\" in the formula \"%s\" of gate \"%s\".\n",
232 for ( i = 0; i < nPins; i++ )
235 printf(
"Name \"%s\" appears in the formula \"%s\" of gate \"%s\" but there is no such pin.\n",
241 memcpy( pPinNames, pPinNamesCopy, nPins *
sizeof(
char *) );
Vec_Int_t * Mio_ParseFormula(char *pFormInit, char **ppVarNames, int nVars)
char * Mio_LibDeriveSop(int nVars, Vec_Int_t *vExpr, Vec_Str_t *vStr)
#define Mio_GateForEachPin(Gate, Pin)
char * Mem_FlexEntryFetch(Mem_Flex_t *p, int nBytes)
int Mio_LibraryParseFormulas(Mio_Library_t *pLib)
FUNCTION DEFINITIONS ///.
static word Exp_Truth6(int nVars, Vec_Int_t *p, word *puFanins)
static Vec_Int_t * Exp_Const0()
int Mio_GateParseFormula(Mio_Gate_t *pGate)
unsigned __int64 word
DECLARATIONS ///.
#define ABC_NAMESPACE_IMPL_END
Mio_Pin_t * Mio_PinDup(Mio_Pin_t *pPin)
STRUCTURE DEFINITIONS ///.
#define ABC_NAMESPACE_IMPL_START
#define MIO_SYMB_AND
DECLARATIONS ///.
char * Mio_SopRegister(Mem_Flex_t *pMan, char *pName)
FUNCTION DEFINITIONS ///.
#define Mio_LibraryForEachGate(Lib, Gate)
GLOBAL VARIABLES ///.
char * Abc_UtilStrsav(char *s)
#define MIO_STRING_CONST1
#define MIO_STRING_CONST0
static Vec_Int_t * Exp_Const1()
int Mio_GateCollectNames(char *pFormula, char *pPinNames[])