ABC: A System for Sequential Synthesis and Verification
 
Loading...
Searching...
No Matches
cnfMap.c File Reference
#include "cnf.h"
Include dependency graph for cnfMap.c:

Go to the source code of this file.

Functions

ABC_NAMESPACE_IMPL_START void Cnf_CutAssignAreaFlow (Cnf_Man_t *p, Dar_Cut_t *pCut, int *pAreaFlows)
 DECLARATIONS ///.
 
int Cnf_CutSuperAreaFlow (Vec_Ptr_t *vSuper, int *pAreaFlows)
 
void Cnf_DeriveMapping (Cnf_Man_t *p)
 

Function Documentation

◆ Cnf_CutAssignAreaFlow()

ABC_NAMESPACE_IMPL_START void Cnf_CutAssignAreaFlow ( Cnf_Man_t * p,
Dar_Cut_t * pCut,
int * pAreaFlows )

DECLARATIONS ///.

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

FileName [cnfMap.c]

SystemName [ABC: Logic synthesis and verification system.]

PackageName [AIG-to-CNF conversion.]

Synopsis []

Author [Alan Mishchenko]

Affiliation [UC Berkeley]

Date [Ver. 1.0. Started - April 28, 2007.]

Revision [

Id
cnfMap.c,v 1.00 2007/04/28 00:00:00 alanmi Exp

] FUNCTION DEFINITIONS /// Function*************************************************************

Synopsis [Computes area flow of the cut.]

Description []

SideEffects []

SeeAlso []

Definition at line 45 of file cnfMap.c.

46{
47 Aig_Obj_t * pLeaf;
48 int i;
49 pCut->Value = 0;
50// pCut->uSign = 100 * Cnf_CutSopCost( p, pCut );
51 pCut->uSign = 10 * Cnf_CutSopCost( p, pCut );
52 Dar_CutForEachLeaf( p->pManAig, pCut, pLeaf, i )
53 {
54 pCut->Value += pLeaf->nRefs;
55 if ( !Aig_ObjIsNode(pLeaf) )
56 continue;
57 assert( pLeaf->nRefs > 0 );
58 pCut->uSign += pAreaFlows[pLeaf->Id] / (pLeaf->nRefs? pLeaf->nRefs : 1);
59 }
60}
struct Aig_Obj_t_ Aig_Obj_t
Definition aig.h:51
#define Dar_CutForEachLeaf(p, pCut, pLeaf, i)
Definition darInt.h:124
Cube * p
Definition exorList.c:222
int Id
Definition aig.h:85
unsigned int nRefs
Definition aig.h:81
unsigned Value
Definition darInt.h:59
unsigned uSign
Definition darInt.h:57
#define assert(ex)
Definition util_old.h:213
Here is the caller graph for this function:

◆ Cnf_CutSuperAreaFlow()

int Cnf_CutSuperAreaFlow ( Vec_Ptr_t * vSuper,
int * pAreaFlows )

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

Synopsis [Computes area flow of the supergate.]

Description []

SideEffects []

SeeAlso []

Definition at line 73 of file cnfMap.c.

74{
75 Aig_Obj_t * pLeaf;
76 int i, nAreaFlow;
77 nAreaFlow = 100 * (Vec_PtrSize(vSuper) + 1);
78 Vec_PtrForEachEntry( Aig_Obj_t *, vSuper, pLeaf, i )
79 {
80 pLeaf = Aig_Regular(pLeaf);
81 if ( !Aig_ObjIsNode(pLeaf) )
82 continue;
83 assert( pLeaf->nRefs > 0 );
84 nAreaFlow += pAreaFlows[pLeaf->Id] / (pLeaf->nRefs? pLeaf->nRefs : 1);
85 }
86 return nAreaFlow;
87}
#define Vec_PtrForEachEntry(Type, vVec, pEntry, i)
MACRO DEFINITIONS ///.
Definition vecPtr.h:55

◆ Cnf_DeriveMapping()

void Cnf_DeriveMapping ( Cnf_Man_t * p)

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

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 100 of file cnfMap.c.

101{
102 Vec_Ptr_t * vSuper;
103 Aig_Obj_t * pObj;
104 Dar_Cut_t * pCut, * pCutBest;
105 int i, k, AreaFlow, * pAreaFlows;
106 // allocate area flows
107 pAreaFlows = ABC_ALLOC( int, Aig_ManObjNumMax(p->pManAig) );
108 memset( pAreaFlows, 0, sizeof(int) * Aig_ManObjNumMax(p->pManAig) );
109 // visit the nodes in the topological order and update their best cuts
110 vSuper = Vec_PtrAlloc( 100 );
111 Aig_ManForEachNode( p->pManAig, pObj, i )
112 {
113 // go through the cuts
114 pCutBest = NULL;
115 Dar_ObjForEachCut( pObj, pCut, k )
116 {
117 pCut->fBest = 0;
118 if ( k == 0 )
119 continue;
120 Cnf_CutAssignAreaFlow( p, pCut, pAreaFlows );
121 if ( pCutBest == NULL || pCutBest->uSign > pCut->uSign ||
122 (pCutBest->uSign == pCut->uSign && pCutBest->Value < pCut->Value) )
123 pCutBest = pCut;
124 }
125 // check the big cut
126// Aig_ObjCollectSuper( pObj, vSuper );
127 // get the area flow of this cut
128// AreaFlow = Cnf_CutSuperAreaFlow( vSuper, pAreaFlows );
129 AreaFlow = ABC_INFINITY;
130 if ( AreaFlow >= (int)pCutBest->uSign )
131 {
132 pAreaFlows[pObj->Id] = pCutBest->uSign;
133 pCutBest->fBest = 1;
134 }
135 else
136 {
137 pAreaFlows[pObj->Id] = AreaFlow;
138 pObj->fMarkB = 1; // mark the special node
139 }
140 }
141 Vec_PtrFree( vSuper );
142 ABC_FREE( pAreaFlows );
143
144/*
145 // compute the area of mapping
146 AreaFlow = 0;
147 Aig_ManForEachCo( p->pManAig, pObj, i )
148 AreaFlow += Dar_ObjBestCut(Aig_ObjFanin0(pObj))->uSign / 100 / Aig_ObjFanin0(pObj)->nRefs;
149 printf( "Area of the network = %d.\n", AreaFlow );
150*/
151}
#define ABC_ALLOC(type, num)
Definition abc_global.h:264
#define ABC_INFINITY
MACRO DEFINITIONS ///.
Definition abc_global.h:250
#define ABC_FREE(obj)
Definition abc_global.h:267
#define Aig_ManForEachNode(p, pObj, i)
Definition aig.h:413
ABC_NAMESPACE_IMPL_START void Cnf_CutAssignAreaFlow(Cnf_Man_t *p, Dar_Cut_t *pCut, int *pAreaFlows)
DECLARATIONS ///.
Definition cnfMap.c:45
struct Dar_Cut_t_ Dar_Cut_t
Definition darInt.h:52
#define Dar_ObjForEachCut(pObj, pCut, i)
Definition darInt.h:121
unsigned int fMarkB
Definition aig.h:80
unsigned fBest
Definition darInt.h:60
char * memset()
typedefABC_NAMESPACE_HEADER_START struct Vec_Ptr_t_ Vec_Ptr_t
INCLUDES ///.
Definition vecPtr.h:42
Here is the call graph for this function:
Here is the caller graph for this function: