mirror of
https://github.com/YosysHQ/abc.git
synced 2026-09-01 18:27:44 +02:00
Version abc80121
This commit is contained in:
+5
-6
@@ -326,8 +326,13 @@ static inline float If_CutLutArea( If_Man_t * p, If_Cut_t * pCut ) { r
|
||||
extern int If_ManPerformMapping( If_Man_t * p );
|
||||
extern int If_ManPerformMappingComb( If_Man_t * p );
|
||||
/*=== ifCut.c ============================================================*/
|
||||
extern int If_CutFilter( If_Set_t * pCutSet, If_Cut_t * pCut );
|
||||
extern void If_CutSort( If_Man_t * p, If_Set_t * pCutSet, If_Cut_t * pCut );
|
||||
extern int If_CutMerge( If_Cut_t * pCut0, If_Cut_t * pCut1, If_Cut_t * pCut );
|
||||
extern void If_CutPrint( If_Man_t * p, If_Cut_t * pCut );
|
||||
extern void If_CutPrintTiming( If_Man_t * p, If_Cut_t * pCut );
|
||||
extern void If_CutLift( If_Cut_t * pCut );
|
||||
extern void If_CutCopy( If_Man_t * p, If_Cut_t * pCutDest, If_Cut_t * pCutSrc );
|
||||
extern float If_CutAreaFlow( If_Man_t * p, If_Cut_t * pCut );
|
||||
extern float If_CutEdgeFlow( If_Man_t * p, If_Cut_t * pCut );
|
||||
extern float If_CutAverageRefs( If_Man_t * p, If_Cut_t * pCut );
|
||||
@@ -339,12 +344,6 @@ extern float If_CutEdgeDeref( If_Man_t * p, If_Cut_t * pCut );
|
||||
extern float If_CutEdgeRef( If_Man_t * p, If_Cut_t * pCut );
|
||||
extern float If_CutEdgeDerefed( If_Man_t * p, If_Cut_t * pCut );
|
||||
extern float If_CutEdgeRefed( If_Man_t * p, If_Cut_t * pCut );
|
||||
extern int If_CutFilter( If_Set_t * pCutSet, If_Cut_t * pCut );
|
||||
extern void If_CutSort( If_Man_t * p, If_Set_t * pCutSet, If_Cut_t * pCut );
|
||||
extern int If_CutMerge( If_Cut_t * pCut0, If_Cut_t * pCut1, If_Cut_t * pCut );
|
||||
extern void If_CutLift( If_Cut_t * pCut );
|
||||
extern void If_CutCopy( If_Man_t * p, If_Cut_t * pCutDest, If_Cut_t * pCutSrc );
|
||||
extern void If_ManSortCuts( If_Man_t * p, int Mode );
|
||||
/*=== ifMan.c =============================================================*/
|
||||
extern If_Man_t * If_ManStart( If_Par_t * pPars );
|
||||
extern void If_ManRestart( If_Man_t * p );
|
||||
|
||||
+95
-94
@@ -311,21 +311,21 @@ int If_CutMerge( If_Cut_t * pCut0, If_Cut_t * pCut1, If_Cut_t * pCut )
|
||||
SeeAlso []
|
||||
|
||||
***********************************************************************/
|
||||
int If_CutCompareDelay( If_Cut_t ** ppC0, If_Cut_t ** ppC1 )
|
||||
int If_CutCompareDelay( If_Man_t * p, If_Cut_t ** ppC0, If_Cut_t ** ppC1 )
|
||||
{
|
||||
If_Cut_t * pC0 = *ppC0;
|
||||
If_Cut_t * pC1 = *ppC1;
|
||||
if ( pC0->Delay < pC1->Delay - 0.0001 )
|
||||
if ( pC0->Delay < pC1->Delay - p->fEpsilon )
|
||||
return -1;
|
||||
if ( pC0->Delay > pC1->Delay + 0.0001 )
|
||||
if ( pC0->Delay > pC1->Delay + p->fEpsilon )
|
||||
return 1;
|
||||
if ( pC0->nLeaves < pC1->nLeaves )
|
||||
return -1;
|
||||
if ( pC0->nLeaves > pC1->nLeaves )
|
||||
return 1;
|
||||
if ( pC0->Area < pC1->Area - 0.0001 )
|
||||
if ( pC0->Area < pC1->Area - p->fEpsilon )
|
||||
return -1;
|
||||
if ( pC0->Area > pC1->Area + 0.0001 )
|
||||
if ( pC0->Area > pC1->Area + p->fEpsilon )
|
||||
return 1;
|
||||
return 0;
|
||||
}
|
||||
@@ -341,17 +341,17 @@ int If_CutCompareDelay( If_Cut_t ** ppC0, If_Cut_t ** ppC1 )
|
||||
SeeAlso []
|
||||
|
||||
***********************************************************************/
|
||||
int If_CutCompareDelayOld( If_Cut_t ** ppC0, If_Cut_t ** ppC1 )
|
||||
int If_CutCompareDelayOld( If_Man_t * p, If_Cut_t ** ppC0, If_Cut_t ** ppC1 )
|
||||
{
|
||||
If_Cut_t * pC0 = *ppC0;
|
||||
If_Cut_t * pC1 = *ppC1;
|
||||
if ( pC0->Delay < pC1->Delay - 0.0001 )
|
||||
if ( pC0->Delay < pC1->Delay - p->fEpsilon )
|
||||
return -1;
|
||||
if ( pC0->Delay > pC1->Delay + 0.0001 )
|
||||
if ( pC0->Delay > pC1->Delay + p->fEpsilon )
|
||||
return 1;
|
||||
if ( pC0->Area < pC1->Area - 0.0001 )
|
||||
if ( pC0->Area < pC1->Area - p->fEpsilon )
|
||||
return -1;
|
||||
if ( pC0->Area > pC1->Area + 0.0001 )
|
||||
if ( pC0->Area > pC1->Area + p->fEpsilon )
|
||||
return 1;
|
||||
if ( pC0->nLeaves < pC1->nLeaves )
|
||||
return -1;
|
||||
@@ -371,13 +371,13 @@ int If_CutCompareDelayOld( If_Cut_t ** ppC0, If_Cut_t ** ppC1 )
|
||||
SeeAlso []
|
||||
|
||||
***********************************************************************/
|
||||
int If_CutCompareArea( If_Cut_t ** ppC0, If_Cut_t ** ppC1 )
|
||||
int If_CutCompareArea( If_Man_t * p, If_Cut_t ** ppC0, If_Cut_t ** ppC1 )
|
||||
{
|
||||
If_Cut_t * pC0 = *ppC0;
|
||||
If_Cut_t * pC1 = *ppC1;
|
||||
if ( pC0->Area < pC1->Area - 0.0001 )
|
||||
if ( pC0->Area < pC1->Area - p->fEpsilon )
|
||||
return -1;
|
||||
if ( pC0->Area > pC1->Area + 0.0001 )
|
||||
if ( pC0->Area > pC1->Area + p->fEpsilon )
|
||||
return 1;
|
||||
if ( pC0->AveRefs > pC1->AveRefs )
|
||||
return -1;
|
||||
@@ -387,9 +387,9 @@ int If_CutCompareArea( If_Cut_t ** ppC0, If_Cut_t ** ppC1 )
|
||||
return -1;
|
||||
if ( pC0->nLeaves > pC1->nLeaves )
|
||||
return 1;
|
||||
if ( pC0->Delay < pC1->Delay - 0.0001 )
|
||||
if ( pC0->Delay < pC1->Delay - p->fEpsilon )
|
||||
return -1;
|
||||
if ( pC0->Delay > pC1->Delay + 0.0001 )
|
||||
if ( pC0->Delay > pC1->Delay + p->fEpsilon )
|
||||
return 1;
|
||||
return 0;
|
||||
}
|
||||
@@ -433,13 +433,13 @@ static inline int If_ManSortCompare( If_Man_t * p, If_Cut_t * pC0, If_Cut_t * pC
|
||||
{
|
||||
if ( p->SortMode == 1 ) // area
|
||||
{
|
||||
if ( pC0->Area < pC1->Area - 0.0001 )
|
||||
if ( pC0->Area < pC1->Area - p->fEpsilon )
|
||||
return -1;
|
||||
if ( pC0->Area > pC1->Area + 0.0001 )
|
||||
if ( pC0->Area > pC1->Area + p->fEpsilon )
|
||||
return 1;
|
||||
if ( pC0->Edge < pC1->Edge - 0.0001 )
|
||||
if ( pC0->Edge < pC1->Edge - p->fEpsilon )
|
||||
return -1;
|
||||
if ( pC0->Edge > pC1->Edge + 0.0001 )
|
||||
if ( pC0->Edge > pC1->Edge + p->fEpsilon )
|
||||
return 1;
|
||||
if ( pC0->AveRefs > pC1->AveRefs )
|
||||
return -1;
|
||||
@@ -449,44 +449,44 @@ static inline int If_ManSortCompare( If_Man_t * p, If_Cut_t * pC0, If_Cut_t * pC
|
||||
return -1;
|
||||
if ( pC0->nLeaves > pC1->nLeaves )
|
||||
return 1;
|
||||
if ( pC0->Delay < pC1->Delay - 0.0001 )
|
||||
if ( pC0->Delay < pC1->Delay - p->fEpsilon )
|
||||
return -1;
|
||||
if ( pC0->Delay > pC1->Delay + 0.0001 )
|
||||
if ( pC0->Delay > pC1->Delay + p->fEpsilon )
|
||||
return 1;
|
||||
return 0;
|
||||
}
|
||||
if ( p->SortMode == 0 ) // delay
|
||||
{
|
||||
if ( pC0->Delay < pC1->Delay - 0.0001 )
|
||||
if ( pC0->Delay < pC1->Delay - p->fEpsilon )
|
||||
return -1;
|
||||
if ( pC0->Delay > pC1->Delay + 0.0001 )
|
||||
if ( pC0->Delay > pC1->Delay + p->fEpsilon )
|
||||
return 1;
|
||||
if ( pC0->nLeaves < pC1->nLeaves )
|
||||
return -1;
|
||||
if ( pC0->nLeaves > pC1->nLeaves )
|
||||
return 1;
|
||||
if ( pC0->Area < pC1->Area - 0.0001 )
|
||||
if ( pC0->Area < pC1->Area - p->fEpsilon )
|
||||
return -1;
|
||||
if ( pC0->Area > pC1->Area + 0.0001 )
|
||||
if ( pC0->Area > pC1->Area + p->fEpsilon )
|
||||
return 1;
|
||||
if ( pC0->Edge < pC1->Edge - 0.0001 )
|
||||
if ( pC0->Edge < pC1->Edge - p->fEpsilon )
|
||||
return -1;
|
||||
if ( pC0->Edge > pC1->Edge + 0.0001 )
|
||||
if ( pC0->Edge > pC1->Edge + p->fEpsilon )
|
||||
return 1;
|
||||
return 0;
|
||||
}
|
||||
assert( p->SortMode == 2 ); // delay old
|
||||
if ( pC0->Delay < pC1->Delay - 0.0001 )
|
||||
if ( pC0->Delay < pC1->Delay - p->fEpsilon )
|
||||
return -1;
|
||||
if ( pC0->Delay > pC1->Delay + 0.0001 )
|
||||
if ( pC0->Delay > pC1->Delay + p->fEpsilon )
|
||||
return 1;
|
||||
if ( pC0->Area < pC1->Area - 0.0001 )
|
||||
if ( pC0->Area < pC1->Area - p->fEpsilon )
|
||||
return -1;
|
||||
if ( pC0->Area > pC1->Area + 0.0001 )
|
||||
if ( pC0->Area > pC1->Area + p->fEpsilon )
|
||||
return 1;
|
||||
if ( pC0->Edge < pC1->Edge - 0.0001 )
|
||||
if ( pC0->Edge < pC1->Edge - p->fEpsilon )
|
||||
return -1;
|
||||
if ( pC0->Edge > pC1->Edge + 0.0001 )
|
||||
if ( pC0->Edge > pC1->Edge + p->fEpsilon )
|
||||
return 1;
|
||||
if ( pC0->nLeaves < pC1->nLeaves )
|
||||
return -1;
|
||||
@@ -510,9 +510,9 @@ static inline int If_ManSortCompare_old( If_Man_t * p, If_Cut_t * pC0, If_Cut_t
|
||||
{
|
||||
if ( p->SortMode == 1 ) // area
|
||||
{
|
||||
if ( pC0->Area < pC1->Area - 0.0001 )
|
||||
if ( pC0->Area < pC1->Area - p->fEpsilon )
|
||||
return -1;
|
||||
if ( pC0->Area > pC1->Area + 0.0001 )
|
||||
if ( pC0->Area > pC1->Area + p->fEpsilon )
|
||||
return 1;
|
||||
if ( pC0->AveRefs > pC1->AveRefs )
|
||||
return -1;
|
||||
@@ -522,36 +522,36 @@ static inline int If_ManSortCompare_old( If_Man_t * p, If_Cut_t * pC0, If_Cut_t
|
||||
return -1;
|
||||
if ( pC0->nLeaves > pC1->nLeaves )
|
||||
return 1;
|
||||
if ( pC0->Delay < pC1->Delay - 0.0001 )
|
||||
if ( pC0->Delay < pC1->Delay - p->fEpsilon )
|
||||
return -1;
|
||||
if ( pC0->Delay > pC1->Delay + 0.0001 )
|
||||
if ( pC0->Delay > pC1->Delay + p->fEpsilon )
|
||||
return 1;
|
||||
return 0;
|
||||
}
|
||||
if ( p->SortMode == 0 ) // delay
|
||||
{
|
||||
if ( pC0->Delay < pC1->Delay - 0.0001 )
|
||||
if ( pC0->Delay < pC1->Delay - p->fEpsilon )
|
||||
return -1;
|
||||
if ( pC0->Delay > pC1->Delay + 0.0001 )
|
||||
if ( pC0->Delay > pC1->Delay + p->fEpsilon )
|
||||
return 1;
|
||||
if ( pC0->nLeaves < pC1->nLeaves )
|
||||
return -1;
|
||||
if ( pC0->nLeaves > pC1->nLeaves )
|
||||
return 1;
|
||||
if ( pC0->Area < pC1->Area - 0.0001 )
|
||||
if ( pC0->Area < pC1->Area - p->fEpsilon )
|
||||
return -1;
|
||||
if ( pC0->Area > pC1->Area + 0.0001 )
|
||||
if ( pC0->Area > pC1->Area + p->fEpsilon )
|
||||
return 1;
|
||||
return 0;
|
||||
}
|
||||
assert( p->SortMode == 2 ); // delay old
|
||||
if ( pC0->Delay < pC1->Delay - 0.0001 )
|
||||
if ( pC0->Delay < pC1->Delay - p->fEpsilon )
|
||||
return -1;
|
||||
if ( pC0->Delay > pC1->Delay + 0.0001 )
|
||||
if ( pC0->Delay > pC1->Delay + p->fEpsilon )
|
||||
return 1;
|
||||
if ( pC0->Area < pC1->Area - 0.0001 )
|
||||
if ( pC0->Area < pC1->Area - p->fEpsilon )
|
||||
return -1;
|
||||
if ( pC0->Area > pC1->Area + 0.0001 )
|
||||
if ( pC0->Area > pC1->Area + p->fEpsilon )
|
||||
return 1;
|
||||
if ( pC0->nLeaves < pC1->nLeaves )
|
||||
return -1;
|
||||
@@ -644,6 +644,56 @@ void If_CutPrintTiming( If_Man_t * p, If_Cut_t * pCut )
|
||||
printf( " }\n" );
|
||||
}
|
||||
|
||||
/**Function*************************************************************
|
||||
|
||||
Synopsis [Moves the cut over the latch.]
|
||||
|
||||
Description []
|
||||
|
||||
SideEffects []
|
||||
|
||||
SeeAlso []
|
||||
|
||||
***********************************************************************/
|
||||
void If_CutLift( If_Cut_t * pCut )
|
||||
{
|
||||
unsigned i;
|
||||
for ( i = 0; i < pCut->nLeaves; i++ )
|
||||
{
|
||||
assert( (pCut->pLeaves[i] & 255) < 255 );
|
||||
pCut->pLeaves[i]++;
|
||||
}
|
||||
}
|
||||
|
||||
/**Function*************************************************************
|
||||
|
||||
Synopsis [Computes area of the first level.]
|
||||
|
||||
Description [The cut need to be derefed.]
|
||||
|
||||
SideEffects []
|
||||
|
||||
SeeAlso []
|
||||
|
||||
***********************************************************************/
|
||||
void If_CutCopy( If_Man_t * p, If_Cut_t * pCutDest, If_Cut_t * pCutSrc )
|
||||
{
|
||||
int * pLeaves;
|
||||
char * pPerm;
|
||||
unsigned * pTruth;
|
||||
// save old arrays
|
||||
pLeaves = pCutDest->pLeaves;
|
||||
pPerm = pCutDest->pPerm;
|
||||
pTruth = pCutDest->pTruth;
|
||||
// copy the cut info
|
||||
memcpy( pCutDest, pCutSrc, p->nCutBytes );
|
||||
// restore the arrays
|
||||
pCutDest->pLeaves = pLeaves;
|
||||
pCutDest->pPerm = pPerm;
|
||||
pCutDest->pTruth = pTruth;
|
||||
}
|
||||
|
||||
|
||||
/**Function*************************************************************
|
||||
|
||||
Synopsis [Computes area flow.]
|
||||
@@ -931,55 +981,6 @@ float If_CutEdgeRefed( If_Man_t * p, If_Cut_t * pCut )
|
||||
}
|
||||
|
||||
|
||||
/**Function*************************************************************
|
||||
|
||||
Synopsis [Moves the cut over the latch.]
|
||||
|
||||
Description []
|
||||
|
||||
SideEffects []
|
||||
|
||||
SeeAlso []
|
||||
|
||||
***********************************************************************/
|
||||
void If_CutLift( If_Cut_t * pCut )
|
||||
{
|
||||
unsigned i;
|
||||
for ( i = 0; i < pCut->nLeaves; i++ )
|
||||
{
|
||||
assert( (pCut->pLeaves[i] & 255) < 255 );
|
||||
pCut->pLeaves[i]++;
|
||||
}
|
||||
}
|
||||
|
||||
/**Function*************************************************************
|
||||
|
||||
Synopsis [Computes area of the first level.]
|
||||
|
||||
Description [The cut need to be derefed.]
|
||||
|
||||
SideEffects []
|
||||
|
||||
SeeAlso []
|
||||
|
||||
***********************************************************************/
|
||||
void If_CutCopy( If_Man_t * p, If_Cut_t * pCutDest, If_Cut_t * pCutSrc )
|
||||
{
|
||||
int * pLeaves;
|
||||
char * pPerm;
|
||||
unsigned * pTruth;
|
||||
// save old arrays
|
||||
pLeaves = pCutDest->pLeaves;
|
||||
pPerm = pCutDest->pPerm;
|
||||
pTruth = pCutDest->pTruth;
|
||||
// copy the cut info
|
||||
memcpy( pCutDest, pCutSrc, p->nCutBytes );
|
||||
// restore the arrays
|
||||
pCutDest->pLeaves = pLeaves;
|
||||
pCutDest->pPerm = pPerm;
|
||||
pCutDest->pTruth = pTruth;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
/// END OF FILE ///
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
|
||||
+2
-2
@@ -68,8 +68,8 @@ If_Man_t * If_ManStart( If_Par_t * pPars )
|
||||
// p->pMemSet = Mem_FixedStart( p->nSetBytes );
|
||||
// report expected memory usage
|
||||
if ( p->pPars->fVerbose )
|
||||
printf( "Memory (bytes): Truth = %4d. Cut = %4d. Obj = %4d. Set = %4d.\n",
|
||||
4 * p->nTruthWords, p->nCutBytes, p->nObjBytes, p->nSetBytes );
|
||||
printf( "K = %d. Memory (bytes): Truth = %4d. Cut = %4d. Obj = %4d. Set = %4d.\n",
|
||||
p->pPars->nLutSize, 4 * p->nTruthWords, p->nCutBytes, p->nObjBytes, p->nSetBytes );
|
||||
// room for temporary truth tables
|
||||
p->puTemp[0] = p->pPars->fTruth? ALLOC( unsigned, 4 * p->nTruthWords ) : NULL;
|
||||
p->puTemp[1] = p->puTemp[0] + p->nTruthWords;
|
||||
|
||||
@@ -150,6 +150,7 @@ void If_ManImproveNodeExpand( If_Man_t * p, If_Obj_t * pObj, int nLimit, Vec_Ptr
|
||||
int CostBef, CostAft, i;
|
||||
float DelayOld, AreaBef, AreaAft;
|
||||
pCut = If_ObjCutBest(pObj);
|
||||
pCut->Delay = If_CutDelay( p, pCut );
|
||||
assert( pCut->Delay <= pObj->Required + p->fEpsilon );
|
||||
if ( pObj->nRefs == 0 )
|
||||
return;
|
||||
@@ -449,8 +450,8 @@ int If_ManImproveNodeFaninCompact_int( If_Man_t * p, If_Obj_t * pObj, int nLimit
|
||||
return 1;
|
||||
if ( Vec_PtrSize(vFront) < nLimit && If_ManImproveNodeFaninCompact1(p, pObj, nLimit, vFront, vVisited) )
|
||||
return 1;
|
||||
if ( Vec_PtrSize(vFront) < nLimit && If_ManImproveNodeFaninCompact2(p, pObj, nLimit, vFront, vVisited) )
|
||||
return 1;
|
||||
// if ( Vec_PtrSize(vFront) < nLimit && If_ManImproveNodeFaninCompact2(p, pObj, nLimit, vFront, vVisited) )
|
||||
// return 1;
|
||||
assert( Vec_PtrSize(vFront) <= nLimit );
|
||||
return 0;
|
||||
}
|
||||
|
||||
+1
-1
@@ -212,7 +212,7 @@ void If_ManComputeRequired( If_Man_t * p )
|
||||
Vec_PtrForEachEntry( p->vMapped, pObj, i )
|
||||
If_CutPropagateRequired( p, If_ObjCutBest(pObj), pObj->Required );
|
||||
}
|
||||
|
||||
|
||||
/**Function*************************************************************
|
||||
|
||||
Synopsis [Computes area, references, and nodes used in the mapping.]
|
||||
|
||||
Reference in New Issue
Block a user