mirror of
https://github.com/YosysHQ/abc.git
synced 2026-09-03 08:25:20 +02:00
Changes to the matching procedure.
This commit is contained in:
+9
-5
@@ -121,7 +121,7 @@ struct If_Par_t_
|
||||
float * pTimesReq; // required times
|
||||
int (* pFuncCost) (If_Cut_t *); // procedure to compute the user's cost of a cut
|
||||
int (* pFuncUser) (If_Man_t *, If_Obj_t *, If_Cut_t *); // procedure called for each cut when cut computation is finished
|
||||
int (* pFuncCell) (unsigned *, int, int); // procedure called for cut functions
|
||||
int (* pFuncCell) (unsigned *, int, int, char *); // procedure called for cut functions
|
||||
void * pReoMan; // reordering manager
|
||||
};
|
||||
|
||||
@@ -184,7 +184,10 @@ struct If_Man_t_
|
||||
If_Set_t * pFreeList; // the list of free cutsets
|
||||
int nSmallSupp; // the small support
|
||||
int nCutsTotal;
|
||||
int nCutsUseless;
|
||||
int nCutsUseless[32];
|
||||
int nCutsCount[32];
|
||||
int nCutsCountAll;
|
||||
int nCutsUselessAll;
|
||||
// timing manager
|
||||
Tim_Man_t * pManTim;
|
||||
Vec_Int_t * vCoAttrs; // CO attributes 0=optimize; 1=keep; 2=relax
|
||||
@@ -413,9 +416,10 @@ extern float If_CutPowerRef( If_Man_t * p, If_Cut_t * pCut, If_Obj_t *
|
||||
extern float If_CutPowerDerefed( If_Man_t * p, If_Cut_t * pCut, If_Obj_t * pRoot );
|
||||
extern float If_CutPowerRefed( If_Man_t * p, If_Cut_t * pCut, If_Obj_t * pRoot );
|
||||
/*=== ifDec.c =============================================================*/
|
||||
extern int If_CutPerformCheck07( unsigned * pTruth, int nVars, int nLeaves );
|
||||
extern int If_CutPerformCheck08( unsigned * pTruth, int nVars, int nLeaves );
|
||||
extern int If_CutPerformCheck10( unsigned * pTruth, int nVars, int nLeaves );
|
||||
extern int If_CutPerformCheck07( unsigned * pTruth, int nVars, int nLeaves, char * pStr );
|
||||
extern int If_CutPerformCheck08( unsigned * pTruth, int nVars, int nLeaves, char * pStr );
|
||||
extern int If_CutPerformCheck10( unsigned * pTruth, int nVars, int nLeaves, char * pStr );
|
||||
extern int If_CutPerformCheck16( unsigned * pTruth, int nVars, int nLeaves, char * pStr );
|
||||
extern float If_CutDelayLutStruct( If_Man_t * p, If_Cut_t * pCut, char * pStr, float WireDelay );
|
||||
/*=== ifLib.c =============================================================*/
|
||||
extern If_Lib_t * If_LutLibRead( char * FileName );
|
||||
|
||||
+1
-1
@@ -685,7 +685,7 @@ void If_CutSort( If_Man_t * p, If_Set_t * pCutSet, If_Cut_t * pCut )
|
||||
return;
|
||||
}
|
||||
|
||||
if ( (p->pPars->fUseBat || p->pPars->fEnableCheck07 || p->pPars->fEnableCheck08 || p->pPars->fEnableCheck10) && !pCut->fUseless )
|
||||
if ( (p->pPars->fUseBat || p->pPars->fEnableCheck07 || p->pPars->fEnableCheck08 || p->pPars->fEnableCheck10 || p->pPars->pLutStruct) && !pCut->fUseless )
|
||||
{
|
||||
If_Cut_t * pFirst = pCutSet->ppCuts[0];
|
||||
if ( pFirst->fUseless || If_ManSortCompare(p, pFirst, pCut) == 1 )
|
||||
|
||||
@@ -673,9 +673,9 @@ int If_Dec7PickBestMux( word t[2], word c0r[2], word c1r[2] )
|
||||
SeeAlso []
|
||||
|
||||
***********************************************************************/
|
||||
int If_CutPerformCheck07( unsigned * pTruth, int nVars, int nLeaves )
|
||||
int If_CutPerformCheck07( unsigned * pTruth, int nVars, int nLeaves, char * pStr )
|
||||
{
|
||||
int fDerive = 1;
|
||||
int fDerive = 0;
|
||||
if ( nLeaves < 6 )
|
||||
return 1;
|
||||
if ( nLeaves == 6 )
|
||||
@@ -685,7 +685,10 @@ int If_CutPerformCheck07( unsigned * pTruth, int nVars, int nLeaves )
|
||||
return 1;
|
||||
z = If_Dec6Perform( t, fDerive );
|
||||
if ( fDerive && z )
|
||||
{
|
||||
// If_DecPrintConfig( z );
|
||||
If_Dec6Verify( t, z );
|
||||
}
|
||||
return z != 0;
|
||||
}
|
||||
if ( nLeaves == 7 )
|
||||
@@ -698,8 +701,6 @@ int If_CutPerformCheck07( unsigned * pTruth, int nVars, int nLeaves )
|
||||
z = If_Dec7Perform( t, fDerive );
|
||||
if ( fDerive && z )
|
||||
If_Dec7Verify( t, z );
|
||||
|
||||
|
||||
return z != 0;
|
||||
}
|
||||
assert( 0 );
|
||||
|
||||
@@ -478,7 +478,7 @@ printf( "\n" );
|
||||
SeeAlso []
|
||||
|
||||
***********************************************************************/
|
||||
int If_CutPerformCheck08( unsigned * pTruth, int nVars, int nLeaves )
|
||||
int If_CutPerformCheck08( unsigned * pTruth, int nVars, int nLeaves, char * pStr )
|
||||
{
|
||||
int nSupp, fDerive = 0;
|
||||
word z[2] = {0}, pF[16];
|
||||
|
||||
@@ -477,7 +477,7 @@ printf( "\n" );
|
||||
SeeAlso []
|
||||
|
||||
***********************************************************************/
|
||||
int If_CutPerformCheck10( unsigned * pTruth, int nVars, int nLeaves )
|
||||
int If_CutPerformCheck10( unsigned * pTruth, int nVars, int nLeaves, char * pStr )
|
||||
{
|
||||
int nSupp, fDerive = 0;
|
||||
word z[2] = {0}, pF[16];
|
||||
|
||||
+625
-195
File diff suppressed because it is too large
Load Diff
+9
-2
@@ -127,8 +127,15 @@ void If_ManRestart( If_Man_t * p )
|
||||
***********************************************************************/
|
||||
void If_ManStop( If_Man_t * p )
|
||||
{
|
||||
if ( p->nCutsUseless && p->pPars->fVerbose )
|
||||
Abc_Print( 1, "Useless cuts = %7d (out of %7d) (%6.2f %%)\n", p->nCutsUseless, p->nCutsTotal, 100.0*p->nCutsUseless/(p->nCutsTotal+1) );
|
||||
// if ( p->nCutsUselessAll && p->pPars->fVerbose )
|
||||
if ( p->nCutsUselessAll )
|
||||
{
|
||||
int i;
|
||||
for ( i = 0; i <= 16; i++ )
|
||||
if ( p->nCutsUseless[i] )
|
||||
Abc_Print( 1, "Useless cuts %2d = %7d (out of %7d) (%6.2f %%)\n", i, p->nCutsUseless[i], p->nCutsCount[i], 100.0*p->nCutsUseless[i]/(p->nCutsCount[i]+1) );
|
||||
Abc_Print( 1, "Useless cuts all = %7d (out of %7d) (%6.2f %%)\n", p->nCutsUselessAll, p->nCutsCountAll, 100.0*p->nCutsUselessAll/(p->nCutsCountAll+1) );
|
||||
}
|
||||
// Abc_PrintTime( 1, "Truth", p->timeTruth );
|
||||
// Abc_Print( 1, "Small support = %d.\n", p->nSmallSupp );
|
||||
Vec_IntFreeP( &p->vCoAttrs );
|
||||
|
||||
+14
-9
@@ -153,9 +153,10 @@ void If_ObjPerformMappingAnd( If_Man_t * p, If_Obj_t * pObj, int Mode, int fPrep
|
||||
if ( pCut->nLeaves > 0 )
|
||||
{
|
||||
// recompute the parameters of the best cut
|
||||
if ( p->pPars->pLutStruct )
|
||||
pCut->Delay = If_CutDelayLutStruct( p, pCut, p->pPars->pLutStruct, p->pPars->WireDelay );
|
||||
else if ( p->pPars->fDelayOpt )
|
||||
/// if ( p->pPars->pLutStruct )
|
||||
/// pCut->Delay = If_CutDelayLutStruct( p, pCut, p->pPars->pLutStruct, p->pPars->WireDelay );
|
||||
// else if ( p->pPars->fDelayOpt )
|
||||
if ( p->pPars->fDelayOpt )
|
||||
pCut->Delay = If_CutDelaySopCost( p, pCut );
|
||||
else
|
||||
pCut->Delay = If_CutDelay( p, pObj, pCut );
|
||||
@@ -205,9 +206,12 @@ void If_ObjPerformMappingAnd( If_Man_t * p, If_Obj_t * pObj, int Mode, int fPrep
|
||||
pCut->fUseless = 0;
|
||||
if ( p->pPars->pFuncCell && RetValue < 2 )
|
||||
{
|
||||
assert( pCut->nLimit >= 4 && pCut->nLimit <= 10 );
|
||||
pCut->fUseless = !p->pPars->pFuncCell( If_CutTruth(pCut), pCut->nLimit, pCut->nLeaves );
|
||||
p->nCutsUseless += pCut->fUseless;
|
||||
assert( pCut->nLimit >= 4 && pCut->nLimit <= 16 );
|
||||
pCut->fUseless = !p->pPars->pFuncCell( If_CutTruth(pCut), pCut->nLimit, pCut->nLeaves, p->pPars->pLutStruct );
|
||||
p->nCutsUselessAll += pCut->fUseless;
|
||||
p->nCutsUseless[pCut->nLeaves] += pCut->fUseless;
|
||||
p->nCutsCountAll++;
|
||||
p->nCutsCount[pCut->nLeaves]++;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -217,9 +221,10 @@ void If_ObjPerformMappingAnd( If_Man_t * p, If_Obj_t * pObj, int Mode, int fPrep
|
||||
if ( pCut->Cost == IF_COST_MAX )
|
||||
continue;
|
||||
// check if the cut satisfies the required times
|
||||
if ( p->pPars->pLutStruct )
|
||||
pCut->Delay = If_CutDelayLutStruct( p, pCut, p->pPars->pLutStruct, p->pPars->WireDelay );
|
||||
else if ( p->pPars->fDelayOpt )
|
||||
/// if ( p->pPars->pLutStruct )
|
||||
/// pCut->Delay = If_CutDelayLutStruct( p, pCut, p->pPars->pLutStruct, p->pPars->WireDelay );
|
||||
// else if ( p->pPars->fDelayOpt )
|
||||
if ( p->pPars->fDelayOpt )
|
||||
pCut->Delay = If_CutDelaySopCost( p, pCut );
|
||||
else
|
||||
pCut->Delay = If_CutDelay( p, pObj, pCut );
|
||||
|
||||
Reference in New Issue
Block a user