ABC: A System for Sequential Synthesis and Verification
 
Loading...
Searching...
No Matches
abcCut.c File Reference
#include "base/abc/abc.h"
#include "opt/cut/cut.h"
Include dependency graph for abcCut.c:

Go to the source code of this file.

Functions

void Abc_NtkCutsSubtractFanunt (Abc_Ntk_t *pNtk)
 FUNCTION DEFINITIONS ///.
 
void Abc_NtkCutsAddFanunt (Abc_Ntk_t *pNtk)
 
Cut_Man_tAbc_NtkCuts (Abc_Ntk_t *pNtk, Cut_Params_t *pParams)
 
void Abc_NtkCutsOracle (Abc_Ntk_t *pNtk, Cut_Oracle_t *p)
 
Cut_Man_tAbc_NtkSeqCuts (Abc_Ntk_t *pNtk, Cut_Params_t *pParams)
 
void * Abc_NodeGetCutsRecursive (void *p, Abc_Obj_t *pObj, int fDag, int fTree)
 
void * Abc_NodeGetCuts (void *p, Abc_Obj_t *pObj, int fDag, int fTree)
 
void Abc_NodeGetCutsSeq (void *p, Abc_Obj_t *pObj, int fTriv)
 
void * Abc_NodeReadCuts (void *p, Abc_Obj_t *pObj)
 
void Abc_NodeFreeCuts (void *p, Abc_Obj_t *pObj)
 
int Abc_NtkSubDagSize_rec (Abc_Obj_t *pObj, Vec_Int_t *vAttrs)
 
Vec_Int_tAbc_NtkGetNodeAttributes2 (Abc_Ntk_t *pNtk)
 

Variables

int nTotal
 DECLARATIONS ///.
 
int nGood
 
int nEqual
 

Function Documentation

◆ Abc_NodeFreeCuts()

void Abc_NodeFreeCuts ( void * p,
Abc_Obj_t * pObj )

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

Synopsis [Computes the cuts for the network.]

Description []

SideEffects []

SeeAlso []

Definition at line 527 of file abcCut.c.

528{
529 Cut_NodeFreeCuts( (Cut_Man_t *)p, pObj->Id );
530}
struct Cut_ManStruct_t_ Cut_Man_t
BASIC TYPES ///.
Definition cut.h:48
void Cut_NodeFreeCuts(Cut_Man_t *p, int Node)
Definition cutApi.c:184
Cube * p
Definition exorList.c:222
int Id
Definition abc.h:132

◆ Abc_NodeGetCuts()

void * Abc_NodeGetCuts ( void * p,
Abc_Obj_t * pObj,
int fDag,
int fTree )

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

Synopsis [Computes the cuts for the network.]

Description []

SideEffects []

SeeAlso []

Definition at line 433 of file abcCut.c.

434{
435 Abc_Obj_t * pFanin;
436 int fDagNode, fTriv, TreeCode = 0;
437// assert( Abc_NtkIsStrash(pObj->pNtk) );
438 assert( Abc_ObjFaninNum(pObj) == 2 );
439
440 // check if the node is a DAG node
441 fDagNode = (Abc_ObjFanoutNum(pObj) > 1 && !Abc_NodeIsMuxControlType(pObj));
442 // increment the counter of DAG nodes
443 if ( fDagNode ) Cut_ManIncrementDagNodes( (Cut_Man_t *)p );
444 // add the trivial cut if the node is a DAG node, or if we compute all cuts
445 fTriv = fDagNode || !fDag;
446 // check if fanins are DAG nodes
447 if ( fTree )
448 {
449 pFanin = Abc_ObjFanin0(pObj);
450 TreeCode |= (Abc_ObjFanoutNum(pFanin) > 1 && !Abc_NodeIsMuxControlType(pFanin));
451 pFanin = Abc_ObjFanin1(pObj);
452 TreeCode |= ((Abc_ObjFanoutNum(pFanin) > 1 && !Abc_NodeIsMuxControlType(pFanin)) << 1);
453 }
454
455 // changes due to the global/local cut computation
456 {
458 if ( pParams->fLocal )
459 {
460 Vec_Int_t * vNodeAttrs = Cut_ManReadNodeAttrs((Cut_Man_t *)p);
461 fDagNode = Vec_IntEntry( vNodeAttrs, pObj->Id );
462 if ( fDagNode ) Cut_ManIncrementDagNodes( (Cut_Man_t *)p );
463// fTriv = fDagNode || !pParams->fGlobal;
464 fTriv = !Vec_IntEntry( vNodeAttrs, pObj->Id );
465 TreeCode = 0;
466 pFanin = Abc_ObjFanin0(pObj);
467 TreeCode |= Vec_IntEntry( vNodeAttrs, pFanin->Id );
468 pFanin = Abc_ObjFanin1(pObj);
469 TreeCode |= (Vec_IntEntry( vNodeAttrs, pFanin->Id ) << 1);
470 }
471 }
472 return Cut_NodeComputeCuts( (Cut_Man_t *)p, pObj->Id, Abc_ObjFaninId0(pObj), Abc_ObjFaninId1(pObj),
473 Abc_ObjFaninC0(pObj), Abc_ObjFaninC1(pObj), fTriv, TreeCode );
474}
struct Abc_Obj_t_ Abc_Obj_t
Definition abc.h:116
ABC_DLL int Abc_NodeIsMuxControlType(Abc_Obj_t *pNode)
Definition abcUtil.c:1398
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
Definition bblif.c:37
void Cut_ManIncrementDagNodes(Cut_Man_t *p)
Definition cutMan.c:309
Cut_Cut_t * Cut_NodeComputeCuts(Cut_Man_t *p, int Node, int Node0, int Node1, int fCompl0, int fCompl1, int fTriv, int TreeCode)
Definition cutNode.c:369
struct Cut_ParamsStruct_t_ Cut_Params_t
Definition cut.h:51
Vec_Int_t * Cut_ManReadNodeAttrs(Cut_Man_t *p)
Definition cutMan.c:293
Cut_Params_t * Cut_ManReadParams(Cut_Man_t *p)
Definition cutMan.c:277
#define assert(ex)
Definition util_old.h:213
Here is the caller graph for this function:

◆ Abc_NodeGetCutsRecursive()

void * Abc_NodeGetCutsRecursive ( void * p,
Abc_Obj_t * pObj,
int fDag,
int fTree )

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

Synopsis [Computes the cuts for the network.]

Description []

SideEffects []

SeeAlso []

Definition at line 412 of file abcCut.c.

413{
414 void * pList;
415 if ( (pList = Abc_NodeReadCuts( p, pObj )) )
416 return pList;
417 Abc_NodeGetCutsRecursive( p, Abc_ObjFanin0(pObj), fDag, fTree );
418 Abc_NodeGetCutsRecursive( p, Abc_ObjFanin1(pObj), fDag, fTree );
419 return Abc_NodeGetCuts( p, pObj, fDag, fTree );
420}
void * Abc_NodeGetCutsRecursive(void *p, Abc_Obj_t *pObj, int fDag, int fTree)
Definition abcCut.c:412
void * Abc_NodeReadCuts(void *p, Abc_Obj_t *pObj)
Definition abcCut.c:511
void * Abc_NodeGetCuts(void *p, Abc_Obj_t *pObj, int fDag, int fTree)
Definition abcCut.c:433
Here is the caller graph for this function:

◆ Abc_NodeGetCutsSeq()

void Abc_NodeGetCutsSeq ( void * p,
Abc_Obj_t * pObj,
int fTriv )

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

Synopsis [Computes the cuts for the network.]

Description []

SideEffects []

SeeAlso []

Definition at line 487 of file abcCut.c.

488{
489/*
490 int CutSetNum;
491 assert( Abc_NtkIsSeq(pObj->pNtk) );
492 assert( Abc_ObjFaninNum(pObj) == 2 );
493 fTriv = pObj->fMarkC ? 0 : fTriv;
494 CutSetNum = pObj->fMarkC ? (int)pObj->pCopy : -1;
495 Cut_NodeComputeCutsSeq( p, pObj->Id, Abc_ObjFaninId0(pObj), Abc_ObjFaninId1(pObj),
496 Abc_ObjFaninC0(pObj), Abc_ObjFaninC1(pObj), Seq_ObjFaninL0(pObj), Seq_ObjFaninL1(pObj), fTriv, CutSetNum );
497*/
498}

◆ Abc_NodeReadCuts()

void * Abc_NodeReadCuts ( void * p,
Abc_Obj_t * pObj )

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

Synopsis [Computes the cuts for the network.]

Description []

SideEffects []

SeeAlso []

Definition at line 511 of file abcCut.c.

512{
513 return Cut_NodeReadCutsNew( (Cut_Man_t *)p, pObj->Id );
514}
Cut_Cut_t * Cut_NodeReadCutsNew(Cut_Man_t *p, int Node)
MACRO DEFINITIONS ///.
Definition cutApi.c:45
Here is the caller graph for this function:

◆ Abc_NtkCuts()

Cut_Man_t * Abc_NtkCuts ( Abc_Ntk_t * pNtk,
Cut_Params_t * pParams )

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

Synopsis [Computes the cuts for the network.]

Description []

SideEffects []

SeeAlso []

Definition at line 122 of file abcCut.c.

123{
124 ProgressBar * pProgress;
125 Cut_Man_t * p;
126 Cut_Cut_t * pList;
127 Abc_Obj_t * pObj, * pNode;
128 Vec_Ptr_t * vNodes;
129 Vec_Int_t * vChoices;
130 int i;
131 abctime clk = Abc_Clock();
132
133 extern void Abc_NtkBalanceAttach( Abc_Ntk_t * pNtk );
134 extern void Abc_NtkBalanceDetach( Abc_Ntk_t * pNtk );
135
136 if ( pParams->fAdjust )
138
139 nTotal = nGood = nEqual = 0;
140
141 assert( Abc_NtkIsStrash(pNtk) );
142 // start the manager
143 pParams->nIdsMax = Abc_NtkObjNumMax( pNtk );
144 p = Cut_ManStart( pParams );
145 // compute node attributes if local or global cuts are requested
146 if ( pParams->fGlobal || pParams->fLocal )
147 {
148 extern Vec_Int_t * Abc_NtkGetNodeAttributes( Abc_Ntk_t * pNtk );
149 Cut_ManSetNodeAttrs( p, Abc_NtkGetNodeAttributes(pNtk) );
150 }
151 // prepare for cut dropping
152 if ( pParams->fDrop )
154 // set cuts for PIs
155 Abc_NtkForEachCi( pNtk, pObj, i )
156 if ( Abc_ObjFanoutNum(pObj) > 0 )
157 Cut_NodeSetTriv( p, pObj->Id );
158 // compute cuts for internal nodes
159 vNodes = Abc_AigDfs( pNtk, 0, 1 ); // collects POs
160 vChoices = Vec_IntAlloc( 100 );
161 pProgress = Extra_ProgressBarStart( stdout, Vec_PtrSize(vNodes) );
162 Vec_PtrForEachEntry( Abc_Obj_t *, vNodes, pObj, i )
163 {
164 // when we reached a CO, it is time to deallocate the cuts
165 if ( Abc_ObjIsCo(pObj) )
166 {
167 if ( pParams->fDrop )
168 Cut_NodeTryDroppingCuts( p, Abc_ObjFaninId0(pObj) );
169 continue;
170 }
171 // skip constant node, it has no cuts
172// if ( Abc_NodeIsConst(pObj) )
173// continue;
174 Extra_ProgressBarUpdate( pProgress, i, NULL );
175 // compute the cuts to the internal node
176 pList = (Cut_Cut_t *)Abc_NodeGetCuts( p, pObj, pParams->fDag, pParams->fTree );
177 if ( pParams->fNpnSave && pList )
178 {
179 extern void Npn_ManSaveOne( unsigned * puTruth, int nVars );
180 Cut_Cut_t * pCut;
181 for ( pCut = pList; pCut; pCut = pCut->pNext )
182 if ( pCut->nLeaves >= 4 )
183 Npn_ManSaveOne( Cut_CutReadTruth(pCut), pCut->nLeaves );
184 }
185 // consider dropping the fanins cuts
186 if ( pParams->fDrop )
187 {
188 Cut_NodeTryDroppingCuts( p, Abc_ObjFaninId0(pObj) );
189 Cut_NodeTryDroppingCuts( p, Abc_ObjFaninId1(pObj) );
190 }
191 // add cuts due to choices
192 if ( Abc_AigNodeIsChoice(pObj) )
193 {
194 Vec_IntClear( vChoices );
195 for ( pNode = pObj; pNode; pNode = (Abc_Obj_t *)pNode->pData )
196 Vec_IntPush( vChoices, pNode->Id );
197 Cut_NodeUnionCuts( p, vChoices );
198 }
199 }
200 Extra_ProgressBarStop( pProgress );
201 Vec_PtrFree( vNodes );
202 Vec_IntFree( vChoices );
204ABC_PRT( "TOTAL", Abc_Clock() - clk );
205// printf( "Area = %d.\n", Abc_NtkComputeArea( pNtk, p ) );
206//Abc_NtkPrintCuts( p, pNtk, 0 );
207// Cut_ManPrintStatsToFile( p, pNtk->pSpec, Abc_Clock() - clk );
208
209 // temporary printout of stats
210 if ( nTotal )
211 printf( "Total cuts = %d. Good cuts = %d. Ratio = %5.2f\n", nTotal, nGood, ((double)nGood)/nTotal );
212 if ( pParams->fAdjust )
213 Abc_NtkCutsAddFanunt( pNtk );
214 return p;
215}
void Abc_NtkBalanceAttach(Abc_Ntk_t *pNtk)
Definition abcBalance.c:506
void Abc_NtkBalanceDetach(Abc_Ntk_t *pNtk)
Definition abcBalance.c:531
void Npn_ManSaveOne(unsigned *puTruth, int nVars)
Definition abcNpnSave.c:714
ABC_DLL Vec_Ptr_t * Abc_AigDfs(Abc_Ntk_t *pNtk, int fCollectAll, int fCollectCos)
Definition abcDfs.c:1198
struct Abc_Ntk_t_ Abc_Ntk_t
Definition abc.h:115
ABC_DLL Vec_Int_t * Abc_NtkFanoutCounts(Abc_Ntk_t *pNtk)
Definition abcUtil.c:1741
#define Abc_NtkForEachCi(pNtk, pCi, i)
Definition abc.h:518
ABC_INT64_T abctime
Definition abc_global.h:332
#define ABC_PRT(a, t)
Definition abc_global.h:255
int nGood
Definition abcCut.c:34
void Abc_NtkCutsAddFanunt(Abc_Ntk_t *pNtk)
Definition abcCut.c:89
void Abc_NtkCutsSubtractFanunt(Abc_Ntk_t *pNtk)
FUNCTION DEFINITIONS ///.
Definition abcCut.c:54
int nTotal
DECLARATIONS ///.
Definition cutTruth.c:37
int nEqual
Definition abcCut.c:34
ABC_NAMESPACE_IMPL_START typedef char ProgressBar
Definition bbrNtbdd.c:27
void Cut_NodeTryDroppingCuts(Cut_Man_t *p, int Node)
Definition cutApi.c:162
void Cut_NodeSetTriv(Cut_Man_t *p, int Node)
Definition cutApi.c:145
Cut_Cut_t * Cut_NodeUnionCuts(Cut_Man_t *p, Vec_Int_t *vNodes)
Definition cutNode.c:678
void Cut_ManPrintStats(Cut_Man_t *p)
Definition cutMan.c:155
void Cut_ManSetNodeAttrs(Cut_Man_t *p, Vec_Int_t *vFanCounts)
Definition cutMan.c:245
Cut_Man_t * Cut_ManStart(Cut_Params_t *pParams)
FUNCTION DEFINITIONS ///.
Definition cutMan.c:47
void Cut_ManSetFanoutCounts(Cut_Man_t *p, Vec_Int_t *vFanCounts)
Definition cutMan.c:229
struct Cut_CutStruct_t_ Cut_Cut_t
Definition cut.h:50
void Extra_ProgressBarStop(ProgressBar *p)
ProgressBar * Extra_ProgressBarStart(FILE *pFile, int nItemsTotal)
FUNCTION DEFINITIONS ///.
void * pData
Definition abc.h:145
unsigned nLeaves
Definition cut.h:84
Cut_Cut_t * pNext
Definition cut.h:88
typedefABC_NAMESPACE_HEADER_START struct Vec_Ptr_t_ Vec_Ptr_t
INCLUDES ///.
Definition vecPtr.h:42
#define Vec_PtrForEachEntry(Type, vVec, pEntry, i)
MACRO DEFINITIONS ///.
Definition vecPtr.h:55
Here is the call graph for this function:

◆ Abc_NtkCutsAddFanunt()

void Abc_NtkCutsAddFanunt ( Abc_Ntk_t * pNtk)

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

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 89 of file abcCut.c.

90{
91 Abc_Obj_t * pObj, * pFan0, * pFan1, * pFanC;
92 int i, Counter = 0;
93 Abc_NtkForEachObj( pNtk, pObj, i )
94 {
95 if ( !Abc_NodeIsMuxType(pObj) )
96 continue;
97 pFanC = Abc_NodeRecognizeMux( pObj, &pFan1, &pFan0 );
98 pFanC = Abc_ObjRegular(pFanC);
99 pFan0 = Abc_ObjRegular(pFan0);
100 pFanC->vFanouts.nSize++;
101 Counter++;
102 if ( Abc_NodeIsExorType(pObj) )
103 {
104 pFan0->vFanouts.nSize++;
105 Counter++;
106 }
107 }
108 printf("Added %d fanouts\n", Counter );
109}
#define Abc_NtkForEachObj(pNtk, pObj, i)
ITERATORS ///.
Definition abc.h:449
ABC_DLL int Abc_NodeIsMuxType(Abc_Obj_t *pNode)
Definition abcUtil.c:1342
ABC_DLL Abc_Obj_t * Abc_NodeRecognizeMux(Abc_Obj_t *pNode, Abc_Obj_t **ppNodeT, Abc_Obj_t **ppNodeE)
Definition abcUtil.c:1430
ABC_DLL int Abc_NodeIsExorType(Abc_Obj_t *pNode)
Definition abcUtil.c:1300
Vec_Int_t vFanouts
Definition abc.h:144
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_NtkCutsOracle()

void Abc_NtkCutsOracle ( Abc_Ntk_t * pNtk,
Cut_Oracle_t * p )

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

Synopsis [Cut computation using the oracle.]

Description []

SideEffects []

SeeAlso []

Definition at line 228 of file abcCut.c.

229{
230 Abc_Obj_t * pObj;
231 Vec_Ptr_t * vNodes;
232 int i; //, clk = Abc_Clock();
233 int fDrop = Cut_OracleReadDrop(p);
234
235 assert( Abc_NtkIsStrash(pNtk) );
236
237 // prepare cut droppping
238 if ( fDrop )
240
241 // set cuts for PIs
242 Abc_NtkForEachCi( pNtk, pObj, i )
243 if ( Abc_ObjFanoutNum(pObj) > 0 )
244 Cut_OracleNodeSetTriv( p, pObj->Id );
245
246 // compute cuts for internal nodes
247 vNodes = Abc_AigDfs( pNtk, 0, 1 ); // collects POs
248 Vec_PtrForEachEntry( Abc_Obj_t *, vNodes, pObj, i )
249 {
250 // when we reached a CO, it is time to deallocate the cuts
251 if ( Abc_ObjIsCo(pObj) )
252 {
253 if ( fDrop )
254 Cut_OracleTryDroppingCuts( p, Abc_ObjFaninId0(pObj) );
255 continue;
256 }
257 // skip constant node, it has no cuts
258// if ( Abc_NodeIsConst(pObj) )
259// continue;
260 // compute the cuts to the internal node
261 Cut_OracleComputeCuts( p, pObj->Id, Abc_ObjFaninId0(pObj), Abc_ObjFaninId1(pObj),
262 Abc_ObjFaninC0(pObj), Abc_ObjFaninC1(pObj) );
263 // consider dropping the fanins cuts
264 if ( fDrop )
265 {
266 Cut_OracleTryDroppingCuts( p, Abc_ObjFaninId0(pObj) );
267 Cut_OracleTryDroppingCuts( p, Abc_ObjFaninId1(pObj) );
268 }
269 }
270 Vec_PtrFree( vNodes );
271//ABC_PRT( "Total", Abc_Clock() - clk );
272//Abc_NtkPrintCuts_( p, pNtk, 0 );
273}
void Cut_OracleTryDroppingCuts(Cut_Oracle_t *p, int Node)
Definition cutOracle.c:407
Cut_Cut_t * Cut_OracleComputeCuts(Cut_Oracle_t *p, int Node, int Node0, int Node1, int fCompl0, int fCompl1)
Definition cutOracle.c:320
int Cut_OracleReadDrop(Cut_Oracle_t *p)
Definition cutOracle.c:176
void Cut_OracleSetFanoutCounts(Cut_Oracle_t *p, Vec_Int_t *vFanCounts)
Definition cutOracle.c:160
void Cut_OracleNodeSetTriv(Cut_Oracle_t *p, int Node)
Definition cutOracle.c:192
Here is the call graph for this function:

◆ Abc_NtkCutsSubtractFanunt()

void Abc_NtkCutsSubtractFanunt ( Abc_Ntk_t * pNtk)

FUNCTION DEFINITIONS ///.

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

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 54 of file abcCut.c.

55{
56 Abc_Obj_t * pObj, * pFan0, * pFan1, * pFanC;
57 int i, Counter = 0;
58 Abc_NtkForEachObj( pNtk, pObj, i )
59 {
60 if ( !Abc_NodeIsMuxType(pObj) )
61 continue;
62 pFanC = Abc_NodeRecognizeMux( pObj, &pFan1, &pFan0 );
63 pFanC = Abc_ObjRegular(pFanC);
64 pFan0 = Abc_ObjRegular(pFan0);
65 assert( pFanC->vFanouts.nSize > 1 );
66 pFanC->vFanouts.nSize--;
67 Counter++;
68 if ( Abc_NodeIsExorType(pObj) )
69 {
70 assert( pFan0->vFanouts.nSize > 1 );
71 pFan0->vFanouts.nSize--;
72 Counter++;
73 }
74 }
75 printf("Subtracted %d fanouts\n", Counter );
76}
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_NtkGetNodeAttributes2()

Vec_Int_t * Abc_NtkGetNodeAttributes2 ( Abc_Ntk_t * pNtk)

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

Synopsis [Assigns global attributes randomly.]

Description [Old code.]

SideEffects []

SeeAlso []

Definition at line 673 of file abcCut.c.

674{
675 Vec_Int_t * vAttrs;
676 Abc_Obj_t * pObj;
677 int i, nSize;
679 vAttrs = Vec_IntStart( Abc_NtkObjNumMax(pNtk) + 1 );
680 Abc_NtkForEachObj( pNtk, pObj, i )
681 {
682 // skip no-nodes and nodes without fanouts
683 if ( pObj->Id == 0 || !(Abc_ObjIsNode(pObj) && Abc_ObjFanoutNum(pObj) > 1 && !Abc_NodeIsMuxControlType(pObj)) )
684 continue;
685 // the node has more than one fanout - count its sub-DAG size
686 Abc_NtkIncrementTravId( pNtk );
687 nSize = Abc_NtkSubDagSize_rec( pObj, vAttrs );
688 if ( nSize > 15 )
689 Vec_IntWriteEntry( vAttrs, pObj->Id, 1 );
690 }
691 return vAttrs;
692}
ABC_DLL int Abc_NtkIsDfsOrdered(Abc_Ntk_t *pNtk)
Definition abcDfs.c:698
int Abc_NtkSubDagSize_rec(Abc_Obj_t *pObj, Vec_Int_t *vAttrs)
Definition abcCut.c:648
Here is the call graph for this function:

◆ Abc_NtkSeqCuts()

Cut_Man_t * Abc_NtkSeqCuts ( Abc_Ntk_t * pNtk,
Cut_Params_t * pParams )

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

Synopsis [Computes the cuts for the network.]

Description []

SideEffects []

SeeAlso []

Definition at line 287 of file abcCut.c.

288{
289/*
290 Cut_Man_t * p;
291 Abc_Obj_t * pObj, * pNode;
292 int i, nIters, fStatus;
293 Vec_Int_t * vChoices;
294 abctime clk = Abc_Clock();
295
296 assert( Abc_NtkIsSeq(pNtk) );
297 assert( pParams->fSeq );
298// assert( Abc_NtkIsDfsOrdered(pNtk) );
299
300 // start the manager
301 pParams->nIdsMax = Abc_NtkObjNumMax( pNtk );
302 pParams->nCutSet = Abc_NtkCutSetNodeNum( pNtk );
303 p = Cut_ManStart( pParams );
304
305 // set cuts for the constant node and the PIs
306 pObj = Abc_AigConst1(pNtk);
307 if ( Abc_ObjFanoutNum(pObj) > 0 )
308 Cut_NodeSetTriv( p, pObj->Id );
309 Abc_NtkForEachPi( pNtk, pObj, i )
310 {
311//printf( "Setting trivial cut %d.\n", pObj->Id );
312 Cut_NodeSetTriv( p, pObj->Id );
313 }
314 // label the cutset nodes and set their number in the array
315 // assign the elementary cuts to the cutset nodes
316 Abc_SeqForEachCutsetNode( pNtk, pObj, i )
317 {
318 assert( pObj->fMarkC == 0 );
319 pObj->fMarkC = 1;
320 pObj->pCopy = (Abc_Obj_t *)i;
321 Cut_NodeSetTriv( p, pObj->Id );
322//printf( "Setting trivial cut %d.\n", pObj->Id );
323 }
324
325 // process the nodes
326 vChoices = Vec_IntAlloc( 100 );
327 for ( nIters = 0; nIters < 10; nIters++ )
328 {
329//printf( "ITERATION %d:\n", nIters );
330 // compute the cuts for the internal nodes
331 Abc_AigForEachAnd( pNtk, pObj, i )
332 {
333 Abc_NodeGetCutsSeq( p, pObj, nIters==0 );
334 // add cuts due to choices
335 if ( Abc_AigNodeIsChoice(pObj) )
336 {
337 Vec_IntClear( vChoices );
338 for ( pNode = pObj; pNode; pNode = pNode->pData )
339 Vec_IntPush( vChoices, pNode->Id );
340 Cut_NodeUnionCutsSeq( p, vChoices, (pObj->fMarkC ? (int)pObj->pCopy : -1), nIters==0 );
341 }
342 }
343 // merge the new cuts with the old cuts
344 Abc_NtkForEachPi( pNtk, pObj, i )
345 Cut_NodeNewMergeWithOld( p, pObj->Id );
346 Abc_AigForEachAnd( pNtk, pObj, i )
347 Cut_NodeNewMergeWithOld( p, pObj->Id );
348 // for the cutset, transfer temp cuts to new cuts
349 fStatus = 0;
350 Abc_SeqForEachCutsetNode( pNtk, pObj, i )
351 fStatus |= Cut_NodeTempTransferToNew( p, pObj->Id, i );
352 if ( fStatus == 0 )
353 break;
354 }
355 Vec_IntFree( vChoices );
356
357 // if the status is not finished, transfer new to old for the cutset
358 Abc_SeqForEachCutsetNode( pNtk, pObj, i )
359 Cut_NodeNewMergeWithOld( p, pObj->Id );
360
361 // transfer the old cuts to the new positions
362 Abc_NtkForEachObj( pNtk, pObj, i )
363 Cut_NodeOldTransferToNew( p, pObj->Id );
364
365 // unlabel the cutset nodes
366 Abc_SeqForEachCutsetNode( pNtk, pObj, i )
367 pObj->fMarkC = 0;
368if ( pParams->fVerbose )
369{
370 Cut_ManPrintStats( p );
371ABC_PRT( "TOTAL ", Abc_Clock() - clk );
372printf( "Converged after %d iterations.\n", nIters );
373}
374//Abc_NtkPrintCuts( p, pNtk, 1 );
375 return p;
376*/
377 return NULL;
378}

◆ Abc_NtkSubDagSize_rec()

int Abc_NtkSubDagSize_rec ( Abc_Obj_t * pObj,
Vec_Int_t * vAttrs )

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

Synopsis [Assigns global attributes randomly.]

Description [Old code.]

SideEffects []

SeeAlso []

Definition at line 648 of file abcCut.c.

649{
650 if ( Abc_NodeIsTravIdCurrent(pObj) )
651 return 0;
652 Abc_NodeSetTravIdCurrent(pObj);
653 if ( Vec_IntEntry( vAttrs, pObj->Id ) )
654 return 0;
655 if ( Abc_ObjIsCi(pObj) )
656 return 1;
657 assert( Abc_ObjFaninNum(pObj) == 2 );
658 return 1 + Abc_NtkSubDagSize_rec(Abc_ObjFanin0(pObj), vAttrs) +
659 Abc_NtkSubDagSize_rec(Abc_ObjFanin1(pObj), vAttrs);
660}
Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ nEqual

int nEqual

Definition at line 34 of file abcCut.c.

◆ nGood

int nGood

Definition at line 34 of file abcCut.c.

◆ nTotal

int nTotal
extern

DECLARATIONS ///.

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

FileName [cutTruth.c]

SystemName [ABC: Logic synthesis and verification system.]

PackageName [K-feasible cut computation package.]

Synopsis [Incremental truth table computation.]

Author [Alan Mishchenko]

Affiliation [UC Berkeley]

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

Revision [

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

]

Definition at line 37 of file cutTruth.c.