#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <assert.h>
#include "misc/util/abc_global.h"
Go to the source code of this file.
|
static int | Tru_ManEqual (word *pOut, word *pIn, int nWords) |
| GLOBAL VARIABLES ///. More...
|
|
static int | Tru_ManEqual0 (word *pOut, int nWords) |
|
static int | Tru_ManEqual1 (word *pOut, int nWords) |
|
static word * | Tru_ManCopy (word *pOut, word *pIn, int nWords) |
|
static word * | Tru_ManClear (word *pOut, int nWords) |
|
static word * | Tru_ManFill (word *pOut, int nWords) |
|
static word * | Tru_ManNot (word *pOut, int nWords) |
|
static word * | Tru_ManAnd (word *pOut, word *pIn, int nWords) |
|
static word * | Tru_ManOr (word *pOut, word *pIn, int nWords) |
|
static word * | Tru_ManCopyNot (word *pOut, word *pIn, int nWords) |
|
static word * | Tru_ManAndNot (word *pOut, word *pIn, int nWords) |
|
static word * | Tru_ManOrNot (word *pOut, word *pIn, int nWords) |
|
static word * | Tru_ManCopyNotCond (word *pOut, word *pIn, int nWords, int fCompl) |
|
static word * | Tru_ManAndNotCond (word *pOut, word *pIn, int nWords, int fCompl) |
|
static word * | Tru_ManOrNotCond (word *pOut, word *pIn, int nWords, int fCompl) |
|
Tru_Man_t * | Tru_ManAlloc (int nVars) |
| FUNCTION DECLARATIONS ///. More...
|
|
void | Tru_ManFree (Tru_Man_t *p) |
|
word * | Tru_ManVar (Tru_Man_t *p, int v) |
|
word * | Tru_ManFunc (Tru_Man_t *p, int h) |
|
int | Tru_ManInsert (Tru_Man_t *p, word *pTruth) |
|
INCLUDES ///.
CFile****************************************************************
FileName [satTruth.h]
SystemName [ABC: Logic synthesis and verification system.]
PackageName [SAT solver.]
Synopsis [Truth table computation package.]
Author [Alan Mishchenko alanm.nosp@m.i@ee.nosp@m.cs.be.nosp@m.rkel.nosp@m.ey.ed.nosp@m.u]
Affiliation [UC Berkeley]
Date [Ver. 1.0. Started - January 1, 2004.]
Revision [
- Id:
- satTruth.h,v 1.0 2004/01/01 1:00:00 alanmi Exp
]PARAMETERS ///STRUCTURE DEFINITIONS ///
Definition at line 44 of file satTruth.h.
FUNCTION DECLARATIONS ///.
Function*************************************************************
Synopsis [Start the truth table logging.]
Description []
SideEffects []
SeeAlso []
Definition at line 198 of file satTruth.c.
211 assert( nVars > 0 && nVars <= 16 );
214 p->nWords = (nVars < 6) ? 1 : (1 << (nVars-6));
215 p->nEntrySize = (
sizeof(
Tru_One_t) + p->nWords *
sizeof(
word))/
sizeof(
int);
216 p->nTableSize = 8147;
221 for ( i = 0; i < nVars; i++ )
223 for ( w = 0; w < p->nWords; w++ )
225 p->pZero[w] = Masks[i];
226 else if ( w & (1 << (i-6)) )
227 p->pZero[w] = ~(
word)0;
231 assert( !i || p->hIthVars[i] > p->hIthVars[i-1] );
static Vec_Set_t * Vec_SetAlloc(int nPageSize)
#define ABC_ALLOC(type, num)
struct Tru_One_t_ Tru_One_t
unsigned __int64 word
DECLARATIONS ///.
typedefABC_NAMESPACE_HEADER_START struct Tru_Man_t_ Tru_Man_t
INCLUDES ///.
int Tru_ManInsert(Tru_Man_t *p, word *pTruth)
static word * Tru_ManClear(word *pOut, int nWords)
#define ABC_CONST(number)
PARAMETERS ///.
#define ABC_CALLOC(type, num)
static word* Tru_ManAnd |
( |
word * |
pOut, |
|
|
word * |
pIn, |
|
|
int |
nWords |
|
) |
| |
|
inlinestatic |
Definition at line 61 of file satTruth.h.
61 {
int w;
for ( w = 0; w <
nWords; w++ ) pOut[w] &= pIn[w];
return pOut; }
static word* Tru_ManAndNot |
( |
word * |
pOut, |
|
|
word * |
pIn, |
|
|
int |
nWords |
|
) |
| |
|
inlinestatic |
Definition at line 64 of file satTruth.h.
64 {
int w;
for ( w = 0; w <
nWords; w++ ) pOut[w] &= ~pIn[w];
return pOut; }
static word* Tru_ManAndNotCond |
( |
word * |
pOut, |
|
|
word * |
pIn, |
|
|
int |
nWords, |
|
|
int |
fCompl |
|
) |
| |
|
inlinestatic |
Definition at line 67 of file satTruth.h.
static word * Tru_ManAndNot(word *pOut, word *pIn, int nWords)
static word * Tru_ManAnd(word *pOut, word *pIn, int nWords)
static word* Tru_ManClear |
( |
word * |
pOut, |
|
|
int |
nWords |
|
) |
| |
|
inlinestatic |
Definition at line 58 of file satTruth.h.
58 {
int w;
for ( w = 0; w <
nWords; w++ ) pOut[w] = 0;
return pOut; }
static word* Tru_ManCopy |
( |
word * |
pOut, |
|
|
word * |
pIn, |
|
|
int |
nWords |
|
) |
| |
|
inlinestatic |
Definition at line 57 of file satTruth.h.
57 {
int w;
for ( w = 0; w <
nWords; w++ ) pOut[w] = pIn[w];
return pOut; }
static word* Tru_ManCopyNot |
( |
word * |
pOut, |
|
|
word * |
pIn, |
|
|
int |
nWords |
|
) |
| |
|
inlinestatic |
Definition at line 63 of file satTruth.h.
63 {
int w;
for ( w = 0; w <
nWords; w++ ) pOut[w] = ~pIn[w];
return pOut; }
static word* Tru_ManCopyNotCond |
( |
word * |
pOut, |
|
|
word * |
pIn, |
|
|
int |
nWords, |
|
|
int |
fCompl |
|
) |
| |
|
inlinestatic |
Definition at line 66 of file satTruth.h.
static word * Tru_ManCopy(word *pOut, word *pIn, int nWords)
static word * Tru_ManCopyNot(word *pOut, word *pIn, int nWords)
static int Tru_ManEqual |
( |
word * |
pOut, |
|
|
word * |
pIn, |
|
|
int |
nWords |
|
) |
| |
|
inlinestatic |
GLOBAL VARIABLES ///.
MACRO DEFINITIONS ///
Definition at line 54 of file satTruth.h.
54 {
int w;
for ( w = 0; w <
nWords; w++ )
if(pOut[w]!=pIn[w])
return 0;
return 1; }
static int Tru_ManEqual0 |
( |
word * |
pOut, |
|
|
int |
nWords |
|
) |
| |
|
inlinestatic |
Definition at line 55 of file satTruth.h.
55 {
int w;
for ( w = 0; w <
nWords; w++ )
if(pOut[w]!=0)
return 0;
return 1; }
static int Tru_ManEqual1 |
( |
word * |
pOut, |
|
|
int |
nWords |
|
) |
| |
|
inlinestatic |
Definition at line 56 of file satTruth.h.
56 {
int w;
for ( w = 0; w <
nWords; w++ )
if(pOut[w]!=~(
word)0)
return 0;
return 1; }
unsigned __int64 word
DECLARATIONS ///.
static word* Tru_ManFill |
( |
word * |
pOut, |
|
|
int |
nWords |
|
) |
| |
|
inlinestatic |
Definition at line 59 of file satTruth.h.
59 {
int w;
for ( w = 0; w <
nWords; w++ ) pOut[w] = ~(
word)0;
return pOut; }
unsigned __int64 word
DECLARATIONS ///.
Function*************************************************************
Synopsis [Stop the truth table logging.]
Description []
SideEffects []
SeeAlso []
Definition at line 248 of file satTruth.c.
250 printf(
"Lookups = %d. Entries = %d.\n",
p->nTableLookups,
Vec_SetEntryNum(
p->pMem) );
static void Vec_SetFree(Vec_Set_t *p)
static int Vec_SetEntryNum(Vec_Set_t *p)
Function*************************************************************
Synopsis [Returns stored truth table]
Description []
SideEffects []
SeeAlso []
Definition at line 285 of file satTruth.c.
static Tru_One_t * Tru_ManReadOne(Tru_Man_t *p, int h)
Function*************************************************************
Synopsis [Adds entry to the hash table.]
Description []
SideEffects []
SeeAlso []
Definition at line 158 of file satTruth.c.
168 fCompl = pTruth[0] & 1;
176 assert( (*pSpot & 1) == 0 );
184 return *pSpot ^ fCompl;
static word * Tru_ManNot(word *pOut, int nWords)
void Tru_ManResize(Tru_Man_t *p)
static int Vec_SetAppend(Vec_Set_t *p, int *pArray, int nSize)
static int Vec_SetEntryNum(Vec_Set_t *p)
static int Tru_ManEqual0(word *pOut, int nWords)
static Tru_One_t * Tru_ManReadOne(Tru_Man_t *p, int h)
int * Tru_ManLookup(Tru_Man_t *p, word *pTruth)
static word * Tru_ManCopy(word *pOut, word *pIn, int nWords)
static int Tru_ManEqual1(word *pOut, int nWords)
static word* Tru_ManNot |
( |
word * |
pOut, |
|
|
int |
nWords |
|
) |
| |
|
inlinestatic |
Definition at line 60 of file satTruth.h.
60 {
int w;
for ( w = 0; w <
nWords; w++ ) pOut[w] = ~pOut[w];
return pOut; }
static word* Tru_ManOr |
( |
word * |
pOut, |
|
|
word * |
pIn, |
|
|
int |
nWords |
|
) |
| |
|
inlinestatic |
Definition at line 62 of file satTruth.h.
62 {
int w;
for ( w = 0; w <
nWords; w++ ) pOut[w] |= pIn[w];
return pOut; }
static word* Tru_ManOrNot |
( |
word * |
pOut, |
|
|
word * |
pIn, |
|
|
int |
nWords |
|
) |
| |
|
inlinestatic |
Definition at line 65 of file satTruth.h.
65 {
int w;
for ( w = 0; w <
nWords; w++ ) pOut[w] |= ~pIn[w];
return pOut; }
static word* Tru_ManOrNotCond |
( |
word * |
pOut, |
|
|
word * |
pIn, |
|
|
int |
nWords, |
|
|
int |
fCompl |
|
) |
| |
|
inlinestatic |
Definition at line 68 of file satTruth.h.
static word * Tru_ManOrNot(word *pOut, word *pIn, int nWords)
static word * Tru_ManOr(word *pOut, word *pIn, int nWords)
Function*************************************************************
Synopsis [Returns elementary variable.]
Description []
SideEffects []
SeeAlso []
Definition at line 268 of file satTruth.c.
270 assert( v >= 0 && v < p->nVars );
static Tru_One_t * Tru_ManReadOne(Tru_Man_t *p, int h)