abc-master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
abcOdc.c File Reference
#include "base/abc/abc.h"

Go to the source code of this file.

Data Structures

struct  Odc_Obj_t_
 
struct  Odc_Man_t_
 

Macros

#define ABC_DC_MAX_NODES   (1<<15)
 DECLARATIONS ///. More...
 
#define Odc_ForEachPi(p, Lit, i)   for ( i = 0; (i < Odc_PiNum(p)) && (((Lit) = Odc_Var(p, i)), 1); i++ )
 
#define Odc_ForEachAnd(p, pObj, i)   for ( i = 1 + Odc_CiNum(p); (i < Odc_ObjNum(p)) && ((pObj) = (p)->pObjs + i); i++ )
 

Typedefs

typedef unsigned short Odc_Lit_t
 
typedef struct Odc_Obj_t_ Odc_Obj_t
 

Functions

static int Odc_PiNum (Odc_Man_t *p)
 
static int Odc_NodeNum (Odc_Man_t *p)
 
static int Odc_ObjNum (Odc_Man_t *p)
 
static int Odc_IsComplement (Odc_Lit_t Lit)
 
static Odc_Lit_t Odc_Regular (Odc_Lit_t Lit)
 
static Odc_Lit_t Odc_Not (Odc_Lit_t Lit)
 
static Odc_Lit_t Odc_NotCond (Odc_Lit_t Lit, int c)
 
static Odc_Lit_t Odc_Const0 ()
 
static Odc_Lit_t Odc_Const1 ()
 
static Odc_Lit_t Odc_Var (Odc_Man_t *p, int i)
 
static int Odc_IsConst (Odc_Lit_t Lit)
 
static int Odc_IsTerm (Odc_Man_t *p, Odc_Lit_t Lit)
 
static Odc_Obj_tOdc_ObjNew (Odc_Man_t *p)
 
static Odc_Lit_t Odc_Obj2Lit (Odc_Man_t *p, Odc_Obj_t *pObj)
 
static Odc_Obj_tOdc_Lit2Obj (Odc_Man_t *p, Odc_Lit_t Lit)
 
static Odc_Lit_t Odc_ObjChild0 (Odc_Obj_t *pObj)
 
static Odc_Lit_t Odc_ObjChild1 (Odc_Obj_t *pObj)
 
static Odc_Lit_t Odc_ObjFanin0 (Odc_Obj_t *pObj)
 
static Odc_Lit_t Odc_ObjFanin1 (Odc_Obj_t *pObj)
 
static int Odc_ObjFaninC0 (Odc_Obj_t *pObj)
 
static int Odc_ObjFaninC1 (Odc_Obj_t *pObj)
 
static void Odc_ManIncrementTravId (Odc_Man_t *p)
 
static void Odc_ObjSetTravIdCurrent (Odc_Man_t *p, Odc_Obj_t *pObj)
 
static int Odc_ObjIsTravIdCurrent (Odc_Man_t *p, Odc_Obj_t *pObj)
 
static unsigned * Odc_ObjTruth (Odc_Man_t *p, Odc_Lit_t Lit)
 
Odc_Man_tAbc_NtkDontCareAlloc (int nVarsMax, int nLevels, int fVerbose, int fVeryVerbose)
 FUNCTION DEFINITIONS ///. More...
 
void Abc_NtkDontCareClear (Odc_Man_t *p)
 
void Abc_NtkDontCareFree (Odc_Man_t *p)
 
void Abc_NtkDontCareWinSweepLeafTfo_rec (Abc_Obj_t *pObj, int nLevelLimit, Abc_Obj_t *pNode)
 
void Abc_NtkDontCareWinSweepLeafTfo (Odc_Man_t *p)
 
void Abc_NtkDontCareWinCollectRoots_rec (Abc_Obj_t *pObj, Vec_Ptr_t *vRoots)
 
void Abc_NtkDontCareWinCollectRoots (Odc_Man_t *p)
 
int Abc_NtkDontCareWinAddMissing_rec (Odc_Man_t *p, Abc_Obj_t *pObj)
 
int Abc_NtkDontCareWinAddMissing (Odc_Man_t *p)
 
int Abc_NtkDontCareWindow (Odc_Man_t *p)
 
static unsigned Odc_HashKey (Odc_Lit_t iFan0, Odc_Lit_t iFan1, int TableSize)
 
static Odc_Lit_tOdc_HashLookup (Odc_Man_t *p, Odc_Lit_t iFan0, Odc_Lit_t iFan1)
 
static Odc_Lit_t Odc_And (Odc_Man_t *p, Odc_Lit_t iFan0, Odc_Lit_t iFan1)
 
static Odc_Lit_t Odc_Or (Odc_Man_t *p, Odc_Lit_t iFan0, Odc_Lit_t iFan1)
 
static Odc_Lit_t Odc_Xor (Odc_Man_t *p, Odc_Lit_t iFan0, Odc_Lit_t iFan1)
 
void * Abc_NtkDontCareTransfer_rec (Odc_Man_t *p, Abc_Obj_t *pNode, Abc_Obj_t *pPivot)
 
int Abc_NtkDontCareTransfer (Odc_Man_t *p)
 
unsigned Abc_NtkDontCareCofactors_rec (Odc_Man_t *p, Odc_Lit_t Lit, unsigned uMask)
 
int Abc_NtkDontCareQuantify (Odc_Man_t *p)
 
void Abc_NtkDontCareSimulateSetElem2 (Odc_Man_t *p)
 
void Abc_NtkDontCareSimulateSetElem (Odc_Man_t *p)
 
void Abc_NtkDontCareSimulateSetRand (Odc_Man_t *p)
 
int Abc_NtkDontCareCountMintsWord (Odc_Man_t *p, unsigned *puTruth)
 
void Abc_NtkDontCareTruthOne (Odc_Man_t *p, Odc_Lit_t Lit)
 
void Abc_NtkDontCareSimulate_rec (Odc_Man_t *p, Odc_Lit_t Lit)
 
int Abc_NtkDontCareSimulate (Odc_Man_t *p, unsigned *puTruth)
 
int Abc_NtkDontCareSimulateBefore (Odc_Man_t *p, unsigned *puTruth)
 
int Abc_NtkDontCareCompute (Odc_Man_t *p, Abc_Obj_t *pNode, Vec_Ptr_t *vLeaves, unsigned *puTruth)
 

Macro Definition Documentation

#define ABC_DC_MAX_NODES   (1<<15)

DECLARATIONS ///.

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

FileName [abcOdc.c]

SystemName [ABC: Logic synthesis and verification system.]

PackageName [Network and node package.]

Synopsis [Scalable computation of observability don't-cares.]

Author [Alan Mishchenko]

Affiliation [UC Berkeley]

Date [Ver. 1.0. Started - June 20, 2005.]

Revision [

Id:
abcOdc.c,v 1.00 2005/06/20 00:00:00 alanmi Exp

]

Definition at line 30 of file abcOdc.c.

#define Odc_ForEachAnd (   p,
  pObj,
 
)    for ( i = 1 + Odc_CiNum(p); (i < Odc_ObjNum(p)) && ((pObj) = (p)->pObjs + i); i++ )

Definition at line 142 of file abcOdc.c.

#define Odc_ForEachPi (   p,
  Lit,
 
)    for ( i = 0; (i < Odc_PiNum(p)) && (((Lit) = Odc_Var(p, i)), 1); i++ )

Definition at line 140 of file abcOdc.c.

Typedef Documentation

typedef unsigned short Odc_Lit_t

Definition at line 32 of file abcOdc.c.

typedef struct Odc_Obj_t_ Odc_Obj_t

Definition at line 34 of file abcOdc.c.

Function Documentation

Odc_Man_t* Abc_NtkDontCareAlloc ( int  nVarsMax,
int  nLevels,
int  fVerbose,
int  fVeryVerbose 
)

FUNCTION DEFINITIONS ///.

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

Synopsis [Allocates the don't-care manager.]

Description [The parameters are the max number of cut variables, the number of fanout levels used for the ODC computation, and verbosiness.]

SideEffects []

SeeAlso []

Definition at line 162 of file abcOdc.c.

163 {
164  Odc_Man_t * p;
165  unsigned * pData;
166  int i, k;
167  p = ABC_ALLOC( Odc_Man_t, 1 );
168  memset( p, 0, sizeof(Odc_Man_t) );
169  assert( nVarsMax > 4 && nVarsMax < 16 );
170  assert( nLevels > 0 && nLevels < 10 );
171 
172  srand( 0xABC );
173 
174  // dont'-care parameters
175  p->nVarsMax = nVarsMax;
176  p->nLevels = nLevels;
177  p->fVerbose = fVerbose;
178  p->fVeryVerbose = fVeryVerbose;
179  p->nPercCutoff = 10;
180 
181  // windowing
182  p->vRoots = Vec_PtrAlloc( 128 );
183  p->vBranches = Vec_PtrAlloc( 128 );
184 
185  // internal AIG package
186  // allocate room for objects
188  p->pObjs = ABC_ALLOC( Odc_Obj_t, p->nObjsAlloc * sizeof(Odc_Obj_t) );
189  p->nPis = nVarsMax + 32;
190  p->nObjs = 1 + p->nPis;
191  memset( p->pObjs, 0, p->nObjs * sizeof(Odc_Obj_t) );
192  // set the PI masks
193  for ( i = 0; i < 32; i++ )
194  p->pObjs[1 + p->nVarsMax + i].uMask = (1 << i);
195  // allocate hash table
196  p->nTableSize = p->nObjsAlloc/3 + 1;
197  p->pTable = ABC_ALLOC( Odc_Lit_t, p->nTableSize * sizeof(Odc_Lit_t) );
198  memset( p->pTable, 0, p->nTableSize * sizeof(Odc_Lit_t) );
199  p->vUsedSpots = Vec_IntAlloc( 1000 );
200 
201  // truth tables
202  p->nWords = Abc_TruthWordNum( p->nVarsMax );
203  p->nBits = p->nWords * 8 * sizeof(unsigned);
206 
207  // set elementary truth tables
208  Abc_InfoFill( (unsigned *)Vec_PtrEntry(p->vTruths, 0), p->nWords );
209  for ( k = 0; k < p->nVarsMax; k++ )
210  {
211 // pData = Odc_ObjTruth( p, Odc_Var(p, k) );
212  pData = (unsigned *)Vec_PtrEntry( p->vTruthsElem, k );
213  Abc_InfoClear( pData, p->nWords );
214  for ( i = 0; i < p->nBits; i++ )
215  if ( i & (1 << k) )
216  pData[i>>5] |= (1 << (i&31));
217  }
218 
219  // set random truth table for the additional inputs
220  for ( k = p->nVarsMax; k < p->nPis; k++ )
221  {
222  pData = Odc_ObjTruth( p, Odc_Var(p, k) );
223  Abc_InfoRandom( pData, p->nWords );
224  }
225 
226  // set the miter to the unused value
227  p->iRoot = 0xffff;
228  return p;
229 }
char * memset()
Vec_Ptr_t * vBranches
Definition: abcOdc.c:58
unsigned uMask
Definition: abcOdc.c:42
static unsigned * Odc_ObjTruth(Odc_Man_t *p, Odc_Lit_t Lit)
Definition: abcOdc.c:137
static Llb_Mgr_t * p
Definition: llb3Image.c:950
int nVarsMax
Definition: abcOdc.c:48
static Odc_Lit_t Odc_Var(Odc_Man_t *p, int i)
Definition: abcOdc.c:114
static void Abc_InfoFill(unsigned *p, int nWords)
Definition: abc.h:237
#define ABC_DC_MAX_NODES
DECLARATIONS ///.
Definition: abcOdc.c:30
int fVerbose
Definition: abcOdc.c:50
int fVeryVerbose
Definition: abcOdc.c:51
#define ABC_ALLOC(type, num)
Definition: abc_global.h:229
static int Abc_TruthWordNum(int nVars)
Definition: abc_global.h:256
int nPis
Definition: abcOdc.c:62
Odc_Lit_t iRoot
Definition: abcOdc.c:66
static Vec_Int_t * Vec_IntAlloc(int nCap)
FUNCTION DEFINITIONS ///.
Definition: bblif.c:149
int nPercCutoff
Definition: abcOdc.c:52
int nObjs
Definition: abcOdc.c:63
static void Abc_InfoClear(unsigned *p, int nWords)
Definition: abc.h:236
static void * Vec_PtrEntry(Vec_Ptr_t *p, int i)
Definition: vecPtr.h:362
Vec_Ptr_t * vTruths
Definition: abcOdc.c:76
int nBits
Definition: abcOdc.c:74
static Vec_Ptr_t * Vec_PtrAlloc(int nCap)
FUNCTION DEFINITIONS ///.
Definition: vecPtr.h:83
Vec_Ptr_t * vRoots
Definition: abcOdc.c:57
Vec_Ptr_t * vTruthsElem
Definition: abcOdc.c:77
Odc_Obj_t * pObjs
Definition: abcOdc.c:65
#define assert(ex)
Definition: util_old.h:213
static void Abc_InfoRandom(unsigned *p, int nWords)
Definition: abc.h:235
int nObjsAlloc
Definition: abcOdc.c:64
Odc_Lit_t * pTable
Definition: abcOdc.c:69
unsigned short Odc_Lit_t
Definition: abcOdc.c:32
Vec_Int_t * vUsedSpots
Definition: abcOdc.c:71
int nLevels
Definition: abcOdc.c:49
int nTableSize
Definition: abcOdc.c:70
static Vec_Ptr_t * Vec_PtrAllocSimInfo(int nEntries, int nWords)
Definition: vecPtr.h:929
int nWords
Definition: abcOdc.c:75
void Abc_NtkDontCareClear ( Odc_Man_t p)

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

Synopsis [Clears the manager.]

Description []

SideEffects []

SeeAlso []

Definition at line 242 of file abcOdc.c.

243 {
244  abctime clk = Abc_Clock();
245  // clean the structural hashing table
246  if ( Vec_IntSize(p->vUsedSpots) > p->nTableSize/3 ) // more than one third
247  memset( p->pTable, 0, sizeof(Odc_Lit_t) * p->nTableSize );
248  else
249  {
250  int iSpot, i;
251  Vec_IntForEachEntry( p->vUsedSpots, iSpot, i )
252  p->pTable[iSpot] = 0;
253  }
254  Vec_IntClear( p->vUsedSpots );
255  // reset the number of nodes
256  p->nObjs = 1 + p->nPis;
257  // reset the root node
258  p->iRoot = 0xffff;
259 
260 p->timeClean += Abc_Clock() - clk;
261 }
char * memset()
static abctime Abc_Clock()
Definition: abc_global.h:279
static int Vec_IntSize(Vec_Int_t *p)
Definition: bblif.c:252
static void Vec_IntClear(Vec_Int_t *p)
Definition: bblif.c:452
ABC_INT64_T abctime
Definition: abc_global.h:278
#define Vec_IntForEachEntry(vVec, Entry, i)
MACRO DEFINITIONS ///.
Definition: vecInt.h:54
Odc_Lit_t * pTable
Definition: abcOdc.c:69
unsigned short Odc_Lit_t
Definition: abcOdc.c:32
Vec_Int_t * vUsedSpots
Definition: abcOdc.c:71
int nTableSize
Definition: abcOdc.c:70
unsigned Abc_NtkDontCareCofactors_rec ( Odc_Man_t p,
Odc_Lit_t  Lit,
unsigned  uMask 
)

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

Synopsis [Recursively computes the pair of cofactors.]

Description []

SideEffects []

SeeAlso []

Definition at line 738 of file abcOdc.c.

739 {
740  Odc_Obj_t * pObj;
741  unsigned uData0, uData1;
742  Odc_Lit_t uLit0, uLit1, uRes0, uRes1;
743  assert( !Odc_IsComplement(Lit) );
744  // skip visited objects
745  pObj = Odc_Lit2Obj( p, Lit );
746  if ( Odc_ObjIsTravIdCurrent(p, pObj) )
747  return pObj->uData;
748  Odc_ObjSetTravIdCurrent(p, pObj);
749  // skip objects out of the cone
750  if ( (pObj->uMask & uMask) == 0 )
751  return pObj->uData = ((Lit << 16) | Lit);
752  // consider the case when the node is the var
753  if ( pObj->uMask == uMask && Odc_IsTerm(p, Lit) )
754  return pObj->uData = ((Odc_Const1() << 16) | Odc_Const0());
755  // compute the cofactors
756  uData0 = Abc_NtkDontCareCofactors_rec( p, Odc_ObjFanin0(pObj), uMask );
757  uData1 = Abc_NtkDontCareCofactors_rec( p, Odc_ObjFanin1(pObj), uMask );
758  // find the 0-cofactor
759  uLit0 = Odc_NotCond( (Odc_Lit_t)(uData0 & 0xffff), Odc_ObjFaninC0(pObj) );
760  uLit1 = Odc_NotCond( (Odc_Lit_t)(uData1 & 0xffff), Odc_ObjFaninC1(pObj) );
761  uRes0 = Odc_And( p, uLit0, uLit1 );
762  // find the 1-cofactor
763  uLit0 = Odc_NotCond( (Odc_Lit_t)(uData0 >> 16), Odc_ObjFaninC0(pObj) );
764  uLit1 = Odc_NotCond( (Odc_Lit_t)(uData1 >> 16), Odc_ObjFaninC1(pObj) );
765  uRes1 = Odc_And( p, uLit0, uLit1 );
766  // find the result
767  return pObj->uData = ((uRes1 << 16) | uRes0);
768 }
unsigned uMask
Definition: abcOdc.c:42
static void Odc_ObjSetTravIdCurrent(Odc_Man_t *p, Odc_Obj_t *pObj)
Definition: abcOdc.c:133
unsigned Abc_NtkDontCareCofactors_rec(Odc_Man_t *p, Odc_Lit_t Lit, unsigned uMask)
Definition: abcOdc.c:738
static Odc_Lit_t Odc_ObjFanin1(Odc_Obj_t *pObj)
Definition: abcOdc.c:127
static Odc_Obj_t * Odc_Lit2Obj(Odc_Man_t *p, Odc_Lit_t Lit)
Definition: abcOdc.c:121
static Odc_Lit_t Odc_NotCond(Odc_Lit_t Lit, int c)
Definition: abcOdc.c:109
static Odc_Lit_t Odc_ObjFanin0(Odc_Obj_t *pObj)
Definition: abcOdc.c:126
unsigned uData
Definition: abcOdc.c:41
static int Odc_IsComplement(Odc_Lit_t Lit)
Definition: abcOdc.c:106
static Odc_Lit_t Odc_Const0()
Definition: abcOdc.c:112
static Odc_Lit_t Odc_And(Odc_Man_t *p, Odc_Lit_t iFan0, Odc_Lit_t iFan1)
Definition: abcOdc.c:565
static int Odc_IsTerm(Odc_Man_t *p, Odc_Lit_t Lit)
Definition: abcOdc.c:116
static int Odc_ObjFaninC1(Odc_Obj_t *pObj)
Definition: abcOdc.c:129
static int Odc_ObjIsTravIdCurrent(Odc_Man_t *p, Odc_Obj_t *pObj)
Definition: abcOdc.c:134
#define assert(ex)
Definition: util_old.h:213
static int Odc_ObjFaninC0(Odc_Obj_t *pObj)
Definition: abcOdc.c:128
static Odc_Lit_t Odc_Const1()
Definition: abcOdc.c:113
unsigned short Odc_Lit_t
Definition: abcOdc.c:32
int Abc_NtkDontCareCompute ( Odc_Man_t p,
Abc_Obj_t pNode,
Vec_Ptr_t vLeaves,
unsigned *  puTruth 
)

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

Synopsis [Computes ODCs for the node in terms of the cut variables.]

Description [Returns the number of don't care minterms in the truth table. In particular, this procedure returns 0 if there is no don't-cares.]

SideEffects []

SeeAlso []

Definition at line 1033 of file abcOdc.c.

1034 {
1035  int nMints, RetValue;
1036  abctime clk, clkTotal = Abc_Clock();
1037 
1038  p->nWins++;
1039 
1040  // set the parameters
1041  assert( !Abc_ObjIsComplement(pNode) );
1042  assert( Abc_ObjIsNode(pNode) );
1043  assert( Vec_PtrSize(vLeaves) <= p->nVarsMax );
1044  p->vLeaves = vLeaves;
1045  p->pNode = pNode;
1046 
1047  // compute the window
1048 clk = Abc_Clock();
1049  RetValue = Abc_NtkDontCareWindow( p );
1050 p->timeWin += Abc_Clock() - clk;
1051  if ( !RetValue )
1052  {
1053 p->timeAbort += Abc_Clock() - clkTotal;
1054  Abc_InfoFill( puTruth, p->nWords );
1055  p->nWinsEmpty++;
1056  return 0;
1057  }
1058 
1059  if ( p->fVeryVerbose )
1060  {
1061  printf( " %5d : ", pNode->Id );
1062  printf( "Leaf = %2d ", Vec_PtrSize(p->vLeaves) );
1063  printf( "Root = %2d ", Vec_PtrSize(p->vRoots) );
1064  printf( "Bran = %2d ", Vec_PtrSize(p->vBranches) );
1065  printf( " | " );
1066  }
1067 
1068  // transfer the window into the AIG package
1069 clk = Abc_Clock();
1071 p->timeMiter += Abc_Clock() - clk;
1072 
1073  // simulate to estimate the amount of don't-cares
1074 clk = Abc_Clock();
1075  nMints = Abc_NtkDontCareSimulateBefore( p, puTruth );
1076 p->timeSim += Abc_Clock() - clk;
1077  if ( p->fVeryVerbose )
1078  {
1079  printf( "AIG = %5d ", Odc_NodeNum(p) );
1080  printf( "%6.2f %% ", 100.0 * (p->nBits - nMints) / p->nBits );
1081  }
1082 
1083  // if there is less then the given percentage of don't-cares, skip
1084  if ( 100.0 * (p->nBits - nMints) / p->nBits < 1.0 * p->nPercCutoff )
1085  {
1086 p->timeAbort += Abc_Clock() - clkTotal;
1087  if ( p->fVeryVerbose )
1088  printf( "Simulation cutoff.\n" );
1089  Abc_InfoFill( puTruth, p->nWords );
1090  p->nSimsEmpty++;
1091  return 0;
1092  }
1093 
1094  // quantify external variables
1095 clk = Abc_Clock();
1096  RetValue = Abc_NtkDontCareQuantify( p );
1097 p->timeQuant += Abc_Clock() - clk;
1098  if ( !RetValue )
1099  {
1100 p->timeAbort += Abc_Clock() - clkTotal;
1101  if ( p->fVeryVerbose )
1102  printf( "=== Overflow! ===\n" );
1103  Abc_InfoFill( puTruth, p->nWords );
1104  p->nQuantsOver++;
1105  return 0;
1106  }
1107 
1108  // get the truth table
1109 clk = Abc_Clock();
1111  nMints = Abc_NtkDontCareSimulate( p, puTruth );
1112 p->timeTruth += Abc_Clock() - clk;
1113  if ( p->fVeryVerbose )
1114  {
1115  printf( "AIG = %5d ", Odc_NodeNum(p) );
1116  printf( "%6.2f %% ", 100.0 * (p->nBits - nMints) / p->nBits );
1117  printf( "\n" );
1118  }
1119 p->timeTotal += Abc_Clock() - clkTotal;
1120  p->nWinsFinish++;
1121  p->nTotalDcs += (int)(100.0 * (p->nBits - nMints) / p->nBits);
1122  return nMints;
1123 }
Vec_Ptr_t * vBranches
Definition: abcOdc.c:58
int Abc_NtkDontCareSimulate(Odc_Man_t *p, unsigned *puTruth)
Definition: abcOdc.c:982
int Abc_NtkDontCareWindow(Odc_Man_t *p)
Definition: abcOdc.c:477
int nVarsMax
Definition: abcOdc.c:48
Abc_Obj_t * pNode
Definition: abcOdc.c:55
abctime timeTruth
Definition: abcOdc.c:94
static void Abc_InfoFill(unsigned *p, int nWords)
Definition: abc.h:237
Vec_Ptr_t * vLeaves
Definition: abcOdc.c:56
abctime timeTotal
Definition: abcOdc.c:95
static int Odc_NodeNum(Odc_Man_t *p)
Definition: abcOdc.c:102
int nTotalDcs
Definition: abcOdc.c:86
int nWinsEmpty
Definition: abcOdc.c:82
abctime timeWin
Definition: abcOdc.c:90
int fVeryVerbose
Definition: abcOdc.c:51
static abctime Abc_Clock()
Definition: abc_global.h:279
abctime timeMiter
Definition: abcOdc.c:91
static int Vec_PtrSize(Vec_Ptr_t *p)
Definition: vecPtr.h:295
abctime timeAbort
Definition: abcOdc.c:96
static int Abc_ObjIsNode(Abc_Obj_t *pObj)
Definition: abc.h:355
int Abc_NtkDontCareTransfer(Odc_Man_t *p)
Definition: abcOdc.c:688
int nSimsEmpty
Definition: abcOdc.c:83
int Abc_NtkDontCareQuantify(Odc_Man_t *p)
Definition: abcOdc.c:781
int nPercCutoff
Definition: abcOdc.c:52
abctime timeSim
Definition: abcOdc.c:92
abctime timeQuant
Definition: abcOdc.c:93
int Abc_NtkDontCareSimulateBefore(Odc_Man_t *p, unsigned *puTruth)
Definition: abcOdc.c:1003
int nBits
Definition: abcOdc.c:74
int nWins
Definition: abcOdc.c:81
int Id
Definition: abc.h:132
int nQuantsOver
Definition: abcOdc.c:84
void Abc_NtkDontCareSimulateSetElem(Odc_Man_t *p)
Definition: abcOdc.c:843
Vec_Ptr_t * vRoots
Definition: abcOdc.c:57
#define assert(ex)
Definition: util_old.h:213
static int Abc_ObjIsComplement(Abc_Obj_t *p)
Definition: abc.h:322
ABC_INT64_T abctime
Definition: abc_global.h:278
int nWinsFinish
Definition: abcOdc.c:85
int nWords
Definition: abcOdc.c:75
int Abc_NtkDontCareCountMintsWord ( Odc_Man_t p,
unsigned *  puTruth 
)

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

Synopsis [Set random simulation words for PIs.]

Description []

SideEffects []

SeeAlso []

Definition at line 892 of file abcOdc.c.

893 {
894  int w, Counter = 0;
895  for ( w = 0; w < p->nWords; w++ )
896  if ( puTruth[w] )
897  Counter++;
898  return Counter;
899 }
static int Counter
int nWords
Definition: abcOdc.c:75
void Abc_NtkDontCareFree ( Odc_Man_t p)

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

Synopsis [Frees the don't-care manager.]

Description []

SideEffects []

SeeAlso []

Definition at line 274 of file abcOdc.c.

275 {
276  if ( p->fVerbose )
277  {
278  printf( "Wins = %5d. Empty = %5d. SimsEmpty = %5d. QuantOver = %5d. WinsFinish = %5d.\n",
279  p->nWins, p->nWinsEmpty, p->nSimsEmpty, p->nQuantsOver, p->nWinsFinish );
280  printf( "Ave DCs per window = %6.2f %%. Ave DCs per finished window = %6.2f %%.\n",
281  1.0*p->nTotalDcs/p->nWins, 1.0*p->nTotalDcs/p->nWinsFinish );
282  printf( "Runtime stats of the ODC manager:\n" );
283  ABC_PRT( "Cleaning ", p->timeClean );
284  ABC_PRT( "Windowing ", p->timeWin );
285  ABC_PRT( "Miter ", p->timeMiter );
286  ABC_PRT( "Simulation ", p->timeSim );
287  ABC_PRT( "Quantifying ", p->timeQuant );
288  ABC_PRT( "Truth table ", p->timeTruth );
289  ABC_PRT( "TOTAL ", p->timeTotal );
290  ABC_PRT( "Aborted ", p->timeAbort );
291  }
292  Vec_PtrFree( p->vRoots );
293  Vec_PtrFree( p->vBranches );
294  Vec_PtrFree( p->vTruths );
295  Vec_PtrFree( p->vTruthsElem );
296  Vec_IntFree( p->vUsedSpots );
297  ABC_FREE( p->pObjs );
298  ABC_FREE( p->pTable );
299  ABC_FREE( p );
300 }
Vec_Ptr_t * vBranches
Definition: abcOdc.c:58
abctime timeTruth
Definition: abcOdc.c:94
abctime timeTotal
Definition: abcOdc.c:95
int nTotalDcs
Definition: abcOdc.c:86
int nWinsEmpty
Definition: abcOdc.c:82
int fVerbose
Definition: abcOdc.c:50
abctime timeWin
Definition: abcOdc.c:90
abctime timeMiter
Definition: abcOdc.c:91
abctime timeAbort
Definition: abcOdc.c:96
int nSimsEmpty
Definition: abcOdc.c:83
abctime timeSim
Definition: abcOdc.c:92
abctime timeQuant
Definition: abcOdc.c:93
Vec_Ptr_t * vTruths
Definition: abcOdc.c:76
int nWins
Definition: abcOdc.c:81
#define ABC_FREE(obj)
Definition: abc_global.h:232
#define ABC_PRT(a, t)
Definition: abc_global.h:220
int nQuantsOver
Definition: abcOdc.c:84
Vec_Ptr_t * vRoots
Definition: abcOdc.c:57
Vec_Ptr_t * vTruthsElem
Definition: abcOdc.c:77
Odc_Obj_t * pObjs
Definition: abcOdc.c:65
static void Vec_IntFree(Vec_Int_t *p)
Definition: bblif.c:235
int nWinsFinish
Definition: abcOdc.c:85
abctime timeClean
Definition: abcOdc.c:89
Odc_Lit_t * pTable
Definition: abcOdc.c:69
Vec_Int_t * vUsedSpots
Definition: abcOdc.c:71
static void Vec_PtrFree(Vec_Ptr_t *p)
Definition: vecPtr.h:223
int Abc_NtkDontCareQuantify ( Odc_Man_t p)

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

Synopsis [Quantifies the branch variables.]

Description []

SideEffects []

SeeAlso []

Definition at line 781 of file abcOdc.c.

782 {
783  Odc_Lit_t uRes0, uRes1;
784  unsigned uData;
785  int i;
786  assert( p->iRoot < 0xffff );
787  assert( Vec_PtrSize(p->vBranches) <= 32 ); // the mask size
788  for ( i = 0; i < Vec_PtrSize(p->vBranches); i++ )
789  {
790  // compute the cofactors w.r.t. this variable
792  uData = Abc_NtkDontCareCofactors_rec( p, Odc_Regular(p->iRoot), (1 << i) );
793  uRes0 = Odc_NotCond( (Odc_Lit_t)(uData & 0xffff), Odc_IsComplement(p->iRoot) );
794  uRes1 = Odc_NotCond( (Odc_Lit_t)(uData >> 16), Odc_IsComplement(p->iRoot) );
795  // quantify this variable existentially
796  p->iRoot = Odc_Or( p, uRes0, uRes1 );
797  // check the limit
798  if ( Odc_ObjNum(p) > ABC_DC_MAX_NODES/2 )
799  return 0;
800  }
801  assert( p->nObjs <= p->nObjsAlloc );
802  return 1;
803 }
Vec_Ptr_t * vBranches
Definition: abcOdc.c:58
static int Odc_ObjNum(Odc_Man_t *p)
Definition: abcOdc.c:103
static Odc_Lit_t Odc_Or(Odc_Man_t *p, Odc_Lit_t iFan0, Odc_Lit_t iFan1)
Definition: abcOdc.c:613
unsigned Abc_NtkDontCareCofactors_rec(Odc_Man_t *p, Odc_Lit_t Lit, unsigned uMask)
Definition: abcOdc.c:738
#define ABC_DC_MAX_NODES
DECLARATIONS ///.
Definition: abcOdc.c:30
static Odc_Lit_t Odc_NotCond(Odc_Lit_t Lit, int c)
Definition: abcOdc.c:109
static int Vec_PtrSize(Vec_Ptr_t *p)
Definition: vecPtr.h:295
Odc_Lit_t iRoot
Definition: abcOdc.c:66
int nObjs
Definition: abcOdc.c:63
static int Odc_IsComplement(Odc_Lit_t Lit)
Definition: abcOdc.c:106
static Odc_Lit_t Odc_Regular(Odc_Lit_t Lit)
Definition: abcOdc.c:107
static void Odc_ManIncrementTravId(Odc_Man_t *p)
Definition: abcOdc.c:132
#define assert(ex)
Definition: util_old.h:213
int nObjsAlloc
Definition: abcOdc.c:64
unsigned short Odc_Lit_t
Definition: abcOdc.c:32
int Abc_NtkDontCareSimulate ( Odc_Man_t p,
unsigned *  puTruth 
)

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

Synopsis [Computes the truth table of the care set.]

Description [Returns the number of ones in the simulation info.]

SideEffects []

SeeAlso []

Definition at line 982 of file abcOdc.c.

983 {
986  Abc_InfoCopy( puTruth, Odc_ObjTruth(p, Odc_Regular(p->iRoot)), p->nWords );
987  if ( Odc_IsComplement(p->iRoot) )
988  Abc_InfoNot( puTruth, p->nWords );
989  return Extra_TruthCountOnes( puTruth, p->nVarsMax );
990 }
void Abc_NtkDontCareSimulate_rec(Odc_Man_t *p, Odc_Lit_t Lit)
Definition: abcOdc.c:952
static unsigned * Odc_ObjTruth(Odc_Man_t *p, Odc_Lit_t Lit)
Definition: abcOdc.c:137
int nVarsMax
Definition: abcOdc.c:48
Odc_Lit_t iRoot
Definition: abcOdc.c:66
static void Abc_InfoNot(unsigned *p, int nWords)
Definition: abc.h:238
static void Abc_InfoCopy(unsigned *p, unsigned *q, int nWords)
Definition: abc.h:241
static int Extra_TruthCountOnes(unsigned *pIn, int nVars)
Definition: extra.h:263
static int Odc_IsComplement(Odc_Lit_t Lit)
Definition: abcOdc.c:106
static Odc_Lit_t Odc_Regular(Odc_Lit_t Lit)
Definition: abcOdc.c:107
static void Odc_ManIncrementTravId(Odc_Man_t *p)
Definition: abcOdc.c:132
int nWords
Definition: abcOdc.c:75
void Abc_NtkDontCareSimulate_rec ( Odc_Man_t p,
Odc_Lit_t  Lit 
)

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

Synopsis [Computes the truth table.]

Description []

SideEffects []

SeeAlso []

Definition at line 952 of file abcOdc.c.

953 {
954  Odc_Obj_t * pObj;
955  assert( !Odc_IsComplement(Lit) );
956  // skip terminals
957  if ( Odc_IsTerm(p, Lit) )
958  return;
959  // skip visited objects
960  pObj = Odc_Lit2Obj( p, Lit );
961  if ( Odc_ObjIsTravIdCurrent(p, pObj) )
962  return;
963  Odc_ObjSetTravIdCurrent(p, pObj);
964  // call recursively
967  // construct the truth table
968  Abc_NtkDontCareTruthOne( p, Lit );
969 }
void Abc_NtkDontCareSimulate_rec(Odc_Man_t *p, Odc_Lit_t Lit)
Definition: abcOdc.c:952
static void Odc_ObjSetTravIdCurrent(Odc_Man_t *p, Odc_Obj_t *pObj)
Definition: abcOdc.c:133
static Odc_Lit_t Odc_ObjFanin1(Odc_Obj_t *pObj)
Definition: abcOdc.c:127
static Odc_Obj_t * Odc_Lit2Obj(Odc_Man_t *p, Odc_Lit_t Lit)
Definition: abcOdc.c:121
static Odc_Lit_t Odc_ObjFanin0(Odc_Obj_t *pObj)
Definition: abcOdc.c:126
static int Odc_IsComplement(Odc_Lit_t Lit)
Definition: abcOdc.c:106
void Abc_NtkDontCareTruthOne(Odc_Man_t *p, Odc_Lit_t Lit)
Definition: abcOdc.c:912
static int Odc_IsTerm(Odc_Man_t *p, Odc_Lit_t Lit)
Definition: abcOdc.c:116
static int Odc_ObjIsTravIdCurrent(Odc_Man_t *p, Odc_Obj_t *pObj)
Definition: abcOdc.c:134
#define assert(ex)
Definition: util_old.h:213
int Abc_NtkDontCareSimulateBefore ( Odc_Man_t p,
unsigned *  puTruth 
)

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

Synopsis [Computes the truth table of the care set.]

Description [Returns the number of ones in the simulation info.]

SideEffects []

SeeAlso []

Definition at line 1003 of file abcOdc.c.

1004 {
1005  int nIters = 2;
1006  int nRounds, Counter, r;
1007  // decide how many rounds to simulate
1008  nRounds = p->nBits / p->nWords;
1009  Counter = 0;
1010  for ( r = 0; r < nIters; r++ )
1011  {
1013  Abc_NtkDontCareSimulate( p, puTruth );
1014  Counter += Abc_NtkDontCareCountMintsWord( p, puTruth );
1015  }
1016  // normalize
1017  Counter = Counter * nRounds / nIters;
1018  return Counter;
1019 }
int Abc_NtkDontCareSimulate(Odc_Man_t *p, unsigned *puTruth)
Definition: abcOdc.c:982
int Abc_NtkDontCareCountMintsWord(Odc_Man_t *p, unsigned *puTruth)
Definition: abcOdc.c:892
void Abc_NtkDontCareSimulateSetRand(Odc_Man_t *p)
Definition: abcOdc.c:866
static int Counter
int nBits
Definition: abcOdc.c:74
int nWords
Definition: abcOdc.c:75
void Abc_NtkDontCareSimulateSetElem ( Odc_Man_t p)

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

Synopsis [Set elementary truth tables for PIs.]

Description []

SideEffects []

SeeAlso []

Definition at line 843 of file abcOdc.c.

844 {
845  unsigned * pData, * pData2;
846  int k;
847  for ( k = 0; k < p->nVarsMax; k++ )
848  {
849  pData = Odc_ObjTruth( p, Odc_Var(p, k) );
850  pData2 = (unsigned *)Vec_PtrEntry( p->vTruthsElem, k );
851  Abc_InfoCopy( pData, pData2, p->nWords );
852  }
853 }
static unsigned * Odc_ObjTruth(Odc_Man_t *p, Odc_Lit_t Lit)
Definition: abcOdc.c:137
int nVarsMax
Definition: abcOdc.c:48
static Odc_Lit_t Odc_Var(Odc_Man_t *p, int i)
Definition: abcOdc.c:114
static void Abc_InfoCopy(unsigned *p, unsigned *q, int nWords)
Definition: abc.h:241
static void * Vec_PtrEntry(Vec_Ptr_t *p, int i)
Definition: vecPtr.h:362
Vec_Ptr_t * vTruthsElem
Definition: abcOdc.c:77
int nWords
Definition: abcOdc.c:75
void Abc_NtkDontCareSimulateSetElem2 ( Odc_Man_t p)

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

Synopsis [Set elementary truth tables for PIs.]

Description []

SideEffects []

SeeAlso []

Definition at line 818 of file abcOdc.c.

819 {
820  unsigned * pData;
821  int i, k;
822  for ( k = 0; k < p->nVarsMax; k++ )
823  {
824  pData = Odc_ObjTruth( p, Odc_Var(p, k) );
825  Abc_InfoClear( pData, p->nWords );
826  for ( i = 0; i < p->nBits; i++ )
827  if ( i & (1 << k) )
828  pData[i>>5] |= (1 << (i&31));
829  }
830 }
static unsigned * Odc_ObjTruth(Odc_Man_t *p, Odc_Lit_t Lit)
Definition: abcOdc.c:137
int nVarsMax
Definition: abcOdc.c:48
static Odc_Lit_t Odc_Var(Odc_Man_t *p, int i)
Definition: abcOdc.c:114
static void Abc_InfoClear(unsigned *p, int nWords)
Definition: abc.h:236
int nBits
Definition: abcOdc.c:74
int nWords
Definition: abcOdc.c:75
void Abc_NtkDontCareSimulateSetRand ( Odc_Man_t p)

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

Synopsis [Set random simulation words for PIs.]

Description []

SideEffects []

SeeAlso []

Definition at line 866 of file abcOdc.c.

867 {
868  unsigned * pData;
869  int w, k, Number;
870  for ( w = 0; w < p->nWords; w++ )
871  {
872  Number = rand();
873  for ( k = 0; k < p->nVarsMax; k++ )
874  {
875  pData = Odc_ObjTruth( p, Odc_Var(p, k) );
876  pData[w] = (Number & (1<<k)) ? ~0 : 0;
877  }
878  }
879 }
static unsigned * Odc_ObjTruth(Odc_Man_t *p, Odc_Lit_t Lit)
Definition: abcOdc.c:137
int nVarsMax
Definition: abcOdc.c:48
static Odc_Lit_t Odc_Var(Odc_Man_t *p, int i)
Definition: abcOdc.c:114
int nWords
Definition: abcOdc.c:75
int Abc_NtkDontCareTransfer ( Odc_Man_t p)

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

Synopsis [Transfers the window into the AIG package.]

Description []

SideEffects []

SeeAlso []

Definition at line 688 of file abcOdc.c.

689 {
690  Abc_Obj_t * pObj;
691  Odc_Lit_t uRes0, uRes1;
692  Odc_Lit_t uLit;
693  unsigned uData;
694  int i;
696  // set elementary variables at the leaves
697  Vec_PtrForEachEntry( Abc_Obj_t *, p->vLeaves, pObj, i )
698  {
699  uLit = Odc_Var( p, i );
700  pObj->pCopy = (Abc_Obj_t *)(ABC_PTRUINT_T)((uLit << 16) | uLit);
702  }
703  // set elementary variables at the branched
704  Vec_PtrForEachEntry( Abc_Obj_t *, p->vBranches, pObj, i )
705  {
706  uLit = Odc_Var( p, i+p->nVarsMax );
707  pObj->pCopy = (Abc_Obj_t *)(ABC_PTRUINT_T)((uLit << 16) | uLit);
709  }
710  // compute the AIG for the window
711  p->iRoot = Odc_Const0();
712  Vec_PtrForEachEntry( Abc_Obj_t *, p->vRoots, pObj, i )
713  {
714  uData = (unsigned)(ABC_PTRUINT_T)Abc_NtkDontCareTransfer_rec( p, pObj, p->pNode );
715  // get the cofactors
716  uRes0 = uData & 0xffff;
717  uRes1 = uData >> 16;
718  // compute the miter
719 // assert( uRes0 != uRes1 ); // may be false if the node is redundant w.r.t. this root
720  uLit = Odc_Xor( p, uRes0, uRes1 );
721  p->iRoot = Odc_Or( p, p->iRoot, uLit );
722  }
723  return 1;
724 }
Vec_Ptr_t * vBranches
Definition: abcOdc.c:58
int nVarsMax
Definition: abcOdc.c:48
void * Abc_NtkDontCareTransfer_rec(Odc_Man_t *p, Abc_Obj_t *pNode, Abc_Obj_t *pPivot)
Definition: abcOdc.c:649
static Odc_Lit_t Odc_Or(Odc_Man_t *p, Odc_Lit_t iFan0, Odc_Lit_t iFan1)
Definition: abcOdc.c:613
Abc_Obj_t * pNode
Definition: abcOdc.c:55
static Odc_Lit_t Odc_Var(Odc_Man_t *p, int i)
Definition: abcOdc.c:114
Vec_Ptr_t * vLeaves
Definition: abcOdc.c:56
Odc_Lit_t iRoot
Definition: abcOdc.c:66
Abc_Obj_t * pCopy
Definition: abc.h:148
static Odc_Lit_t Odc_Const0()
Definition: abcOdc.c:112
Abc_Ntk_t * pNtk
Definition: abc.h:130
static Odc_Lit_t Odc_Xor(Odc_Man_t *p, Odc_Lit_t iFan0, Odc_Lit_t iFan1)
Definition: abcOdc.c:629
static void Abc_NtkIncrementTravId(Abc_Ntk_t *p)
Definition: abc.h:406
Vec_Ptr_t * vRoots
Definition: abcOdc.c:57
#define Vec_PtrForEachEntry(Type, vVec, pEntry, i)
MACRO DEFINITIONS ///.
Definition: vecPtr.h:55
unsigned short Odc_Lit_t
Definition: abcOdc.c:32
static void Abc_NodeSetTravIdCurrent(Abc_Obj_t *p)
Definition: abc.h:409
void* Abc_NtkDontCareTransfer_rec ( Odc_Man_t p,
Abc_Obj_t pNode,
Abc_Obj_t pPivot 
)

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

Synopsis [Transfers the window into the AIG package.]

Description []

SideEffects []

SeeAlso []

Definition at line 649 of file abcOdc.c.

650 {
651  unsigned uData0, uData1;
652  Odc_Lit_t uLit0, uLit1, uRes0, uRes1;
653  assert( !Abc_ObjIsComplement(pNode) );
654  // skip visited objects
655  if ( Abc_NodeIsTravIdCurrent(pNode) )
656  return pNode->pCopy;
658  assert( Abc_ObjIsNode(pNode) );
659  // consider the case when the node is the pivot
660  if ( pNode == pPivot )
661  return pNode->pCopy = (Abc_Obj_t *)(ABC_PTRUINT_T)((Odc_Const1() << 16) | Odc_Const0());
662  // compute the cofactors
663  uData0 = (unsigned)(ABC_PTRUINT_T)Abc_NtkDontCareTransfer_rec( p, Abc_ObjFanin0(pNode), pPivot );
664  uData1 = (unsigned)(ABC_PTRUINT_T)Abc_NtkDontCareTransfer_rec( p, Abc_ObjFanin1(pNode), pPivot );
665  // find the 0-cofactor
666  uLit0 = Odc_NotCond( (Odc_Lit_t)(uData0 & 0xffff), Abc_ObjFaninC0(pNode) );
667  uLit1 = Odc_NotCond( (Odc_Lit_t)(uData1 & 0xffff), Abc_ObjFaninC1(pNode) );
668  uRes0 = Odc_And( p, uLit0, uLit1 );
669  // find the 1-cofactor
670  uLit0 = Odc_NotCond( (Odc_Lit_t)(uData0 >> 16), Abc_ObjFaninC0(pNode) );
671  uLit1 = Odc_NotCond( (Odc_Lit_t)(uData1 >> 16), Abc_ObjFaninC1(pNode) );
672  uRes1 = Odc_And( p, uLit0, uLit1 );
673  // find the result
674  return pNode->pCopy = (Abc_Obj_t *)(ABC_PTRUINT_T)((uRes1 << 16) | uRes0);
675 }
static Abc_Obj_t * Abc_ObjFanin1(Abc_Obj_t *pObj)
Definition: abc.h:374
void * Abc_NtkDontCareTransfer_rec(Odc_Man_t *p, Abc_Obj_t *pNode, Abc_Obj_t *pPivot)
Definition: abcOdc.c:649
static int Abc_ObjFaninC1(Abc_Obj_t *pObj)
Definition: abc.h:378
static int Abc_ObjFaninC0(Abc_Obj_t *pObj)
Definition: abc.h:377
static Odc_Lit_t Odc_NotCond(Odc_Lit_t Lit, int c)
Definition: abcOdc.c:109
static Abc_Obj_t * Abc_ObjFanin0(Abc_Obj_t *pObj)
Definition: abc.h:373
static int Abc_ObjIsNode(Abc_Obj_t *pObj)
Definition: abc.h:355
Abc_Obj_t * pCopy
Definition: abc.h:148
static Odc_Lit_t Odc_Const0()
Definition: abcOdc.c:112
static Odc_Lit_t Odc_And(Odc_Man_t *p, Odc_Lit_t iFan0, Odc_Lit_t iFan1)
Definition: abcOdc.c:565
static int Abc_NodeIsTravIdCurrent(Abc_Obj_t *p)
Definition: abc.h:411
#define assert(ex)
Definition: util_old.h:213
static int Abc_ObjIsComplement(Abc_Obj_t *p)
Definition: abc.h:322
static Odc_Lit_t Odc_Const1()
Definition: abcOdc.c:113
unsigned short Odc_Lit_t
Definition: abcOdc.c:32
static void Abc_NodeSetTravIdCurrent(Abc_Obj_t *p)
Definition: abc.h:409
void Abc_NtkDontCareTruthOne ( Odc_Man_t p,
Odc_Lit_t  Lit 
)

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

Synopsis [Simulates one node.]

Description []

SideEffects []

SeeAlso []

Definition at line 912 of file abcOdc.c.

913 {
914  Odc_Obj_t * pObj;
915  unsigned * pInfo, * pInfo1, * pInfo2;
916  int k, fComp1, fComp2;
917  assert( !Odc_IsComplement( Lit ) );
918  assert( !Odc_IsTerm( p, Lit ) );
919  // get the truth tables
920  pObj = Odc_Lit2Obj( p, Lit );
921  pInfo = Odc_ObjTruth( p, Lit );
922  pInfo1 = Odc_ObjTruth( p, Odc_ObjFanin0(pObj) );
923  pInfo2 = Odc_ObjTruth( p, Odc_ObjFanin1(pObj) );
924  fComp1 = Odc_ObjFaninC0( pObj );
925  fComp2 = Odc_ObjFaninC1( pObj );
926  // simulate
927  if ( fComp1 && fComp2 )
928  for ( k = 0; k < p->nWords; k++ )
929  pInfo[k] = ~pInfo1[k] & ~pInfo2[k];
930  else if ( fComp1 && !fComp2 )
931  for ( k = 0; k < p->nWords; k++ )
932  pInfo[k] = ~pInfo1[k] & pInfo2[k];
933  else if ( !fComp1 && fComp2 )
934  for ( k = 0; k < p->nWords; k++ )
935  pInfo[k] = pInfo1[k] & ~pInfo2[k];
936  else // if ( fComp1 && fComp2 )
937  for ( k = 0; k < p->nWords; k++ )
938  pInfo[k] = pInfo1[k] & pInfo2[k];
939 }
static unsigned * Odc_ObjTruth(Odc_Man_t *p, Odc_Lit_t Lit)
Definition: abcOdc.c:137
static Odc_Lit_t Odc_ObjFanin1(Odc_Obj_t *pObj)
Definition: abcOdc.c:127
static Odc_Obj_t * Odc_Lit2Obj(Odc_Man_t *p, Odc_Lit_t Lit)
Definition: abcOdc.c:121
static Odc_Lit_t Odc_ObjFanin0(Odc_Obj_t *pObj)
Definition: abcOdc.c:126
static int Odc_IsComplement(Odc_Lit_t Lit)
Definition: abcOdc.c:106
static int Odc_IsTerm(Odc_Man_t *p, Odc_Lit_t Lit)
Definition: abcOdc.c:116
static int Odc_ObjFaninC1(Odc_Obj_t *pObj)
Definition: abcOdc.c:129
#define assert(ex)
Definition: util_old.h:213
static int Odc_ObjFaninC0(Odc_Obj_t *pObj)
Definition: abcOdc.c:128
int nWords
Definition: abcOdc.c:75
int Abc_NtkDontCareWinAddMissing ( Odc_Man_t p)

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

Synopsis [Adds to the window nodes and leaves in the TFI of the roots.]

Description []

SideEffects []

SeeAlso []

Definition at line 450 of file abcOdc.c.

451 {
452  Abc_Obj_t * pObj;
453  int i;
454  // set the leaves
456  Vec_PtrForEachEntry( Abc_Obj_t *, p->vLeaves, pObj, i )
457  Abc_NodeSetTravIdCurrent( pObj );
458  // explore from the roots
459  Vec_PtrClear( p->vBranches );
460  Vec_PtrForEachEntry( Abc_Obj_t *, p->vRoots, pObj, i )
461  if ( !Abc_NtkDontCareWinAddMissing_rec( p, pObj ) )
462  return 0;
463  return 1;
464 }
Abc_Obj_t * pNode
Definition: abcOdc.c:55
Vec_Ptr_t * vLeaves
Definition: abcOdc.c:56
if(last==0)
Definition: sparse_int.h:34
int Abc_NtkDontCareWinAddMissing_rec(Odc_Man_t *p, Abc_Obj_t *pObj)
Definition: abcOdc.c:418
Abc_Ntk_t * pNtk
Definition: abc.h:130
static void Abc_NtkIncrementTravId(Abc_Ntk_t *p)
Definition: abc.h:406
static void Vec_PtrClear(Vec_Ptr_t *p)
Definition: vecPtr.h:545
#define Vec_PtrForEachEntry(Type, vVec, pEntry, i)
MACRO DEFINITIONS ///.
Definition: vecPtr.h:55
static void Abc_NodeSetTravIdCurrent(Abc_Obj_t *p)
Definition: abc.h:409
int Abc_NtkDontCareWinAddMissing_rec ( Odc_Man_t p,
Abc_Obj_t pObj 
)

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

Synopsis [Recursively adds missing nodes and leaves.]

Description []

SideEffects []

SeeAlso []

Definition at line 418 of file abcOdc.c.

419 {
420  Abc_Obj_t * pFanin;
421  int i;
422  // skip the already collected leaves and branches
423  if ( Abc_NodeIsTravIdCurrent(pObj) )
424  return 1;
425  // if this is not an internal node - make it a new branch
426  if ( !Abc_NodeIsTravIdPrevious(pObj) || Abc_ObjIsCi(pObj) ) //|| (int)pObj->Level <= p->nLevLeaves )
427  {
428  Abc_NodeSetTravIdCurrent( pObj );
429  Vec_PtrPush( p->vBranches, pObj );
430  return Vec_PtrSize(p->vBranches) <= 32;
431  }
432  // visit the fanins of the node
433  Abc_ObjForEachFanin( pObj, pFanin, i )
434  if ( !Abc_NtkDontCareWinAddMissing_rec( p, pFanin ) )
435  return 0;
436  return 1;
437 }
Vec_Ptr_t * vBranches
Definition: abcOdc.c:58
static int Abc_ObjIsCi(Abc_Obj_t *pObj)
Definition: abc.h:351
static void Vec_PtrPush(Vec_Ptr_t *p, void *Entry)
Definition: vecPtr.h:606
static int Abc_NodeIsTravIdPrevious(Abc_Obj_t *p)
Definition: abc.h:412
static int Vec_PtrSize(Vec_Ptr_t *p)
Definition: vecPtr.h:295
if(last==0)
Definition: sparse_int.h:34
int Abc_NtkDontCareWinAddMissing_rec(Odc_Man_t *p, Abc_Obj_t *pObj)
Definition: abcOdc.c:418
static int Abc_NodeIsTravIdCurrent(Abc_Obj_t *p)
Definition: abc.h:411
#define Abc_ObjForEachFanin(pObj, pFanin, i)
Definition: abc.h:524
static void Abc_NodeSetTravIdCurrent(Abc_Obj_t *p)
Definition: abc.h:409
void Abc_NtkDontCareWinCollectRoots ( Odc_Man_t p)

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

Synopsis [Collects the roots of the window.]

Description [Roots of the window are the nodes that have at least one fanout that it not in the TFO of the leaves.]

SideEffects []

SeeAlso []

Definition at line 397 of file abcOdc.c.

398 {
400  // mark the node with the old traversal ID
402  // collect the roots
403  Vec_PtrClear( p->vRoots );
405 }
Abc_Obj_t * pNode
Definition: abcOdc.c:55
void Abc_NtkDontCareWinCollectRoots_rec(Abc_Obj_t *pObj, Vec_Ptr_t *vRoots)
Definition: abcOdc.c:364
static int Abc_NodeIsTravIdCurrent(Abc_Obj_t *p)
Definition: abc.h:411
Vec_Ptr_t * vRoots
Definition: abcOdc.c:57
#define assert(ex)
Definition: util_old.h:213
static void Vec_PtrClear(Vec_Ptr_t *p)
Definition: vecPtr.h:545
static void Abc_NodeSetTravIdCurrent(Abc_Obj_t *p)
Definition: abc.h:409
void Abc_NtkDontCareWinCollectRoots_rec ( Abc_Obj_t pObj,
Vec_Ptr_t vRoots 
)

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

Synopsis [Recursively collects the roots.]

Description []

SideEffects []

SeeAlso []

Definition at line 364 of file abcOdc.c.

365 {
366  Abc_Obj_t * pFanout;
367  int i;
368  assert( Abc_ObjIsNode(pObj) );
370  // check if the node has all fanouts marked
371  Abc_ObjForEachFanout( pObj, pFanout, i )
372  if ( !Abc_NodeIsTravIdCurrent(pFanout) )
373  break;
374  // if some of the fanouts are unmarked, add the node to the root
375  if ( i < Abc_ObjFanoutNum(pObj) )
376  {
377  Vec_PtrPushUnique( vRoots, pObj );
378  return;
379  }
380  // otherwise, call recursively
381  Abc_ObjForEachFanout( pObj, pFanout, i )
382  Abc_NtkDontCareWinCollectRoots_rec( pFanout, vRoots );
383 }
static int Vec_PtrPushUnique(Vec_Ptr_t *p, void *Entry)
Definition: vecPtr.h:656
static int Abc_ObjFanoutNum(Abc_Obj_t *pObj)
Definition: abc.h:365
static int Abc_ObjIsNode(Abc_Obj_t *pObj)
Definition: abc.h:355
if(last==0)
Definition: sparse_int.h:34
void Abc_NtkDontCareWinCollectRoots_rec(Abc_Obj_t *pObj, Vec_Ptr_t *vRoots)
Definition: abcOdc.c:364
static int Abc_NodeIsTravIdCurrent(Abc_Obj_t *p)
Definition: abc.h:411
#define Abc_ObjForEachFanout(pObj, pFanout, i)
Definition: abc.h:526
#define assert(ex)
Definition: util_old.h:213
int Abc_NtkDontCareWindow ( Odc_Man_t p)

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

Synopsis [Computes window for the node.]

Description []

SideEffects []

SeeAlso []

Definition at line 477 of file abcOdc.c.

478 {
479  // mark the TFO of the collected nodes up to the given level (p->pNode->Level + p->nWinTfoMax)
481  // find the roots of the window
483  if ( Vec_PtrSize(p->vRoots) == 1 && Vec_PtrEntry(p->vRoots, 0) == p->pNode )
484  {
485 // printf( "Empty window\n" );
486  return 0;
487  }
488  // add the nodes in the TFI of the roots that are not yet in the window
489  if ( !Abc_NtkDontCareWinAddMissing( p ) )
490  {
491 // printf( "Too many branches (%d)\n", Vec_PtrSize(p->vBranches) );
492  return 0;
493  }
494  return 1;
495 }
Abc_Obj_t * pNode
Definition: abcOdc.c:55
int Abc_NtkDontCareWinAddMissing(Odc_Man_t *p)
Definition: abcOdc.c:450
static int Vec_PtrSize(Vec_Ptr_t *p)
Definition: vecPtr.h:295
void Abc_NtkDontCareWinSweepLeafTfo(Odc_Man_t *p)
Definition: abcOdc.c:344
static void * Vec_PtrEntry(Vec_Ptr_t *p, int i)
Definition: vecPtr.h:362
Vec_Ptr_t * vRoots
Definition: abcOdc.c:57
void Abc_NtkDontCareWinCollectRoots(Odc_Man_t *p)
Definition: abcOdc.c:397
void Abc_NtkDontCareWinSweepLeafTfo ( Odc_Man_t p)

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

Synopsis [Marks the TFO of the collected nodes up to the given level.]

Description []

SideEffects []

SeeAlso []

Definition at line 344 of file abcOdc.c.

345 {
346  Abc_Obj_t * pObj;
347  int i;
349  Vec_PtrForEachEntry( Abc_Obj_t *, p->vLeaves, pObj, i )
350  Abc_NtkDontCareWinSweepLeafTfo_rec( pObj, p->pNode->Level + p->nLevels, p->pNode );
351 }
Abc_Obj_t * pNode
Definition: abcOdc.c:55
Vec_Ptr_t * vLeaves
Definition: abcOdc.c:56
void Abc_NtkDontCareWinSweepLeafTfo_rec(Abc_Obj_t *pObj, int nLevelLimit, Abc_Obj_t *pNode)
Definition: abcOdc.c:315
Abc_Ntk_t * pNtk
Definition: abc.h:130
static void Abc_NtkIncrementTravId(Abc_Ntk_t *p)
Definition: abc.h:406
#define Vec_PtrForEachEntry(Type, vVec, pEntry, i)
MACRO DEFINITIONS ///.
Definition: vecPtr.h:55
void Abc_NtkDontCareWinSweepLeafTfo_rec ( Abc_Obj_t pObj,
int  nLevelLimit,
Abc_Obj_t pNode 
)

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

Synopsis [Marks the TFO of the collected nodes up to the given level.]

Description []

SideEffects []

SeeAlso []

Definition at line 315 of file abcOdc.c.

316 {
317  Abc_Obj_t * pFanout;
318  int i;
319  if ( Abc_ObjIsCo(pObj) || (int)pObj->Level > nLevelLimit || pObj == pNode )
320  return;
321  if ( Abc_NodeIsTravIdCurrent(pObj) )
322  return;
323  Abc_NodeSetTravIdCurrent( pObj );
324  ////////////////////////////////////////
325  // try to reduce the runtime
326  if ( Abc_ObjFanoutNum(pObj) > 100 )
327  return;
328  ////////////////////////////////////////
329  Abc_ObjForEachFanout( pObj, pFanout, i )
330  Abc_NtkDontCareWinSweepLeafTfo_rec( pFanout, nLevelLimit, pNode );
331 }
static int Abc_ObjFanoutNum(Abc_Obj_t *pObj)
Definition: abc.h:365
unsigned Level
Definition: abc.h:142
static int Abc_ObjIsCo(Abc_Obj_t *pObj)
Definition: abc.h:352
void Abc_NtkDontCareWinSweepLeafTfo_rec(Abc_Obj_t *pObj, int nLevelLimit, Abc_Obj_t *pNode)
Definition: abcOdc.c:315
static int Abc_NodeIsTravIdCurrent(Abc_Obj_t *p)
Definition: abc.h:411
#define Abc_ObjForEachFanout(pObj, pFanout, i)
Definition: abc.h:526
static void Abc_NodeSetTravIdCurrent(Abc_Obj_t *p)
Definition: abc.h:409
static Odc_Lit_t Odc_And ( Odc_Man_t p,
Odc_Lit_t  iFan0,
Odc_Lit_t  iFan1 
)
inlinestatic

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

Synopsis [Finds node by structural hashing or creates a new node.]

Description []

SideEffects []

SeeAlso []

Definition at line 565 of file abcOdc.c.

566 {
567  Odc_Obj_t * pObj;
568  Odc_Lit_t * pEntry;
569  unsigned uMask0, uMask1;
570  int Temp;
571  // consider trivial cases
572  if ( iFan0 == iFan1 )
573  return iFan0;
574  if ( iFan0 == Odc_Not(iFan1) )
575  return Odc_Const0();
576  if ( Odc_Regular(iFan0) == Odc_Const1() )
577  return iFan0 == Odc_Const1() ? iFan1 : Odc_Const0();
578  if ( Odc_Regular(iFan1) == Odc_Const1() )
579  return iFan1 == Odc_Const1() ? iFan0 : Odc_Const0();
580  // canonicize the fanin order
581  if ( iFan0 > iFan1 )
582  Temp = iFan0, iFan0 = iFan1, iFan1 = Temp;
583  // check if a node with these fanins exists
584  pEntry = Odc_HashLookup( p, iFan0, iFan1 );
585  if ( *pEntry )
586  return *pEntry;
587  // create a new node
588  pObj = Odc_ObjNew( p );
589  pObj->iFan0 = iFan0;
590  pObj->iFan1 = iFan1;
591  pObj->iNext = 0;
592  pObj->TravId = 0;
593  // set the mask
594  uMask0 = Odc_Lit2Obj(p, Odc_Regular(iFan0))->uMask;
595  uMask1 = Odc_Lit2Obj(p, Odc_Regular(iFan1))->uMask;
596  pObj->uMask = uMask0 | uMask1;
597  // add to the table
598  *pEntry = Odc_Obj2Lit( p, pObj );
599  return *pEntry;
600 }
static Odc_Obj_t * Odc_ObjNew(Odc_Man_t *p)
Definition: abcOdc.c:119
unsigned uMask
Definition: abcOdc.c:42
static Odc_Lit_t Odc_Not(Odc_Lit_t Lit)
Definition: abcOdc.c:108
unsigned short TravId
Definition: abcOdc.c:40
Odc_Lit_t iFan0
Definition: abcOdc.c:37
static Odc_Obj_t * Odc_Lit2Obj(Odc_Man_t *p, Odc_Lit_t Lit)
Definition: abcOdc.c:121
Odc_Lit_t iNext
Definition: abcOdc.c:39
static Odc_Lit_t * Odc_HashLookup(Odc_Man_t *p, Odc_Lit_t iFan0, Odc_Lit_t iFan1)
Definition: abcOdc.c:533
static Odc_Lit_t Odc_Regular(Odc_Lit_t Lit)
Definition: abcOdc.c:107
static Odc_Lit_t Odc_Obj2Lit(Odc_Man_t *p, Odc_Obj_t *pObj)
Definition: abcOdc.c:120
static Odc_Lit_t Odc_Const0()
Definition: abcOdc.c:112
static Odc_Lit_t Odc_Const1()
Definition: abcOdc.c:113
unsigned short Odc_Lit_t
Definition: abcOdc.c:32
Odc_Lit_t iFan1
Definition: abcOdc.c:38
static Odc_Lit_t Odc_Const0 ( )
inlinestatic

Definition at line 112 of file abcOdc.c.

112 { return 1; }
static Odc_Lit_t Odc_Const1 ( )
inlinestatic

Definition at line 113 of file abcOdc.c.

113 { return 0; }
static unsigned Odc_HashKey ( Odc_Lit_t  iFan0,
Odc_Lit_t  iFan1,
int  TableSize 
)
inlinestatic

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

Synopsis [Performing hashing of two AIG Literals.]

Description []

SideEffects []

SeeAlso []

Definition at line 512 of file abcOdc.c.

513 {
514  unsigned Key = 0;
515  Key ^= Odc_Regular(iFan0) * 7937;
516  Key ^= Odc_Regular(iFan1) * 2971;
517  Key ^= Odc_IsComplement(iFan0) * 911;
518  Key ^= Odc_IsComplement(iFan1) * 353;
519  return Key % TableSize;
520 }
static int Odc_IsComplement(Odc_Lit_t Lit)
Definition: abcOdc.c:106
static Odc_Lit_t Odc_Regular(Odc_Lit_t Lit)
Definition: abcOdc.c:107
static Odc_Lit_t* Odc_HashLookup ( Odc_Man_t p,
Odc_Lit_t  iFan0,
Odc_Lit_t  iFan1 
)
inlinestatic

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

Synopsis [Checks if the given name node already exists in the table.]

Description []

SideEffects []

SeeAlso []

Definition at line 533 of file abcOdc.c.

534 {
535  Odc_Obj_t * pObj;
536  Odc_Lit_t * pEntry;
537  unsigned uHashKey;
538  assert( iFan0 < iFan1 );
539  // get the hash key for this node
540  uHashKey = Odc_HashKey( iFan0, iFan1, p->nTableSize );
541  // remember the spot in the hash table that will be used
542  if ( p->pTable[uHashKey] == 0 )
543  Vec_IntPush( p->vUsedSpots, uHashKey );
544  // find the entry
545  for ( pEntry = p->pTable + uHashKey; *pEntry; pEntry = &pObj->iNext )
546  {
547  pObj = Odc_Lit2Obj( p, *pEntry );
548  if ( pObj->iFan0 == iFan0 && pObj->iFan1 == iFan1 )
549  return pEntry;
550  }
551  return pEntry;
552 }
Odc_Lit_t iFan0
Definition: abcOdc.c:37
static Odc_Obj_t * Odc_Lit2Obj(Odc_Man_t *p, Odc_Lit_t Lit)
Definition: abcOdc.c:121
static unsigned Odc_HashKey(Odc_Lit_t iFan0, Odc_Lit_t iFan1, int TableSize)
Definition: abcOdc.c:512
Odc_Lit_t iNext
Definition: abcOdc.c:39
static void Vec_IntPush(Vec_Int_t *p, int Entry)
Definition: bblif.c:468
#define assert(ex)
Definition: util_old.h:213
Odc_Lit_t * pTable
Definition: abcOdc.c:69
unsigned short Odc_Lit_t
Definition: abcOdc.c:32
Vec_Int_t * vUsedSpots
Definition: abcOdc.c:71
int nTableSize
Definition: abcOdc.c:70
Odc_Lit_t iFan1
Definition: abcOdc.c:38
static int Odc_IsComplement ( Odc_Lit_t  Lit)
inlinestatic

Definition at line 106 of file abcOdc.c.

106 { return Lit & (Odc_Lit_t)1; }
unsigned short Odc_Lit_t
Definition: abcOdc.c:32
static int Odc_IsConst ( Odc_Lit_t  Lit)
inlinestatic

Definition at line 115 of file abcOdc.c.

115 { return Lit < (Odc_Lit_t)2; }
unsigned short Odc_Lit_t
Definition: abcOdc.c:32
static int Odc_IsTerm ( Odc_Man_t p,
Odc_Lit_t  Lit 
)
inlinestatic

Definition at line 116 of file abcOdc.c.

116 { return (int)(Lit>>1) <= p->nPis; }
int nPis
Definition: abcOdc.c:62
static Odc_Obj_t* Odc_Lit2Obj ( Odc_Man_t p,
Odc_Lit_t  Lit 
)
inlinestatic

Definition at line 121 of file abcOdc.c.

121 { assert( !(Lit & 1) && (int)(Lit>>1) < p->nObjs ); return p->pObjs + (Lit>>1); }
int nObjs
Definition: abcOdc.c:63
Odc_Obj_t * pObjs
Definition: abcOdc.c:65
#define assert(ex)
Definition: util_old.h:213
static void Odc_ManIncrementTravId ( Odc_Man_t p)
inlinestatic

Definition at line 132 of file abcOdc.c.

132 { p->nTravIds++; }
unsigned short nTravIds
Definition: abcOdc.c:67
static int Odc_NodeNum ( Odc_Man_t p)
inlinestatic

Definition at line 102 of file abcOdc.c.

102 { return p->nObjs - p->nPis - 1; }
int nPis
Definition: abcOdc.c:62
int nObjs
Definition: abcOdc.c:63
static Odc_Lit_t Odc_Not ( Odc_Lit_t  Lit)
inlinestatic

Definition at line 108 of file abcOdc.c.

108 { return Lit ^ (Odc_Lit_t)1; }
unsigned short Odc_Lit_t
Definition: abcOdc.c:32
static Odc_Lit_t Odc_NotCond ( Odc_Lit_t  Lit,
int  c 
)
inlinestatic

Definition at line 109 of file abcOdc.c.

109 { return Lit ^ (Odc_Lit_t)(c!=0); }
unsigned short Odc_Lit_t
Definition: abcOdc.c:32
static Odc_Lit_t Odc_Obj2Lit ( Odc_Man_t p,
Odc_Obj_t pObj 
)
inlinestatic

Definition at line 120 of file abcOdc.c.

120 { assert( pObj ); return (pObj - p->pObjs) << 1; }
Odc_Obj_t * pObjs
Definition: abcOdc.c:65
#define assert(ex)
Definition: util_old.h:213
static Odc_Lit_t Odc_ObjChild0 ( Odc_Obj_t pObj)
inlinestatic

Definition at line 124 of file abcOdc.c.

124 { return pObj->iFan0; }
Odc_Lit_t iFan0
Definition: abcOdc.c:37
static Odc_Lit_t Odc_ObjChild1 ( Odc_Obj_t pObj)
inlinestatic

Definition at line 125 of file abcOdc.c.

125 { return pObj->iFan1; }
Odc_Lit_t iFan1
Definition: abcOdc.c:38
static Odc_Lit_t Odc_ObjFanin0 ( Odc_Obj_t pObj)
inlinestatic

Definition at line 126 of file abcOdc.c.

126 { return Odc_Regular(pObj->iFan0); }
Odc_Lit_t iFan0
Definition: abcOdc.c:37
static Odc_Lit_t Odc_Regular(Odc_Lit_t Lit)
Definition: abcOdc.c:107
static Odc_Lit_t Odc_ObjFanin1 ( Odc_Obj_t pObj)
inlinestatic

Definition at line 127 of file abcOdc.c.

127 { return Odc_Regular(pObj->iFan1); }
static Odc_Lit_t Odc_Regular(Odc_Lit_t Lit)
Definition: abcOdc.c:107
Odc_Lit_t iFan1
Definition: abcOdc.c:38
static int Odc_ObjFaninC0 ( Odc_Obj_t pObj)
inlinestatic

Definition at line 128 of file abcOdc.c.

128 { return Odc_IsComplement(pObj->iFan0); }
Odc_Lit_t iFan0
Definition: abcOdc.c:37
static int Odc_IsComplement(Odc_Lit_t Lit)
Definition: abcOdc.c:106
static int Odc_ObjFaninC1 ( Odc_Obj_t pObj)
inlinestatic

Definition at line 129 of file abcOdc.c.

129 { return Odc_IsComplement(pObj->iFan1); }
static int Odc_IsComplement(Odc_Lit_t Lit)
Definition: abcOdc.c:106
Odc_Lit_t iFan1
Definition: abcOdc.c:38
static int Odc_ObjIsTravIdCurrent ( Odc_Man_t p,
Odc_Obj_t pObj 
)
inlinestatic

Definition at line 134 of file abcOdc.c.

134 { return (int )((int)pObj->TravId == p->nTravIds); }
unsigned short nTravIds
Definition: abcOdc.c:67
unsigned short TravId
Definition: abcOdc.c:40
static Odc_Obj_t* Odc_ObjNew ( Odc_Man_t p)
inlinestatic

Definition at line 119 of file abcOdc.c.

119 { assert( p->nObjs < p->nObjsAlloc ); return p->pObjs + p->nObjs++; }
int nObjs
Definition: abcOdc.c:63
Odc_Obj_t * pObjs
Definition: abcOdc.c:65
#define assert(ex)
Definition: util_old.h:213
int nObjsAlloc
Definition: abcOdc.c:64
static int Odc_ObjNum ( Odc_Man_t p)
inlinestatic

Definition at line 103 of file abcOdc.c.

103 { return p->nObjs; }
int nObjs
Definition: abcOdc.c:63
static void Odc_ObjSetTravIdCurrent ( Odc_Man_t p,
Odc_Obj_t pObj 
)
inlinestatic

Definition at line 133 of file abcOdc.c.

133 { pObj->TravId = p->nTravIds; }
unsigned short nTravIds
Definition: abcOdc.c:67
unsigned short TravId
Definition: abcOdc.c:40
static unsigned* Odc_ObjTruth ( Odc_Man_t p,
Odc_Lit_t  Lit 
)
inlinestatic

Definition at line 137 of file abcOdc.c.

137 { assert( !(Lit & 1) ); return (unsigned *) Vec_PtrEntry(p->vTruths, Lit >> 1); }
static void * Vec_PtrEntry(Vec_Ptr_t *p, int i)
Definition: vecPtr.h:362
Vec_Ptr_t * vTruths
Definition: abcOdc.c:76
#define assert(ex)
Definition: util_old.h:213
static Odc_Lit_t Odc_Or ( Odc_Man_t p,
Odc_Lit_t  iFan0,
Odc_Lit_t  iFan1 
)
inlinestatic

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

Synopsis [Boolean OR.]

Description []

SideEffects []

SeeAlso []

Definition at line 613 of file abcOdc.c.

614 {
615  return Odc_Not( Odc_And(p, Odc_Not(iFan0), Odc_Not(iFan1)) );
616 }
static Odc_Lit_t Odc_Not(Odc_Lit_t Lit)
Definition: abcOdc.c:108
static Odc_Lit_t Odc_And(Odc_Man_t *p, Odc_Lit_t iFan0, Odc_Lit_t iFan1)
Definition: abcOdc.c:565
static int Odc_PiNum ( Odc_Man_t p)
inlinestatic

Definition at line 101 of file abcOdc.c.

101 { return p->nPis; }
int nPis
Definition: abcOdc.c:62
static Odc_Lit_t Odc_Regular ( Odc_Lit_t  Lit)
inlinestatic

Definition at line 107 of file abcOdc.c.

107 { return Lit & ~(Odc_Lit_t)1; }
unsigned short Odc_Lit_t
Definition: abcOdc.c:32
static Odc_Lit_t Odc_Var ( Odc_Man_t p,
int  i 
)
inlinestatic

Definition at line 114 of file abcOdc.c.

114 { assert( i >= 0 && i < p->nPis ); return (i+1) << 1; }
#define assert(ex)
Definition: util_old.h:213
static Odc_Lit_t Odc_Xor ( Odc_Man_t p,
Odc_Lit_t  iFan0,
Odc_Lit_t  iFan1 
)
inlinestatic

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

Synopsis [Boolean XOR.]

Description []

SideEffects []

SeeAlso []

Definition at line 629 of file abcOdc.c.

630 {
631  return Odc_Or( p, Odc_And(p, iFan0, Odc_Not(iFan1)), Odc_And(p, Odc_Not(iFan0), iFan1) );
632 }
static Odc_Lit_t Odc_Or(Odc_Man_t *p, Odc_Lit_t iFan0, Odc_Lit_t iFan1)
Definition: abcOdc.c:613
static Odc_Lit_t Odc_Not(Odc_Lit_t Lit)
Definition: abcOdc.c:108
static Odc_Lit_t Odc_And(Odc_Man_t *p, Odc_Lit_t iFan0, Odc_Lit_t iFan1)
Definition: abcOdc.c:565