From d56570f23547fe6d14a6185ebf19e827ec8d8f61 Mon Sep 17 00:00:00 2001 From: Alan Mishchenko Date: Thu, 1 Nov 2012 14:23:05 -0700 Subject: Improvements to the truth table computations. --- src/base/abci/abcNpn.c | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) (limited to 'src/base/abci/abcNpn.c') diff --git a/src/base/abci/abcNpn.c b/src/base/abci/abcNpn.c index 759d91b3..ffcf00f7 100644 --- a/src/base/abci/abcNpn.c +++ b/src/base/abci/abcNpn.c @@ -23,6 +23,7 @@ #include "bool/kit/kit.h" #include "bool/lucky/lucky.h" +#include "opt/dau/dau.h" ABC_NAMESPACE_IMPL_START @@ -190,6 +191,8 @@ void Abc_TruthNpnPerform( Abc_TtStore_t * p, int NpnType, int fVerbose ) pAlgoName = "Jake's hybrid fast "; else if ( NpnType == 4 ) pAlgoName = "Jake's hybrid good "; + else if ( NpnType == 5 ) + pAlgoName = "new hybrid fast "; assert( p->nVars <= 16 ); if ( pAlgoName ) @@ -202,10 +205,8 @@ void Abc_TruthNpnPerform( Abc_TtStore_t * p, int NpnType, int fVerbose ) { for ( i = 0; i < p->nFuncs; i++ ) { - extern void Abc_TtCofactorTest( word * pTruth, int nVars, int i ); if ( fVerbose ) printf( "%7d : ", i ); - Abc_TtCofactorTest( p->pFuncs[i], p->nVars, i ); if ( fVerbose ) Extra_PrintHex( stdout, (unsigned *)p->pFuncs[i], p->nVars ), printf( "\n" ); } @@ -261,6 +262,17 @@ void Abc_TruthNpnPerform( Abc_TtStore_t * p, int NpnType, int fVerbose ) Extra_PrintHex( stdout, (unsigned *)p->pFuncs[i], p->nVars ), Abc_TruthNpnPrint(pCanonPerm, uCanonPhase, p->nVars), printf( "\n" ); } } + else if ( NpnType == 5 ) + { + for ( i = 0; i < p->nFuncs; i++ ) + { + if ( fVerbose ) + printf( "%7d : ", i ); + uCanonPhase = Abc_TtCanonicize( p->pFuncs[i], p->nVars, pCanonPerm ); + if ( fVerbose ) + Extra_PrintHex( stdout, (unsigned *)p->pFuncs[i], p->nVars ), Abc_TruthNpnPrint(pCanonPerm, uCanonPhase, p->nVars), printf( "\n" ); + } + } else assert( 0 ); clk = clock() - clk; printf( "Classes =%9d ", Abc_TruthNpnCountUnique(p) ); @@ -324,7 +336,7 @@ int Abc_NpnTest( char * pFileName, int NpnType, int nVarNum, int fDumpRes, int f { if ( fVerbose ) printf( "Using truth tables from file \"%s\"...\n", pFileName ); - if ( NpnType >= 0 && NpnType <= 4 ) + if ( NpnType >= 0 && NpnType <= 5 ) Abc_TruthNpnTest( pFileName, NpnType, nVarNum, fDumpRes, fBinary, fVerbose ); else printf( "Unknown canonical form value (%d).\n", NpnType ); -- cgit v1.2.3