33 #define DAU_DSD_MAX_VAR 12
59 if ( Func == ~(
word)0 )
97 char * q = pStr + pMatches[ *p - pStr ];
99 assert( **p ==
'(' && *q ==
')' );
100 for ( (*p)++; *p < q; (*p)++ )
110 char * q = pStr + pMatches[ *p - pStr ];
112 assert( **p ==
'[' && *q ==
']' );
113 for ( (*p)++; *p < q; (*p)++ )
127 int Temp[3], * pTemp = Temp, Res;
130 char * q = pStr + pMatches[ *p - pStr ];
136 q2 = pStr + pMatches[ *p - pStr ];
137 assert( **p ==
'{' && *q2 ==
'}' );
138 for ( nVars = 0, (*p)++; *p < q2; (*p)++, nVars++ )
147 q = pStr + pMatches[ *p - pStr ];
148 assert( **p ==
'<' && *q ==
'>' );
151 for ( ; pOld < q; pOld++ )
152 if ( *pOld >=
'a' && *pOld <=
'z' )
153 assert( *pOld -
'a' < nVars );
155 for ( (*p)++; *p < q; (*p)++ )
157 assert( pTemp == Temp + 3 );
161 char * q = pStr + pMatches[ ++(*p) - pStr ];
162 assert( **p ==
'{' && *q ==
'}' );
171 if ( (**p >=
'A' && **p <=
'F') || (**p >=
'0' && **p <=
'9') )
178 q = pStr + pMatches[ *p - pStr ];
179 assert( **p ==
'{' && *q ==
'}' );
180 for ( i = 0, (*p)++; *p < q; (*p)++, i++ )
185 vLeaves.nCap = nVars;
186 vLeaves.nSize = nVars;
187 vLeaves.pArray = Fanins;
188 Res =
Kit_TruthToGia( pGia, (
unsigned *)pFunc, nVars, vCover, &vLeaves, 1 );
198 if ( *p ==
'0' && *(p+1) == 0 )
200 else if ( *p ==
'1' && *(p+1) == 0 )
225 for ( i = nFans; i > 0; i-- )
229 ABC_SWAP(
int, pFans[i], pFans[i-1] );
235 int iFan0, iFan1, iFan;
239 iFan0 = pFans[--nFans];
240 iFan1 = pFans[--nFans];
275 char * q = pStr + pMatches[ *p - pStr ];
277 assert( **p ==
'(' && *q ==
')' );
278 for ( (*p)++; *p < q; (*p)++ )
289 char * q = pStr + pMatches[ *p - pStr ];
291 assert( **p ==
'[' && *q ==
']' );
292 for ( (*p)++; *p < q; (*p)++ )
305 int Temp[3], * pTemp = Temp, Res;
308 char * q = pStr + pMatches[ *p - pStr ];
314 q2 = pStr + pMatches[ *p - pStr ];
315 assert( **p ==
'{' && *q2 ==
'}' );
316 for ( nVars = 0, (*p)++; *p < q2; (*p)++, nVars++ )
325 q = pStr + pMatches[ *p - pStr ];
326 assert( **p ==
'<' && *q ==
'>' );
329 for ( ; pOld < q; pOld++ )
330 if ( *pOld >=
'a' && *pOld <=
'z' )
331 assert( *pOld -
'a' < nVars );
333 for ( (*p)++; *p < q; (*p)++ )
335 assert( pTemp == Temp + 3 );
339 char * q = pStr + pMatches[ ++(*p) - pStr ];
340 assert( **p ==
'{' && *q ==
'}' );
363 if ( (**p >=
'A' && **p <=
'F') || (**p >=
'0' && **p <=
'9') )
370 q = pStr + pMatches[ *p - pStr ];
371 assert( **p ==
'{' && *q ==
'}' );
372 for ( i = 0, (*p)++; *p < q; (*p)++, i++ )
376 vLeaves.nCap = nVars;
377 vLeaves.nSize = nVars;
378 vLeaves.pArray = Fanins;
380 Res =
Kit_TruthToGia( pGia, (
unsigned *)pFunc, nVars, vCover, &vLeaves, 1 );
394 if ( *p ==
'0' && *(p+1) == 0 )
396 else if ( *p ==
'1' && *(p+1) == 0 )
418 int fDelayBalance = 1;
425 if ( fDelayBalance && fUseMuxes )
477 int k, i, iLut, iVar;
void Dau_DsdAddToArray(Gia_Man_t *pGia, int *pFans, int nFans, int iFan)
static int Gia_ObjLevelId(Gia_Man_t *p, int Id)
static int * Vec_IntArray(Vec_Int_t *p)
int Dau_DsdToGiaCompose_rec(Gia_Man_t *pGia, word Func, int *pFanins, int nVars)
FUNCTION DEFINITIONS ///.
void Dsm_ManReportStats()
void Gia_ManStop(Gia_Man_t *p)
#define Gia_ManForEachCo(p, pObj, i)
void Gia_ObjComputeTruthTableStart(Gia_Man_t *p, int nVarsMax)
static int Gia_ManAppendCo(Gia_Man_t *p, int iLit0)
int Gia_ManHashXor(Gia_Man_t *p, int iLit0, int iLit1)
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
word * Gia_ObjComputeTruthTableCut(Gia_Man_t *p, Gia_Obj_t *pObj, Vec_Int_t *vLeaves)
static int Abc_Tt6HasVar(word t, int iVar)
static void Gia_ObjSetGateLevel(Gia_Man_t *p, Gia_Obj_t *pObj)
static int Gia_ManAppendCi(Gia_Man_t *p)
void Gia_ObjComputeTruthTableStop(Gia_Man_t *p)
int Dau_DsdDecompose(word *pTruth, int nVarsInit, int fSplitPrime, int fWriteTruth, char *pRes)
static int Gia_ObjIsBuf(Gia_Obj_t *pObj)
void Gia_ManSetRegNum(Gia_Man_t *p, int nRegs)
static word Abc_Tt6Cofactor0(word t, int iVar)
static Gia_Obj_t * Gia_ManObj(Gia_Man_t *p, int v)
static int Abc_LitNotCond(int Lit, int c)
int Dau_DsdDecomposeLevel(word *pTruth, int nVarsInit, int fSplitPrime, int fWriteTruth, char *pRes, int *pVarLevels)
#define ABC_SWAP(Type, a, b)
int Dsm_ManTruthToGia(void *p, word *pTruth, Vec_Int_t *vLeaves, Vec_Int_t *vCover)
static int Abc_TtReadHex(word *pTruth, char *pString)
#define Gia_ManForEachCi(p, pObj, i)
static Vec_Int_t * Vec_IntStart(int nSize)
void * Dsm_ManDeriveGia(void *pGia, int fUseMuxes)
int * Dau_DsdComputeMatches(char *p)
static Gia_Obj_t * Gia_ObjFanin0(Gia_Obj_t *pObj)
static int Abc_TtHexDigitNum(int nVars)
static word Abc_Tt6Cofactor1(word t, int iVar)
int Dau_DsdBalance(Gia_Man_t *pGia, int *pFans, int nFans, int fAnd)
static Vec_Int_t * Vec_IntAlloc(int nCap)
FUNCTION DEFINITIONS ///.
static int Gia_ManAppendBuf(Gia_Man_t *p, int iLit)
static void Gia_ObjSetAndLevel(Gia_Man_t *p, Gia_Obj_t *pObj)
unsigned __int64 word
DECLARATIONS ///.
#define ABC_NAMESPACE_IMPL_END
int Gia_ManHashMux(Gia_Man_t *p, int iCtrl, int iData1, int iData0)
void Gia_ManHashStart(Gia_Man_t *p)
Gia_Man_t * Gia_ManStart(int nObjsMax)
DECLARATIONS ///.
#define Gia_ManForEachAnd(p, pObj, i)
int Gia_ManHashXorReal(Gia_Man_t *p, int iLit0, int iLit1)
static void Vec_IntPush(Vec_Int_t *p, int Entry)
void Gia_ManFillValue(Gia_Man_t *p)
int Gia_ManLutSizeMax(Gia_Man_t *p)
int Dau_DsdToGia_rec(Gia_Man_t *pGia, char *pStr, char **p, int *pMatches, int *pLits, Vec_Int_t *vCover)
static word s_Truths6Neg[6]
static int Gia_ObjFanin0Copy(Gia_Obj_t *pObj)
#define ABC_NAMESPACE_IMPL_START
int Dau_DsdToGia(Gia_Man_t *pGia, char *p, int *pLits, Vec_Int_t *vCover)
int Dau_DsdToGia2_rec(Gia_Man_t *pGia, char *pStr, char **p, int *pMatches, int *pLits, Vec_Int_t *vCover)
int Dau_DsdToGia2(Gia_Man_t *pGia, char *p, int *pLits, Vec_Int_t *vCover)
static int Vec_IntSize(Vec_Int_t *p)
static int Gia_ManHasMapping(Gia_Man_t *p)
ABC_NAMESPACE_IMPL_START int Kit_TruthToGia(Gia_Man_t *pMan, unsigned *pTruth, int nVars, Vec_Int_t *vMemory, Vec_Int_t *vLeaves, int fHash)
DECLARATIONS ///.
static int Gia_ObjIsAnd(Gia_Obj_t *pObj)
static Gia_Obj_t * Gia_ManConst0(Gia_Man_t *p)
static void Gia_ObjSetMuxLevel(Gia_Man_t *p, Gia_Obj_t *pObj)
#define ABC_CALLOC(type, num)
static int Abc_Lit2Var(int Lit)
static void Gia_ObjSetXorLevel(Gia_Man_t *p, Gia_Obj_t *pObj)
static Gia_Obj_t * Gia_ObjFanin1(Gia_Obj_t *pObj)
int Gia_ManHashMuxReal(Gia_Man_t *p, int iLitC, int iLit1, int iLit0)
static int Gia_ObjIsLut(Gia_Man_t *p, int Id)
static void Vec_IntFree(Vec_Int_t *p)
static void Vec_IntClear(Vec_Int_t *p)
Gia_Man_t * Gia_ManCleanup(Gia_Man_t *p)
char * Abc_UtilStrsav(char *s)
#define Vec_IntForEachEntry(vVec, Entry, i)
MACRO DEFINITIONS ///.
#define Gia_LutForEachFanin(p, i, iFan, k)
int Gia_ManHashAnd(Gia_Man_t *p, int iLit0, int iLit1)
static int Gia_ManObjNum(Gia_Man_t *p)
void Gia_ManHashStop(Gia_Man_t *p)
static int Gia_ManRegNum(Gia_Man_t *p)