Commit 06100279 by Alan Mishchenko

Added DSD-based collapsing &dsd.

parent c8bfe83e
......@@ -3715,6 +3715,10 @@ SOURCE=.\src\aig\gia\giaCex.c
# End Source File
# Begin Source File
SOURCE=.\src\aig\gia\giaClp.c
# End Source File
# Begin Source File
SOURCE=.\src\aig\gia\giaCof.c
# End Source File
# Begin Source File
......
......@@ -207,7 +207,7 @@ Gia_Man_t * Gia_ManDomDerive( Gia_Man_t * p, Gia_Obj_t * pRoot, Vec_Int_t * vSup
Gia_Man_t * pNew, * pTemp;
int nMints = 1 << nVars;
int i, m, iResLit;
assert( nVars > 0 && nVars <= 5 );
assert( nVars >= 0 && nVars <= 5 );
pNew = Gia_ManStart( Gia_ManObjNum(p) );
pNew->pName = Abc_UtilStrsav( p->pName );
pNew->pSpec = Abc_UtilStrsav( p->pSpec );
......@@ -249,6 +249,8 @@ Gia_Man_t * Gia_ManDomDerive( Gia_Man_t * p, Gia_Obj_t * pRoot, Vec_Int_t * vSup
***********************************************************************/
void Gia_ManComputeDomsTry( Gia_Man_t * p )
{
extern void Gia_ManCollapseTestTest( Gia_Man_t * p );
Vec_Int_t * vSupp, * vSuppRefs;
Gia_Man_t * pNew;
Gia_Obj_t * pObj;
......@@ -272,7 +274,7 @@ void Gia_ManComputeDomsTry( Gia_Man_t * p )
if ( !Gia_ObjIsAnd(pObj) )
continue;
nSize = Gia_NodeMffcSizeSupp( p, pObj, vSupp, vSuppRefs );
if ( nSize < 30 || nSize > 100 )
if ( nSize < 10 )//|| nSize > 100 )
continue;
// sort by cost
Vec_IntSelectSortCost2( Vec_IntArray(vSupp), Vec_IntSize(vSupp), Vec_IntArray(vSuppRefs) );
......@@ -280,8 +282,8 @@ void Gia_ManComputeDomsTry( Gia_Man_t * p )
printf( "Obj %6d : ", i );
printf( "Cone = %4d ", nSize );
printf( "Supp = %4d ", Vec_IntSize(vSupp) );
Vec_IntForEachEntry( vSuppRefs, Entry, k )
printf( "%d(%d) ", -Entry, Gia_ObjLevelId(p, Vec_IntEntry(vSupp, k)) );
// Vec_IntForEachEntry( vSuppRefs, Entry, k )
// printf( "%d(%d) ", -Entry, Gia_ObjLevelId(p, Vec_IntEntry(vSupp, k)) );
printf( "\n" );
// selected k
......@@ -289,10 +291,13 @@ void Gia_ManComputeDomsTry( Gia_Man_t * p )
if ( Vec_IntEntry(vSuppRefs, k) == 1 )
break;
k = Abc_MinInt( k, 3 );
k = 0;
// dump
pNew = Gia_ManDomDerive( p, pObj, vSupp, k );
Gia_DumpAiger( pNew, "mffc", i, 6 );
Gia_ManCollapseTestTest( pNew );
Gia_ManStop( pNew );
}
Vec_IntFree( vSuppRefs );
......
......@@ -32,7 +32,7 @@ ABC_NAMESPACE_IMPL_START
#define ABC_MUX_CUBES 100000
static int Abc_ConvertZddToSop( DdManager * dd, DdNode * zCover, char * pSop, int nFanins, Vec_Str_t * vCube, int fPhase );
int Abc_ConvertZddToSop( DdManager * dd, DdNode * zCover, char * pSop, int nFanins, Vec_Str_t * vCube, int fPhase );
static DdNode * Abc_ConvertAigToBdd( DdManager * dd, Hop_Obj_t * pRoot);
static Hop_Obj_t * Abc_ConvertSopToAig( Hop_Man_t * pMan, char * pSop );
......
......@@ -347,6 +347,7 @@ static int Abc_CommandAbc9Frames ( Abc_Frame_t * pAbc, int argc, cha
static int Abc_CommandAbc9Retime ( Abc_Frame_t * pAbc, int argc, char ** argv );
static int Abc_CommandAbc9Enable ( Abc_Frame_t * pAbc, int argc, char ** argv );
static int Abc_CommandAbc9Dc2 ( Abc_Frame_t * pAbc, int argc, char ** argv );
static int Abc_CommandAbc9Dsd ( Abc_Frame_t * pAbc, int argc, char ** argv );
static int Abc_CommandAbc9Bidec ( Abc_Frame_t * pAbc, int argc, char ** argv );
static int Abc_CommandAbc9Shrink ( Abc_Frame_t * pAbc, int argc, char ** argv );
static int Abc_CommandAbc9Fx ( Abc_Frame_t * pAbc, int argc, char ** argv );
......@@ -929,6 +930,7 @@ void Abc_Init( Abc_Frame_t * pAbc )
Cmd_CommandAdd( pAbc, "ABC9", "&retime", Abc_CommandAbc9Retime, 0 );
Cmd_CommandAdd( pAbc, "ABC9", "&enable", Abc_CommandAbc9Enable, 0 );
Cmd_CommandAdd( pAbc, "ABC9", "&dc2", Abc_CommandAbc9Dc2, 0 );
Cmd_CommandAdd( pAbc, "ABC9", "&dsd", Abc_CommandAbc9Dsd, 0 );
Cmd_CommandAdd( pAbc, "ABC9", "&bidec", Abc_CommandAbc9Bidec, 0 );
Cmd_CommandAdd( pAbc, "ABC9", "&shrink", Abc_CommandAbc9Shrink, 0 );
Cmd_CommandAdd( pAbc, "ABC9", "&fx", Abc_CommandAbc9Fx, 0 );
......@@ -27521,6 +27523,58 @@ usage:
SeeAlso []
***********************************************************************/
int Abc_CommandAbc9Dsd( Abc_Frame_t * pAbc, int argc, char ** argv )
{
extern Gia_Man_t * Gia_ManCollapseTest( Gia_Man_t * p, int fVerbose );
Gia_Man_t * pTemp;
int c, fVerbose = 0;
int fUpdateLevel = 1;
Extra_UtilGetoptReset();
while ( ( c = Extra_UtilGetopt( argc, argv, "lvh" ) ) != EOF )
{
switch ( c )
{
case 'l':
fUpdateLevel ^= 1;
break;
case 'v':
fVerbose ^= 1;
break;
case 'h':
goto usage;
default:
goto usage;
}
}
if ( pAbc->pGia == NULL )
{
Abc_Print( -1, "Abc_CommandAbc9Dsd(): There is no AIG.\n" );
return 1;
}
pTemp = Gia_ManCollapseTest( pAbc->pGia, fVerbose );
Abc_FrameUpdateGia( pAbc, pTemp );
return 0;
usage:
Abc_Print( -2, "usage: &dsd [-vh]\n" );
Abc_Print( -2, "\t performs DSD-based collapsing\n" );
// Abc_Print( -2, "\t-l : toggle level update during rewriting [default = %s]\n", fUpdateLevel? "yes": "no" );
Abc_Print( -2, "\t-v : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
Abc_Print( -2, "\t-h : print the command usage\n");
return 1;
}
/**Function*************************************************************
Synopsis []
Description []
SideEffects []
SeeAlso []
***********************************************************************/
int Abc_CommandAbc9Bidec( Abc_Frame_t * pAbc, int argc, char ** argv )
{
Gia_Man_t * pTemp;
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