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

Go to the source code of this file.

Functions

int Extra_TruthCanonFastN (int nVarsMax, int nVarsReal, unsigned *pt, unsigned **pptRes, char **ppfRes)
 
void Map_Var3Print ()
 
void Map_Var3Test ()
 
void Map_Var4Test ()
 

Function Documentation

◆ Extra_TruthCanonFastN()

int Extra_TruthCanonFastN ( int nVarsMax,
int nVarsReal,
unsigned * pt,
unsigned ** pptRes,
char ** ppfRes )

AutomaticEnd Function********************************************************************

Synopsis [Computes the N-canonical form of the Boolean function up to 6 inputs.]

Description [The N-canonical form is defined as the truth table with the minimum integer value. This function exhaustively enumerates through the complete set of 2^N phase assignments. Returns pointers to the static storage to the truth table and phases. This data should be used before the function is called again.]

SideEffects []

SeeAlso []

Definition at line 374 of file extraUtilCanon.c.

375{
376 static unsigned uTruthStore6[2];
377 int RetValue;
378 assert( nVarsMax <= 6 );
379 assert( nVarsReal <= nVarsMax );
380 RetValue = Extra_TruthCanonN_rec( nVarsReal <= 3? 3: nVarsReal, (unsigned char *)pt, pptRes, ppfRes, 0 );
381 if ( nVarsMax == 6 && nVarsReal < nVarsMax )
382 {
383 uTruthStore6[0] = **pptRes;
384 uTruthStore6[1] = **pptRes;
385 *pptRes = uTruthStore6;
386 }
387 return RetValue;
388}
#define assert(ex)
Definition util_old.h:213
Here is the caller graph for this function:

◆ Map_Var3Print()

void Map_Var3Print ( )

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

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 585 of file extraUtilCanon.c.

586{
587 extern void Extra_Truth3VarN( unsigned ** puCanons, char *** puPhases, char ** ppCounters );
588
589 unsigned * uCanons;
590 char ** uPhases;
591 char * pCounters;
592 int i, k;
593
594 Extra_Truth3VarN( &uCanons, &uPhases, &pCounters );
595
596 for ( i = 0; i < 256; i++ )
597 {
598 if ( i % 8 == 0 )
599 printf( "\n" );
600 Extra_PrintHex( stdout, uCanons + i, 5 );
601 printf( ", " );
602 }
603 printf( "\n" );
604
605 for ( i = 0; i < 256; i++ )
606 {
607 printf( "%3d */ { %2d, ", i, pCounters[i] );
608 for ( k = 0; k < pCounters[i]; k++ )
609 printf( "%s%d", k? ", ":"", uPhases[i][k] );
610 printf( " }\n" );
611 }
612 printf( "\n" );
613}
void Extra_Truth3VarN(unsigned **puCanons, char ***puPhases, char **ppCounters)
void Extra_PrintHex(FILE *pFile, unsigned *pTruth, int nVars)
Here is the call graph for this function:

◆ Map_Var3Test()

void Map_Var3Test ( )

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

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 626 of file extraUtilCanon.c.

627{
628 extern void Extra_Truth3VarN( unsigned ** puCanons, char *** puPhases, char ** ppCounters );
629
630 unsigned * uCanons;
631 char ** uPhases;
632 char * pCounters;
633 int i;
634 unsigned * ptRes;
635 char * pfRes;
636 unsigned uTruth;
637 int Count;
638
639 Extra_Truth3VarN( &uCanons, &uPhases, &pCounters );
640
641 for ( i = 0; i < 256; i++ )
642 {
643 uTruth = i;
644 Count = Extra_TruthCanonFastN( 5, 3, &uTruth, &ptRes, &pfRes );
645 }
646}
int Extra_TruthCanonFastN(int nVarsMax, int nVarsReal, unsigned *pt, unsigned **pptRes, char **ppfRes)
Here is the call graph for this function:

◆ Map_Var4Test()

void Map_Var4Test ( )

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

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 659 of file extraUtilCanon.c.

660{
661 extern void Extra_Truth4VarN( unsigned short ** puCanons, char *** puPhases, char ** ppCounters, int PhaseMax );
662
663 unsigned short * uCanons;
664 char ** uPhases;
665 char * pCounters;
666 int i;
667 unsigned * ptRes;
668 char * pfRes;
669 unsigned uTruth;
670 int Count;
671
672 Extra_Truth4VarN( &uCanons, &uPhases, &pCounters, 16 );
673
674 for ( i = 0; i < 256*256; i++ )
675 {
676 uTruth = i;
677 Count = Extra_TruthCanonFastN( 5, 4, &uTruth, &ptRes, &pfRes );
678 }
679}
void Extra_Truth4VarN(unsigned short **puCanons, char ***puPhases, char **ppCounters, int nPhasesMax)
Here is the call graph for this function: