92 p->vCutsNew = Vec_PtrAlloc(
p->pParams->nIdsMax );
93 Vec_PtrFill(
p->vCutsNew,
p->pParams->nIdsMax, NULL );
94 p->vCuts0 = Vec_PtrAlloc( 100 );
95 p->vCuts1 = Vec_PtrAlloc( 100 );
98 p->EntrySize =
sizeof(
Cut_Cut_t) +
p->pParams->nVarsMax *
sizeof(
int);
99 if (
p->pParams->fTruth )
101 if (
p->pParams->nVarsMax > 8 )
103 p->pParams->fTruth = 0;
104 printf(
"Skipping computation of truth table for more than 8 inputs.\n" );
108 p->nTruthWords = Cut_TruthWords(
p->pParams->nVarsMax );
109 p->EntrySize +=
p->nTruthWords *
sizeof(unsigned);
131 printf(
"Cut computation statistics with oracle:\n" );
132 printf(
"Current cuts = %8d. (Trivial = %d.)\n",
p->nCuts-
p->nCutsTriv,
p->nCutsTriv );
133 ABC_PRT(
"Total time ",
p->timeTotal );
136 if (
p->vCuts0 ) Vec_PtrFree(
p->vCuts0 );
137 if (
p->vCuts1 ) Vec_PtrFree(
p->vCuts1 );
138 if (
p->vCutsNew ) Vec_PtrFree(
p->vCutsNew );
139 if (
p->vFanCounts ) Vec_IntFree(
p->vFanCounts );
141 if (
p->vNodeCuts ) Vec_IntFree(
p->vNodeCuts );
142 if (
p->vNodeStarts ) Vec_IntFree(
p->vNodeStarts );
143 if (
p->vCutPairs ) Vec_IntFree(
p->vCutPairs );
162 p->vFanCounts = vFanCounts;
178 return p->pParams->fDrop;
194 assert( Vec_PtrEntry(
p->vCutsNew, Node ) == NULL );
195 Vec_PtrWriteEntry(
p->vCutsNew, Node, Cut_CutTriv(
p, Node) );
237 pCut = Cut_CutStart(
p );
240 if (
p->pParams->fTruth )
242 unsigned * pTruth = Cut_CutReadTruth(pCut);
244 for ( i = 0; i <
p->nTruthWords; i++ )
245 pTruth[i] = 0xAAAAAAAA;
267 pCut = Cut_CutStart(
p );
268 Limit =
p->pParams->nVarsMax;
269 for ( i = k = c = 0; c < Limit; c++ )
271 if ( k == (
int)pCut1->
nLeaves )
273 if ( i == (
int)pCut0->
nLeaves )
281 if ( i == (
int)pCut0->
nLeaves )
283 if ( k == (
int)pCut1->
nLeaves )
322 Cut_Cut_t * pList = NULL, ** ppTail = &pList;
323 Cut_Cut_t * pCut, * pCut0, * pCut1, * pList0, * pList1;
324 int iCutStart, nCuts, i, Entry;
328 pList0 = (
Cut_Cut_t *)Vec_PtrEntry(
p->vCutsNew, Node0 );
329 pList1 = (
Cut_Cut_t *)Vec_PtrEntry(
p->vCutsNew, Node1 );
330 assert( pList0 && pList1 );
333 p->fSimul = (fCompl0 ^ pList0->
fSimul) & (fCompl1 ^ pList1->
fSimul);
336 Vec_PtrClear(
p->vCuts0 );
338 Vec_PtrPush(
p->vCuts0, pCut );
339 Vec_PtrClear(
p->vCuts1 );
341 Vec_PtrPush(
p->vCuts1, pCut );
344 nCuts = Vec_IntEntry(
p->vNodeCuts, Node);
345 iCutStart = Vec_IntEntry(
p->vNodeStarts, Node);
348 assert( Vec_IntEntry(
p->vCutPairs, iCutStart) == 0 );
349 pCut = Cut_CutTriv(
p, Node );
351 ppTail = &pCut->
pNext;
353 for ( i = 1; i < nCuts; i++ )
355 Entry = Vec_IntEntry(
p->vCutPairs, iCutStart + i );
356 pCut0 = (
Cut_Cut_t *)Vec_PtrEntry(
p->vCuts0, Entry & 0xFFFF );
357 pCut1 = (
Cut_Cut_t *)Vec_PtrEntry(
p->vCuts1, Entry >> 16 );
358 pCut = Cut_CutMerge(
p, pCut0, pCut1 );
360 ppTail = &pCut->
pNext;
362 if (
p->pParams->fTruth )
368 assert( Vec_PtrEntry(
p->vCutsNew, Node ) == NULL );
369 Vec_PtrWriteEntry(
p->vCutsNew, Node, pList );
370p->timeTotal += Abc_Clock() - clk;
388 pList = (
Cut_Cut_t *)Vec_PtrEntry(
p->vCutsNew, Node );
393 Vec_PtrWriteEntry(
p->vCutsNew, Node, pList );
411 nFanouts = Vec_IntEntry(
p->vFanCounts, Node );
413 if ( --nFanouts == 0 )
415 Vec_IntWriteEntry(
p->vFanCounts, Node, nFanouts );
#define ABC_ALLOC(type, num)
#define ABC_NAMESPACE_IMPL_START
#define ABC_NAMESPACE_IMPL_END
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
#define Cut_ListForEachCut(pList, pCut)
#define Cut_ListForEachCutSafe(pList, pCut, pCut2)
void Cut_TruthComputeOld(Cut_Cut_t *pCut, Cut_Cut_t *pCut0, Cut_Cut_t *pCut1, int fCompl0, int fCompl1)
void Cut_OracleTryDroppingCuts(Cut_Oracle_t *p, int Node)
Cut_Cut_t * Cut_OracleComputeCuts(Cut_Oracle_t *p, int Node, int Node0, int Node1, int fCompl0, int fCompl1)
Cut_Oracle_t * Cut_OracleStart(Cut_Man_t *pMan)
FUNCTION DEFINITIONS ///.
int Cut_OracleReadDrop(Cut_Oracle_t *p)
void Cut_OracleSetFanoutCounts(Cut_Oracle_t *p, Vec_Int_t *vFanCounts)
void Cut_OracleFreeCuts(Cut_Oracle_t *p, int Node)
void Cut_OracleNodeSetTriv(Cut_Oracle_t *p, int Node)
void Cut_OracleStop(Cut_Oracle_t *p)
struct Cut_ParamsStruct_t_ Cut_Params_t
struct Cut_ManStruct_t_ Cut_Man_t
BASIC TYPES ///.
struct Cut_OracleStruct_t_ Cut_Oracle_t
struct Cut_CutStruct_t_ Cut_Cut_t
Extra_MmFixed_t * pMmCuts
typedefABC_NAMESPACE_HEADER_START struct Vec_Ptr_t_ Vec_Ptr_t
INCLUDES ///.