28 #define FPGA_CO_LIST_SIZE 5
64 for ( i = 0; i < pMan->
nInputs; i++ )
71 for ( i = 0; i < pMan->
nOutputs; i++ )
77 for ( i = 0; i < vNodes->
nSize; i++ )
108 if ( fCollectEquiv && pNode->
pNextE )
135 for ( i = 0; i < nNodes; i++ )
137 for ( i = 0; i < vNodes->
nSize; i++ )
155 float aFlowFlowTotal = 0;
163 return aFlowFlowTotal;
247 for ( i = 0; i < pMan->
nOutputs; i++ )
249 for ( i = 0; i < vNodes->
nSize; i++ )
272 if ( pNode->
nRefs++ )
279 ppStore[pNode->
Level] = pNode;
316 for ( i = 0; i < pMan->
nOutputs; i++ )
327 for ( i = LevelMax; i >= 0; i-- )
352 if ( Arrival1 < Arrival2 )
354 if ( Arrival1 > Arrival2 )
378 for ( k = nNodes - 1; k >= 0; k-- )
381 if ( k == nNodesMax - 1 )
383 if ( nNodes < nNodesMax )
385 for ( v = nNodes - 1; v > k+1; v-- )
386 pNodes[v] = pNodes[v-1];
406 int fCompl, Limit, MaxNameSize, i;
416 for ( i = 0; i < Limit; i++ )
421 for ( i = 0; i < Limit; i++ )
427 printf(
"Output %-*s : ", MaxNameSize + 3, p->
ppOutputNames[pSorted[i]] );
453 for ( m = 0; m < 32; m++ )
454 for ( v = 0; v < 5; v++ )
456 uTruths[v][0] |= (1 << m);
458 for ( v = 0; v < 5; v++ )
459 uTruths[v][1] = uTruths[v][0];
506 for ( i = 0; i < pVec->
nSize; i++ )
512 printf(
"Primary input %d is a secondary node.\n", pNode->
Num );
517 printf(
"Constant 1 %d is a secondary node.\n", pNode->
Num );
522 printf(
"Internal node %d is a secondary node.\n", pNode->
Num );
524 printf(
"Internal node %d has first fanin that is a secondary node.\n", pNode->
Num );
526 printf(
"Internal node %d has second fanin that is a secondary node.\n", pNode->
Num );
613 for ( i = 0; i < vNodes->
nSize; i++ )
682 for ( i = 0; i < pMan->
nOutputs; i++ )
684 for ( i = 0; i < vVisited->
nSize; i++ )
712 if ( pNode == pPivot )
752 int nNodes, nLevelsMax, i;
756 nNodes = vNodes->
nSize;
757 for ( i = 0; i < nNodes; i++ )
770 for ( i = 0; i < pMan->
nOutputs; i++ )
776 for ( i = 0; i < nLevelsMax; i++ )
780 for ( i = 0; i < nNodes; i++ )
808 for ( i = 0; i < pMan->
nOutputs; i++ )
829 int Level1, Level2, LevelE;
846 if ( pNode->
Level < (
unsigned)LevelE )
847 pNode->
Level = LevelE;
851 if ( pNode->
Level > (
unsigned)LevelE )
852 pNode->
Level = LevelE;
855 if ( pNode->
pRepr == NULL )
856 for ( pTemp = pNode->
pNextE; pTemp; pTemp = pTemp->
pNextE )
880 for ( i = 0; i < pMan->
nOutputs; i++ )
900 int nChoiceNodes, nChoices;
901 int i, LevelMax1, LevelMax2;
906 for ( i = 0; i < pMan->
nOutputs; i++ )
911 nChoiceNodes = nChoices = 0;
915 if ( pNode->
pRepr == NULL && pNode->
pNextE != NULL )
918 for ( pTemp = pNode; pTemp; pTemp = pTemp->
pNextE )
924 printf(
"Maximum level: Original = %d. Reduced due to choices = %d.\n", LevelMax1, LevelMax2 );
925 printf(
"Choice stats: Choice nodes = %d. Total choices = %d.\n", nChoiceNodes, nChoices );
963 for ( i = 0; i <= nLevels; i++ )
966 for ( i = 0; i < pMan->
nOutputs; i++ )
969 for ( i = 0; i < pMan->
nOutputs; i++ )
978 for ( i = 0; i < pMan->
nOutputs; i++ )
static int Fpga_CollectNodeTfo_rec(Fpga_Node_t *pNode, Fpga_Node_t *pPivot, Fpga_NodeVec_t *vVisited, Fpga_NodeVec_t *vTfo)
int Fpga_CompareNodesByLevelIncreasing(Fpga_Node_t **ppS1, Fpga_Node_t **ppS2)
static int Fpga_MappingCompareOutputDelay(Fpga_Node_t **ppNode1, Fpga_Node_t **ppNode2)
static void Fpga_DfsLim_rec(Fpga_Node_t *pNode, int Level, Fpga_NodeVec_t *vNodes)
static Fpga_NodeVec_t * Fpga_MappingOrderCosByLevel(Fpga_Man_t *pMan)
void Fpga_MappingPrintOutputArrivals(Fpga_Man_t *p)
float Fpga_MappingSetRefsAndArea_rec(Fpga_Man_t *pMan, Fpga_Node_t *pNode, Fpga_Node_t **ppStore)
Fpga_NodeVec_t * Fpga_MappingDfs(Fpga_Man_t *pMan, int fCollectEquiv)
FUNCTION DEFINITIONS ///.
int Fpga_MappingUpdateLevel_rec(Fpga_Man_t *pMan, Fpga_Node_t *pNode, int fMaximum)
int Fpga_MappingMaxLevel(Fpga_Man_t *pMan)
void Fpga_ManReportChoices(Fpga_Man_t *pMan)
Fpga_NodeVec_t * vMapping
#define ABC_ALLOC(type, num)
float pLutAreas[FPGA_MAX_LUTSIZE+1]
Fpga_NodeVec_t * Fpga_MappingLevelize(Fpga_Man_t *pMan, Fpga_NodeVec_t *vNodes)
float Fpga_MappingAreaTrav(Fpga_Man_t *pMan)
Fpga_Node_t * ppLeaves[FPGA_MAX_LEAVES+1]
Fpga_NodeVec_t * vNodesAll
Fpga_NodeVec_t * Fpga_NodeVecAlloc(int nCap)
FUNCTION DEFINITIONS ///.
void Fpga_NodeVecFree(Fpga_NodeVec_t *p)
Fpga_NodeVec_t * Fpga_MappingDfsNodes(Fpga_Man_t *pMan, Fpga_Node_t **ppNodes, int nNodes, int fEquiv)
#define ABC_NAMESPACE_IMPL_END
float Fpga_MappingArea(Fpga_Man_t *pMan)
Fpga_NodeVec_t * Fpga_DfsLim(Fpga_Man_t *pMan, Fpga_Node_t *pNode, int nLevels)
int Fpga_NodeIsConst(Fpga_Node_t *p)
float Fpga_MappingArea_rec(Fpga_Man_t *pMan, Fpga_Node_t *pNode, Fpga_NodeVec_t *vNodes)
#define ABC_NAMESPACE_IMPL_START
int Fpga_NodeIsAnd(Fpga_Node_t *p)
void Fpga_MappingSetupTruthTables(unsigned uTruths[][2])
void Fpga_ManCleanData0(Fpga_Man_t *pMan)
static void Fpga_MappingFindLatest(Fpga_Man_t *p, int *pNodes, int nNodesMax)
float Fpga_MappingSetRefsAndArea(Fpga_Man_t *pMan)
int Fpga_NodeIsVar(Fpga_Node_t *p)
STRUCTURE DEFINITIONS ///.
#define FPGA_CO_LIST_SIZE
DECLARATIONS ///.
void Fpga_MappingSetupMask(unsigned uMask[], int nVarsMax)
Fpga_Node_t * Fpga_NodeVecReadEntry(Fpga_NodeVec_t *p, int i)
void Fpga_NodeVecWriteEntry(Fpga_NodeVec_t *p, int i, Fpga_Node_t *Entry)
Fpga_NodeVec_t * Fpga_CollectNodeTfo(Fpga_Man_t *pMan, Fpga_Node_t *pNode)
void Fpga_MappingSortByLevel(Fpga_Man_t *pMan, Fpga_NodeVec_t *vNodes, int fIncreasing)
int Fpga_CompareNodesByLevelDecreasing(Fpga_Node_t **ppS1, Fpga_Node_t **ppS2)
int Fpga_ManCheckConsistency(Fpga_Man_t *p)
static void Fpga_MappingDfs_rec(Fpga_Node_t *pNode, Fpga_NodeVec_t *vNodes, int fCollectEquiv)
#define Fpga_IsComplement(p)
GLOBAL VARIABLES ///.
void Fpga_NodeVecPush(Fpga_NodeVec_t *p, Fpga_Node_t *Entry)
void Fpga_MappingSetChoiceLevels(Fpga_Man_t *pMan)
float Fpga_MappingGetAreaFlow(Fpga_Man_t *p)
static void Fpga_MappingDfsCuts_rec(Fpga_Node_t *pNode, Fpga_NodeVec_t *vNodes)