50 p->vGates = Vec_PtrAlloc( 100 );
72 Vec_PtrFree(
p->vSelect );
74 Vec_PtrFree(
p->vSorted );
76 Vec_PtrFree(
p->vGates );
82 Vec_IntFree(
p->vRules3 );
108 if ( Counter < (
int)pGate->
nPins )
109 Counter = pGate->
nPins;
126 char * pPhaseNames[10] = {
"UNKNOWN",
"INV",
"NONINV" };
127 fprintf( pFile,
" PIN " );
128 fprintf( pFile,
"%9s ", pPin->
pName );
129 fprintf( pFile,
"%10s ", pPhaseNames[pPin->
Phase] );
130 fprintf( pFile,
"%6d ", (
int)pPin->
dLoadInput );
131 fprintf( pFile,
"%6d ", (
int)pPin->
dLoadMax );
136 fprintf( pFile,
"\n" );
153 fprintf( pFile,
"GATE " );
154 fprintf( pFile,
"%12s ", pGate->
pName );
155 fprintf( pFile,
"%10.2f ", pGate->
dArea );
159 if ( pGate->
pFunc == NULL )
160 printf(
"Truth table is not available.\n" );
183 fprintf( pFile,
"# The genlib library \"%s\".\n", pLib->pName );
201 double Diff = (*pp1)->dArea - (*pp2)->dArea;
223 vSorted = Vec_PtrDup( pLib->vGates );
224 qsort( (
void *)Vec_PtrArray(vSorted), (
size_t)Vec_PtrSize(vSorted),
sizeof(
void *),
246 if (( pGate == NULL ) || ( pGate->
pFunc == NULL ))
continue;
247 if ( pGate->
nPins <= 5 && pGate->
pFunc[0] == uTruth )
273 vSelect = Vec_PtrAlloc( 100 );
276 if ( pGate->
pFunc == NULL || pGate->
pTwin != NULL )
280 if ( pGate2->
pFunc == NULL || pGate2->
pTwin != NULL )
289 Vec_PtrPush( vSelect, pGate );
310 vArray = fAllGates?
p->vGates :
p->vSelect;
313 printf(
"%3d :%12s %d %9.2f ", i, pGate->
pName, pGate->
nPins, pGate->
dArea );
336 if ( pBuffer == NULL )
342 p->pName = Abc_UtilStrsav( pFileName );
345 printf(
"Read %d gates from file \"%s\".\n", Vec_PtrSize(
p->vGates), pFileName );
357 printf(
"Selected %d functionally unique gates. ", Vec_PtrSize(
p->vSelect) );
358 ABC_PRT(
"Time", Abc_Clock() - clk );
365 printf(
"Created %d rules and %d matches. ",
p->nNodes,
p->nSets );
366 ABC_PRT(
"Time", Abc_Clock() - clk );
#define ABC_ALLOC(type, num)
#define ABC_NAMESPACE_IMPL_START
#define ABC_NAMESPACE_IMPL_END
void Aig_MmFlexStop(Aig_MmFlex_t *p, int fVerbose)
Aig_MmFlex_t * Aig_MmFlexStart()
#define Amap_GateForEachPin(pGate, pPin)
void Amap_LibCreateRules(Amap_Lib_t *p, int fVeryVerbose)
Amap_Lib_t * Amap_LibReadFile(char *pFileName, int fVerbose)
struct Amap_Gat_t_ Amap_Gat_t
#define Amap_LibForEachGate(pLib, pGate, i)
int Amap_LibParseEquations(Amap_Lib_t *p, int fVerbose)
Amap_Lib_t * Amap_LibReadBuffer(char *pBuffer, int fVerbose)
struct Amap_Pin_t_ Amap_Pin_t
BASIC TYPES ///.
Amap_Lib_t * Amap_LibReadAndPrepare(char *pFileName, char *pBuffer, int fVerbose, int fVeryVerbose)
int Amap_LibNumPinsMax(Amap_Lib_t *p)
void Amap_LibPrintSelectedGates(Amap_Lib_t *p, int fAllGates)
void Amap_LibWriteGate(FILE *pFile, Amap_Gat_t *pGate, int fPrintDsd)
void Amap_LibWritePin(FILE *pFile, Amap_Pin_t *pPin)
Amap_Gat_t * Amap_LibFindGate(Amap_Lib_t *p, unsigned uTruth)
Vec_Ptr_t * Amap_LibSortGatesByArea(Amap_Lib_t *pLib)
int Amap_LibCompareGatesByArea(Amap_Gat_t **pp1, Amap_Gat_t **pp2)
ABC_NAMESPACE_IMPL_START Amap_Lib_t * Amap_LibAlloc()
DECLARATIONS ///.
void Amap_LibFree(Amap_Lib_t *p)
void Amap_LibWrite(FILE *pFile, Amap_Lib_t *pLib, int fPrintDsd)
Vec_Ptr_t * Amap_LibSelectGates(Amap_Lib_t *p, int fVerbose)
typedefABC_NAMESPACE_HEADER_START struct Amap_Lib_t_ Amap_Lib_t
INCLUDES ///.
void Kit_DsdPrintFromTruth(unsigned *pTruth, int nVars)
#define Vec_PtrForEachEntryStop(Type, vVec, pEntry, i, Stop)
typedefABC_NAMESPACE_HEADER_START struct Vec_Ptr_t_ Vec_Ptr_t
INCLUDES ///.
#define Vec_PtrForEachEntry(Type, vVec, pEntry, i)
MACRO DEFINITIONS ///.
typedefABC_NAMESPACE_HEADER_START struct Vec_Vec_t_ Vec_Vec_t
INCLUDES ///.