mirror of
https://github.com/YosysHQ/abc.git
synced 2026-09-03 16:29:14 +02:00
Version abc70407
This commit is contained in:
@@ -234,6 +234,9 @@ struct Lut_Par_t_
|
||||
int nLutsMax; // (N) the maximum number of LUTs in the structure
|
||||
int nLutsOver; // (Q) the maximum number of LUTs not in the MFFC
|
||||
int nVarsShared; // (S) the maximum number of shared variables (crossbars)
|
||||
int nGrowthLevel; // (L) the maximum increase in the node level after resynthesis
|
||||
int fSatur; // iterate till saturation
|
||||
int fZeroCost; // accept zero-cost replacements
|
||||
int fVerbose; // the verbosiness flag
|
||||
int fVeryVerbose; // additional verbose info printout
|
||||
// internal parameters
|
||||
|
||||
@@ -38,6 +38,8 @@ static bool Abc_NtkComparePis( Abc_Ntk_t * pNtk1, Abc_Ntk_t * pNtk2, int fComb )
|
||||
static bool Abc_NtkComparePos( Abc_Ntk_t * pNtk1, Abc_Ntk_t * pNtk2, int fComb );
|
||||
static bool Abc_NtkCompareLatches( Abc_Ntk_t * pNtk1, Abc_Ntk_t * pNtk2, int fComb );
|
||||
|
||||
static inline char * Abc_ObjNameNet( Abc_Obj_t * pObj ) { return (Abc_ObjIsNode(pObj) && Abc_NtkIsNetlist(pObj->pNtk)) ? Abc_ObjName(Abc_ObjFanout0(pObj)) : Abc_ObjName(pObj); }
|
||||
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
/// FUNCTION DEFINITIONS ///
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
@@ -523,7 +525,7 @@ bool Abc_NtkCheckNode( Abc_Ntk_t * pNtk, Abc_Obj_t * pNode )
|
||||
// the node should have a function assigned unless it is an AIG
|
||||
if ( pNode->pData == NULL )
|
||||
{
|
||||
fprintf( stdout, "NodeCheck: An internal node \"%s\" does not have a logic function.\n", Abc_NtkIsNetlist(pNode->pNtk)? Abc_ObjName(Abc_ObjFanout0(pNode)) : Abc_ObjName(pNode) );
|
||||
fprintf( stdout, "NodeCheck: An internal node \"%s\" does not have a logic function.\n", Abc_ObjNameNet(pNode) );
|
||||
return 0;
|
||||
}
|
||||
// the netlist and SOP logic network should have SOPs
|
||||
@@ -531,7 +533,7 @@ bool Abc_NtkCheckNode( Abc_Ntk_t * pNtk, Abc_Obj_t * pNode )
|
||||
{
|
||||
if ( !Abc_SopCheck( pNode->pData, Abc_ObjFaninNum(pNode) ) )
|
||||
{
|
||||
fprintf( stdout, "NodeCheck: SOP check for node \"%s\" has failed.\n", Abc_ObjName(pNode) );
|
||||
fprintf( stdout, "NodeCheck: SOP check for node \"%s\" has failed.\n", Abc_ObjNameNet(pNode) );
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
@@ -540,7 +542,7 @@ bool Abc_NtkCheckNode( Abc_Ntk_t * pNtk, Abc_Obj_t * pNode )
|
||||
int nSuppSize = Cudd_SupportSize(pNtk->pManFunc, pNode->pData);
|
||||
if ( nSuppSize > Abc_ObjFaninNum(pNode) )
|
||||
{
|
||||
fprintf( stdout, "NodeCheck: BDD of the node \"%s\" has incorrect support size.\n", Abc_ObjName(pNode) );
|
||||
fprintf( stdout, "NodeCheck: BDD of the node \"%s\" has incorrect support size.\n", Abc_ObjNameNet(pNode) );
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
+30
-6
@@ -1264,9 +1264,9 @@ int Abc_CommandPrintKMap( Abc_Frame_t * pAbc, int argc, char ** argv )
|
||||
return 1;
|
||||
}
|
||||
|
||||
if ( !Abc_NtkIsBddLogic(pNtk) )
|
||||
if ( !Abc_NtkIsLogic(pNtk) )
|
||||
{
|
||||
fprintf( pErr, "Visualizing Karnaugh map works for BDD logic networks (run \"bdd\").\n" );
|
||||
fprintf( pErr, "Visualization of Karnaugh maps works for logic networks.\n" );
|
||||
return 1;
|
||||
}
|
||||
if ( argc > globalUtilOptind + 1 )
|
||||
@@ -1292,6 +1292,7 @@ int Abc_CommandPrintKMap( Abc_Frame_t * pAbc, int argc, char ** argv )
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
Abc_NtkToBdd(pNtk);
|
||||
Abc_NodePrintKMap( pNode, fUseRealNames );
|
||||
return 0;
|
||||
|
||||
@@ -2908,12 +2909,15 @@ int Abc_CommandLutpack( Abc_Frame_t * pAbc, int argc, char ** argv )
|
||||
// set defaults
|
||||
memset( pPars, 0, sizeof(Lut_Par_t) );
|
||||
pPars->nLutsMax = 4; // (N) the maximum number of LUTs in the structure
|
||||
pPars->nLutsOver = 2; // (Q) the maximum number of LUTs not in the MFFC
|
||||
pPars->nLutsOver = 3; // (Q) the maximum number of LUTs not in the MFFC
|
||||
pPars->nVarsShared = 0; // (S) the maximum number of shared variables (crossbars)
|
||||
pPars->fVerbose = 0;
|
||||
pPars->nGrowthLevel = 1;
|
||||
pPars->fSatur = 1;
|
||||
pPars->fZeroCost = 0;
|
||||
pPars->fVerbose = 1;
|
||||
pPars->fVeryVerbose = 0;
|
||||
Extra_UtilGetoptReset();
|
||||
while ( ( c = Extra_UtilGetopt( argc, argv, "NQSvwh" ) ) != EOF )
|
||||
while ( ( c = Extra_UtilGetopt( argc, argv, "NQSLszvwh" ) ) != EOF )
|
||||
{
|
||||
switch ( c )
|
||||
{
|
||||
@@ -2950,6 +2954,23 @@ int Abc_CommandLutpack( Abc_Frame_t * pAbc, int argc, char ** argv )
|
||||
if ( pPars->nVarsShared < 0 || pPars->nVarsShared > 4 )
|
||||
goto usage;
|
||||
break;
|
||||
case 'L':
|
||||
if ( globalUtilOptind >= argc )
|
||||
{
|
||||
fprintf( pErr, "Command line switch \"-L\" should be followed by an integer.\n" );
|
||||
goto usage;
|
||||
}
|
||||
pPars->nGrowthLevel = atoi(argv[globalUtilOptind]);
|
||||
globalUtilOptind++;
|
||||
if ( pPars->nGrowthLevel < 0 || pPars->nGrowthLevel > ABC_INFINITY )
|
||||
goto usage;
|
||||
break;
|
||||
case 's':
|
||||
pPars->fSatur ^= 1;
|
||||
break;
|
||||
case 'z':
|
||||
pPars->fZeroCost ^= 1;
|
||||
break;
|
||||
case 'v':
|
||||
pPars->fVerbose ^= 1;
|
||||
break;
|
||||
@@ -2983,11 +3004,14 @@ int Abc_CommandLutpack( Abc_Frame_t * pAbc, int argc, char ** argv )
|
||||
return 0;
|
||||
|
||||
usage:
|
||||
fprintf( pErr, "usage: lutpack [-N <num>] [-Q <num>] [-S <num>] [-vwh]\n" );
|
||||
fprintf( pErr, "usage: lutpack [-N <num>] [-Q <num>] [-S <num>] [-L <num>] [-szvwh]\n" );
|
||||
fprintf( pErr, "\t performs \"rewriting\" for LUT networks\n" );
|
||||
fprintf( pErr, "\t-N <num> : the max number of LUTs in the structure (2 <= num) [default = %d]\n", pPars->nLutsMax );
|
||||
fprintf( pErr, "\t-Q <num> : the max number of LUTs not in MFFC (0 <= num) [default = %d]\n", pPars->nLutsOver );
|
||||
fprintf( pErr, "\t-S <num> : the max number of LUT inputs shared (0 <= num) [default = %d]\n", pPars->nVarsShared );
|
||||
fprintf( pErr, "\t-L <num> : the largest increase in node level after resynthesis (0 <= num) [default = %d]\n", pPars->nGrowthLevel );
|
||||
fprintf( pErr, "\t-s : toggle iteration till saturation [default = %s]\n", pPars->fSatur? "yes": "no" );
|
||||
fprintf( pErr, "\t-z : toggle zero-cost replacements [default = %s]\n", pPars->fZeroCost? "yes": "no" );
|
||||
fprintf( pErr, "\t-v : toggle verbose printout [default = %s]\n", pPars->fVerbose? "yes": "no" );
|
||||
fprintf( pErr, "\t-w : toggle printout subgraph statistics [default = %s]\n", pPars->fVeryVerbose? "yes": "no" );
|
||||
fprintf( pErr, "\t-h : print the command usage\n");
|
||||
|
||||
+735
-100
File diff suppressed because it is too large
Load Diff
@@ -28,7 +28,7 @@
|
||||
|
||||
static If_Man_t * Abc_NtkToIf( Abc_Ntk_t * pNtk, If_Par_t * pPars );
|
||||
static Abc_Ntk_t * Abc_NtkFromIf( If_Man_t * pIfMan, Abc_Ntk_t * pNtk );
|
||||
static Abc_Obj_t * Abc_NodeFromIf_rec( Abc_Ntk_t * pNtkNew, If_Man_t * pIfMan, If_Obj_t * pIfObj, Vec_Int_t * vCover );
|
||||
extern Abc_Obj_t * Abc_NodeFromIf_rec( Abc_Ntk_t * pNtkNew, If_Man_t * pIfMan, If_Obj_t * pIfObj, Vec_Int_t * vCover );
|
||||
static Hop_Obj_t * Abc_NodeIfToHop( Hop_Man_t * pHopMan, If_Man_t * pIfMan, If_Obj_t * pIfObj );
|
||||
static Vec_Ptr_t * Abc_NtkFindGoodOrder( Abc_Ntk_t * pNtk );
|
||||
|
||||
@@ -262,6 +262,11 @@ Abc_Obj_t * Abc_NodeFromIf_rec( Abc_Ntk_t * pNtkNew, If_Man_t * pIfMan, If_Obj_t
|
||||
If_CutForEachLeaf( pIfMan, pCutBest, pIfLeaf, i )
|
||||
Abc_ObjAddFanin( pNodeNew, Abc_NodeFromIf_rec(pNtkNew, pIfMan, pIfLeaf, vCover) );
|
||||
}
|
||||
// set the level of the new node
|
||||
{
|
||||
extern int Res_UpdateNetworkLevelNew( Abc_Obj_t * pObj );
|
||||
pNodeNew->Level = Res_UpdateNetworkLevelNew( pNodeNew );
|
||||
}
|
||||
// derive the function of this node
|
||||
if ( pIfMan->pPars->fTruth )
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user