Commit fbc9c00f by Alan Mishchenko

Renaming DSD commands (dsd_tune -> dsd_match; dsd_clean -> dsd_filter).

parent 69bd3554
...@@ -1003,6 +1003,45 @@ int Abc_NtkLogicMakeSimpleCos2( Abc_Ntk_t * pNtk, int fDuplicate ) ...@@ -1003,6 +1003,45 @@ int Abc_NtkLogicMakeSimpleCos2( Abc_Ntk_t * pNtk, int fDuplicate )
SeeAlso [] SeeAlso []
***********************************************************************/ ***********************************************************************/
void Abc_NtkLogicMakeSimpleCosTest( Abc_Ntk_t * pNtk, int fDuplicate )
{
int nObjs = Abc_NtkObjNumMax(pNtk);
unsigned * pType = ABC_CALLOC( unsigned, nObjs );
Abc_Obj_t * pNode;
int i, Counts[4] = {0}, Consts[2] = {0}, Inputs[2] = {0};
// collect info
Abc_NtkForEachCo( pNtk, pNode, i )
{
if ( Abc_ObjFaninId0(pNode) == 0 )
Consts[Abc_ObjFaninC0(pNode)]++;
if ( Abc_ObjIsCi(Abc_ObjFanin0(pNode)) )
Inputs[Abc_ObjFaninC0(pNode)]++;
pType[Abc_ObjFaninId0(pNode)] |= (1 << Abc_ObjFaninC0(pNode));
}
// count the numbers
for ( i = 0; i < nObjs; i++ )
Counts[pType[i]]++;
for ( i = 0; i < 4; i++ )
printf( "%d = %d ", i, Counts[i] );
for ( i = 0; i < 2; i++ )
printf( "c%d = %d ", i, Consts[i] );
for ( i = 0; i < 2; i++ )
printf( "i%d = %d ", i, Inputs[i] );
printf( "\n" );
ABC_FREE( pType );
}
/**Function*************************************************************
Synopsis [Transforms the network to have simple COs.]
Description []
SideEffects []
SeeAlso []
***********************************************************************/
int Abc_NtkLogicMakeSimpleCos( Abc_Ntk_t * pNtk, int fDuplicate ) int Abc_NtkLogicMakeSimpleCos( Abc_Ntk_t * pNtk, int fDuplicate )
{ {
Vec_Ptr_t * vDrivers, * vCoTerms; Vec_Ptr_t * vDrivers, * vCoTerms;
...@@ -1010,6 +1049,7 @@ int Abc_NtkLogicMakeSimpleCos( Abc_Ntk_t * pNtk, int fDuplicate ) ...@@ -1010,6 +1049,7 @@ int Abc_NtkLogicMakeSimpleCos( Abc_Ntk_t * pNtk, int fDuplicate )
int i, k, LevelMax, nTotal = 0; int i, k, LevelMax, nTotal = 0;
assert( Abc_NtkIsLogic(pNtk) ); assert( Abc_NtkIsLogic(pNtk) );
LevelMax = Abc_NtkLevel(pNtk); LevelMax = Abc_NtkLevel(pNtk);
// Abc_NtkLogicMakeSimpleCosTest( pNtk, fDuplicate );
// fix constant drivers // fix constant drivers
Abc_NtkForEachCo( pNtk, pNode, i ) Abc_NtkForEachCo( pNtk, pNode, i )
......
...@@ -240,9 +240,9 @@ static int Abc_CommandDsdSave ( Abc_Frame_t * pAbc, int argc, cha ...@@ -240,9 +240,9 @@ static int Abc_CommandDsdSave ( Abc_Frame_t * pAbc, int argc, cha
static int Abc_CommandDsdLoad ( Abc_Frame_t * pAbc, int argc, char ** argv ); static int Abc_CommandDsdLoad ( Abc_Frame_t * pAbc, int argc, char ** argv );
static int Abc_CommandDsdFree ( Abc_Frame_t * pAbc, int argc, char ** argv ); static int Abc_CommandDsdFree ( Abc_Frame_t * pAbc, int argc, char ** argv );
static int Abc_CommandDsdPs ( Abc_Frame_t * pAbc, int argc, char ** argv ); static int Abc_CommandDsdPs ( Abc_Frame_t * pAbc, int argc, char ** argv );
static int Abc_CommandDsdTune ( Abc_Frame_t * pAbc, int argc, char ** argv ); static int Abc_CommandDsdMatch ( Abc_Frame_t * pAbc, int argc, char ** argv );
static int Abc_CommandDsdMerge ( Abc_Frame_t * pAbc, int argc, char ** argv ); static int Abc_CommandDsdMerge ( Abc_Frame_t * pAbc, int argc, char ** argv );
static int Abc_CommandDsdClean ( Abc_Frame_t * pAbc, int argc, char ** argv ); static int Abc_CommandDsdFilter ( Abc_Frame_t * pAbc, int argc, char ** argv );
static int Abc_CommandScut ( Abc_Frame_t * pAbc, int argc, char ** argv ); static int Abc_CommandScut ( Abc_Frame_t * pAbc, int argc, char ** argv );
static int Abc_CommandInit ( Abc_Frame_t * pAbc, int argc, char ** argv ); static int Abc_CommandInit ( Abc_Frame_t * pAbc, int argc, char ** argv );
...@@ -833,9 +833,9 @@ void Abc_Init( Abc_Frame_t * pAbc ) ...@@ -833,9 +833,9 @@ void Abc_Init( Abc_Frame_t * pAbc )
Cmd_CommandAdd( pAbc, "DSD manager", "dsd_load", Abc_CommandDsdLoad, 0 ); Cmd_CommandAdd( pAbc, "DSD manager", "dsd_load", Abc_CommandDsdLoad, 0 );
Cmd_CommandAdd( pAbc, "DSD manager", "dsd_free", Abc_CommandDsdFree, 0 ); Cmd_CommandAdd( pAbc, "DSD manager", "dsd_free", Abc_CommandDsdFree, 0 );
Cmd_CommandAdd( pAbc, "DSD manager", "dsd_ps", Abc_CommandDsdPs, 0 ); Cmd_CommandAdd( pAbc, "DSD manager", "dsd_ps", Abc_CommandDsdPs, 0 );
Cmd_CommandAdd( pAbc, "DSD manager", "dsd_tune", Abc_CommandDsdTune, 0 ); Cmd_CommandAdd( pAbc, "DSD manager", "dsd_match", Abc_CommandDsdMatch, 0 );
Cmd_CommandAdd( pAbc, "DSD manager", "dsd_merge", Abc_CommandDsdMerge, 0 ); Cmd_CommandAdd( pAbc, "DSD manager", "dsd_merge", Abc_CommandDsdMerge, 0 );
Cmd_CommandAdd( pAbc, "DSD manager", "dsd_clean", Abc_CommandDsdClean, 0 ); Cmd_CommandAdd( pAbc, "DSD manager", "dsd_filter", Abc_CommandDsdFilter, 0 );
// Cmd_CommandAdd( pAbc, "Sequential", "scut", Abc_CommandScut, 0 ); // Cmd_CommandAdd( pAbc, "Sequential", "scut", Abc_CommandScut, 0 );
Cmd_CommandAdd( pAbc, "Sequential", "init", Abc_CommandInit, 1 ); Cmd_CommandAdd( pAbc, "Sequential", "init", Abc_CommandInit, 1 );
...@@ -16055,7 +16055,7 @@ usage: ...@@ -16055,7 +16055,7 @@ usage:
SeeAlso [] SeeAlso []
***********************************************************************/ ***********************************************************************/
int Abc_CommandDsdTune( Abc_Frame_t * pAbc, int argc, char ** argv ) int Abc_CommandDsdMatch( Abc_Frame_t * pAbc, int argc, char ** argv )
{ {
char * pStruct = NULL; char * pStruct = NULL;
int c, fVerbose = 0, fFast = 0, fAdd = 0, fSpec = 0, LutSize = 0, nConfls = 10000, nProcs = 1; int c, fVerbose = 0, fFast = 0, fAdd = 0, fSpec = 0, LutSize = 0, nConfls = 10000, nProcs = 1;
...@@ -16133,8 +16133,8 @@ int Abc_CommandDsdTune( Abc_Frame_t * pAbc, int argc, char ** argv ) ...@@ -16133,8 +16133,8 @@ int Abc_CommandDsdTune( Abc_Frame_t * pAbc, int argc, char ** argv )
return 0; return 0;
usage: usage:
Abc_Print( -2, "usage: dsd_tune [-KCP num] [-fasvh] [-S str]\n" ); Abc_Print( -2, "usage: dsd_match [-KCP num] [-fasvh] [-S str]\n" );
Abc_Print( -2, "\t tunes DSD manager for the given LUT size\n" ); Abc_Print( -2, "\t matches DSD structures with the given cell\n" );
Abc_Print( -2, "\t-K num : LUT size used for tuning [default = %d]\n", LutSize ); Abc_Print( -2, "\t-K num : LUT size used for tuning [default = %d]\n", LutSize );
Abc_Print( -2, "\t-C num : the maximum number of conflicts [default = %d]\n", nConfls ); Abc_Print( -2, "\t-C num : the maximum number of conflicts [default = %d]\n", nConfls );
Abc_Print( -2, "\t-P num : the maximum number of processes [default = %d]\n", nProcs ); Abc_Print( -2, "\t-P num : the maximum number of processes [default = %d]\n", nProcs );
...@@ -16229,7 +16229,7 @@ usage: ...@@ -16229,7 +16229,7 @@ usage:
SeeAlso [] SeeAlso []
***********************************************************************/ ***********************************************************************/
int Abc_CommandDsdClean( Abc_Frame_t * pAbc, int argc, char ** argv ) int Abc_CommandDsdFilter( Abc_Frame_t * pAbc, int argc, char ** argv )
{ {
If_DsdMan_t * pDsd = (If_DsdMan_t *)Abc_FrameReadManDsd(); If_DsdMan_t * pDsd = (If_DsdMan_t *)Abc_FrameReadManDsd();
int c, nLimit = 0, nLutSize = -1, fCleanOccur = 0, fCleanMarks = 0, fVerbose = 0; int c, nLimit = 0, nLutSize = -1, fCleanOccur = 0, fCleanMarks = 0, fVerbose = 0;
...@@ -16287,8 +16287,8 @@ int Abc_CommandDsdClean( Abc_Frame_t * pAbc, int argc, char ** argv ) ...@@ -16287,8 +16287,8 @@ int Abc_CommandDsdClean( Abc_Frame_t * pAbc, int argc, char ** argv )
return 0; return 0;
usage: usage:
Abc_Print( -2, "usage: dsd_clean [-LK num] [-omvh]\n" ); Abc_Print( -2, "usage: dsd_filter [-LK num] [-omvh]\n" );
Abc_Print( -2, "\t modifying parameters of the DSD manager\n" ); Abc_Print( -2, "\t filtering structured and modifying parameters of DSD manager\n" );
Abc_Print( -2, "\t-L num : remove structures with fewer occurrences that this [default = %d]\n", nLimit ); Abc_Print( -2, "\t-L num : remove structures with fewer occurrences that this [default = %d]\n", nLimit );
Abc_Print( -2, "\t-K num : new LUT size to set for the DSD manager [default = %d]\n", nLutSize ); Abc_Print( -2, "\t-K num : new LUT size to set for the DSD manager [default = %d]\n", nLutSize );
Abc_Print( -2, "\t-o : toggles cleaning occurrence counters [default = %s]\n", fCleanOccur? "yes": "no" ); Abc_Print( -2, "\t-o : toggles cleaning occurrence counters [default = %s]\n", fCleanOccur? "yes": "no" );
...@@ -299,7 +299,7 @@ void Wlc_WriteVerInt( FILE * pFile, Wlc_Ntk_t * p ) ...@@ -299,7 +299,7 @@ void Wlc_WriteVerInt( FILE * pFile, Wlc_Ntk_t * p )
fprintf( pFile, "CPL_FF" ); fprintf( pFile, "CPL_FF" );
if ( Wlc_ObjRange(pObj) > 1 ) if ( Wlc_ObjRange(pObj) > 1 )
fprintf( pFile, "#%d", Wlc_ObjRange(pObj) ); fprintf( pFile, "#%d", Wlc_ObjRange(pObj) );
fprintf( pFile, " %reg%d (", i ); fprintf( pFile, " reg%d (", i );
fprintf( pFile, " .q( %s ),", pName ); fprintf( pFile, " .q( %s ),", pName );
fprintf( pFile, " .qbar()," ); fprintf( pFile, " .qbar()," );
fprintf( pFile, " .d( %s ),", Wlc_ObjName(p, Wlc_ObjId(p, Wlc_ObjFoToFi(p, pObj))) ); fprintf( pFile, " .d( %s ),", Wlc_ObjName(p, Wlc_ObjId(p, Wlc_ObjFoToFi(p, pObj))) );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment