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

Go to the source code of this file.

Functions

ABC_NAMESPACE_IMPL_START int Wlc_ObjIsArithm (Wlc_Obj_t *pObj)
 DECLARATIONS ///.
 
int Wlc_ObjIsArithmReal (Wlc_Obj_t *pObj)
 
int Wlc_ManCountArithmReal (Wlc_Ntk_t *p, Vec_Int_t *vNodes)
 
int Wlc_ObjHasArithm_rec (Wlc_Ntk_t *p, Wlc_Obj_t *pObj)
 
int Wlc_ObjHasArithmFanins (Wlc_Ntk_t *p, Wlc_Obj_t *pObj)
 
void Wlc_WinCompute_rec (Wlc_Ntk_t *p, Wlc_Obj_t *pObj, Vec_Int_t *vLeaves, Vec_Int_t *vNodes)
 
void Wlc_WinCleanMark_rec (Wlc_Ntk_t *p, Wlc_Obj_t *pObj)
 
void Wlc_WinCompute (Wlc_Ntk_t *p, Wlc_Obj_t *pObj, Vec_Int_t *vLeaves, Vec_Int_t *vNodes)
 
void Wlc_WinProfileArith (Wlc_Ntk_t *p)
 

Function Documentation

◆ Wlc_ManCountArithmReal()

int Wlc_ManCountArithmReal ( Wlc_Ntk_t * p,
Vec_Int_t * vNodes )

Definition at line 60 of file wlcWin.c.

61{
62 Wlc_Obj_t * pObj;
63 int i, Counter = 0;
64 Wlc_NtkForEachObjVec( vNodes, p, pObj, i )
65 Counter += Wlc_ObjIsArithmReal( pObj );
66 return Counter;
67}
Cube * p
Definition exorList.c:222
int Wlc_ObjIsArithmReal(Wlc_Obj_t *pObj)
Definition wlcWin.c:54
#define Wlc_NtkForEachObjVec(vVec, p, pObj, i)
Definition wlc.h:360
struct Wlc_Obj_t_ Wlc_Obj_t
BASIC TYPES ///.
Definition wlc.h:118
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Wlc_ObjHasArithm_rec()

int Wlc_ObjHasArithm_rec ( Wlc_Ntk_t * p,
Wlc_Obj_t * pObj )

Definition at line 68 of file wlcWin.c.

69{
70 if ( pObj->Type == WLC_OBJ_CONST )
71 return 0;
72 if ( pObj->Type == WLC_OBJ_BUF || pObj->Type == WLC_OBJ_BIT_NOT ||
74 return Wlc_ObjHasArithm_rec( p, Wlc_ObjFanin0(p, pObj) );
75 return pObj->Type == WLC_OBJ_ARI_ADD || pObj->Type == WLC_OBJ_ARI_SUB ||
76 pObj->Type == WLC_OBJ_ARI_MULTI || pObj->Type == WLC_OBJ_ARI_MINUS;
77}
unsigned Type
Definition wlc.h:121
int Wlc_ObjHasArithm_rec(Wlc_Ntk_t *p, Wlc_Obj_t *pObj)
Definition wlcWin.c:68
@ WLC_OBJ_ARI_MULTI
Definition wlc.h:90
@ WLC_OBJ_BIT_SIGNEXT
Definition wlc.h:70
@ WLC_OBJ_BIT_ZEROPAD
Definition wlc.h:69
@ WLC_OBJ_BUF
Definition wlc.h:52
@ WLC_OBJ_ARI_SUB
Definition wlc.h:89
@ WLC_OBJ_BIT_NOT
Definition wlc.h:60
@ WLC_OBJ_CONST
Definition wlc.h:51
@ WLC_OBJ_ARI_MINUS
Definition wlc.h:95
@ WLC_OBJ_ARI_ADD
Definition wlc.h:88
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Wlc_ObjHasArithmFanins()

int Wlc_ObjHasArithmFanins ( Wlc_Ntk_t * p,
Wlc_Obj_t * pObj )

Definition at line 78 of file wlcWin.c.

79{
80 Wlc_Obj_t * pFanin; int i;
81 assert( !Wlc_ObjHasArithm_rec(p, pObj) );
82 Wlc_ObjForEachFaninObj( p, pObj, pFanin, i )
83 if ( Wlc_ObjHasArithm_rec(p, pFanin) )
84 return 1;
85 return 0;
86}
#define assert(ex)
Definition util_old.h:213
#define Wlc_ObjForEachFaninObj(p, pObj, pFanin, i)
Definition wlc.h:377
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Wlc_ObjIsArithm()

ABC_NAMESPACE_IMPL_START int Wlc_ObjIsArithm ( Wlc_Obj_t * pObj)

DECLARATIONS ///.

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

FileName [wlcWin.c]

SystemName [ABC: Logic synthesis and verification system.]

PackageName [Verilog parser.]

Synopsis [Parses several flavors of word-level Verilog.]

Author [Alan Mishchenko]

Affiliation [UC Berkeley]

Date [Ver. 1.0. Started - August 22, 2014.]

Revision [

Id
wlcWin.c,v 1.00 2014/09/12 00:00:00 alanmi Exp

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

Synopsis [Collect arithmetic nodes.]

Description []

SideEffects []

SeeAlso []

Definition at line 45 of file wlcWin.c.

46{
47 return pObj->Type == WLC_OBJ_CONST ||
48 pObj->Type == WLC_OBJ_BUF || pObj->Type == WLC_OBJ_BIT_NOT ||
49 pObj->Type == WLC_OBJ_BIT_ZEROPAD || pObj->Type == WLC_OBJ_BIT_SIGNEXT ||
50// pObj->Type == WLC_OBJ_BIT_SELECT || pObj->Type == WLC_OBJ_BIT_CONCAT ||
51 pObj->Type == WLC_OBJ_ARI_ADD || pObj->Type == WLC_OBJ_ARI_SUB ||
52 pObj->Type == WLC_OBJ_ARI_MULTI || pObj->Type == WLC_OBJ_ARI_MINUS;
53}
Here is the caller graph for this function:

◆ Wlc_ObjIsArithmReal()

int Wlc_ObjIsArithmReal ( Wlc_Obj_t * pObj)

Definition at line 54 of file wlcWin.c.

55{
56 return pObj->Type == WLC_OBJ_BIT_NOT ||
57 pObj->Type == WLC_OBJ_ARI_ADD || pObj->Type == WLC_OBJ_ARI_SUB ||
58 pObj->Type == WLC_OBJ_ARI_MULTI || pObj->Type == WLC_OBJ_ARI_MINUS;
59}
Here is the caller graph for this function:

◆ Wlc_WinCleanMark_rec()

void Wlc_WinCleanMark_rec ( Wlc_Ntk_t * p,
Wlc_Obj_t * pObj )

Definition at line 102 of file wlcWin.c.

103{
104 Wlc_Obj_t * pFanin; int i;
105 if ( !pObj->Mark )
106 return;
107 pObj->Mark = 0;
108 Wlc_ObjForEachFaninObj( p, pObj, pFanin, i )
109 Wlc_WinCleanMark_rec( p, pFanin );
110}
unsigned Mark
Definition wlc.h:123
void Wlc_WinCleanMark_rec(Wlc_Ntk_t *p, Wlc_Obj_t *pObj)
Definition wlcWin.c:102
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Wlc_WinCompute()

void Wlc_WinCompute ( Wlc_Ntk_t * p,
Wlc_Obj_t * pObj,
Vec_Int_t * vLeaves,
Vec_Int_t * vNodes )

Definition at line 111 of file wlcWin.c.

112{
113 Vec_IntClear( vLeaves );
114 Vec_IntClear( vNodes );
115 if ( Wlc_ObjHasArithm_rec(p, pObj) )
116 {
117 Wlc_WinCompute_rec( p, pObj, vLeaves, vNodes );
118 Wlc_WinCleanMark_rec( p, pObj );
119 }
120 else if ( Wlc_ObjHasArithmFanins(p, pObj) )
121 {
122 Wlc_Obj_t * pFanin; int i;
123 Wlc_ObjForEachFaninObj( p, pObj, pFanin, i )
124 if ( Wlc_ObjHasArithm_rec(p, pFanin) )
125 Wlc_WinCompute_rec( p, pFanin, vLeaves, vNodes );
126 Wlc_ObjForEachFaninObj( p, pObj, pFanin, i )
127 if ( Wlc_ObjHasArithm_rec(p, pFanin) )
128 Wlc_WinCleanMark_rec( p, pFanin );
129 }
130 else assert( 0 );
131}
int Wlc_ObjHasArithmFanins(Wlc_Ntk_t *p, Wlc_Obj_t *pObj)
Definition wlcWin.c:78
void Wlc_WinCompute_rec(Wlc_Ntk_t *p, Wlc_Obj_t *pObj, Vec_Int_t *vLeaves, Vec_Int_t *vNodes)
Definition wlcWin.c:87
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Wlc_WinCompute_rec()

void Wlc_WinCompute_rec ( Wlc_Ntk_t * p,
Wlc_Obj_t * pObj,
Vec_Int_t * vLeaves,
Vec_Int_t * vNodes )

Definition at line 87 of file wlcWin.c.

88{
89 Wlc_Obj_t * pFanin; int i;
90 if ( pObj->Mark )
91 return;
92 pObj->Mark = 1;
93 if ( !Wlc_ObjIsArithm(pObj) )
94 {
95 Vec_IntPush( vLeaves, Wlc_ObjId(p, pObj) );
96 return;
97 }
98 Wlc_ObjForEachFaninObj( p, pObj, pFanin, i )
99 Wlc_WinCompute_rec( p, pFanin, vLeaves, vNodes );
100 Vec_IntPush( vNodes, Wlc_ObjId(p, pObj) );
101}
ABC_NAMESPACE_IMPL_START int Wlc_ObjIsArithm(Wlc_Obj_t *pObj)
DECLARATIONS ///.
Definition wlcWin.c:45
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Wlc_WinProfileArith()

void Wlc_WinProfileArith ( Wlc_Ntk_t * p)

Definition at line 132 of file wlcWin.c.

133{
134 Vec_Int_t * vLeaves = Vec_IntAlloc( 1000 );
135 Vec_Int_t * vNodes = Vec_IntAlloc( 1000 );
136 Wlc_Obj_t * pObj; int i, Count = 0;
137 Wlc_NtkForEachObj( p, pObj, i )
138 pObj->Mark = 0;
139 Wlc_NtkForEachObj( p, pObj, i )
140 if ( Wlc_ObjHasArithm_rec(p, pObj) ? Wlc_ObjIsCo(pObj) : Wlc_ObjHasArithmFanins(p, pObj) )
141 {
142 Wlc_WinCompute( p, pObj, vLeaves, vNodes );
143 if ( Wlc_ManCountArithmReal(p, vNodes) < 2 )
144 continue;
145
146 printf( "Arithmetic cone of node %d (%s):\n", Wlc_ObjId(p, pObj), Wlc_ObjName(p, Wlc_ObjId(p, pObj)) );
147 Wlc_NtkPrintNode( p, pObj );
148 Vec_IntReverseOrder( vNodes );
149 Wlc_NtkPrintNodeArray( p, vNodes );
150 printf( "\n" );
151 Count++;
152 }
153 Wlc_NtkForEachObj( p, pObj, i )
154 assert( pObj->Mark == 0 );
155 printf( "Finished printing %d arithmetic cones.\n", Count );
156 Vec_IntFree( vLeaves );
157 Vec_IntFree( vNodes );
158}
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
Definition bblif.c:37
void Wlc_WinCompute(Wlc_Ntk_t *p, Wlc_Obj_t *pObj, Vec_Int_t *vLeaves, Vec_Int_t *vNodes)
Definition wlcWin.c:111
int Wlc_ManCountArithmReal(Wlc_Ntk_t *p, Vec_Int_t *vNodes)
Definition wlcWin.c:60
void Wlc_NtkPrintNode(Wlc_Ntk_t *p, Wlc_Obj_t *pObj)
Definition wlcNtk.c:703
void Wlc_NtkPrintNodeArray(Wlc_Ntk_t *p, Vec_Int_t *vArray)
Definition wlcNtk.c:764
#define Wlc_NtkForEachObj(p, pObj, i)
MACRO DEFINITIONS ///.
Definition wlc.h:356
char * Wlc_ObjName(Wlc_Ntk_t *p, int iObj)
Definition wlcNtk.c:225
Here is the call graph for this function: