74 for ( i = 0; i < p->
nInputs; i++ )
80 for ( i = 0; i < nNodes; i++ )
126 printf(
"\nError: A node in the mapping graph does not have feasible cuts.\n" );
157 if ( (fDelayOriented &&
171 if ( pCutBestOld == NULL )
203 for ( i = 0; i < p->
nInputs; i++ )
209 for ( i = 0; i < nNodes; i++ )
242 for ( i = 0; i < vNodes->
nSize; i++ )
244 pNode = vNodes->
pArray[i];
276 printf(
"\nError: A node in the mapping graph does not have feasible cuts.\n" );
356 for ( i = 0; i < p->
nInputs; i++ )
362 for ( i = 0; i < nNodes; i++ )
397 printf(
"\nError: A node in the mapping graph does not have feasible cuts.\n" );
478 pNode->vFanouts = NULL;
486 if ( pNode->vFanouts == NULL )
488 if ( pNode->vFanouts->nSize >= 10 )
490 Counter[pNode->vFanouts->nSize]++;
493 printf(
"Fanout stats: " );
494 for ( i = 0; i < 10; i++ )
495 printf(
" %d=%d", i, Counter[i] );
507 if ( pNode->vFanouts == NULL )
509 if ( pNode->vFanouts->nSize != 1 && pNode->vFanouts->nSize != 2 && pNode->vFanouts->nSize != 3 )
513 if ( pNode->
nRefs == 0 )
523 printf(
"attempt failed\n" );
525 printf(
"attempt succeeded\n" );
550 int Counter[10] = {0};
554 float Gain, Loss, GainTotal, Area1, Area2;
560 pNode->vFanouts = NULL;
568 if ( pNode->vFanouts == NULL )
570 if ( pNode->vFanouts->nSize >= 10 )
572 Counter[pNode->vFanouts->nSize]++;
575 printf(
"Fanout stats: " );
576 for ( i = 0; i < 10; i++ )
577 printf(
" %d=%d", i, Counter[i] );
587 if ( pNode->vFanouts == NULL )
589 if ( pNode->vFanouts->nSize != 2 )
595 for ( k = 0; k < pNode->vFanouts->nSize; k++ )
597 pFanout = pNode->vFanouts->pArray[k];
600 if ( ppCutsNew[k] == NULL )
603 if ( k != pNode->vFanouts->nSize )
605 printf(
"Node %4d: Skipped.\n", pNode->
Num );
612 for ( k = 0; k < pNode->vFanouts->nSize; k++ )
614 pFanout = pNode->vFanouts->pArray[k];
616 Area1 = Fpga_MatchAreaDeref( p, ppCutsOld[k] );
620 Area2 = Fpga_MatchAreaRef( p, ppCutsNew[k] );
622 Gain += Area1 - Area2;
625 printf(
"%d ", pNode->
nRefs );
629 for ( k = 0; k < pNode->vFanouts->nSize; k++ )
631 pFanout = pNode->vFanouts->pArray[k];
633 Area1 = Fpga_MatchAreaDeref( p, ppCutsNew[k] );
637 Area2 = Fpga_MatchAreaRef( p, ppCutsOld[k] );
639 Loss += Area2 - Area1;
644 printf(
"Node %4d: Fanouts = %d. Cut area = %4.2f. Gain = %4.2f.\n",
651 printf(
"AREA GAIN = %4.2f (%.2f %%)\n", GainTotal, 100.0 * GainTotal /
Fpga_MappingArea(p) );
675 printf(
"\nError: A node in the mapping graph does not have feasible cuts.\n" );
684 aAreaCutBest = Fpga_MatchAreaDeref( p, pNode->
pCutBest );
692 Fpga_MatchCutGetArrTime( p, pCut );
699 for ( i = 0; i < pCut->
nLeaves; i++ )
706 pCut->
aFlow = Fpga_MatchAreaCount( p, pCut );
760 float Gain, CutArea1, CutArea2, CutArea3;
764 for ( i = 0; i < vNodes->
nSize; i++ )
766 pNode = vNodes->
pArray[i];
779 if ( Gain < CutArea1 - CutArea2 )
783 Gain = CutArea1 - CutArea2;
788 assert( CutArea1 == CutArea3 );
791 printf(
"Returning no gain.\n" );
static Fpga_Cut_t * Fpga_MappingAreaWithoutNode(Fpga_Man_t *p, Fpga_Node_t *pFanout, Fpga_Node_t *pNodeNo)
static int Fpga_MatchNodeSwitch(Fpga_Man_t *p, Fpga_Node_t *pNode)
float Fpga_CutRef(Fpga_Man_t *pMan, Fpga_Node_t *pNode, Fpga_Cut_t *pCut, int fFanouts)
void Fpga_TimeComputeRequiredGlobal(Fpga_Man_t *p, int fFirstTime)
static int Fpga_MatchNodeArea(Fpga_Man_t *p, Fpga_Node_t *pNode)
static ABC_NAMESPACE_IMPL_START int Fpga_MatchNode(Fpga_Man_t *p, Fpga_Node_t *pNode, int fDelayOriented)
DECLARATIONS ///.
float Fpga_FindBestNode(Fpga_Man_t *p, Fpga_NodeVec_t *vNodes, Fpga_Node_t **ppNode, Fpga_Cut_t **ppCutBest)
static int Fpga_MappingMatchesAreaArray(Fpga_Man_t *p, Fpga_NodeVec_t *vNodes)
void Fpga_CutGetParameters(Fpga_Man_t *pMan, Fpga_Cut_t *pCut)
float Fpga_CutGetSwitchDerefed(Fpga_Man_t *pMan, Fpga_Node_t *pNode, Fpga_Cut_t *pCut)
DECLARATIONS ///.
float Fpga_CutRefSwitch(Fpga_Man_t *pMan, Fpga_Node_t *pNode, Fpga_Cut_t *pCut, int fFanouts)
int Fpga_MappingMatches(Fpga_Man_t *p, int fDelayOriented)
FUNCTION DEFINITIONS ///.
static int Fpga_FloatEqual(Fpga_Man_t *p, float Arg1, float Arg2)
int Fpga_MappingMatchesSwitch(Fpga_Man_t *p)
Fpga_Node_t * ppLeaves[FPGA_MAX_LEAVES+1]
float Fpga_MappingArea(Fpga_Man_t *pMan)
void Fpga_NodeVecFree(Fpga_NodeVec_t *p)
#define ABC_NAMESPACE_IMPL_END
int Fpga_MappingMatchesArea(Fpga_Man_t *p)
Fpga_NodeVec_t * Fpga_CollectNodeTfo(Fpga_Man_t *pMan, Fpga_Node_t *pNode)
static int Fpga_FloatMoreThan(Fpga_Man_t *p, float Arg1, float Arg2)
float Fpga_CutGetAreaDerefed(Fpga_Man_t *pMan, Fpga_Cut_t *pCut)
#define ABC_NAMESPACE_IMPL_START
int Fpga_NodeIsAnd(Fpga_Node_t *p)
STRUCTURE DEFINITIONS ///.
float Fpga_CutDeref(Fpga_Man_t *pMan, Fpga_Node_t *pNode, Fpga_Cut_t *pCut, int fFanouts)
float Fpga_TimeCutComputeArrival(Fpga_Man_t *pMan, Fpga_Cut_t *pCut)
DECLARATIONS ///.
float Fpga_CutDerefSwitch(Fpga_Man_t *pMan, Fpga_Node_t *pNode, Fpga_Cut_t *pCut, int fFanouts)