ABC: A System for Sequential Synthesis and Verification
 
Loading...
Searching...
No Matches
kitGraph.c File Reference
#include "kit.h"
#include "misc/extra/extra.h"
Include dependency graph for kitGraph.c:

Go to the source code of this file.

Functions

ABC_NAMESPACE_IMPL_START Kit_Graph_tKit_GraphCreate (int nLeaves)
 DECLARATIONS ///.
 
Kit_Graph_tKit_GraphCreateConst0 ()
 
Kit_Graph_tKit_GraphCreateConst1 ()
 
Kit_Graph_tKit_GraphCreateLeaf (int iLeaf, int nLeaves, int fCompl)
 
void Kit_GraphFree (Kit_Graph_t *pGraph)
 
Kit_Node_tKit_GraphAppendNode (Kit_Graph_t *pGraph)
 
Kit_Edge_t Kit_GraphAddNodeAnd (Kit_Graph_t *pGraph, Kit_Edge_t eEdge0, Kit_Edge_t eEdge1)
 
Kit_Edge_t Kit_GraphAddNodeOr (Kit_Graph_t *pGraph, Kit_Edge_t eEdge0, Kit_Edge_t eEdge1)
 
Kit_Edge_t Kit_GraphAddNodeXor (Kit_Graph_t *pGraph, Kit_Edge_t eEdge0, Kit_Edge_t eEdge1, int Type)
 
Kit_Edge_t Kit_GraphAddNodeMux (Kit_Graph_t *pGraph, Kit_Edge_t eEdgeC, Kit_Edge_t eEdgeT, Kit_Edge_t eEdgeE, int Type)
 
unsigned Kit_GraphToTruth (Kit_Graph_t *pGraph)
 
Kit_Graph_tKit_TruthToGraph (unsigned *pTruth, int nVars, Vec_Int_t *vMemory)
 
Kit_Graph_tKit_TruthToGraph2 (unsigned *pTruth0, unsigned *pTruth1, int nVars, Vec_Int_t *vMemory)
 
int Kit_GraphLeafDepth_rec (Kit_Graph_t *pGraph, Kit_Node_t *pNode, Kit_Node_t *pLeaf)
 
int Kit_GraphLevelNum_rec (Kit_Graph_t *pGraph, Kit_Node_t *pNode)
 
int Kit_TruthStats (unsigned *pTruth, int nVars, Vec_Int_t *vMemory)
 
int * Kit_TruthStatsArray (unsigned *pArray, int nVars, int nFuncs)
 
int Kit_TruthFindVarNum (char *pFileName)
 
int * Kit_TruthTest (char *pFileName)
 
int Kit_TruthLitNum (unsigned *pTruth, int nVars, Vec_Int_t *vMemory)
 

Function Documentation

◆ Kit_GraphAddNodeAnd()

Kit_Edge_t Kit_GraphAddNodeAnd ( Kit_Graph_t * pGraph,
Kit_Edge_t eEdge0,
Kit_Edge_t eEdge1 )

Function*************************************************************

Synopsis [Creates an AND node.]

Description []

SideEffects []

SeeAlso []

Definition at line 173 of file kitGraph.c.

174{
175 Kit_Node_t * pNode;
176 // get the new node
177 pNode = Kit_GraphAppendNode( pGraph );
178 // set the inputs and other info
179 pNode->eEdge0 = eEdge0;
180 pNode->eEdge1 = eEdge1;
181 pNode->fCompl0 = eEdge0.fCompl;
182 pNode->fCompl1 = eEdge1.fCompl;
183 return Kit_EdgeCreate( pGraph->nSize - 1, 0 );
184}
Kit_Node_t * Kit_GraphAppendNode(Kit_Graph_t *pGraph)
Definition kitGraph.c:149
struct Kit_Node_t_ Kit_Node_t
Definition kit.h:69
unsigned fCompl
Definition kit.h:65
int nSize
Definition kit.h:93
Kit_Edge_t eEdge0
Definition kit.h:72
Kit_Edge_t eEdge1
Definition kit.h:73
unsigned fCompl1
Definition kit.h:81
unsigned fCompl0
Definition kit.h:80
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Kit_GraphAddNodeMux()

Kit_Edge_t Kit_GraphAddNodeMux ( Kit_Graph_t * pGraph,
Kit_Edge_t eEdgeC,
Kit_Edge_t eEdgeT,
Kit_Edge_t eEdgeE,
int Type )

Function*************************************************************

Synopsis [Creates an XOR node.]

Description []

SideEffects []

SeeAlso []

Definition at line 266 of file kitGraph.c.

267{
268 Kit_Edge_t eNode0, eNode1, eNode;
269 if ( Type == 0 )
270 {
271 // derive the first AND
272 eNode0 = Kit_GraphAddNodeAnd( pGraph, eEdgeC, eEdgeT );
273 // derive the second AND
274 eEdgeC.fCompl ^= 1;
275 eNode1 = Kit_GraphAddNodeAnd( pGraph, eEdgeC, eEdgeE );
276 // derive the final OR
277 eNode = Kit_GraphAddNodeOr( pGraph, eNode0, eNode1 );
278 }
279 else
280 {
281 // complement the arguments
282 eEdgeT.fCompl ^= 1;
283 eEdgeE.fCompl ^= 1;
284 // derive the first AND
285 eNode0 = Kit_GraphAddNodeAnd( pGraph, eEdgeC, eEdgeT );
286 // derive the second AND
287 eEdgeC.fCompl ^= 1;
288 eNode1 = Kit_GraphAddNodeAnd( pGraph, eEdgeC, eEdgeE );
289 // derive the final OR
290 eNode = Kit_GraphAddNodeOr( pGraph, eNode0, eNode1 );
291 eNode.fCompl ^= 1;
292 }
293 return eNode;
294}
Kit_Edge_t Kit_GraphAddNodeAnd(Kit_Graph_t *pGraph, Kit_Edge_t eEdge0, Kit_Edge_t eEdge1)
Definition kitGraph.c:173
Kit_Edge_t Kit_GraphAddNodeOr(Kit_Graph_t *pGraph, Kit_Edge_t eEdge0, Kit_Edge_t eEdge1)
Definition kitGraph.c:197
struct Kit_Edge_t_ Kit_Edge_t
Definition kit.h:62
Here is the call graph for this function:

◆ Kit_GraphAddNodeOr()

Kit_Edge_t Kit_GraphAddNodeOr ( Kit_Graph_t * pGraph,
Kit_Edge_t eEdge0,
Kit_Edge_t eEdge1 )

Function*************************************************************

Synopsis [Creates an OR node.]

Description []

SideEffects []

SeeAlso []

Definition at line 197 of file kitGraph.c.

198{
199 Kit_Node_t * pNode;
200 // get the new node
201 pNode = Kit_GraphAppendNode( pGraph );
202 // set the inputs and other info
203 pNode->eEdge0 = eEdge0;
204 pNode->eEdge1 = eEdge1;
205 pNode->fCompl0 = eEdge0.fCompl;
206 pNode->fCompl1 = eEdge1.fCompl;
207 // make adjustments for the OR gate
208 pNode->fNodeOr = 1;
209 pNode->eEdge0.fCompl = !pNode->eEdge0.fCompl;
210 pNode->eEdge1.fCompl = !pNode->eEdge1.fCompl;
211 return Kit_EdgeCreate( pGraph->nSize - 1, 1 );
212}
unsigned fNodeOr
Definition kit.h:79
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Kit_GraphAddNodeXor()

Kit_Edge_t Kit_GraphAddNodeXor ( Kit_Graph_t * pGraph,
Kit_Edge_t eEdge0,
Kit_Edge_t eEdge1,
int Type )

Function*************************************************************

Synopsis [Creates an XOR node.]

Description []

SideEffects []

SeeAlso []

Definition at line 225 of file kitGraph.c.

226{
227 Kit_Edge_t eNode0, eNode1, eNode;
228 if ( Type == 0 )
229 {
230 // derive the first AND
231 eEdge0.fCompl ^= 1;
232 eNode0 = Kit_GraphAddNodeAnd( pGraph, eEdge0, eEdge1 );
233 eEdge0.fCompl ^= 1;
234 // derive the second AND
235 eEdge1.fCompl ^= 1;
236 eNode1 = Kit_GraphAddNodeAnd( pGraph, eEdge0, eEdge1 );
237 // derive the final OR
238 eNode = Kit_GraphAddNodeOr( pGraph, eNode0, eNode1 );
239 }
240 else
241 {
242 // derive the first AND
243 eNode0 = Kit_GraphAddNodeAnd( pGraph, eEdge0, eEdge1 );
244 // derive the second AND
245 eEdge0.fCompl ^= 1;
246 eEdge1.fCompl ^= 1;
247 eNode1 = Kit_GraphAddNodeAnd( pGraph, eEdge0, eEdge1 );
248 // derive the final OR
249 eNode = Kit_GraphAddNodeOr( pGraph, eNode0, eNode1 );
250 eNode.fCompl ^= 1;
251 }
252 return eNode;
253}
Here is the call graph for this function:

◆ Kit_GraphAppendNode()

Kit_Node_t * Kit_GraphAppendNode ( Kit_Graph_t * pGraph)

Function*************************************************************

Synopsis [Appends a new node to the graph.]

Description [This procedure is meant for internal use.]

SideEffects []

SeeAlso []

Definition at line 149 of file kitGraph.c.

150{
151 Kit_Node_t * pNode;
152 if ( pGraph->nSize == pGraph->nCap )
153 {
154 pGraph->pNodes = ABC_REALLOC( Kit_Node_t, pGraph->pNodes, 2 * pGraph->nCap );
155 pGraph->nCap = 2 * pGraph->nCap;
156 }
157 pNode = pGraph->pNodes + pGraph->nSize++;
158 memset( pNode, 0, sizeof(Kit_Node_t) );
159 return pNode;
160}
#define ABC_REALLOC(type, obj, num)
Definition abc_global.h:268
Kit_Node_t * pNodes
Definition kit.h:95
int nCap
Definition kit.h:94
char * memset()
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Kit_GraphCreate()

ABC_NAMESPACE_IMPL_START Kit_Graph_t * Kit_GraphCreate ( int nLeaves)

DECLARATIONS ///.

CFile****************************************************************

FileName [kitGraph.c]

SystemName [ABC: Logic synthesis and verification system.]

PackageName [Computation kit.]

Synopsis [Decomposition graph representation.]

Author [Alan Mishchenko]

Affiliation [UC Berkeley]

Date [Ver. 1.0. Started - Dec 6, 2006.]

Revision [

Id
kitGraph.c,v 1.00 2006/12/06 00:00:00 alanmi Exp

] FUNCTION DEFINITIONS /// Function*************************************************************

Synopsis [Creates a graph with the given number of leaves.]

Description []

SideEffects []

SeeAlso []

Definition at line 46 of file kitGraph.c.

47{
48 Kit_Graph_t * pGraph;
49 pGraph = ABC_ALLOC( Kit_Graph_t, 1 );
50 memset( pGraph, 0, sizeof(Kit_Graph_t) );
51 pGraph->nLeaves = nLeaves;
52 pGraph->nSize = nLeaves;
53 pGraph->nCap = 2 * nLeaves + 50;
54 pGraph->pNodes = ABC_ALLOC( Kit_Node_t, pGraph->nCap );
55 memset( pGraph->pNodes, 0, sizeof(Kit_Node_t) * pGraph->nSize );
56 return pGraph;
57}
#define ABC_ALLOC(type, num)
Definition abc_global.h:264
struct Kit_Graph_t_ Kit_Graph_t
Definition kit.h:88
int nLeaves
Definition kit.h:92
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Kit_GraphCreateConst0()

Kit_Graph_t * Kit_GraphCreateConst0 ( )

Function*************************************************************

Synopsis [Creates constant 0 graph.]

Description []

SideEffects []

SeeAlso []

Definition at line 70 of file kitGraph.c.

71{
72 Kit_Graph_t * pGraph;
73 pGraph = ABC_ALLOC( Kit_Graph_t, 1 );
74 memset( pGraph, 0, sizeof(Kit_Graph_t) );
75 pGraph->fConst = 1;
76 pGraph->eRoot.fCompl = 1;
77 return pGraph;
78}
Kit_Edge_t eRoot
Definition kit.h:96
int fConst
Definition kit.h:91
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Kit_GraphCreateConst1()

Kit_Graph_t * Kit_GraphCreateConst1 ( )

Function*************************************************************

Synopsis [Creates constant 1 graph.]

Description []

SideEffects []

SeeAlso []

Definition at line 91 of file kitGraph.c.

92{
93 Kit_Graph_t * pGraph;
94 pGraph = ABC_ALLOC( Kit_Graph_t, 1 );
95 memset( pGraph, 0, sizeof(Kit_Graph_t) );
96 pGraph->fConst = 1;
97 return pGraph;
98}
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Kit_GraphCreateLeaf()

Kit_Graph_t * Kit_GraphCreateLeaf ( int iLeaf,
int nLeaves,
int fCompl )

Function*************************************************************

Synopsis [Creates the literal graph.]

Description []

SideEffects []

SeeAlso []

Definition at line 111 of file kitGraph.c.

112{
113 Kit_Graph_t * pGraph;
114 assert( 0 <= iLeaf && iLeaf < nLeaves );
115 pGraph = Kit_GraphCreate( nLeaves );
116 pGraph->eRoot.Node = iLeaf;
117 pGraph->eRoot.fCompl = fCompl;
118 return pGraph;
119}
ABC_NAMESPACE_IMPL_START Kit_Graph_t * Kit_GraphCreate(int nLeaves)
DECLARATIONS ///.
Definition kitGraph.c:46
unsigned Node
Definition kit.h:66
#define assert(ex)
Definition util_old.h:213
Here is the call graph for this function:

◆ Kit_GraphFree()

void Kit_GraphFree ( Kit_Graph_t * pGraph)

Function*************************************************************

Synopsis [Creates a graph with the given number of leaves.]

Description []

SideEffects []

SeeAlso []

Definition at line 132 of file kitGraph.c.

133{
134 ABC_FREE( pGraph->pNodes );
135 ABC_FREE( pGraph );
136}
#define ABC_FREE(obj)
Definition abc_global.h:267
Here is the caller graph for this function:

◆ Kit_GraphLeafDepth_rec()

int Kit_GraphLeafDepth_rec ( Kit_Graph_t * pGraph,
Kit_Node_t * pNode,
Kit_Node_t * pLeaf )

Function*************************************************************

Synopsis [Derives the maximum depth from the leaf to the root.]

Description []

SideEffects []

SeeAlso []

Definition at line 412 of file kitGraph.c.

413{
414 int Depth0, Depth1, Depth;
415 if ( pNode == pLeaf )
416 return 0;
417 if ( Kit_GraphNodeIsVar(pGraph, pNode) )
418 return -100;
419 Depth0 = Kit_GraphLeafDepth_rec( pGraph, Kit_GraphNodeFanin0(pGraph, pNode), pLeaf );
420 Depth1 = Kit_GraphLeafDepth_rec( pGraph, Kit_GraphNodeFanin1(pGraph, pNode), pLeaf );
421 Depth = KIT_MAX( Depth0, Depth1 );
422 Depth = (Depth == -100) ? -100 : Depth + 1;
423 return Depth;
424}
int Kit_GraphLeafDepth_rec(Kit_Graph_t *pGraph, Kit_Node_t *pNode, Kit_Node_t *pLeaf)
Definition kitGraph.c:412
#define KIT_MAX(a, b)
Definition kit.h:175
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Kit_GraphLevelNum_rec()

int Kit_GraphLevelNum_rec ( Kit_Graph_t * pGraph,
Kit_Node_t * pNode )

Function*************************************************************

Synopsis [Derives logic level of the node.]

Description []

SideEffects []

SeeAlso []

Definition at line 437 of file kitGraph.c.

438{
439 int Depth0, Depth1;
440 if ( Kit_GraphNodeIsVar(pGraph, pNode) )
441 return 0;
442 Depth0 = Kit_GraphLevelNum_rec( pGraph, Kit_GraphNodeFanin0(pGraph, pNode) );
443 Depth1 = Kit_GraphLevelNum_rec( pGraph, Kit_GraphNodeFanin1(pGraph, pNode) );
444 return 1 + KIT_MAX( Depth0, Depth1 );
445}
int Kit_GraphLevelNum_rec(Kit_Graph_t *pGraph, Kit_Node_t *pNode)
Definition kitGraph.c:437
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Kit_GraphToTruth()

unsigned Kit_GraphToTruth ( Kit_Graph_t * pGraph)

Function*************************************************************

Synopsis [Derives the truth table.]

Description []

SideEffects []

SeeAlso []

Definition at line 307 of file kitGraph.c.

308{
309 unsigned uTruths[5] = { 0xAAAAAAAA, 0xCCCCCCCC, 0xF0F0F0F0, 0xFF00FF00, 0xFFFF0000 };
310 unsigned uTruth = 0, uTruth0, uTruth1;
311 Kit_Node_t * pNode;
312 int i;
313
314 // sanity checks
315 assert( Kit_GraphLeaveNum(pGraph) >= 0 );
316 assert( Kit_GraphLeaveNum(pGraph) <= pGraph->nSize );
317 assert( Kit_GraphLeaveNum(pGraph) <= 5 );
318
319 // check for constant function
320 if ( Kit_GraphIsConst(pGraph) )
321 return Kit_GraphIsComplement(pGraph)? 0 : ~((unsigned)0);
322 // check for a literal
323 if ( Kit_GraphIsVar(pGraph) )
324 return Kit_GraphIsComplement(pGraph)? ~uTruths[Kit_GraphVarInt(pGraph)] : uTruths[Kit_GraphVarInt(pGraph)];
325
326 // assign the elementary variables
327 Kit_GraphForEachLeaf( pGraph, pNode, i )
328 pNode->pFunc = (void *)(long)uTruths[i];
329
330 // compute the function for each internal node
331 Kit_GraphForEachNode( pGraph, pNode, i )
332 {
333 uTruth0 = (unsigned)(long)Kit_GraphNode(pGraph, pNode->eEdge0.Node)->pFunc;
334 uTruth1 = (unsigned)(long)Kit_GraphNode(pGraph, pNode->eEdge1.Node)->pFunc;
335 uTruth0 = pNode->eEdge0.fCompl? ~uTruth0 : uTruth0;
336 uTruth1 = pNode->eEdge1.fCompl? ~uTruth1 : uTruth1;
337 uTruth = uTruth0 & uTruth1;
338 pNode->pFunc = (void *)(long)uTruth;
339 }
340
341 // complement the result if necessary
342 return Kit_GraphIsComplement(pGraph)? ~uTruth : uTruth;
343}
#define Kit_GraphForEachNode(pGraph, pAnd, i)
Definition kit.h:507
#define Kit_GraphForEachLeaf(pGraph, pLeaf, i)
Definition kit.h:505
void * pFunc
Definition kit.h:76

◆ Kit_TruthFindVarNum()

int Kit_TruthFindVarNum ( char * pFileName)

Definition at line 476 of file kitGraph.c.

477{
478 int i;
479 for ( i = 0; i < (int)strlen(pFileName); i++ )
480 if ( pFileName[i] >= '0' && pFileName[i] <= '9' )
481 return atoi(pFileName+i);
482 return -1;
483}
int strlen()
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Kit_TruthLitNum()

int Kit_TruthLitNum ( unsigned * pTruth,
int nVars,
Vec_Int_t * vMemory )

Function*************************************************************

Synopsis [Derives the factored form from the truth table.]

Description []

SideEffects []

SeeAlso []

Definition at line 511 of file kitGraph.c.

512{
513 Kit_Graph_t * pGraph;
514 int RetValue, nLits;
515 RetValue = Kit_TruthIsop( pTruth, nVars, vMemory, 1 );
516 if ( RetValue == -1 || Vec_IntSize(vMemory) > (1<<16) )
517 return -1;
518 assert( RetValue == 0 || RetValue == 1 );
519 pGraph = Kit_SopFactor( vMemory, RetValue, nVars, vMemory );
520 nLits = 1 + Kit_GraphNodeNum( pGraph );
521 Kit_GraphFree( pGraph );
522 return nLits;
523}
void Kit_GraphFree(Kit_Graph_t *pGraph)
Definition kitGraph.c:132
int Kit_TruthIsop(unsigned *puTruth, int nVars, Vec_Int_t *vMemory, int fTryBoth)
Definition kitIsop.c:134
Kit_Graph_t * Kit_SopFactor(Vec_Int_t *vCover, int fCompl, int nVars, Vec_Int_t *vMemory)
FUNCTION DEFINITIONS ///.
Definition kitFactor.c:55
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Kit_TruthStats()

int Kit_TruthStats ( unsigned * pTruth,
int nVars,
Vec_Int_t * vMemory )

Function*************************************************************

Synopsis [Returns FF nodes and levels.]

Description []

SideEffects []

SeeAlso []

Definition at line 458 of file kitGraph.c.

459{
460 Kit_Graph_t * pGraph = Kit_TruthToGraph( pTruth, nVars, vMemory );
461 int nNodes = Kit_GraphNodeNum( pGraph );
462 int nLevels = Kit_GraphLevelNum_rec( pGraph, Kit_GraphNodeLast(pGraph) );
463 Kit_GraphFree( pGraph );
464 return (nLevels << 16) | nNodes;
465}
Kit_Graph_t * Kit_TruthToGraph(unsigned *pTruth, int nVars, Vec_Int_t *vMemory)
Definition kitGraph.c:356
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Kit_TruthStatsArray()

int * Kit_TruthStatsArray ( unsigned * pArray,
int nVars,
int nFuncs )

Definition at line 466 of file kitGraph.c.

467{
468 int f, * pRes = ABC_CALLOC( int, nFuncs );
469 int nInts = Abc_TruthWordNum( nVars );
470 Vec_Int_t * vMemory = Vec_IntAlloc( 1 << 16 );
471 for ( f = 0; f < nFuncs; f++ )
472 pRes[f] = Kit_TruthStats( pArray + f*nInts, nVars, vMemory );
473 Vec_IntFree( vMemory );
474 return pRes;
475}
#define ABC_CALLOC(type, num)
Definition abc_global.h:265
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
Definition bblif.c:37
int Kit_TruthStats(unsigned *pTruth, int nVars, Vec_Int_t *vMemory)
Definition kitGraph.c:458
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Kit_TruthTest()

int * Kit_TruthTest ( char * pFileName)

Definition at line 484 of file kitGraph.c.

485{
486 abctime clk = Abc_Clock(); int i;
487 int nFileSize = Extra_FileSize( pFileName );
488 int nVars = Kit_TruthFindVarNum( pFileName );
489 int nFuncs = nFileSize / 4 / Abc_TruthWordNum(nVars);
490 unsigned * pA = (unsigned *)Extra_FileReadContents( pFileName );
491 int * pResult = Kit_TruthStatsArray( pA, nVars, nFuncs );
492 printf( "Finished proceessing %d functions with %d variables. ", nFuncs, nVars );
493 Abc_PrintTime( 1, "Time", Abc_Clock() - clk );
494 ABC_FREE( pA );
495 for ( i = 0; i < 5; i++ )
496 printf( "Function %3d : AND2 = %3d Lev = %3d\n", i, pResult[i] & 0xFFFF, pResult[i] >> 16 );
497 return pResult;
498}
ABC_INT64_T abctime
Definition abc_global.h:332
int Extra_FileSize(char *pFileName)
char * Extra_FileReadContents(char *pFileName)
int * Kit_TruthStatsArray(unsigned *pArray, int nVars, int nFuncs)
Definition kitGraph.c:466
int Kit_TruthFindVarNum(char *pFileName)
Definition kitGraph.c:476
Here is the call graph for this function:

◆ Kit_TruthToGraph()

Kit_Graph_t * Kit_TruthToGraph ( unsigned * pTruth,
int nVars,
Vec_Int_t * vMemory )

Function*************************************************************

Synopsis [Derives the factored form from the truth table.]

Description []

SideEffects []

SeeAlso []

Definition at line 356 of file kitGraph.c.

357{
358 Kit_Graph_t * pGraph;
359 int RetValue;
360 // derive SOP
361 RetValue = Kit_TruthIsop( pTruth, nVars, vMemory, 1 ); // tried 1 and found not useful in "renode"
362 if ( RetValue == -1 )
363 return NULL;
364 if ( Vec_IntSize(vMemory) > (1<<16) )
365 return NULL;
366// printf( "Isop size = %d.\n", Vec_IntSize(vMemory) );
367 assert( RetValue == 0 || RetValue == 1 );
368 // derive factored form
369 pGraph = Kit_SopFactor( vMemory, RetValue, nVars, vMemory );
370 return pGraph;
371}
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Kit_TruthToGraph2()

Kit_Graph_t * Kit_TruthToGraph2 ( unsigned * pTruth0,
unsigned * pTruth1,
int nVars,
Vec_Int_t * vMemory )

Function*************************************************************

Synopsis [Derives the factored form from the truth table.]

Description []

SideEffects []

SeeAlso []

Definition at line 384 of file kitGraph.c.

385{
386 Kit_Graph_t * pGraph;
387 int RetValue;
388 // derive SOP
389 RetValue = Kit_TruthIsop2( pTruth0, pTruth1, nVars, vMemory, 0, 0 ); // tried 1 and found not useful in "renode"
390 if ( RetValue == -1 )
391 return NULL;
392 if ( Vec_IntSize(vMemory) > (1<<16) )
393 return NULL;
394// printf( "Isop size = %d.\n", Vec_IntSize(vMemory) );
395 assert( RetValue == 0 || RetValue == 1 );
396 // derive factored form
397 pGraph = Kit_SopFactor( vMemory, RetValue, nVars, vMemory );
398 return pGraph;
399}
int Kit_TruthIsop2(unsigned *puTruth0, unsigned *puTruth1, int nVars, Vec_Int_t *vMemory, int fTryBoth, int fReturnTt)
FUNCTION DEFINITIONS ///.
Definition kitIsop.c:55
Here is the call graph for this function:
Here is the caller graph for this function: