67 printf(
"Io_ReadPla: The network check has failed.\n" );
92 int nInputs = -1, nOutputs = -1, nProducts = -1;
93 char * pCubeIn, * pCubeOut;
94 int i, k, iLine, nDigits, nCubes;
108 if (
strncmp( (
char *)vTokens->pArray[0],
".e", 2 ) == 0 )
112 if (
strcmp( (
char *)vTokens->pArray[0],
".model" ) == 0 )
119 if ( vTokens->nSize == 1 )
121 printf(
"%s (line %d): Wrong number of token.\n",
129 if (
strcmp( (
char *)vTokens->pArray[0],
".i" ) == 0 )
130 nInputs = atoi((
char *)vTokens->pArray[1]);
131 else if (
strcmp( (
char *)vTokens->pArray[0],
".o" ) == 0 )
132 nOutputs = atoi((
char *)vTokens->pArray[1]);
133 else if (
strcmp( (
char *)vTokens->pArray[0],
".p" ) == 0 )
134 nProducts = atoi((
char *)vTokens->pArray[1]);
135 else if (
strcmp( (
char *)vTokens->pArray[0],
".ilb" ) == 0 )
137 if ( vTokens->nSize - 1 != nInputs )
138 printf(
"Warning: Mismatch between the number of PIs on the .i line (%d) and the number of PIs on the .ilb line (%d).\n", nInputs, vTokens->nSize - 1 );
139 for ( i = 1; i < vTokens->nSize; i++ )
142 else if (
strcmp( (
char *)vTokens->pArray[0],
".ob" ) == 0 )
144 if ( vTokens->nSize - 1 != nOutputs )
145 printf(
"Warning: Mismatch between the number of POs on the .o line (%d) and the number of POs on the .ob line (%d).\n", nOutputs, vTokens->nSize - 1 );
146 for ( i = 1; i < vTokens->nSize; i++ )
163 for ( i = 0; i < nInputs; i++ )
165 sprintf( Buffer,
"x%0*d", nDigits, i );
171 if ( nOutputs == -1 )
180 for ( i = 0; i < nOutputs; i++ )
182 sprintf( Buffer,
"z%0*d", nDigits, i );
204 if ( vTokens->nSize != 2 )
206 printf(
"%s (line %d): Input and output cubes are not specified.\n",
213 pCubeIn = (
char *)vTokens->pArray[0];
214 pCubeOut = (
char *)vTokens->pArray[1];
215 if (
strlen(pCubeIn) != (unsigned)nInputs )
217 printf(
"%s (line %d): Input cube length (%zu) differs from the number of inputs (%d).\n",
222 if (
strlen(pCubeOut) != (
unsigned)nOutputs )
224 printf(
"%s (line %d): Output cube length (%zu) differs from the number of outputs (%d).\n",
233 for ( i = 0; i < nOutputs; i++ )
235 if ( pCubeOut[i] ==
'0' )
244 for ( i = 0; i < nOutputs; i++ )
246 if ( pCubeOut[i] ==
'1' )
257 if ( nProducts != -1 && nCubes != nProducts )
258 printf(
"Warning: Mismatch between the number of cubes (%d) and the number on .p line (%d).\n",
265 if ( ppSops[i]->nSize == 0 )
typedefABC_NAMESPACE_HEADER_START struct Vec_Ptr_t_ Vec_Ptr_t
INCLUDES ///.
static Abc_Obj_t * Abc_ObjFanin0Ntk(Abc_Obj_t *pObj)
#define ABC_ALLOC(type, num)
static Vec_Str_t * Vec_StrAlloc(int nCap)
static void Vec_StrPush(Vec_Str_t *p, char Entry)
ABC_DLL void Abc_NtkFinalizeRead(Abc_Ntk_t *pNtk)
static Abc_Obj_t * Abc_ObjFanin0(Abc_Obj_t *pObj)
ABC_DLL void Abc_NtkDelete(Abc_Ntk_t *pNtk)
ABC_DLL void Abc_ObjAddFanin(Abc_Obj_t *pObj, Abc_Obj_t *pFanin)
static int Abc_NtkNodeNum(Abc_Ntk_t *pNtk)
ABC_DLL char * Abc_SopRegister(Mem_Flex_t *pMan, char *pName)
DECLARATIONS ///.
Abc_Obj_t * Io_ReadCreatePi(Abc_Ntk_t *pNtk, char *pName)
ABC_DLL Abc_Ntk_t * Abc_NtkStartRead(char *pName)
static void Vec_StrFree(Vec_Str_t *p)
ABC_DLL int Abc_NtkCheckRead(Abc_Ntk_t *pNtk)
static int Abc_Base10Log(unsigned n)
#define ABC_NAMESPACE_IMPL_END
static Abc_Obj_t * Abc_ObjFanout0Ntk(Abc_Obj_t *pObj)
ABC_DLL void Abc_ObjRemoveFanins(Abc_Obj_t *pObj)
#define ABC_NAMESPACE_IMPL_START
Abc_Ntk_t * Io_ReadPla(char *pFileName, int fZeros, int fCheck)
FUNCTION DEFINITIONS ///.
static int Abc_NtkPoNum(Abc_Ntk_t *pNtk)
static int Abc_NtkPiNum(Abc_Ntk_t *pNtk)
static Abc_Obj_t * Abc_NtkCreateNode(Abc_Ntk_t *pNtk)
static ABC_NAMESPACE_IMPL_START Abc_Ntk_t * Io_ReadPlaNetwork(Extra_FileReader_t *p, int fZeros)
DECLARATIONS ///.
static void Vec_StrPrintStr(Vec_Str_t *p, const char *pStr)
#define Abc_NtkForEachPo(pNtk, pPo, i)
Abc_Obj_t * Io_ReadCreatePo(Abc_Ntk_t *pNtk, char *pName)
#define Abc_NtkForEachPi(pNtk, pPi, i)