119 static word uTruth, uTruths6[3] = {
128 if ( uTruth == (uTruths6[0] & uTruths6[1]) )
return PTR_OBJ_AND;
129 if ( uTruth == (uTruths6[0] | uTruths6[1]) )
return PTR_OBJ_OR;
130 if ( uTruth == (uTruths6[0] ^ uTruths6[1]) )
return PTR_OBJ_XOR;
131 if ( uTruth == (uTruths6[0] ^~uTruths6[1]) )
return PTR_OBJ_XNOR;
275 fprintf( pFile,
".names" );
277 fprintf( pFile,
" %s", pName );
278 fprintf( pFile,
" %s\n", (
char *)
Vec_PtrEntry(vNode, 0) );
293 fprintf( pFile,
" %s=%s", pName, (
char *)
Vec_PtrEntry(vBox, i+1) ), i++;
294 fprintf( pFile,
"\n" );
307 fprintf( pFile,
" %s", pSig );
311 fprintf( pFile,
".model %s\n", (
char *)
Vec_PtrEntry(vNtk, 0) );
312 fprintf( pFile,
".inputs" );
314 fprintf( pFile,
"\n" );
315 fprintf( pFile,
".outputs" );
317 fprintf( pFile,
"\n\n" );
319 fprintf( pFile,
"\n" );
321 fprintf( pFile,
"\n" );
322 fprintf( pFile,
".end\n\n" );
328 pFile = fopen( pFileName,
"wb" );
331 printf(
"Cannot open output file \"%s\".\n", pFileName );
355 fprintf( pFile,
"( %s", (
char *)
Vec_PtrEntry(vNode, 0) );
357 fprintf( pFile,
", %s", pName );
358 fprintf( pFile,
" );\n" );
372 fprintf( pFile,
" .%s(%s)%s", pName, (
char *)
Vec_PtrEntry(vBox, i+1), i >=
Vec_PtrSize(vBox)-2 ?
"" :
"," ), i++;
373 fprintf( pFile,
" );\n" );
386 fprintf( pFile,
" %s%s", pSig, (fSkipLastComma && i ==
Vec_PtrSize(vSigs)-1) ?
"" :
"," );
390 fprintf( pFile,
"module %s\n", (
char *)
Vec_PtrEntry(vNtk, 0) );
391 fprintf( pFile,
"(\n" );
393 fprintf( pFile,
"\n" );
395 fprintf( pFile,
"\n);\ninput" );
397 fprintf( pFile,
";\noutput" );
399 fprintf( pFile,
";\n\n" );
401 fprintf( pFile,
"\n" );
403 fprintf( pFile,
"endmodule\n\n" );
409 pFile = fopen( pFileName,
"wb" );
412 printf(
"Cannot open output file \"%s\".\n", pFileName );
503 printf(
"Converting to Ptr: Memory = %6.3f MB ", 1.0*
Ptr_ManMemDes(vDes)/(1<<20) );
int Ptr_ManMemNtk(Vec_Ptr_t *vNtk)
Vec_Ptr_t * Ptr_ManDumpNode(Abc_Obj_t *pObj)
void Ptr_ManDumpModuleToBlif(FILE *pFile, Vec_Ptr_t *vNtk)
void Ptr_ManDumpNodesToBlif(FILE *pFile, Vec_Ptr_t *vNodes)
typedefABC_NAMESPACE_HEADER_START struct Vec_Ptr_t_ Vec_Ptr_t
INCLUDES ///.
void Ptr_ManDumpToFile(char *pFileName, Vec_Ptr_t *vDes)
static int Abc_Ptr2Int(void *p)
void Ptr_ManDumpToBlif(char *pFileName, Vec_Ptr_t *vDes)
static int Abc_ObjIsCi(Abc_Obj_t *pObj)
void Ptr_ManDumpSignalsToBlif(FILE *pFile, Vec_Ptr_t *vSigs, int fSkipLastComma)
void Ptr_ManExperiment(Abc_Ntk_t *pNtk)
#define Vec_PtrForEachEntryStart(Type, vVec, pEntry, i, Start)
typedefABC_NAMESPACE_HEADER_START struct Vec_Vec_t_ Vec_Vec_t
INCLUDES ///.
static int Abc_ObjFanoutNum(Abc_Obj_t *pObj)
Vec_Ptr_t * Ptr_ManDumpBoxes(Abc_Ntk_t *pNtk)
static int Abc_NtkBoxNum(Abc_Ntk_t *pNtk)
char * Ptr_TypeToSop(Ptr_ObjType_t Type)
static int Abc_ObjFaninNum(Abc_Obj_t *pObj)
static void Vec_PtrPush(Vec_Ptr_t *p, void *Entry)
word Hop_ManComputeTruth6(Hop_Man_t *p, Hop_Obj_t *pObj, int nVars)
static abctime Abc_Clock()
static int Abc_MaxInt(int a, int b)
static int Vec_PtrSize(Vec_Ptr_t *p)
static void Vec_VecFree(Vec_Vec_t *p)
static Abc_Obj_t * Abc_ObjFanin0(Abc_Obj_t *pObj)
int Ptr_ManMemArrayArray(Vec_Ptr_t *vArrayArray)
static int Abc_ObjIsCo(Abc_Obj_t *pObj)
static Abc_Ntk_t * Abc_ObjModel(Abc_Obj_t *pObj)
static void Abc_PrintTime(int level, const char *pStr, abctime time)
static int Abc_ObjIsNode(Abc_Obj_t *pObj)
static int Abc_NtkNodeNum(Abc_Ntk_t *pNtk)
void Ptr_ManFreeNtk(Vec_Ptr_t *vNtk)
Vec_Ptr_t * Ptr_ManDumpBox(Abc_Obj_t *pObj)
void Ptr_ManDumpModuleToFile(FILE *pFile, Vec_Ptr_t *vNtk)
void Ptr_ManDumpBoxToFile(FILE *pFile, Vec_Ptr_t *vBox)
Vec_Ptr_t * Ptr_ManDumpInputs(Abc_Ntk_t *pNtk)
void Ptr_ManDumpBoxesToBlif(FILE *pFile, Vec_Ptr_t *vBoxes)
void Ptr_ManDumpSignalsToFile(FILE *pFile, Vec_Ptr_t *vSigs, int fSkipLastComma)
Ptr_ObjType_t Ptr_HopToType(Abc_Obj_t *pObj)
Ptr_ObjType_t Ptr_SopToType(char *pSop)
unsigned __int64 word
DECLARATIONS ///.
#define ABC_NAMESPACE_IMPL_END
Vec_Ptr_t * Ptr_ManDumpNodes(Abc_Ntk_t *pNtk)
static int Ptr_ManCheckArray(Vec_Ptr_t *vArray)
void Ptr_ManDumpNodesToFile(FILE *pFile, Vec_Ptr_t *vNodes)
char * Ptr_TypeToName(Ptr_ObjType_t Type)
FUNCTION DEFINITIONS ///.
static double Vec_PtrMemory(Vec_Ptr_t *p)
#define Abc_NtkForEachBox(pNtk, pObj, i)
static int Vec_PtrCap(Vec_Ptr_t *p)
#define Abc_NtkForEachNode(pNtk, pNode, i)
#define ABC_NAMESPACE_IMPL_START
Vec_Ptr_t * Ptr_ManDumpDes(Abc_Ntk_t *pNtk)
static void * Vec_PtrEntry(Vec_Ptr_t *p, int i)
static char * Ptr_ObjName(Abc_Obj_t *pObj)
#define Abc_ObjForEachFanout(pObj, pFanout, i)
static char * Abc_NtkName(Abc_Ntk_t *pNtk)
static Abc_Obj_t * Abc_NtkPo(Abc_Ntk_t *pNtk, int i)
static int Abc_NtkPoNum(Abc_Ntk_t *pNtk)
static Vec_Ptr_t * Vec_PtrAlloc(int nCap)
FUNCTION DEFINITIONS ///.
void Ptr_ManDumpNodeToFile(FILE *pFile, Vec_Ptr_t *vNode)
Ptr_ObjType_t
DECLARATIONS ///.
#define Abc_ObjForEachFanin(pObj, pFanin, i)
int Ptr_ManMemDes(Vec_Ptr_t *vDes)
#define ABC_CONST(number)
PARAMETERS ///.
static int Abc_NtkPiNum(Abc_Ntk_t *pNtk)
ABC_DLL char * Abc_ObjName(Abc_Obj_t *pNode)
DECLARATIONS ///.
void Ptr_ManFreeDes(Vec_Ptr_t *vDes)
static int Abc_ObjIsNet(Abc_Obj_t *pObj)
Vec_Ptr_t * Ptr_ManDumpNtk(Abc_Ntk_t *pNtk)
int Ptr_ManMemArray(Vec_Ptr_t *vArray)
static int Abc_ObjIsBox(Abc_Obj_t *pObj)
static void * Abc_Int2Ptr(int i)
static Abc_Obj_t * Abc_NtkPi(Abc_Ntk_t *pNtk, int i)
static Abc_Ntk_t * Abc_ObjNtk(Abc_Obj_t *pObj)
Vec_Ptr_t * Ptr_ManDumpOutputs(Abc_Ntk_t *pNtk)
#define Abc_NtkForEachPo(pNtk, pPo, i)
#define Vec_PtrForEachEntry(Type, vVec, pEntry, i)
MACRO DEFINITIONS ///.
void Ptr_ManDumpBoxToBlif(FILE *pFile, Vec_Ptr_t *vBox)
typedefABC_NAMESPACE_HEADER_START struct Hop_Man_t_ Hop_Man_t
INCLUDES ///.
static Abc_Obj_t * Abc_ObjFanout0(Abc_Obj_t *pObj)
#define Abc_NtkForEachPi(pNtk, pPi, i)
void Ptr_ManDumpBoxesToFile(FILE *pFile, Vec_Ptr_t *vBoxes)
static void Vec_PtrFree(Vec_Ptr_t *p)
void Ptr_ManDumpNodeToBlif(FILE *pFile, Vec_Ptr_t *vNode)