summaryrefslogtreecommitdiffstats
path: root/src/bool/kit/kitGraph.c
diff options
context:
space:
mode:
authorAlan Mishchenko <alanmi@berkeley.edu>2020-03-18 19:01:45 -0700
committerAlan Mishchenko <alanmi@berkeley.edu>2020-03-18 19:01:45 -0700
commitf8b1be8bbf588fb6e0f6362a79c56283ab11858f (patch)
tree56e3177e4de7255b2f7c171bd4c124144570463a /src/bool/kit/kitGraph.c
parentc54da1e990b0e2c52d0f0aaa6af693f9c9dd99b4 (diff)
downloadabc-f8b1be8bbf588fb6e0f6362a79c56283ab11858f.tar.gz
abc-f8b1be8bbf588fb6e0f6362a79c56283ab11858f.tar.bz2
abc-f8b1be8bbf588fb6e0f6362a79c56283ab11858f.zip
Extending TT-based ISOP to handle ISFs.
Diffstat (limited to 'src/bool/kit/kitGraph.c')
-rw-r--r--src/bool/kit/kitGraph.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/bool/kit/kitGraph.c b/src/bool/kit/kitGraph.c
index 08dabc7e..2ee135e2 100644
--- a/src/bool/kit/kitGraph.c
+++ b/src/bool/kit/kitGraph.c
@@ -371,6 +371,34 @@ Kit_Graph_t * Kit_TruthToGraph( unsigned * pTruth, int nVars, Vec_Int_t * vMemor
/**Function*************************************************************
+ Synopsis [Derives the factored form from the truth table.]
+
+ Description []
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
+Kit_Graph_t * Kit_TruthToGraph2( unsigned * pTruth0, unsigned * pTruth1, int nVars, Vec_Int_t * vMemory )
+{
+ Kit_Graph_t * pGraph;
+ int RetValue;
+ // derive SOP
+ RetValue = Kit_TruthIsop2( pTruth0, pTruth1, nVars, vMemory, 1 ); // tried 1 and found not useful in "renode"
+ if ( RetValue == -1 )
+ return NULL;
+ if ( Vec_IntSize(vMemory) > (1<<16) )
+ return NULL;
+// printf( "Isop size = %d.\n", Vec_IntSize(vMemory) );
+ assert( RetValue == 0 || RetValue == 1 );
+ // derive factored form
+ pGraph = Kit_SopFactor( vMemory, RetValue, nVars, vMemory );
+ return pGraph;
+}
+
+/**Function*************************************************************
+
Synopsis [Derives the maximum depth from the leaf to the root.]
Description []