summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlan Mishchenko <alanmi@berkeley.edu>2021-12-03 18:48:26 -0800
committerAlan Mishchenko <alanmi@berkeley.edu>2021-12-03 18:48:26 -0800
commitb7176ee3e52c5068d93abd898be0639f9a648230 (patch)
treeaa0ab4c4dd1c3fa73c50836a1ce22de2d2d8a68e
parent03b9f41786b59f90b1513e9436ec3e1082f80cb3 (diff)
downloadabc-b7176ee3e52c5068d93abd898be0639f9a648230.tar.gz
abc-b7176ee3e52c5068d93abd898be0639f9a648230.tar.bz2
abc-b7176ee3e52c5068d93abd898be0639f9a648230.zip
Adding command-line switch 'testnpn -A 12' for P-only canonical form computation.
-rw-r--r--src/base/abci/abc.c1
-rw-r--r--src/base/abci/abcNpn.c15
-rw-r--r--src/opt/dau/dauCanon.c2
3 files changed, 16 insertions, 2 deletions
diff --git a/src/base/abci/abc.c b/src/base/abci/abc.c
index 29732bc6..70479041 100644
--- a/src/base/abci/abc.c
+++ b/src/base/abci/abc.c
@@ -6961,6 +6961,7 @@ usage:
Abc_Print( -2, "\t 9: adjustable algorithm (heuristic) by XueGong Zhou at Fudan University, Shanghai\n" );
Abc_Print( -2, "\t 10: adjustable algorithm (exact) by XueGong Zhou at Fudan University, Shanghai\n" );
Abc_Print( -2, "\t 11: new cost-aware exact algorithm by XueGong Zhou at Fudan University, Shanghai\n" );
+ Abc_Print( -2, "\t 12: new fast hybrid semi-canonical form (permutation only)\n" );
Abc_Print( -2, "\t-N <num> : the number of support variables (binary files only) [default = unused]\n" );
Abc_Print( -2, "\t-d : toggle dumping resulting functions into a file [default = %s]\n", fDumpRes? "yes": "no" );
Abc_Print( -2, "\t-b : toggle dumping in binary format [default = %s]\n", fBinary? "yes": "no" );
diff --git a/src/base/abci/abcNpn.c b/src/base/abci/abcNpn.c
index e109a9cf..92b47c17 100644
--- a/src/base/abci/abcNpn.c
+++ b/src/base/abci/abcNpn.c
@@ -208,6 +208,8 @@ void Abc_TruthNpnPerform( Abc_TtStore_t * p, int NpnType, int fVerbose )
pAlgoName = "adjustable algorithm (exact) ";
else if ( NpnType == 11 )
pAlgoName = "new cost-aware exact algorithm ";
+ else if ( NpnType == 12 )
+ pAlgoName = "new hybrid fast (P) ";
assert( p->nVars <= 16 );
if ( pAlgoName )
@@ -356,6 +358,17 @@ void Abc_TruthNpnPerform( Abc_TtStore_t * p, int NpnType, int fVerbose )
}
Abc_TtHieManStop(pMan);
}
+ else if ( NpnType == 12 )
+ {
+ for ( i = 0; i < p->nFuncs; i++ )
+ {
+ if ( fVerbose )
+ printf( "%7d : ", i );
+ uCanonPhase = Abc_TtCanonicizePerm( 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 = Abc_Clock() - clk;
printf( "Classes =%9d ", Abc_TruthNpnCountUnique(p) );
@@ -419,7 +432,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 <= 11 )
+ if ( NpnType >= 0 && NpnType <= 12 )
Abc_TruthNpnTest( pFileName, NpnType, nVarNum, fDumpRes, fBinary, fVerbose );
else
printf( "Unknown canonical form value (%d).\n", NpnType );
diff --git a/src/opt/dau/dauCanon.c b/src/opt/dau/dauCanon.c
index 89359611..dd954d9a 100644
--- a/src/opt/dau/dauCanon.c
+++ b/src/opt/dau/dauCanon.c
@@ -1027,7 +1027,7 @@ int Abc_TtCofactorPerm( word * pTruth, int i, int nWords, int fSwapOnly, char *
SeeAlso []
***********************************************************************/
-#define CANON_VERIFY
+//#define CANON_VERIFY
unsigned Abc_TtCanonicize( word * pTruth, int nVars, char * pCanonPerm )
{
int pStoreIn[17];