From 90529df0592ed261a4c6685ffeb41ac6abf6e422 Mon Sep 17 00:00:00 2001 From: Alan Mishchenko Date: Mon, 29 Oct 2012 13:39:05 -0700 Subject: Tentatively integrated new DSD. --- src/base/abci/abc.c | 1 + src/base/abci/abcDec.c | 22 +++++++++++++++++++++- src/opt/dau/dauDsd.c | 2 +- 3 files changed, 23 insertions(+), 2 deletions(-) diff --git a/src/base/abci/abc.c b/src/base/abci/abc.c index 0da5cde6..c1a1dfe2 100644 --- a/src/base/abci/abc.c +++ b/src/base/abci/abc.c @@ -4838,6 +4838,7 @@ usage: Abc_Print( -2, "\t 1: algebraic factoring applied to ISOP\n" ); Abc_Print( -2, "\t 2: bi-decomposition with cofactoring\n" ); Abc_Print( -2, "\t 3: disjoint-support decomposition with cofactoring\n" ); + Abc_Print( -2, "\t 4: updated disjoint-support decomposition with cofactoring\n" ); Abc_Print( -2, "\t-N : the number of support variables (binary files only) [default = unused]\n" ); Abc_Print( -2, "\t-v : toggle verbose printout [default = %s]\n", fVerbose? "yes": "no" ); Abc_Print( -2, "\t-h : print the command usage\n"); diff --git a/src/base/abci/abcDec.c b/src/base/abci/abcDec.c index 776ecda1..f5dce96e 100644 --- a/src/base/abci/abcDec.c +++ b/src/base/abci/abcDec.c @@ -473,6 +473,8 @@ void Abc_TruthDecPerform( Abc_TtStore_t * p, int DecType, int fVerbose ) pAlgoName = "bi-decomp"; else if ( DecType == 3 ) pAlgoName = "DSD"; + else if ( DecType == 4 ) + pAlgoName = "fast DSD"; if ( pAlgoName ) printf( "Applying %-10s to %8d func%s of %2d vars... ", @@ -537,6 +539,24 @@ void Abc_TruthDecPerform( Abc_TtStore_t * p, int DecType, int fVerbose ) Kit_DsdNtkFree( pNtk ); } } + else if ( DecType == 4 ) + { + extern void Dau_DsdTestOne( word t, int i ); + if ( p->nVars != 6 ) + { + printf( "Currently only works for 6 variables.\n" ); + return; + } + // perform disjoint-support decomposition and count AIG nodes + // (non-DSD blocks are decomposed into 2:1 MUXes, each counting as 3 AIG nodes) + assert( p->nVars == 6 ); + for ( i = 0; i < p->nFuncs; i++ ) + { + if ( fVerbose ) + printf( "%7d : ", i ); + Dau_DsdTestOne( *p->pFuncs[i], i ); + } + } else assert( 0 ); printf( "AIG nodes =%9d ", nNodes ); @@ -587,7 +607,7 @@ int Abc_DecTest( char * pFileName, int DecType, int nVarNum, int fVerbose ) printf( "Using truth tables from file \"%s\"...\n", pFileName ); if ( DecType == 0 ) { if ( nVarNum < 0 ) Abc_TtStoreTest( pFileName ); } - else if ( DecType >= 1 && DecType <= 3 ) + else if ( DecType >= 1 && DecType <= 4 ) Abc_TruthDecTest( pFileName, DecType, nVarNum, fVerbose ); else printf( "Unknown decomposition type value (%d).\n", DecType ); diff --git a/src/opt/dau/dauDsd.c b/src/opt/dau/dauDsd.c index 6f970b62..262314d8 100644 --- a/src/opt/dau/dauDsd.c +++ b/src/opt/dau/dauDsd.c @@ -443,7 +443,7 @@ void Dau_DsdTestOne( word t, int i ) { word t2; char * p = Dau_DsdPerform( t ); -// return; + return; t2 = Dau_DsdToTruth( p ); if ( t != t2 ) { -- cgit v1.2.3