ABC: A System for Sequential Synthesis and Verification
 
Loading...
Searching...
No Matches
sbdPath.c File Reference
#include "sbdInt.h"
#include "misc/tim/tim.h"
Include dependency graph for sbdPath.c:

Go to the source code of this file.

Functions

ABC_NAMESPACE_IMPL_START int Sbc_ManAddInternalToPath_rec (Gia_Man_t *p, int iObj, Vec_Bit_t *vPath)
 DECLARATIONS ///.
 
void Sbc_ManAddInternalToPath (Gia_Man_t *p, Vec_Bit_t *vPath)
 
void Sbc_ManCriticalPath_rec (Gia_Man_t *p, int *pLevels, int iObj, int LevelFan, Vec_Bit_t *vPath, int Slack)
 
Vec_Bit_tSbc_ManCriticalPath (Gia_Man_t *p)
 
void Sbc_ManDelayTrace (Gia_Man_t *p)
 

Function Documentation

◆ Sbc_ManAddInternalToPath()

void Sbc_ManAddInternalToPath ( Gia_Man_t * p,
Vec_Bit_t * vPath )

Definition at line 63 of file sbdPath.c.

64{
65 int k, iFan, iObj;
66 Gia_ManForEachLut( p, iObj )
67 {
68 if ( !Vec_BitEntry(vPath, iObj) )
69 continue;
71 Gia_LutForEachFanin( p, iObj, iFan, k )
72 Gia_ObjSetTravIdCurrentId(p, iFan);
73 Sbc_ManAddInternalToPath_rec( p, iObj, vPath );
74 }
75}
Cube * p
Definition exorList.c:222
#define Gia_ManForEachLut(p, i)
Definition gia.h:1157
#define Gia_LutForEachFanin(p, i, iFan, k)
Definition gia.h:1161
void Gia_ManIncrementTravId(Gia_Man_t *p)
Definition giaUtil.c:190
ABC_NAMESPACE_IMPL_START int Sbc_ManAddInternalToPath_rec(Gia_Man_t *p, int iObj, Vec_Bit_t *vPath)
DECLARATIONS ///.
Definition sbdPath.c:46
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Sbc_ManAddInternalToPath_rec()

ABC_NAMESPACE_IMPL_START int Sbc_ManAddInternalToPath_rec ( Gia_Man_t * p,
int iObj,
Vec_Bit_t * vPath )

DECLARATIONS ///.

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

FileName [sbdPath.c]

SystemName [ABC: Logic synthesis and verification system.]

PackageName [SAT-based optimization using internal don't-cares.]

Synopsis [Critical path.]

Author [Alan Mishchenko]

Affiliation [UC Berkeley]

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

Revision [

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

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

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 46 of file sbdPath.c.

47{
48 Gia_Obj_t * pObj;
49 int k, iFan, Value = 0;
50 if ( Gia_ObjIsTravIdCurrentId(p, iObj) )
51 return Vec_BitEntry(vPath, iObj);
52 Gia_ObjSetTravIdCurrentId(p, iObj);
53 pObj = Gia_ManObj( p, iObj );
54 if ( Gia_ObjIsCi(pObj) )
55 return Vec_BitEntry(vPath, iObj);
56 assert( Gia_ObjIsAnd(pObj) );
57 Gia_LutForEachFanin( p, iObj, iFan, k )
58 Value |= Sbc_ManAddInternalToPath_rec( p, iFan, vPath );
59 if ( Value )
60 Vec_BitWriteEntry( vPath, iObj, 1 );
61 return Value;
62}
struct Gia_Obj_t_ Gia_Obj_t
Definition gia.h:76
#define assert(ex)
Definition util_old.h:213
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Sbc_ManCriticalPath()

Vec_Bit_t * Sbc_ManCriticalPath ( Gia_Man_t * p)

Definition at line 119 of file sbdPath.c.

120{
121 int * pLevels = NULL, k, iDriver, Slack = 1;
122 int nLevels = p->pManTime ? Gia_ManLutLevelWithBoxes(p) : Gia_ManLutLevel(p, &pLevels);
123 Vec_Bit_t * vPath = Vec_BitStart( Gia_ManObjNum(p) );
124 if ( p->pManTime )
125 pLevels = Vec_IntArray( p->vLevels );
127 Gia_ManForEachCoDriverId( p, iDriver, k )
128 if ( (pLevels[iDriver] == nLevels) && iDriver )
129 Sbc_ManCriticalPath_rec( p, pLevels, iDriver, pLevels[iDriver], vPath, Slack );
130 if ( !p->pManTime )
131 ABC_FREE( pLevels );
132 Sbc_ManAddInternalToPath( p, vPath );
133 return vPath;
134}
#define ABC_FREE(obj)
Definition abc_global.h:267
int Gia_ManLutLevel(Gia_Man_t *p, int **ppLevels)
Definition giaIf.c:165
#define Gia_ManForEachCoDriverId(p, DriverId, i)
Definition gia.h:1246
int Gia_ManLutLevelWithBoxes(Gia_Man_t *p)
Definition giaTim.c:581
void Sbc_ManAddInternalToPath(Gia_Man_t *p, Vec_Bit_t *vPath)
Definition sbdPath.c:63
void Sbc_ManCriticalPath_rec(Gia_Man_t *p, int *pLevels, int iObj, int LevelFan, Vec_Bit_t *vPath, int Slack)
Definition sbdPath.c:88
typedefABC_NAMESPACE_HEADER_START struct Vec_Bit_t_ Vec_Bit_t
INCLUDES ///.
Definition vecBit.h:42
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Sbc_ManCriticalPath_rec()

void Sbc_ManCriticalPath_rec ( Gia_Man_t * p,
int * pLevels,
int iObj,
int LevelFan,
Vec_Bit_t * vPath,
int Slack )

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

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 88 of file sbdPath.c.

89{
90 Gia_Obj_t * pObj; int k, iFan;
91 if ( Gia_ObjIsTravIdCurrentId(p, iObj) )
92 return;
93 Gia_ObjSetTravIdCurrentId(p, iObj);
94 pObj = Gia_ManObj( p, iObj );
95 Vec_BitWriteEntry( vPath, iObj, 1 );
96 if ( Gia_ObjIsCi(pObj) )
97 {
98 Tim_Man_t * pManTime = (Tim_Man_t *)p->pManTime;
99 int iBox = pManTime ? Tim_ManBoxForCi( pManTime, Gia_ObjCioId(pObj) ) : -1;
100 if ( iBox >= 0 )
101 {
102 int curCo = Tim_ManBoxInputFirst( pManTime, iBox );
103 int nBoxInputs = Tim_ManBoxInputNum( pManTime, iBox );
104 for ( k = 0; k < nBoxInputs; k++ )
105 {
106 Gia_Obj_t * pCo = Gia_ManCo( p, curCo + k );
107 int iDriver = Gia_ObjFaninId0p( p, pCo );
108 if ( (pLevels[iDriver]+Slack >= LevelFan-1) && iDriver )
109 Sbc_ManCriticalPath_rec( p, pLevels, iDriver, pLevels[iDriver], vPath, Abc_MaxInt(0, pLevels[iDriver]+Slack-(LevelFan-1)) );
110 }
111 }
112 return;
113 }
114 assert( Gia_ObjIsAnd(pObj) );
115 Gia_LutForEachFanin( p, iObj, iFan, k )
116 if ( pLevels[iFan]+Slack >= LevelFan-1 )
117 Sbc_ManCriticalPath_rec( p, pLevels, iFan, pLevels[iFan], vPath, Abc_MaxInt(0, pLevels[iFan]+Slack-(LevelFan-1)) );
118}
typedefABC_NAMESPACE_HEADER_START struct Tim_Man_t_ Tim_Man_t
INCLUDES ///.
Definition tim.h:92
int Tim_ManBoxForCi(Tim_Man_t *p, int iCo)
Definition timBox.c:87
int Tim_ManBoxInputFirst(Tim_Man_t *p, int iBox)
Definition timBox.c:123
int Tim_ManBoxInputNum(Tim_Man_t *p, int iBox)
Definition timBox.c:187
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Sbc_ManDelayTrace()

void Sbc_ManDelayTrace ( Gia_Man_t * p)

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

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 148 of file sbdPath.c.

149{
150 Vec_Bit_t * vPath = Vec_BitStart( Gia_ManObjNum(p) );
151 int i, k, iFan, nLevels, * pLevels;
152 int nLuts = 0, nNodes = 0, nEdges = 0, nEdgesAll = 0;
153 if ( !Gia_ManHasMapping(p) )
154 {
155 printf( "No mapping is available.\n" );
156 return;
157 }
158 assert( Gia_ManHasMapping(p) );
159 // set critical CO drivers
160 nLevels = Gia_ManLutLevel( p, &pLevels );
161 Gia_ManForEachCoDriverId( p, iFan, i )
162 if ( pLevels[iFan] == nLevels )
163 Vec_BitWriteEntry( vPath, iFan, 1 );
164 // set critical internal nodes
166 {
167 nLuts++;
168 if ( !Vec_BitEntry(vPath, i) )
169 continue;
170 nNodes++;
171 Gia_LutForEachFanin( p, i, iFan, k )
172 {
173 if ( pLevels[iFan] +1 < pLevels[i] )
174 continue;
175 assert( pLevels[iFan] + 1 == pLevels[i] );
176 Vec_BitWriteEntry( vPath, iFan, 1 );
177 nEdges++;
178 //printf( "%d -> %d\n", i, iFan );
179 }
180 }
181 Gia_ManForEachLut( p, i )
182 Gia_LutForEachFanin( p, i, iFan, k )
183 nEdgesAll += (Vec_BitEntry(vPath, i) && Vec_BitEntry(vPath, iFan));
184
185 ABC_FREE( pLevels );
186 Vec_BitFree( vPath );
187 printf( "AIG = %d. LUT = %d. Lev = %d. Path nodes = %d. Path edges = %d. (%d.)\n",
188 Gia_ManAndNum(p), nLuts, nLevels, nNodes, nEdges, nEdgesAll );
189}
#define Gia_ManForEachLutReverse(p, i)
Definition gia.h:1159
Here is the call graph for this function: