abc-master
|
#include "kit.h"
Go to the source code of this file.
Functions | |
ABC_NAMESPACE_IMPL_START void | Kit_TruthSwapAdjacentVars (unsigned *pOut, unsigned *pIn, int nVars, int iVar) |
DECLARATIONS ///. More... | |
void | Kit_TruthSwapAdjacentVars2 (unsigned *pIn, unsigned *pOut, int nVars, int Start) |
void | Kit_TruthStretch (unsigned *pOut, unsigned *pIn, int nVars, int nVarsAll, unsigned Phase, int fReturnIn) |
void | Kit_TruthShrink (unsigned *pOut, unsigned *pIn, int nVars, int nVarsAll, unsigned Phase, int fReturnIn) |
void | Kit_TruthPermute (unsigned *pOut, unsigned *pIn, int nVars, char *pPerm, int fReturnIn) |
int | Kit_TruthVarInSupport (unsigned *pTruth, int nVars, int iVar) |
int | Kit_TruthSupportSize (unsigned *pTruth, int nVars) |
unsigned | Kit_TruthSupport (unsigned *pTruth, int nVars) |
void | Kit_TruthCofactor0 (unsigned *pTruth, int nVars, int iVar) |
int | Kit_TruthCofactor0Count (unsigned *pTruth, int nVars, int iVar) |
void | Kit_TruthCofactor1 (unsigned *pTruth, int nVars, int iVar) |
void | Kit_TruthCofactor0New (unsigned *pOut, unsigned *pIn, int nVars, int iVar) |
void | Kit_TruthCofactor1New (unsigned *pOut, unsigned *pIn, int nVars, int iVar) |
int | Kit_TruthVarIsVacuous (unsigned *pOnset, unsigned *pOffset, int nVars, int iVar) |
void | Kit_TruthExist (unsigned *pTruth, int nVars, int iVar) |
void | Kit_TruthExistNew (unsigned *pRes, unsigned *pTruth, int nVars, int iVar) |
void | Kit_TruthExistSet (unsigned *pRes, unsigned *pTruth, int nVars, unsigned uMask) |
void | Kit_TruthForall (unsigned *pTruth, int nVars, int iVar) |
void | Kit_TruthForallNew (unsigned *pRes, unsigned *pTruth, int nVars, int iVar) |
void | Kit_TruthUniqueNew (unsigned *pRes, unsigned *pTruth, int nVars, int iVar) |
int | Kit_TruthBooleanDiffCount (unsigned *pTruth, int nVars, int iVar) |
int | Kit_TruthXorCount (unsigned *pTruth0, unsigned *pTruth1, int nVars) |
void | Kit_TruthForallSet (unsigned *pRes, unsigned *pTruth, int nVars, unsigned uMask) |
void | Kit_TruthMuxVar (unsigned *pOut, unsigned *pCof0, unsigned *pCof1, int nVars, int iVar) |
void | Kit_TruthMuxVarPhase (unsigned *pOut, unsigned *pCof0, unsigned *pCof1, int nVars, int iVar, int fCompl0) |
int | Kit_TruthVarsSymm (unsigned *pTruth, int nVars, int iVar0, int iVar1, unsigned *pCof0, unsigned *pCof1) |
int | Kit_TruthVarsAntiSymm (unsigned *pTruth, int nVars, int iVar0, int iVar1, unsigned *pCof0, unsigned *pCof1) |
void | Kit_TruthChangePhase (unsigned *pTruth, int nVars, int iVar) |
int | Kit_TruthMinCofSuppOverlap (unsigned *pTruth, int nVars, int *pVarMin) |
int | Kit_TruthBestCofVar (unsigned *pTruth, int nVars, unsigned *pCof0, unsigned *pCof1) |
void | Kit_TruthCountOnesInCofs (unsigned *pTruth, int nVars, int *pStore) |
void | Kit_TruthCountOnesInCofs0 (unsigned *pTruth, int nVars, int *pStore) |
void | Kit_TruthCountOnesInCofsSlow (unsigned *pTruth, int nVars, int *pStore, unsigned *pAux) |
unsigned | Kit_TruthHash (unsigned *pIn, int nWords) |
unsigned | Kit_TruthSemiCanonicize (unsigned *pInOut, unsigned *pAux, int nVars, char *pCanonPerm) |
int | Kit_TruthCountMinterms (unsigned *pTruth, int nVars, int *pRes, int *pBytesInit) |
void | Kit_PrintHexadecimal (FILE *pFile, unsigned Sign[], int nVars) |
void | Kit_TruthCountMintermsPrecomp () |
char * | Kit_TruthDumpToFile (unsigned *pTruth, int nVars, int nFile) |
void | Kit_TruthPrintProfile_int (unsigned *pTruth, int nVars) |
void | Kit_TruthPrintProfile (unsigned *pTruth, int nVars) |
void Kit_PrintHexadecimal | ( | FILE * | pFile, |
unsigned | Sign[], | ||
int | nVars | ||
) |
Function*************************************************************
Synopsis [Prints the hex unsigned into a file.]
Description []
SideEffects []
SeeAlso []
Definition at line 1939 of file kitTruth.c.
int Kit_TruthBestCofVar | ( | unsigned * | pTruth, |
int | nVars, | ||
unsigned * | pCof0, | ||
unsigned * | pCof1 | ||
) |
Function*************************************************************
Synopsis [Find the best cofactoring variable.]
Description []
SideEffects []
SeeAlso []
Definition at line 1365 of file kitTruth.c.
int Kit_TruthBooleanDiffCount | ( | unsigned * | pTruth, |
int | nVars, | ||
int | iVar | ||
) |
Function*************************************************************
Synopsis [Returns the number of minterms in the Boolean difference.]
Description []
SideEffects []
SeeAlso []
Definition at line 977 of file kitTruth.c.
void Kit_TruthChangePhase | ( | unsigned * | pTruth, |
int | nVars, | ||
int | iVar | ||
) |
Function*************************************************************
Synopsis [Changes phase of the function w.r.t. one variable.]
Description []
SideEffects []
SeeAlso []
Definition at line 1259 of file kitTruth.c.
void Kit_TruthCofactor0 | ( | unsigned * | pTruth, |
int | nVars, | ||
int | iVar | ||
) |
Function*************************************************************
Synopsis [Computes negative cofactor of the function.]
Description []
SideEffects []
SeeAlso []
Definition at line 368 of file kitTruth.c.
int Kit_TruthCofactor0Count | ( | unsigned * | pTruth, |
int | nVars, | ||
int | iVar | ||
) |
Function*************************************************************
Synopsis [Computes negative cofactor of the function.]
Description []
SideEffects []
SeeAlso []
Definition at line 419 of file kitTruth.c.
void Kit_TruthCofactor0New | ( | unsigned * | pOut, |
unsigned * | pIn, | ||
int | nVars, | ||
int | iVar | ||
) |
Function*************************************************************
Synopsis [Computes positive cofactor of the function.]
Description []
SideEffects []
SeeAlso []
Definition at line 521 of file kitTruth.c.
void Kit_TruthCofactor1 | ( | unsigned * | pTruth, |
int | nVars, | ||
int | iVar | ||
) |
Function*************************************************************
Synopsis [Computes positive cofactor of the function.]
Description []
SideEffects []
SeeAlso []
Definition at line 470 of file kitTruth.c.
void Kit_TruthCofactor1New | ( | unsigned * | pOut, |
unsigned * | pIn, | ||
int | nVars, | ||
int | iVar | ||
) |
Function*************************************************************
Synopsis [Computes positive cofactor of the function.]
Description []
SideEffects []
SeeAlso []
Definition at line 573 of file kitTruth.c.
int Kit_TruthCountMinterms | ( | unsigned * | pTruth, |
int | nVars, | ||
int * | pRes, | ||
int * | pBytesInit | ||
) |
Function*************************************************************
Synopsis [Fast counting minterms in the cofactors of a function.]
Description [Returns the total number of minterms in the function. The resulting array (pRes) contains the number of minterms in 0-cofactor w.r.t. each variables. The additional array (pBytes) is used for internal storage. It should have the size equal to the number of truth table bytes.]
SideEffects []
SeeAlso []
Definition at line 1839 of file kitTruth.c.
void Kit_TruthCountMintermsPrecomp | ( | ) |
Function*************************************************************
Synopsis [Fast counting minterms for the functions.]
Description [Returns 0 if the function is a constant.]
SideEffects []
SeeAlso []
Definition at line 1966 of file kitTruth.c.
void Kit_TruthCountOnesInCofs | ( | unsigned * | pTruth, |
int | nVars, | ||
int * | pStore | ||
) |
Function*************************************************************
Synopsis [Counts the number of 1's in each cofactor.]
Description [The resulting numbers are stored in the array of ints, whose length is 2*nVars. The number of 1's is counted in a different space than the original function. For example, if the function depends on k variables, the cofactors are assumed to depend on k-1 variables.]
SideEffects []
SeeAlso []
Definition at line 1410 of file kitTruth.c.
void Kit_TruthCountOnesInCofs0 | ( | unsigned * | pTruth, |
int | nVars, | ||
int * | pStore | ||
) |
Function*************************************************************
Synopsis [Counts the number of 1's in each negative cofactor.]
Description [The resulting numbers are stored in the array of ints, whose length is nVars. The number of 1's is counted in a different space than the original function. For example, if the function depends on k variables, the cofactors are assumed to depend on k-1 variables.]
SideEffects []
SeeAlso []
Definition at line 1486 of file kitTruth.c.
void Kit_TruthCountOnesInCofsSlow | ( | unsigned * | pTruth, |
int | nVars, | ||
int * | pStore, | ||
unsigned * | pAux | ||
) |
Function*************************************************************
Synopsis [Counts the number of 1's in each cofactor.]
Description [Verifies the above procedure.]
SideEffects []
SeeAlso []
Definition at line 1537 of file kitTruth.c.
char* Kit_TruthDumpToFile | ( | unsigned * | pTruth, |
int | nVars, | ||
int | nFile | ||
) |
Function*************************************************************
Synopsis [Dumps truth table into a file.]
Description [Generates script file for reading into ABC.]
SideEffects []
SeeAlso []
Definition at line 2004 of file kitTruth.c.
void Kit_TruthExist | ( | unsigned * | pTruth, |
int | nVars, | ||
int | iVar | ||
) |
Function*************************************************************
Synopsis [Existentially quantifies the variable.]
Description []
SideEffects []
SeeAlso []
Definition at line 684 of file kitTruth.c.
void Kit_TruthExistNew | ( | unsigned * | pRes, |
unsigned * | pTruth, | ||
int | nVars, | ||
int | iVar | ||
) |
Function*************************************************************
Synopsis [Existentially quantifies the variable.]
Description []
SideEffects []
SeeAlso []
Definition at line 738 of file kitTruth.c.
void Kit_TruthExistSet | ( | unsigned * | pRes, |
unsigned * | pTruth, | ||
int | nVars, | ||
unsigned | uMask | ||
) |
Function*************************************************************
Synopsis [Existantially quantifies the set of variables.]
Description []
SideEffects []
SeeAlso []
Definition at line 793 of file kitTruth.c.
void Kit_TruthForall | ( | unsigned * | pTruth, |
int | nVars, | ||
int | iVar | ||
) |
Function*************************************************************
Synopsis [Unversally quantifies the variable.]
Description []
SideEffects []
SeeAlso []
Definition at line 813 of file kitTruth.c.
void Kit_TruthForallNew | ( | unsigned * | pRes, |
unsigned * | pTruth, | ||
int | nVars, | ||
int | iVar | ||
) |
Function*************************************************************
Synopsis [Universally quantifies the variable.]
Description []
SideEffects []
SeeAlso []
Definition at line 867 of file kitTruth.c.
void Kit_TruthForallSet | ( | unsigned * | pRes, |
unsigned * | pTruth, | ||
int | nVars, | ||
unsigned | uMask | ||
) |
Function*************************************************************
Synopsis [Universally quantifies the set of variables.]
Description []
SideEffects []
SeeAlso []
Definition at line 1048 of file kitTruth.c.
unsigned Kit_TruthHash | ( | unsigned * | pIn, |
int | nWords | ||
) |
Function*************************************************************
Synopsis [Canonicize the truth table.]
Description []
SideEffects []
SeeAlso []
Definition at line 1560 of file kitTruth.c.
int Kit_TruthMinCofSuppOverlap | ( | unsigned * | pTruth, |
int | nVars, | ||
int * | pVarMin | ||
) |
Function*************************************************************
Synopsis [Computes minimum overlap in supports of cofactors.]
Description []
SideEffects []
SeeAlso []
Definition at line 1315 of file kitTruth.c.
void Kit_TruthMuxVar | ( | unsigned * | pOut, |
unsigned * | pCof0, | ||
unsigned * | pCof1, | ||
int | nVars, | ||
int | iVar | ||
) |
Function*************************************************************
Synopsis [Multiplexes two functions with the given variable.]
Description []
SideEffects []
SeeAlso []
Definition at line 1069 of file kitTruth.c.
void Kit_TruthMuxVarPhase | ( | unsigned * | pOut, |
unsigned * | pCof0, | ||
unsigned * | pCof1, | ||
int | nVars, | ||
int | iVar, | ||
int | fCompl0 | ||
) |
Function*************************************************************
Synopsis [Multiplexes two functions with the given variable.]
Description []
SideEffects []
SeeAlso []
Definition at line 1125 of file kitTruth.c.
void Kit_TruthPermute | ( | unsigned * | pOut, |
unsigned * | pIn, | ||
int | nVars, | ||
char * | pPerm, | ||
int | fReturnIn | ||
) |
Function*************************************************************
Synopsis [Implement give permutation.]
Description [The input and output truth tables are in pIn/pOut. The number of variables is nVars. Permutation is in pPerm.]
SideEffects [The input truth table is modified.]
SeeAlso []
Definition at line 233 of file kitTruth.c.
void Kit_TruthPrintProfile | ( | unsigned * | pTruth, |
int | nVars | ||
) |
Function*************************************************************
Synopsis [Dumps truth table into a file.]
Description [Generates script file for reading into ABC.]
SideEffects []
SeeAlso []
Definition at line 2203 of file kitTruth.c.
void Kit_TruthPrintProfile_int | ( | unsigned * | pTruth, |
int | nVars | ||
) |
Function*************************************************************
Synopsis [Dumps truth table into a file.]
Description [Generates script file for reading into ABC.]
SideEffects []
SeeAlso []
Definition at line 2029 of file kitTruth.c.
unsigned Kit_TruthSemiCanonicize | ( | unsigned * | pInOut, |
unsigned * | pAux, | ||
int | nVars, | ||
char * | pCanonPerm | ||
) |
Function*************************************************************
Synopsis [Canonicize the truth table.]
Description [Returns the phase. ]
SideEffects []
SeeAlso []
Definition at line 1657 of file kitTruth.c.
void Kit_TruthShrink | ( | unsigned * | pOut, |
unsigned * | pIn, | ||
int | nVars, | ||
int | nVarsAll, | ||
unsigned | Phase, | ||
int | fReturnIn | ||
) |
Function*************************************************************
Synopsis [Shrinks the truth table according to the phase.]
Description [The input and output truth tables are in pIn/pOut. The current number of variables is nVars. The total number of variables in nVarsAll. The last argument (Phase) shows what variables should remain.]
SideEffects [The input truth table is modified.]
SeeAlso []
Definition at line 200 of file kitTruth.c.
void Kit_TruthStretch | ( | unsigned * | pOut, |
unsigned * | pIn, | ||
int | nVars, | ||
int | nVarsAll, | ||
unsigned | Phase, | ||
int | fReturnIn | ||
) |
Function*************************************************************
Synopsis [Expands the truth table according to the phase.]
Description [The input and output truth tables are in pIn/pOut. The current number of variables is nVars. The total number of variables in nVarsAll. The last argument (Phase) contains shows where the variables should go.]
SideEffects [The input truth table is modified.]
SeeAlso []
Definition at line 166 of file kitTruth.c.
unsigned Kit_TruthSupport | ( | unsigned * | pTruth, |
int | nVars | ||
) |
Function*************************************************************
Synopsis [Returns support of the function.]
Description []
SideEffects []
SeeAlso []
Definition at line 346 of file kitTruth.c.
int Kit_TruthSupportSize | ( | unsigned * | pTruth, |
int | nVars | ||
) |
Function*************************************************************
Synopsis [Returns the number of support vars.]
Description []
SideEffects []
SeeAlso []
Definition at line 327 of file kitTruth.c.
ABC_NAMESPACE_IMPL_START void Kit_TruthSwapAdjacentVars | ( | unsigned * | pOut, |
unsigned * | pIn, | ||
int | nVars, | ||
int | iVar | ||
) |
DECLARATIONS ///.
CFile****************************************************************
FileName [kitTruth.c]
SystemName [ABC: Logic synthesis and verification system.]
PackageName [Computation kit.]
Synopsis [Procedures involving truth tables.]
Author [Alan Mishchenko]
Affiliation [UC Berkeley]
Date [Ver. 1.0. Started - Dec 6, 2006.]
Revision [
]FUNCTION DEFINITIONS /// Function*************************************************************
Synopsis [Swaps two adjacent variables in the truth table.]
Description [Swaps var number Start and var number Start+1 (0-based numbers). The input truth table is pIn. The output truth table is pOut.]
SideEffects []
SeeAlso []
Definition at line 46 of file kitTruth.c.
void Kit_TruthSwapAdjacentVars2 | ( | unsigned * | pIn, |
unsigned * | pOut, | ||
int | nVars, | ||
int | Start | ||
) |
Function*************************************************************
Synopsis [Swaps two adjacent variables in the truth table.]
Description [Swaps var number Start and var number Start+1 (0-based numbers). The input truth table is pIn. The output truth table is pOut.]
SideEffects []
SeeAlso []
Definition at line 103 of file kitTruth.c.
void Kit_TruthUniqueNew | ( | unsigned * | pRes, |
unsigned * | pTruth, | ||
int | nVars, | ||
int | iVar | ||
) |
Function*************************************************************
Synopsis [Universally quantifies the variable.]
Description []
SideEffects []
SeeAlso []
Definition at line 922 of file kitTruth.c.
int Kit_TruthVarInSupport | ( | unsigned * | pTruth, |
int | nVars, | ||
int | iVar | ||
) |
Function*************************************************************
Synopsis [Returns 1 if TT depends on the given variable.]
Description []
SideEffects []
SeeAlso []
Definition at line 270 of file kitTruth.c.
int Kit_TruthVarIsVacuous | ( | unsigned * | pOnset, |
unsigned * | pOffset, | ||
int | nVars, | ||
int | iVar | ||
) |
Function*************************************************************
Synopsis [Computes negative cofactor of the function.]
Description []
SideEffects []
SeeAlso []
Definition at line 625 of file kitTruth.c.
int Kit_TruthVarsAntiSymm | ( | unsigned * | pTruth, |
int | nVars, | ||
int | iVar0, | ||
int | iVar1, | ||
unsigned * | pCof0, | ||
unsigned * | pCof1 | ||
) |
Function*************************************************************
Synopsis [Checks antisymmetry of two variables.]
Description []
SideEffects []
SeeAlso []
Definition at line 1223 of file kitTruth.c.
int Kit_TruthVarsSymm | ( | unsigned * | pTruth, |
int | nVars, | ||
int | iVar0, | ||
int | iVar1, | ||
unsigned * | pCof0, | ||
unsigned * | pCof1 | ||
) |
Function*************************************************************
Synopsis [Checks symmetry of two variables.]
Description []
SideEffects []
SeeAlso []
Definition at line 1187 of file kitTruth.c.
int Kit_TruthXorCount | ( | unsigned * | pTruth0, |
unsigned * | pTruth1, | ||
int | nVars | ||
) |
Function*************************************************************
Synopsis [Returns the number of minterms in the Boolean difference.]
Description []
SideEffects []
SeeAlso []
Definition at line 1028 of file kitTruth.c.