ABC: A System for Sequential Synthesis and Verification
 
Loading...
Searching...
No Matches
giaDecs.c File Reference
#include "aig/gia/gia.h"
#include "misc/util/utilTruth.h"
#include "misc/extra/extra.h"
#include "bool/bdc/bdc.h"
#include "bool/kit/kit.h"
Include dependency graph for giaDecs.c:

Go to the source code of this file.

Functions

ABC_NAMESPACE_IMPL_START void Extra_BitMatrixTransposeP (Vec_Wrd_t *vSimsIn, int nWordsIn, Vec_Wrd_t *vSimsOut, int nWordsOut)
 DECLARATIONS ///.
 
Vec_Int_tGia_ManResubOne (Vec_Ptr_t *vDivs, int nWords, int nLimit, int nDivsMax, int iChoice, int fUseXor, int fDebug, int fVerbose, word *pFunc, int Depth)
 
int Gia_ResubVarNum (Vec_Int_t *vResub)
 FUNCTION DEFINITIONS ///.
 
word Gia_ResubToTruth6_rec (Vec_Int_t *vResub, int iNode, int nVars)
 
word Gia_ResubToTruth6 (Vec_Int_t *vResub)
 
Vec_Wrd_tGia_ManDeriveTruths (Gia_Man_t *p, Vec_Wrd_t *vSims, Vec_Wrd_t *vIsfs, Vec_Int_t *vCands, Vec_Int_t *vSet, int nWords)
 
int Gia_ManCountResub (Vec_Wrd_t *vTruths, int nVars, int fVerbose)
 
Vec_Int_tGia_ManDeriveResub (Vec_Wrd_t *vTruths, int nVars)
 
int Gia_ManCountBidec (Vec_Wrd_t *vTruths, int nVars, int fVerbose)
 
Vec_Int_tGia_ManDeriveBidec (Vec_Wrd_t *vTruths, int nVars)
 
int Gia_ManCountIsop (Vec_Wrd_t *vTruths, int nVars, int fVerbose)
 
Vec_Int_tGia_ManDeriveIsop (Vec_Wrd_t *vTruths, int nVars)
 
int Gia_ManCountBdd (Vec_Wrd_t *vTruths, int nVars, int fVerbose)
 
Vec_Int_tGia_ManDeriveBdd (Vec_Wrd_t *vTruths, int nVars)
 
int Gia_ManEvalSolutionOne (Gia_Man_t *p, Vec_Wrd_t *vSims, Vec_Wrd_t *vIsfs, Vec_Int_t *vCands, Vec_Int_t *vSet, int nWords, int fVerbose)
 
Vec_Int_tGia_ManDeriveSolutionOne (Gia_Man_t *p, Vec_Wrd_t *vSims, Vec_Wrd_t *vIsfs, Vec_Int_t *vCands, Vec_Int_t *vSet, int nWords, int Type)
 

Function Documentation

◆ Extra_BitMatrixTransposeP()

ABC_NAMESPACE_IMPL_START void Extra_BitMatrixTransposeP ( Vec_Wrd_t * vSimsIn,
int nWordsIn,
Vec_Wrd_t * vSimsOut,
int nWordsOut )
extern

DECLARATIONS ///.

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

FileName [giaDecs.c]

SystemName [ABC: Logic synthesis and verification system.]

PackageName [Scalable AIG package.]

Synopsis [Calling various decomposition engines.]

Author [Alan Mishchenko]

Affiliation [UC Berkeley]

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

Revision [

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

]

Definition at line 2652 of file extraUtilMisc.c.

2653{
2654 word * pM[64]; int i, y, x;
2655 assert( Vec_WrdSize(vSimsIn) == Vec_WrdSize(vSimsOut) );
2656 assert( Vec_WrdSize(vSimsIn) == 64 * nWordsIn * nWordsOut );
2657 for ( x = 0; x < nWordsOut; x++ )
2658 for ( y = 0; y < nWordsIn; y++ )
2659 {
2660 for ( i = 0; i < 64; i++ )
2661 {
2662 pM[i] = Vec_WrdEntryP( vSimsOut, (64*y+63-i)*nWordsOut + x );
2663 pM[i][0] = Vec_WrdEntry ( vSimsIn, (64*x+63-i)*nWordsIn + y );
2664 }
2665 Extra_Transpose64p( pM );
2666 }
2667}
void Extra_Transpose64p(word *A[64])
unsigned __int64 word
DECLARATIONS ///.
Definition kitPerm.c:36
#define assert(ex)
Definition util_old.h:213
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Gia_ManCountBdd()

int Gia_ManCountBdd ( Vec_Wrd_t * vTruths,
int nVars,
int fVerbose )

Definition at line 227 of file giaDecs.c.

228{
229 extern Gia_Man_t * Gia_TryPermOptNew( word * pTruths, int nIns, int nOuts, int nWords, int nRounds, int fVerbose );
230 int nTtWords = Abc_Truth6WordNum(nVars);
231 word * pTruth[2] = { Vec_WrdEntryP(vTruths, 0*nTtWords),
232 Vec_WrdEntryP(vTruths, 1*nTtWords) };
233 Gia_Man_t * pGia; int nNodes;
234
235 Abc_TtOr( pTruth[1], pTruth[1], pTruth[0], nTtWords );
236 Abc_TtNot( pTruth[0], nTtWords );
237 pGia = Gia_TryPermOptNew( pTruth[0], nVars, 1, nTtWords, 50, 0 );
238 Abc_TtNot( pTruth[0], nTtWords );
239 Abc_TtSharp( pTruth[1], pTruth[1], pTruth[0], nTtWords );
240
241 nNodes = Gia_ManAndNum(pGia);
242 Gia_ManStop( pGia );
243 return nNodes;
244}
int nWords
Definition abcNpn.c:127
Gia_Man_t * Gia_TryPermOptNew(word *pTruths, int nIns, int nOuts, int nWords, int nRounds, int fVerbose)
void Gia_ManStop(Gia_Man_t *p)
Definition giaMan.c:82
struct Gia_Man_t_ Gia_Man_t
Definition gia.h:96
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Gia_ManCountBidec()

int Gia_ManCountBidec ( Vec_Wrd_t * vTruths,
int nVars,
int fVerbose )

Definition at line 187 of file giaDecs.c.

188{
189 int nNodes, nTtWords = Abc_Truth6WordNum(nVars);
190 word * pTruth[2] = { Vec_WrdEntryP(vTruths, 0*nTtWords),
191 Vec_WrdEntryP(vTruths, 1*nTtWords) };
192 Abc_TtOr( pTruth[0], pTruth[0], pTruth[1], nTtWords );
193 nNodes = Bdc_ManBidecNodeNum( pTruth[1], pTruth[0], nVars, fVerbose );
194 Abc_TtSharp( pTruth[0], pTruth[0], pTruth[1], nTtWords );
195 return nNodes;
196}
int Bdc_ManBidecNodeNum(word *pFunc, word *pCare, int nVars, int fVerbose)
Definition bdcCore.c:378
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Gia_ManCountIsop()

int Gia_ManCountIsop ( Vec_Wrd_t * vTruths,
int nVars,
int fVerbose )

Definition at line 209 of file giaDecs.c.

210{
211 int nTtWords = Abc_Truth6WordNum(nVars);
212 word * pTruth[2] = { Vec_WrdEntryP(vTruths, 0*nTtWords),
213 Vec_WrdEntryP(vTruths, 1*nTtWords) };
214 int nNodes = Kit_IsopNodeNum( (unsigned *)pTruth[0], (unsigned *)pTruth[1], nVars, NULL );
215 return nNodes;
216}
int Kit_IsopNodeNum(unsigned *pTruth0, unsigned *pTruth1, int nVars, Vec_Int_t *vMemory)
Definition kitHop.c:139
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Gia_ManCountResub()

int Gia_ManCountResub ( Vec_Wrd_t * vTruths,
int nVars,
int fVerbose )

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

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 148 of file giaDecs.c.

149{
150 Vec_Int_t * vResub; int nNodes;
151 int nTtWords = Abc_Truth6WordNum(nVars);
152 int v, nFuncs = Vec_WrdSize(vTruths) / 2 / nTtWords;
153 Vec_Wrd_t * vElems = Vec_WrdStartTruthTables( nVars );
154 Vec_Ptr_t * vDivs = Vec_PtrAlloc( 2 + nVars );
155 assert( Vec_WrdSize(vElems) == nTtWords * nVars );
156 assert( nFuncs == 1 );
157 Vec_PtrPush( vDivs, Vec_WrdEntryP(vTruths, (2*0+0)*nTtWords) );
158 Vec_PtrPush( vDivs, Vec_WrdEntryP(vTruths, (2*0+1)*nTtWords) );
159 for ( v = 0; v < nVars; v++ )
160 Vec_PtrPush( vDivs, Vec_WrdEntryP(vElems, v*nTtWords) );
161 vResub = Gia_ManResubOne( vDivs, nTtWords, 30, 100, 0, 0, 0, fVerbose, NULL, 0 );
162 Vec_PtrFree( vDivs );
163 Vec_WrdFree( vElems );
164 nNodes = Vec_IntSize(vResub) ? Vec_IntSize(vResub)/2 : 999;
165 Vec_IntFree( vResub );
166 return nNodes;
167}
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
Definition bblif.c:37
Vec_Int_t * Gia_ManResubOne(Vec_Ptr_t *vDivs, int nWords, int nLimit, int nDivsMax, int iChoice, int fUseXor, int fDebug, int fVerbose, word *pFunc, int Depth)
Definition giaResub.c:1503
typedefABC_NAMESPACE_HEADER_START struct Vec_Ptr_t_ Vec_Ptr_t
INCLUDES ///.
Definition vecPtr.h:42
typedefABC_NAMESPACE_HEADER_START struct Vec_Wrd_t_ Vec_Wrd_t
INCLUDES ///.
Definition vecWrd.h:42
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Gia_ManDeriveBdd()

Vec_Int_t * Gia_ManDeriveBdd ( Vec_Wrd_t * vTruths,
int nVars )

Definition at line 245 of file giaDecs.c.

246{
247 extern Vec_Int_t * Gia_ManToGates( Gia_Man_t * p );
248 Vec_Int_t * vRes = NULL;
249 extern Gia_Man_t * Gia_TryPermOptNew( word * pTruths, int nIns, int nOuts, int nWords, int nRounds, int fVerbose );
250 int nTtWords = Abc_Truth6WordNum(nVars);
251 word * pTruth[2] = { Vec_WrdEntryP(vTruths, 0*nTtWords),
252 Vec_WrdEntryP(vTruths, 1*nTtWords) };
253 Gia_Man_t * pGia;
254
255 Abc_TtOr( pTruth[1], pTruth[1], pTruth[0], nTtWords );
256 Abc_TtNot( pTruth[0], nTtWords );
257 pGia = Gia_TryPermOptNew( pTruth[0], nVars, 1, nTtWords, 50, 0 );
258 Abc_TtNot( pTruth[0], nTtWords );
259 Abc_TtSharp( pTruth[1], pTruth[1], pTruth[0], nTtWords );
260
261 vRes = Gia_ManToGates( pGia );
262 Gia_ManStop( pGia );
263 return vRes;
264}
Cube * p
Definition exorList.c:222
Vec_Int_t * Gia_ManToGates(Gia_Man_t *p)
Definition giaResub.c:655
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Gia_ManDeriveBidec()

Vec_Int_t * Gia_ManDeriveBidec ( Vec_Wrd_t * vTruths,
int nVars )

Definition at line 197 of file giaDecs.c.

198{
199 Vec_Int_t * vRes = NULL;
200 int nTtWords = Abc_Truth6WordNum(nVars);
201 word * pTruth[2] = { Vec_WrdEntryP(vTruths, 0*nTtWords),
202 Vec_WrdEntryP(vTruths, 1*nTtWords) };
203 Abc_TtOr( pTruth[0], pTruth[0], pTruth[1], nTtWords );
204 vRes = Bdc_ManBidecResub( pTruth[1], pTruth[0], nVars );
205 Abc_TtSharp( pTruth[0], pTruth[0], pTruth[1], nTtWords );
206 return vRes;
207}
Vec_Int_t * Bdc_ManBidecResub(word *pFunc, word *pCare, int nVars)
Definition bdcCore.c:426
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Gia_ManDeriveIsop()

Vec_Int_t * Gia_ManDeriveIsop ( Vec_Wrd_t * vTruths,
int nVars )

Definition at line 217 of file giaDecs.c.

218{
219 Vec_Int_t * vRes = NULL;
220 int nTtWords = Abc_Truth6WordNum(nVars);
221 word * pTruth[2] = { Vec_WrdEntryP(vTruths, 0*nTtWords),
222 Vec_WrdEntryP(vTruths, 1*nTtWords) };
223 vRes = Kit_IsopResub( (unsigned *)pTruth[0], (unsigned *)pTruth[1], nVars, NULL );
224 return vRes;
225}
Vec_Int_t * Kit_IsopResub(unsigned *pTruth0, unsigned *pTruth1, int nVars, Vec_Int_t *vMemory)
Definition kitHop.c:200
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Gia_ManDeriveResub()

Vec_Int_t * Gia_ManDeriveResub ( Vec_Wrd_t * vTruths,
int nVars )

Definition at line 168 of file giaDecs.c.

169{
170 Vec_Int_t * vResub;
171 int nTtWords = Abc_Truth6WordNum(nVars);
172 int v, nFuncs = Vec_WrdSize(vTruths) / 2 / nTtWords;
173 Vec_Wrd_t * vElems = Vec_WrdStartTruthTables( nVars );
174 Vec_Ptr_t * vDivs = Vec_PtrAlloc( 2 + nVars );
175 assert( Vec_WrdSize(vElems) == nTtWords * nVars );
176 assert( nFuncs == 1 );
177 Vec_PtrPush( vDivs, Vec_WrdEntryP(vTruths, (2*0+0)*nTtWords) );
178 Vec_PtrPush( vDivs, Vec_WrdEntryP(vTruths, (2*0+1)*nTtWords) );
179 for ( v = 0; v < nVars; v++ )
180 Vec_PtrPush( vDivs, Vec_WrdEntryP(vElems, v*nTtWords) );
181 vResub = Gia_ManResubOne( vDivs, nTtWords, 30, 100, 0, 0, 0, 0, NULL, 0 );
182 Vec_PtrFree( vDivs );
183 Vec_WrdFree( vElems );
184 return vResub;
185}
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Gia_ManDeriveSolutionOne()

Vec_Int_t * Gia_ManDeriveSolutionOne ( Gia_Man_t * p,
Vec_Wrd_t * vSims,
Vec_Wrd_t * vIsfs,
Vec_Int_t * vCands,
Vec_Int_t * vSet,
int nWords,
int Type )

Definition at line 318 of file giaDecs.c.

319{
320 Vec_Int_t * vRes = NULL;
321 Vec_Wrd_t * vTruths = Gia_ManDeriveTruths( p, vSims, vIsfs, vCands, vSet, nWords );
322 int nTtWords = Vec_WrdSize(vTruths)/2, nVars = Vec_IntSize(vSet);
323 word * pTruth[2] = { Vec_WrdEntryP(vTruths, 0*nTtWords),
324 Vec_WrdEntryP(vTruths, 1*nTtWords) };
325 if ( Type == 0 )
326 vRes = Gia_ManDeriveResub( vTruths, nVars );
327 else if ( Type == 1 )
328 vRes = Gia_ManDeriveBidec( vTruths, nVars );
329 else if ( Type == 2 )
330 vRes = Gia_ManDeriveIsop( vTruths, nVars );
331 else if ( Type == 3 )
332 vRes = Gia_ManDeriveBdd( vTruths, nVars );
333 if ( vRes && Gia_ResubVarNum(vRes) <= 6 )
334 {
335 word Func = Gia_ResubToTruth6( vRes );
336 assert( !(Func & pTruth[0][0]) );
337 assert( !(pTruth[1][0] & ~Func) );
338 }
339 Vec_WrdFree( vTruths );
340 return vRes;
341}
Vec_Int_t * Gia_ManDeriveBidec(Vec_Wrd_t *vTruths, int nVars)
Definition giaDecs.c:197
word Gia_ResubToTruth6(Vec_Int_t *vResub)
Definition giaDecs.c:73
int Gia_ResubVarNum(Vec_Int_t *vResub)
FUNCTION DEFINITIONS ///.
Definition giaDecs.c:51
Vec_Wrd_t * Gia_ManDeriveTruths(Gia_Man_t *p, Vec_Wrd_t *vSims, Vec_Wrd_t *vIsfs, Vec_Int_t *vCands, Vec_Int_t *vSet, int nWords)
Definition giaDecs.c:95
Vec_Int_t * Gia_ManDeriveBdd(Vec_Wrd_t *vTruths, int nVars)
Definition giaDecs.c:245
Vec_Int_t * Gia_ManDeriveResub(Vec_Wrd_t *vTruths, int nVars)
Definition giaDecs.c:168
Vec_Int_t * Gia_ManDeriveIsop(Vec_Wrd_t *vTruths, int nVars)
Definition giaDecs.c:217
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Gia_ManDeriveTruths()

Vec_Wrd_t * Gia_ManDeriveTruths ( Gia_Man_t * p,
Vec_Wrd_t * vSims,
Vec_Wrd_t * vIsfs,
Vec_Int_t * vCands,
Vec_Int_t * vSet,
int nWords )

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

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 95 of file giaDecs.c.

96{
97 int nTtWords = Abc_Truth6WordNum(Vec_IntSize(vSet));
98 int nFuncs = Vec_WrdSize(vIsfs) / 2 / nWords;
99 Vec_Wrd_t * vRes = Vec_WrdStart( 2 * nFuncs * nTtWords );
100 Vec_Wrd_t * vIn = Vec_WrdStart( 64*nWords ), * vOut;
101 int i, f, m, iObj; word Func;
102 assert( Vec_IntSize(vSet) <= 64 );
103 Vec_IntForEachEntry( vSet, iObj, i )
104 Abc_TtCopy( Vec_WrdEntryP(vIn, i*nWords), Vec_WrdEntryP(vSims, Vec_IntEntry(vCands, iObj)*nWords), nWords, 0 );
105 vOut = Vec_WrdStart( Vec_WrdSize(vIn) );
106 Extra_BitMatrixTransposeP( vIn, nWords, vOut, 1 );
107 for ( f = 0; f < nFuncs; f++ )
108 {
109 word * pIsf[2] = { Vec_WrdEntryP(vIsfs, (2*f+0)*nWords),
110 Vec_WrdEntryP(vIsfs, (2*f+1)*nWords) };
111 word * pTruth[2] = { Vec_WrdEntryP(vRes, (2*f+0)*nTtWords),
112 Vec_WrdEntryP(vRes, (2*f+1)*nTtWords) };
113 for ( m = 0; m < 64*nWords; m++ )
114 {
115 int iMint = (int)Vec_WrdEntry(vOut, m);
116 int Value0 = Abc_TtGetBit( pIsf[0], m );
117 int Value1 = Abc_TtGetBit( pIsf[1], m );
118 if ( !Value0 && !Value1 )
119 continue;
120 if ( Value0 && Value1 )
121 printf( "Internal error: Onset and Offset overlap.\n" );
122 assert( !Value0 || !Value1 );
123 Abc_TtSetBit( pTruth[Value1], iMint );
124 }
125 if ( Abc_TtCountOnesVecMask(pTruth[0], pTruth[1], nTtWords, 0) )
126 printf( "Verification for function %d failed for %d minterm pairs.\n", f,
127 Abc_TtCountOnesVecMask(pTruth[0], pTruth[1], nTtWords, 0) );
128 }
129 if ( Vec_IntSize(vSet) < 6 )
130 Vec_WrdForEachEntry( vRes, Func, i )
131 Vec_WrdWriteEntry( vRes, i, Abc_Tt6Stretch(Func, Vec_IntSize(vSet)) );
132 Vec_WrdFree( vIn );
133 Vec_WrdFree( vOut );
134 return vRes;
135}
ABC_NAMESPACE_IMPL_START void Extra_BitMatrixTransposeP(Vec_Wrd_t *vSimsIn, int nWordsIn, Vec_Wrd_t *vSimsOut, int nWordsOut)
DECLARATIONS ///.
#define Vec_IntForEachEntry(vVec, Entry, i)
MACRO DEFINITIONS ///.
Definition vecInt.h:54
#define Vec_WrdForEachEntry(vVec, Entry, i)
MACRO DEFINITIONS ///.
Definition vecWrd.h:54
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Gia_ManEvalSolutionOne()

int Gia_ManEvalSolutionOne ( Gia_Man_t * p,
Vec_Wrd_t * vSims,
Vec_Wrd_t * vIsfs,
Vec_Int_t * vCands,
Vec_Int_t * vSet,
int nWords,
int fVerbose )

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

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 277 of file giaDecs.c.

278{
279 Vec_Wrd_t * vTruths = Gia_ManDeriveTruths( p, vSims, vIsfs, vCands, vSet, nWords );
280 int nTtWords = Vec_WrdSize(vTruths)/2, nVars = Vec_IntSize(vSet);
281 word * pTruth[2] = { Vec_WrdEntryP(vTruths, 0*nTtWords),
282 Vec_WrdEntryP(vTruths, 1*nTtWords) };
283 int nNodesResub = Gia_ManCountResub( vTruths, nVars, 0 );
284 int nNodesBidec = nVars > 2 ? Gia_ManCountBidec( vTruths, nVars, 0 ) : 999;
285 int nNodesIsop = nVars > 2 ? Gia_ManCountIsop( vTruths, nVars, 0 ) : 999;
286 int nNodesBdd = nVars > 2 ? Gia_ManCountBdd( vTruths, nVars, 0 ) : 999;
287 int nNodesMin = Abc_MinInt( Abc_MinInt(nNodesResub, nNodesBidec), Abc_MinInt(nNodesIsop, nNodesBdd) );
288 if ( fVerbose )
289 {
290 printf( "Size = %2d ", nVars );
291 printf( "Resub =%3d ", nNodesResub );
292 printf( "Bidec =%3d ", nNodesBidec );
293 printf( "Isop =%3d ", nNodesIsop );
294 printf( "Bdd =%3d ", nNodesBdd );
295 Abc_TtIsfPrint( pTruth[0], pTruth[1], nTtWords );
296 if ( nVars <= 6 )
297 {
298 printf( " " );
299 Extra_PrintHex( stdout, (unsigned*)pTruth[0], nVars );
300 printf( " " );
301 Extra_PrintHex( stdout, (unsigned*)pTruth[1], nVars );
302 }
303 printf( "\n" );
304 }
305 Vec_WrdFree( vTruths );
306 if ( nNodesMin > 500 )
307 return -1;
308 if ( nNodesMin == nNodesResub )
309 return (nNodesMin << 2) | 0;
310 if ( nNodesMin == nNodesBidec )
311 return (nNodesMin << 2) | 1;
312 if ( nNodesMin == nNodesIsop )
313 return (nNodesMin << 2) | 2;
314 if ( nNodesMin == nNodesBdd )
315 return (nNodesMin << 2) | 3;
316 return -1;
317}
int Gia_ManCountBidec(Vec_Wrd_t *vTruths, int nVars, int fVerbose)
Definition giaDecs.c:187
int Gia_ManCountIsop(Vec_Wrd_t *vTruths, int nVars, int fVerbose)
Definition giaDecs.c:209
int Gia_ManCountResub(Vec_Wrd_t *vTruths, int nVars, int fVerbose)
Definition giaDecs.c:148
int Gia_ManCountBdd(Vec_Wrd_t *vTruths, int nVars, int fVerbose)
Definition giaDecs.c:227
void Extra_PrintHex(FILE *pFile, unsigned *pTruth, int nVars)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Gia_ManResubOne()

Vec_Int_t * Gia_ManResubOne ( Vec_Ptr_t * vDivs,
int nWords,
int nLimit,
int nDivsMax,
int iChoice,
int fUseXor,
int fDebug,
int fVerbose,
word * pFunc,
int Depth )
extern

Definition at line 1503 of file giaResub.c.

1504{
1505 Vec_Int_t * vRes;
1507 Gia_ManResubPerform( p, vDivs, nWords, nLimit, nDivsMax, iChoice, fUseXor, fDebug, fVerbose, Depth );
1508 if ( fVerbose )
1509 Gia_ManResubPrint( p->vGates, Vec_PtrSize(vDivs) );
1510 //if ( fVerbose )
1511 // printf( "\n" );
1512 if ( !Gia_ManResubVerify(p, pFunc) )
1513 {
1514 Gia_ManResubPrint( p->vGates, Vec_PtrSize(vDivs) );
1515 printf( "Verification FAILED.\n" );
1516 }
1517 else if ( fDebug && fVerbose )
1518 printf( "Verification succeeded." );
1519 if ( fVerbose )
1520 printf( "\n" );
1521 vRes = Vec_IntDup( p->vGates );
1522 Gia_ResbFree( p );
1523 return vRes;
1524}
Gia_ResbMan_t * Gia_ResbAlloc(int nWords)
Definition giaResub.c:314
int Gia_ManResubVerify(Gia_ResbMan_t *p, word *pFunc)
Definition giaResub.c:456
struct Gia_ResbMan_t_ Gia_ResbMan_t
Definition giaResub.c:289
void Gia_ManResubPerform(Gia_ResbMan_t *p, Vec_Ptr_t *vDivs, int nWords, int nLimit, int nDivsMax, int iChoice, int fUseXor, int fDebug, int fVerbose, int Depth)
Definition giaResub.c:1491
int Gia_ManResubPrint(Vec_Int_t *vRes, int nVars)
Definition giaResub.c:430
void Gia_ResbFree(Gia_ResbMan_t *p)
Definition giaResub.c:366
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Gia_ResubToTruth6()

word Gia_ResubToTruth6 ( Vec_Int_t * vResub)

Definition at line 73 of file giaDecs.c.

74{
75 word Res;
76 int iRoot = Vec_IntEntryLast(vResub);
77 if ( iRoot < 2 )
78 return iRoot ? ~(word)0 : 0;
79 assert( iRoot != 2 && iRoot != 3 );
80 Res = Gia_ResubToTruth6_rec( vResub, Abc_Lit2Var(iRoot)-2, Gia_ResubVarNum(vResub) );
81 return Abc_LitIsCompl(iRoot) ? ~Res : Res;
82}
word Gia_ResubToTruth6_rec(Vec_Int_t *vResub, int iNode, int nVars)
Definition giaDecs.c:57
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Gia_ResubToTruth6_rec()

word Gia_ResubToTruth6_rec ( Vec_Int_t * vResub,
int iNode,
int nVars )

Definition at line 57 of file giaDecs.c.

58{
59 assert( iNode >= 0 && nVars <= 6 );
60 if ( iNode < nVars )
61 return s_Truths6[iNode];
62 else
63 {
64 int iLit0 = Vec_IntEntry( vResub, Abc_Var2Lit(iNode-nVars, 0) );
65 int iLit1 = Vec_IntEntry( vResub, Abc_Var2Lit(iNode-nVars, 1) );
66 word Res0 = Gia_ResubToTruth6_rec( vResub, Abc_Lit2Var(iLit0)-2, nVars );
67 word Res1 = Gia_ResubToTruth6_rec( vResub, Abc_Lit2Var(iLit1)-2, nVars );
68 Res0 = Abc_LitIsCompl(iLit0) ? ~Res0 : Res0;
69 Res1 = Abc_LitIsCompl(iLit1) ? ~Res1 : Res1;
70 return iLit0 > iLit1 ? Res0 ^ Res1 : Res0 & Res1;
71 }
72}
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Gia_ResubVarNum()

int Gia_ResubVarNum ( Vec_Int_t * vResub)

FUNCTION DEFINITIONS ///.

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

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 51 of file giaDecs.c.

52{
53 if ( Vec_IntSize(vResub) == 1 )
54 return Vec_IntEntryLast(vResub) >= 2;
55 return Vec_IntEntryLast(vResub)/2 - Vec_IntSize(vResub)/2 - 1;
56}
Here is the caller graph for this function: