Commit 4aa33e7d by Alan Mishchenko

Structural reparametrization.

parent b71d4425
...@@ -888,6 +888,7 @@ extern word Gia_ObjComputeTruthTable6( Gia_Man_t * p, Gia_Obj_t * ...@@ -888,6 +888,7 @@ extern word Gia_ObjComputeTruthTable6( Gia_Man_t * p, Gia_Obj_t *
extern void Gia_ObjCollectInternal( Gia_Man_t * p, Gia_Obj_t * pObj ); extern void Gia_ObjCollectInternal( Gia_Man_t * p, Gia_Obj_t * pObj );
extern unsigned * Gia_ObjComputeTruthTable( Gia_Man_t * p, Gia_Obj_t * pObj ); extern unsigned * Gia_ObjComputeTruthTable( Gia_Man_t * p, Gia_Obj_t * pObj );
extern void Gia_ObjComputeTruthTableStart( Gia_Man_t * p, int nVarsMax ); extern void Gia_ObjComputeTruthTableStart( Gia_Man_t * p, int nVarsMax );
extern void Gia_ObjComputeTruthTableStop( Gia_Man_t * p );
extern unsigned * Gia_ObjComputeTruthTableCut( Gia_Man_t * p, Gia_Obj_t * pObj, Vec_Int_t * vLeaves ); extern unsigned * Gia_ObjComputeTruthTableCut( Gia_Man_t * p, Gia_Obj_t * pObj, Vec_Int_t * vLeaves );
/*=== giaTsim.c ============================================================*/ /*=== giaTsim.c ============================================================*/
extern Gia_Man_t * Gia_ManReduceConst( Gia_Man_t * pAig, int fVerbose ); extern Gia_Man_t * Gia_ManReduceConst( Gia_Man_t * pAig, int fVerbose );
......
...@@ -285,6 +285,15 @@ void Gia_ObjComputeTruthTableStart( Gia_Man_t * p, int nVarsMax ) ...@@ -285,6 +285,15 @@ void Gia_ObjComputeTruthTableStart( Gia_Man_t * p, int nVarsMax )
p->vTtInputs = Vec_PtrAllocTruthTables( p->nTtVars ); p->vTtInputs = Vec_PtrAllocTruthTables( p->nTtVars );
p->vTtMemory = Vec_WrdStart( p->nTtWords * 256 ); p->vTtMemory = Vec_WrdStart( p->nTtWords * 256 );
} }
void Gia_ObjComputeTruthTableStop( Gia_Man_t * p )
{
p->nTtVars = 0;
p->nTtWords = 0;
Vec_StrFreeP( &p->vTtNums );
Vec_IntFreeP( &p->vTtNodes );
Vec_PtrFreeP( &p->vTtInputs );
Vec_WrdFreeP( &p->vTtMemory );
}
/**Function************************************************************* /**Function*************************************************************
...@@ -303,7 +312,7 @@ unsigned * Gia_ObjComputeTruthTableCut( Gia_Man_t * p, Gia_Obj_t * pRoot, Vec_In ...@@ -303,7 +312,7 @@ unsigned * Gia_ObjComputeTruthTableCut( Gia_Man_t * p, Gia_Obj_t * pRoot, Vec_In
word * pTruth, * pTruthL, * pTruth0, * pTruth1; word * pTruth, * pTruthL, * pTruth0, * pTruth1;
int i; int i;
assert( p->vTtMemory != NULL ); assert( p->vTtMemory != NULL );
assert( p->nTtVars <= Vec_IntSize(vLeaves) ); assert( Vec_IntSize(vLeaves) <= p->nTtVars );
// collect internal nodes // collect internal nodes
Gia_ObjCollectInternalCut( p, pRoot, vLeaves ); Gia_ObjCollectInternalCut( p, pRoot, vLeaves );
// compute the truth table for internal nodes // compute the truth table for internal nodes
......
...@@ -26784,18 +26784,33 @@ usage: ...@@ -26784,18 +26784,33 @@ usage:
***********************************************************************/ ***********************************************************************/
int Abc_CommandAbc9Rpm( Abc_Frame_t * pAbc, int argc, char ** argv ) int Abc_CommandAbc9Rpm( Abc_Frame_t * pAbc, int argc, char ** argv )
{ {
extern Gia_Man_t * Abs_RpmPerform( Gia_Man_t * p, int nCutMax, int fVerbose ); extern Gia_Man_t * Abs_RpmPerform( Gia_Man_t * p, int nCutMax, int fVerbose, int fVeryVerbose );
Gia_Man_t * pTemp; Gia_Man_t * pTemp;
int nCutMax = 6; int c, nCutMax = 6;
int c, fVerbose = 0; int fVerbose = 0;
int fVeryVerbose = 0;
Extra_UtilGetoptReset(); Extra_UtilGetoptReset();
while ( ( c = Extra_UtilGetopt( argc, argv, "vh" ) ) != EOF ) while ( ( c = Extra_UtilGetopt( argc, argv, "Cvwh" ) ) != EOF )
{ {
switch ( c ) switch ( c )
{ {
case 'C':
if ( globalUtilOptind >= argc )
{
Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
goto usage;
}
nCutMax = atoi(argv[globalUtilOptind]);
globalUtilOptind++;
if ( nCutMax < 0 )
goto usage;
break;
case 'v': case 'v':
fVerbose ^= 1; fVerbose ^= 1;
break; break;
case 'w':
fVeryVerbose ^= 1;
break;
case 'h': case 'h':
goto usage; goto usage;
default: default:
...@@ -26807,16 +26822,17 @@ int Abc_CommandAbc9Rpm( Abc_Frame_t * pAbc, int argc, char ** argv ) ...@@ -26807,16 +26822,17 @@ int Abc_CommandAbc9Rpm( Abc_Frame_t * pAbc, int argc, char ** argv )
Abc_Print( -1, "Abc_CommandAbc9Rpm(): There is no AIG.\n" ); Abc_Print( -1, "Abc_CommandAbc9Rpm(): There is no AIG.\n" );
return 0; return 0;
} }
pTemp = Abs_RpmPerform( pAbc->pGia, nCutMax, fVerbose ); pTemp = Abs_RpmPerform( pAbc->pGia, nCutMax, fVerbose, fVeryVerbose );
if ( pTemp ) if ( pTemp )
Abc_CommandUpdate9( pAbc, pTemp ); Abc_CommandUpdate9( pAbc, pTemp );
return 0; return 0;
usage: usage:
Abc_Print( -2, "usage: &rpm [-K num] [-vh]\n" ); Abc_Print( -2, "usage: &rpm [-C num] [-vwh]\n" );
Abc_Print( -2, "\t performs structural reparametrization\n" ); Abc_Print( -2, "\t performs structural reparametrization\n" );
Abc_Print( -2, "\t-K num : the max cut size used for testing [default = %d]\n", nCutMax ); Abc_Print( -2, "\t-C num : max cut size for testing range equivalence [default = %d]\n", nCutMax );
Abc_Print( -2, "\t-v : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" ); Abc_Print( -2, "\t-v : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
Abc_Print( -2, "\t-w : toggle printing more verbose information [default = %s]\n", fVeryVerbose? "yes": "no" );
Abc_Print( -2, "\t-h : print the command usage\n"); Abc_Print( -2, "\t-h : print the command usage\n");
return 1; return 1;
} }
......
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