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

Go to the source code of this file.

Classes

struct  Ivy_SuppMan_t_
 
struct  Ivy_Supp_t_
 

Macros

#define IVY_INFINITY   10000
 DECLARATIONS ///.
 

Typedefs

typedef struct Ivy_SuppMan_t_ Ivy_SuppMan_t
 
typedef struct Ivy_Supp_t_ Ivy_Supp_t
 

Functions

void Ivy_FastMapPerform (Ivy_Man_t *pAig, int nLimit, int fRecovery, int fVerbose)
 FUNCTION DEFINITIONS ///.
 
void Ivy_FastMapStop (Ivy_Man_t *pAig)
 
int Ivy_FastMapArea_rec (Ivy_Man_t *pAig, Ivy_Obj_t *pObj, Vec_Vec_t *vLuts)
 
void Ivy_FastMapNodeArea2 (Ivy_Man_t *pAig, Ivy_Obj_t *pObj, int nLimit)
 
void Ivy_FastMapReadSupp (Ivy_Man_t *pAig, Ivy_Obj_t *pObj, Vec_Int_t *vLeaves)
 
void Ivy_FastMapRequired_rec (Ivy_Man_t *pAig, Ivy_Obj_t *pObj, Ivy_Obj_t *pRoot, int DelayR)
 
int Ivy_FastMapCutCost (Ivy_Man_t *pAig, Vec_Ptr_t *vFront)
 
void Ivy_FastMapMark_rec (Ivy_Man_t *pAig, Ivy_Obj_t *pObj)
 
int Ivy_FastMapNodeWillGrow (Ivy_Man_t *pAig, Ivy_Obj_t *pObj)
 
int Ivy_FastMapNodeFaninCost (Ivy_Man_t *pAig, Ivy_Obj_t *pObj)
 
void Ivy_FastMapNodeFaninUpdate (Ivy_Man_t *pAig, Ivy_Obj_t *pObj, Vec_Ptr_t *vFront)
 
int Ivy_FastMapNodeFaninCompact0 (Ivy_Man_t *pAig, Ivy_Obj_t *pObj, int nLimit, Vec_Ptr_t *vFront)
 
int Ivy_FastMapNodeFaninCompact1 (Ivy_Man_t *pAig, Ivy_Obj_t *pObj, int nLimit, Vec_Ptr_t *vFront)
 
int Ivy_FastMapNodeFaninCompact2 (Ivy_Man_t *pAig, Ivy_Obj_t *pObj, int nLimit, Vec_Ptr_t *vFront)
 
int Ivy_FastMapNodeFaninCompact_int (Ivy_Man_t *pAig, Ivy_Obj_t *pObj, int nLimit, Vec_Ptr_t *vFront)
 
void Ivy_FastMapNodeFaninCompact (Ivy_Man_t *pAig, Ivy_Obj_t *pObj, int nLimit, Vec_Ptr_t *vFront)
 
void Ivy_FastMapNodePrepare (Ivy_Man_t *pAig, Ivy_Obj_t *pObj, int nLimit, Vec_Ptr_t *vFront, Vec_Ptr_t *vFrontOld)
 
void Ivy_FastMapNodeUpdate (Ivy_Man_t *pAig, Ivy_Obj_t *pObj, Vec_Ptr_t *vFront)
 
void Ivy_FastMapNodeRecover2 (Ivy_Man_t *pAig, Ivy_Obj_t *pObj, int nLimit, Vec_Ptr_t *vFront, Vec_Ptr_t *vFrontOld)
 
void Ivy_FastMapNodeRecover4 (Ivy_Man_t *pAig, Ivy_Obj_t *pObj, int nLimit, Vec_Ptr_t *vFront, Vec_Ptr_t *vFrontOld)
 

Variables

abctime s_MappingTime
 DECLARATIONS ///.
 
int s_MappingMem
 

Macro Definition Documentation

◆ IVY_INFINITY

#define IVY_INFINITY   10000

DECLARATIONS ///.

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

FileName [ivyFastMap.c]

SystemName [ABC: Logic synthesis and verification system.]

PackageName [And-Inverter Graph package.]

Synopsis [Fast FPGA mapping.]

Author [Alan Mishchenko]

Affiliation [UC Berkeley]

Date [Ver. 1.0. Started - May 11, 2006.]

Revision [

Id
ivyFastMap.c,v 1.00 2006/05/11 00:00:00 alanmi Exp

]

Definition at line 30 of file ivyFastMap.c.

Typedef Documentation

◆ Ivy_Supp_t

typedef struct Ivy_Supp_t_ Ivy_Supp_t

Definition at line 42 of file ivyFastMap.c.

◆ Ivy_SuppMan_t

typedef struct Ivy_SuppMan_t_ Ivy_SuppMan_t

Definition at line 32 of file ivyFastMap.c.

Function Documentation

◆ Ivy_FastMapArea_rec()

int Ivy_FastMapArea_rec ( Ivy_Man_t * pAig,
Ivy_Obj_t * pObj,
Vec_Vec_t * vLuts )

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

Synopsis [Computes area after mapping.]

Description []

SideEffects []

SeeAlso []

Definition at line 259 of file ivyFastMap.c.

260{
261 Ivy_Supp_t * pSupp;
262 int i, Counter;
263 pSupp = Ivy_ObjSupp( pAig, pObj );
264 // skip visited nodes and PIs
265 if ( pSupp->fMark || pSupp->nSize == 1 )
266 return 0;
267 pSupp->fMark = 1;
268 // compute the area of this node
269 Counter = 0;
270 for ( i = 0; i < pSupp->nSize; i++ )
271 Counter += Ivy_FastMapArea_rec( pAig, Ivy_ManObj(pAig, pSupp->pArray[i]), vLuts );
272 // add the node to the array of LUTs
273 Vec_VecPush( vLuts, pSupp->Delay, pObj );
274 return 1 + Counter;
275}
int Ivy_FastMapArea_rec(Ivy_Man_t *pAig, Ivy_Obj_t *pObj, Vec_Vec_t *vLuts)
Definition ivyFastMap.c:259
struct Ivy_Supp_t_ Ivy_Supp_t
Definition ivyFastMap.c:42
short Delay
Definition ivyFastMap.c:50
int pArray[0]
Definition ivyFastMap.c:52
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Ivy_FastMapCutCost()

int Ivy_FastMapCutCost ( Ivy_Man_t * pAig,
Vec_Ptr_t * vFront )

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

Synopsis [Counts the number of nodes with no external fanout.]

Description []

SideEffects []

SeeAlso []

Definition at line 1093 of file ivyFastMap.c.

1094{
1095 Ivy_Supp_t * pSuppF;
1096 Ivy_Obj_t * pFanin;
1097 int i, Counter = 0;
1098 Vec_PtrForEachEntry( Ivy_Obj_t *, vFront, pFanin, i )
1099 {
1100 pSuppF = Ivy_ObjSupp( pAig, pFanin );
1101 if ( pSuppF->nRefs == 0 )
1102 Counter++;
1103 }
1104 return Counter;
1105}
struct Ivy_Obj_t_ Ivy_Obj_t
Definition ivy.h:47
#define Vec_PtrForEachEntry(Type, vVec, pEntry, i)
MACRO DEFINITIONS ///.
Definition vecPtr.h:55
Here is the caller graph for this function:

◆ Ivy_FastMapMark_rec()

void Ivy_FastMapMark_rec ( Ivy_Man_t * pAig,
Ivy_Obj_t * pObj )

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

Synopsis [Performs area recovery for each node.]

Description []

SideEffects []

SeeAlso []

Definition at line 1118 of file ivyFastMap.c.

1119{
1120 if ( Ivy_ObjIsTravIdCurrent(pAig, pObj) )
1121 return;
1122 assert( Ivy_ObjIsNode(pObj) );
1123 Ivy_FastMapMark_rec( pAig, Ivy_ObjFanin0(pObj) );
1124 Ivy_FastMapMark_rec( pAig, Ivy_ObjFanin1(pObj) );
1125 Ivy_ObjSetTravIdCurrent(pAig, pObj);
1126}
void Ivy_FastMapMark_rec(Ivy_Man_t *pAig, Ivy_Obj_t *pObj)
#define assert(ex)
Definition util_old.h:213
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Ivy_FastMapNodeArea2()

void Ivy_FastMapNodeArea2 ( Ivy_Man_t * pAig,
Ivy_Obj_t * pObj,
int nLimit )

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

Synopsis [Performs fast mapping for one node.]

Description []

SideEffects []

SeeAlso []

Definition at line 370 of file ivyFastMap.c.

371{
372 static int Store[32], StoreSize;
373 static char Supp0[16], Supp1[16];
374 static Ivy_Supp_t * pTemp0 = (Ivy_Supp_t *)Supp0;
375 static Ivy_Supp_t * pTemp1 = (Ivy_Supp_t *)Supp1;
376 Ivy_Obj_t * pFanin0, * pFanin1;
377 Ivy_Supp_t * pSupp0, * pSupp1, * pSupp;
378 int RetValue, DelayOld;
379 assert( nLimit <= 32 );
380 assert( Ivy_ObjIsNode(pObj) );
381 // get the fanins
382 pFanin0 = Ivy_ObjFanin0(pObj);
383 pFanin1 = Ivy_ObjFanin1(pObj);
384 // get the supports
385 pSupp0 = Ivy_ObjSupp( pAig, pFanin0 );
386 pSupp1 = Ivy_ObjSupp( pAig, pFanin1 );
387 pSupp = Ivy_ObjSupp( pAig, pObj );
388 assert( pSupp->fMark == 0 );
389 // get the old delay of the node
390 DelayOld = Ivy_FastMapNodeDelay(pAig, pObj);
391 assert( DelayOld <= pSupp->DelayR );
392 // copy the current cut
393 memcpy( Store, pSupp->pArray, sizeof(int) * pSupp->nSize );
394 StoreSize = pSupp->nSize;
395 // get the fanin support
396 if ( Ivy_ObjRefs(pFanin0) > 1 && pSupp0->Delay < pSupp->DelayR )
397 {
398 pSupp0 = pTemp0;
399 pSupp0->nSize = 1;
400 pSupp0->pArray[0] = Ivy_ObjFaninId0(pObj);
401 }
402 // get the fanin support
403 if ( Ivy_ObjRefs(pFanin1) > 1 && pSupp1->Delay < pSupp->DelayR )
404 {
405 pSupp1 = pTemp1;
406 pSupp1->nSize = 1;
407 pSupp1->pArray[0] = Ivy_ObjFaninId1(pObj);
408 }
409 // merge the cuts
410 if ( pSupp0->nSize < pSupp1->nSize )
411 RetValue = Ivy_FastMapMerge( pSupp1, pSupp0, pSupp, nLimit );
412 else
413 RetValue = Ivy_FastMapMerge( pSupp0, pSupp1, pSupp, nLimit );
414 if ( !RetValue )
415 {
416 pSupp->nSize = 2;
417 pSupp->pArray[0] = Ivy_ObjFaninId0(pObj);
418 pSupp->pArray[1] = Ivy_ObjFaninId1(pObj);
419 }
420 // check the resulting delay
421 pSupp->Delay = Ivy_FastMapNodeDelay(pAig, pObj);
422 if ( pSupp->Delay > pSupp->DelayR )
423 {
424 pSupp->nSize = StoreSize;
425 memcpy( pSupp->pArray, Store, sizeof(int) * pSupp->nSize );
426 pSupp->Delay = DelayOld;
427 }
428}
short DelayR
Definition ivyFastMap.c:51
char * memcpy()
Here is the call graph for this function:

◆ Ivy_FastMapNodeFaninCompact()

void Ivy_FastMapNodeFaninCompact ( Ivy_Man_t * pAig,
Ivy_Obj_t * pObj,
int nLimit,
Vec_Ptr_t * vFront )

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

Synopsis [Compacts the number of external refs.]

Description []

SideEffects []

SeeAlso []

Definition at line 1332 of file ivyFastMap.c.

1333{
1334 while ( Ivy_FastMapNodeFaninCompact_int( pAig, pObj, nLimit, vFront ) );
1335}
int Ivy_FastMapNodeFaninCompact_int(Ivy_Man_t *pAig, Ivy_Obj_t *pObj, int nLimit, Vec_Ptr_t *vFront)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Ivy_FastMapNodeFaninCompact0()

int Ivy_FastMapNodeFaninCompact0 ( Ivy_Man_t * pAig,
Ivy_Obj_t * pObj,
int nLimit,
Vec_Ptr_t * vFront )

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

Synopsis [Compacts the number of external refs.]

Description []

SideEffects []

SeeAlso []

Definition at line 1223 of file ivyFastMap.c.

1224{
1225 Ivy_Obj_t * pFanin;
1226 int i;
1227 Vec_PtrForEachEntry( Ivy_Obj_t *, vFront, pFanin, i )
1228 {
1229 if ( Ivy_ObjIsCi(pFanin) )
1230 continue;
1231 if ( Ivy_FastMapNodeWillGrow(pAig, pFanin) )
1232 continue;
1233 if ( Ivy_FastMapNodeFaninCost(pAig, pFanin) <= 0 )
1234 {
1235 Ivy_FastMapNodeFaninUpdate( pAig, pFanin, vFront );
1236 return 1;
1237 }
1238 }
1239 return 0;
1240}
int Ivy_FastMapNodeWillGrow(Ivy_Man_t *pAig, Ivy_Obj_t *pObj)
int Ivy_FastMapNodeFaninCost(Ivy_Man_t *pAig, Ivy_Obj_t *pObj)
void Ivy_FastMapNodeFaninUpdate(Ivy_Man_t *pAig, Ivy_Obj_t *pObj, Vec_Ptr_t *vFront)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Ivy_FastMapNodeFaninCompact1()

int Ivy_FastMapNodeFaninCompact1 ( Ivy_Man_t * pAig,
Ivy_Obj_t * pObj,
int nLimit,
Vec_Ptr_t * vFront )

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

Synopsis [Compacts the number of external refs.]

Description []

SideEffects []

SeeAlso []

Definition at line 1253 of file ivyFastMap.c.

1254{
1255 Ivy_Obj_t * pFanin;
1256 int i;
1257 Vec_PtrForEachEntry( Ivy_Obj_t *, vFront, pFanin, i )
1258 {
1259 if ( Ivy_ObjIsCi(pFanin) )
1260 continue;
1261 if ( Ivy_FastMapNodeFaninCost(pAig, pFanin) < 0 )
1262 {
1263 Ivy_FastMapNodeFaninUpdate( pAig, pFanin, vFront );
1264 return 1;
1265 }
1266 }
1267 return 0;
1268}
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Ivy_FastMapNodeFaninCompact2()

int Ivy_FastMapNodeFaninCompact2 ( Ivy_Man_t * pAig,
Ivy_Obj_t * pObj,
int nLimit,
Vec_Ptr_t * vFront )

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

Synopsis [Compacts the number of external refs.]

Description []

SideEffects []

SeeAlso []

Definition at line 1281 of file ivyFastMap.c.

1282{
1283 Ivy_Obj_t * pFanin;
1284 int i;
1285 Vec_PtrForEachEntry( Ivy_Obj_t *, vFront, pFanin, i )
1286 {
1287 if ( Ivy_ObjIsCi(pFanin) )
1288 continue;
1289 if ( Ivy_FastMapNodeFaninCost(pAig, pFanin) <= 0 )
1290 {
1291 Ivy_FastMapNodeFaninUpdate( pAig, pFanin, vFront );
1292 return 1;
1293 }
1294 }
1295 return 0;
1296}
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Ivy_FastMapNodeFaninCompact_int()

int Ivy_FastMapNodeFaninCompact_int ( Ivy_Man_t * pAig,
Ivy_Obj_t * pObj,
int nLimit,
Vec_Ptr_t * vFront )

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

Synopsis [Compacts the number of external refs.]

Description []

SideEffects []

SeeAlso []

Definition at line 1309 of file ivyFastMap.c.

1310{
1311 if ( Ivy_FastMapNodeFaninCompact0(pAig, pObj, nLimit, vFront) )
1312 return 1;
1313 if ( Vec_PtrSize(vFront) < nLimit && Ivy_FastMapNodeFaninCompact1(pAig, pObj, nLimit, vFront) )
1314 return 1;
1315 if ( Vec_PtrSize(vFront) < nLimit && Ivy_FastMapNodeFaninCompact2(pAig, pObj, nLimit, vFront) )
1316 return 1;
1317 assert( Vec_PtrSize(vFront) <= nLimit );
1318 return 0;
1319}
int Ivy_FastMapNodeFaninCompact1(Ivy_Man_t *pAig, Ivy_Obj_t *pObj, int nLimit, Vec_Ptr_t *vFront)
int Ivy_FastMapNodeFaninCompact0(Ivy_Man_t *pAig, Ivy_Obj_t *pObj, int nLimit, Vec_Ptr_t *vFront)
int Ivy_FastMapNodeFaninCompact2(Ivy_Man_t *pAig, Ivy_Obj_t *pObj, int nLimit, Vec_Ptr_t *vFront)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Ivy_FastMapNodeFaninCost()

int Ivy_FastMapNodeFaninCost ( Ivy_Man_t * pAig,
Ivy_Obj_t * pObj )

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

Synopsis [Returns the increase in the number of fanins with no external refs.]

Description []

SideEffects []

SeeAlso []

Definition at line 1159 of file ivyFastMap.c.

1160{
1161 Ivy_Supp_t * pSuppF;
1162 Ivy_Obj_t * pFanin;
1163 int Counter = 0;
1164 assert( Ivy_ObjIsNode(pObj) );
1165 // check if the node has external refs
1166 pSuppF = Ivy_ObjSupp( pAig, pObj );
1167 if ( pSuppF->nRefs == 0 )
1168 Counter--;
1169 // increment the number of fanins without external refs
1170 pFanin = Ivy_ObjFanin0(pObj);
1171 pSuppF = Ivy_ObjSupp( pAig, pFanin );
1172 if ( !Ivy_ObjIsTravIdCurrent(pAig, pFanin) && pSuppF->nRefs == 0 )
1173 Counter++;
1174 // increment the number of fanins without external refs
1175 pFanin = Ivy_ObjFanin1(pObj);
1176 pSuppF = Ivy_ObjSupp( pAig, pFanin );
1177 if ( !Ivy_ObjIsTravIdCurrent(pAig, pFanin) && pSuppF->nRefs == 0 )
1178 Counter++;
1179 return Counter;
1180}
Here is the caller graph for this function:

◆ Ivy_FastMapNodeFaninUpdate()

void Ivy_FastMapNodeFaninUpdate ( Ivy_Man_t * pAig,
Ivy_Obj_t * pObj,
Vec_Ptr_t * vFront )

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

Synopsis [Updates the frontier.]

Description []

SideEffects []

SeeAlso []

Definition at line 1193 of file ivyFastMap.c.

1194{
1195 Ivy_Obj_t * pFanin;
1196 assert( Ivy_ObjIsNode(pObj) );
1197 Vec_PtrRemove( vFront, pObj );
1198 pFanin = Ivy_ObjFanin0(pObj);
1199 if ( !Ivy_ObjIsTravIdCurrent(pAig, pFanin) )
1200 {
1201 Ivy_ObjSetTravIdCurrent(pAig, pFanin);
1202 Vec_PtrPush( vFront, pFanin );
1203 }
1204 pFanin = Ivy_ObjFanin1(pObj);
1205 if ( !Ivy_ObjIsTravIdCurrent(pAig, pFanin) )
1206 {
1207 Ivy_ObjSetTravIdCurrent(pAig, pFanin);
1208 Vec_PtrPush( vFront, pFanin );
1209 }
1210}
Here is the caller graph for this function:

◆ Ivy_FastMapNodePrepare()

void Ivy_FastMapNodePrepare ( Ivy_Man_t * pAig,
Ivy_Obj_t * pObj,
int nLimit,
Vec_Ptr_t * vFront,
Vec_Ptr_t * vFrontOld )

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

Synopsis [Prepares node mapping.]

Description []

SideEffects []

SeeAlso []

Definition at line 1348 of file ivyFastMap.c.

1349{
1350 Ivy_Supp_t * pSupp;
1351 Ivy_Obj_t * pFanin;
1352 int i;
1353 pSupp = Ivy_ObjSupp( pAig, pObj );
1354 // expand the cut downwards from the given place
1355 Vec_PtrClear( vFront );
1356 Vec_PtrClear( vFrontOld );
1357 Ivy_ManIncrementTravId( pAig );
1358 for ( i = 0; i < pSupp->nSize; i++ )
1359 {
1360 pFanin = Ivy_ManObj(pAig, pSupp->pArray[i]);
1361 Vec_PtrPush( vFront, pFanin );
1362 Vec_PtrPush( vFrontOld, pFanin );
1363 Ivy_ObjSetTravIdCurrent( pAig, pFanin );
1364 }
1365 // mark the nodes in the cone
1366 Ivy_FastMapMark_rec( pAig, pObj );
1367}
void Ivy_ManIncrementTravId(Ivy_Man_t *p)
DECLARATIONS ///.
Definition ivyUtil.c:45
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Ivy_FastMapNodeRecover2()

void Ivy_FastMapNodeRecover2 ( Ivy_Man_t * pAig,
Ivy_Obj_t * pObj,
int nLimit,
Vec_Ptr_t * vFront,
Vec_Ptr_t * vFrontOld )

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

Synopsis [Performs area recovery for each node.]

Description []

SideEffects []

SeeAlso []

Definition at line 1407 of file ivyFastMap.c.

1408{
1409 Ivy_Supp_t * pSupp;
1410 int CostBef, CostAft;
1411 int AreaBef, AreaAft;
1412 pSupp = Ivy_ObjSupp( pAig, pObj );
1413// if ( pSupp->nRefs == 0 )
1414// return;
1415 if ( pSupp->nRefs == 0 )
1416 AreaBef = Ivy_FastMapNodeAreaDerefed( pAig, pObj );
1417 else
1418 AreaBef = Ivy_FastMapNodeAreaRefed( pAig, pObj );
1419 // get the area
1420 if ( AreaBef == 1 )
1421 return;
1422
1423 if ( pSupp->nRefs == 0 )
1424 {
1425 pSupp->nRefs = 1000000;
1426 Ivy_FastMapNodeRef( pAig, pObj );
1427 }
1428 // the cut is non-trivial
1429 Ivy_FastMapNodePrepare( pAig, pObj, nLimit, vFront, vFrontOld );
1430 // iteratively modify the cut
1431 CostBef = Ivy_FastMapCutCost( pAig, vFront );
1432 Ivy_FastMapNodeFaninCompact( pAig, pObj, nLimit, vFront );
1433 CostAft = Ivy_FastMapCutCost( pAig, vFront );
1434 assert( CostBef >= CostAft );
1435 // update the node
1436 Ivy_FastMapNodeUpdate( pAig, pObj, vFront );
1437 // get the new area
1438 AreaAft = Ivy_FastMapNodeAreaRefed( pAig, pObj );
1439 if ( AreaAft > AreaBef )
1440 {
1441 Ivy_FastMapNodeUpdate( pAig, pObj, vFrontOld );
1442 AreaAft = Ivy_FastMapNodeAreaRefed( pAig, pObj );
1443 assert( AreaAft == AreaBef );
1444 }
1445 if ( pSupp->nRefs == 1000000 )
1446 {
1447 pSupp->nRefs = 0;
1448 Ivy_FastMapNodeDeref( pAig, pObj );
1449 }
1450}
void Ivy_FastMapNodePrepare(Ivy_Man_t *pAig, Ivy_Obj_t *pObj, int nLimit, Vec_Ptr_t *vFront, Vec_Ptr_t *vFrontOld)
int Ivy_FastMapCutCost(Ivy_Man_t *pAig, Vec_Ptr_t *vFront)
void Ivy_FastMapNodeUpdate(Ivy_Man_t *pAig, Ivy_Obj_t *pObj, Vec_Ptr_t *vFront)
void Ivy_FastMapNodeFaninCompact(Ivy_Man_t *pAig, Ivy_Obj_t *pObj, int nLimit, Vec_Ptr_t *vFront)
Here is the call graph for this function:

◆ Ivy_FastMapNodeRecover4()

void Ivy_FastMapNodeRecover4 ( Ivy_Man_t * pAig,
Ivy_Obj_t * pObj,
int nLimit,
Vec_Ptr_t * vFront,
Vec_Ptr_t * vFrontOld )

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

Synopsis [Performs area recovery for each node.]

Description []

SideEffects []

SeeAlso []

Definition at line 1512 of file ivyFastMap.c.

1513{
1514 Ivy_Supp_t * pSupp;
1515 int CostBef, CostAft;
1516 int AreaBef, AreaAft;
1517 int DelayOld;
1518 pSupp = Ivy_ObjSupp( pAig, pObj );
1519 DelayOld = pSupp->Delay = Ivy_FastMapNodeDelay( pAig, pObj );
1520 assert( pSupp->Delay <= pSupp->DelayR );
1521// if ( pSupp->nRefs == 0 )
1522// return;
1523// AreaBef = Ivy_FastMapNodeAreaRefed( pAig, pObj );
1524 // get the area
1525 if ( pSupp->nRefs == 0 )
1526 AreaBef = Ivy_FastMapNodeAreaDerefed( pAig, pObj );
1527 else
1528 AreaBef = Ivy_FastMapNodeAreaRefed( pAig, pObj );
1529 if ( AreaBef == 1 )
1530 return;
1531
1532 if ( pSupp->nRefs == 0 )
1533 {
1534 pSupp->nRefs = 1000000;
1535 Ivy_FastMapNodeRef( pAig, pObj );
1536 }
1537 // the cut is non-trivial
1538 Ivy_FastMapNodePrepare( pAig, pObj, nLimit, vFront, vFrontOld );
1539 // iteratively modify the cut
1540 CostBef = Ivy_FastMapCutCost( pAig, vFront );
1541 Ivy_FastMapNodeFaninCompact( pAig, pObj, nLimit, vFront );
1542 CostAft = Ivy_FastMapCutCost( pAig, vFront );
1543 assert( CostBef >= CostAft );
1544 // update the node
1545 Ivy_FastMapNodeUpdate( pAig, pObj, vFront );
1546 pSupp->Delay = Ivy_FastMapNodeDelay( pAig, pObj );
1547 // get the new area
1548 AreaAft = Ivy_FastMapNodeAreaRefed( pAig, pObj );
1549 if ( AreaAft > AreaBef || pSupp->Delay > pSupp->DelayR )
1550 {
1551 Ivy_FastMapNodeUpdate( pAig, pObj, vFrontOld );
1552 AreaAft = Ivy_FastMapNodeAreaRefed( pAig, pObj );
1553 assert( AreaAft == AreaBef );
1554 pSupp->Delay = DelayOld;
1555 }
1556 if ( pSupp->nRefs == 1000000 )
1557 {
1558 pSupp->nRefs = 0;
1559 Ivy_FastMapNodeDeref( pAig, pObj );
1560 }
1561}
Here is the call graph for this function:

◆ Ivy_FastMapNodeUpdate()

void Ivy_FastMapNodeUpdate ( Ivy_Man_t * pAig,
Ivy_Obj_t * pObj,
Vec_Ptr_t * vFront )

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

Synopsis [Updates the frontier.]

Description []

SideEffects []

SeeAlso []

Definition at line 1380 of file ivyFastMap.c.

1381{
1382 Ivy_Supp_t * pSupp;
1383 Ivy_Obj_t * pFanin;
1384 int i;
1385 pSupp = Ivy_ObjSupp( pAig, pObj );
1386 // deref node's cut
1387 Ivy_FastMapNodeDeref( pAig, pObj );
1388 // update the node's cut
1389 pSupp->nSize = Vec_PtrSize(vFront);
1390 Vec_PtrForEachEntry( Ivy_Obj_t *, vFront, pFanin, i )
1391 pSupp->pArray[i] = pFanin->Id;
1392 // ref the new cut
1393 Ivy_FastMapNodeRef( pAig, pObj );
1394}
int Id
Definition ivy.h:75
Here is the caller graph for this function:

◆ Ivy_FastMapNodeWillGrow()

int Ivy_FastMapNodeWillGrow ( Ivy_Man_t * pAig,
Ivy_Obj_t * pObj )

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

Synopsis [Returns 1 if the number of fanins will grow.]

Description []

SideEffects []

SeeAlso []

Definition at line 1139 of file ivyFastMap.c.

1140{
1141 Ivy_Obj_t * pFanin0, * pFanin1;
1142 assert( Ivy_ObjIsNode(pObj) );
1143 pFanin0 = Ivy_ObjFanin0(pObj);
1144 pFanin1 = Ivy_ObjFanin1(pObj);
1145 return !Ivy_ObjIsTravIdCurrent(pAig, pFanin0) && !Ivy_ObjIsTravIdCurrent(pAig, pFanin1);
1146}
Here is the caller graph for this function:

◆ Ivy_FastMapPerform()

void Ivy_FastMapPerform ( Ivy_Man_t * pAig,
int nLimit,
int fRecovery,
int fVerbose )

FUNCTION DEFINITIONS ///.

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

Synopsis [Performs fast K-LUT mapping of the AIG.]

Description []

SideEffects []

SeeAlso []

Definition at line 105 of file ivyFastMap.c.

106{
107 Ivy_SuppMan_t * pMan;
108 Ivy_Obj_t * pObj;
109 int i, Delay, Area;
110 abctime clk, clkTotal = Abc_Clock();
111 // start the memory for supports
112 pMan = ABC_ALLOC( Ivy_SuppMan_t, 1 );
113 memset( pMan, 0, sizeof(Ivy_SuppMan_t) );
114 pMan->nLimit = nLimit;
115 pMan->nObjs = Ivy_ManObjIdMax(pAig) + 1;
116 pMan->nSize = sizeof(Ivy_Supp_t) + nLimit * sizeof(int);
117 pMan->pMem = (char *)ABC_ALLOC( char, pMan->nObjs * pMan->nSize );
118 memset( pMan->pMem, 0, pMan->nObjs * pMan->nSize );
119 pMan->vLuts = Vec_VecAlloc( 100 );
120 pAig->pData = pMan;
121clk = Abc_Clock();
122 // set the PI mapping
123 Ivy_ObjSuppStart( pAig, Ivy_ManConst1(pAig) );
124 Ivy_ManForEachPi( pAig, pObj, i )
125 Ivy_ObjSuppStart( pAig, pObj );
126 // iterate through all nodes in the topological order
127 Ivy_ManForEachNode( pAig, pObj, i )
128 Ivy_FastMapNode( pAig, pObj, nLimit );
129 // find the best arrival time and area
130 Delay = Ivy_FastMapDelay( pAig );
131 Area = Ivy_FastMapArea(pAig);
132 if ( fVerbose )
133 Ivy_FastMapPrint( pAig, Delay, Area, Abc_Clock() - clk, "Delay oriented mapping: " );
134
135// 2-1-2 (doing 2-1-2-1-2 improves 0.5%)
136
137 if ( fRecovery )
138 {
139clk = Abc_Clock();
140 Ivy_FastMapRequired( pAig, Delay, 0 );
141 // remap the nodes
142 Ivy_FastMapRecover( pAig, nLimit );
143 Delay = Ivy_FastMapDelay( pAig );
144 Area = Ivy_FastMapArea(pAig);
145 if ( fVerbose )
146 Ivy_FastMapPrint( pAig, Delay, Area, Abc_Clock() - clk, "Area recovery 2 : " );
147
148clk = Abc_Clock();
149 Ivy_FastMapRequired( pAig, Delay, 0 );
150 // iterate through all nodes in the topological order
151 Ivy_ManForEachNode( pAig, pObj, i )
152 Ivy_FastMapNodeArea( pAig, pObj, nLimit );
153 Delay = Ivy_FastMapDelay( pAig );
154 Area = Ivy_FastMapArea(pAig);
155 if ( fVerbose )
156 Ivy_FastMapPrint( pAig, Delay, Area, Abc_Clock() - clk, "Area recovery 1 : " );
157
158clk = Abc_Clock();
159 Ivy_FastMapRequired( pAig, Delay, 0 );
160 // remap the nodes
161 Ivy_FastMapRecover( pAig, nLimit );
162 Delay = Ivy_FastMapDelay( pAig );
163 Area = Ivy_FastMapArea(pAig);
164 if ( fVerbose )
165 Ivy_FastMapPrint( pAig, Delay, Area, Abc_Clock() - clk, "Area recovery 2 : " );
166 }
167
168
169 s_MappingTime = Abc_Clock() - clkTotal;
170 s_MappingMem = pMan->nObjs * pMan->nSize;
171/*
172 {
173 Vec_Ptr_t * vNodes;
174 vNodes = Vec_PtrAlloc( 100 );
175 Vec_VecForEachEntry( Ivy_Obj_t *, pMan->vLuts, pObj, i, k )
176 Vec_PtrPush( vNodes, pObj );
177 Ivy_ManShow( pAig, 0, vNodes );
178 Vec_PtrFree( vNodes );
179 }
180*/
181}
ABC_INT64_T abctime
Definition abc_global.h:332
#define ABC_ALLOC(type, num)
Definition abc_global.h:264
abctime s_MappingTime
DECLARATIONS ///.
Definition abcPrint.c:47
int s_MappingMem
Definition abcPrint.c:48
struct Ivy_SuppMan_t_ Ivy_SuppMan_t
Definition ivyFastMap.c:32
#define Ivy_ManForEachNode(p, pObj, i)
Definition ivy.h:402
#define Ivy_ManForEachPi(p, pObj, i)
ITERATORS ///.
Definition ivy.h:387
Vec_Vec_t * vLuts
Definition ivyFastMap.c:39
char * memset()
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Ivy_FastMapReadSupp()

void Ivy_FastMapReadSupp ( Ivy_Man_t * pAig,
Ivy_Obj_t * pObj,
Vec_Int_t * vLeaves )

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

Synopsis [Creates integer vector with the support of the node.]

Description []

SideEffects []

SeeAlso []

Definition at line 793 of file ivyFastMap.c.

794{
795 Ivy_Supp_t * pSupp;
796 pSupp = Ivy_ObjSupp( pAig, pObj );
797 vLeaves->nCap = 8;
798 vLeaves->nSize = pSupp->nSize;
799 vLeaves->pArray = pSupp->pArray;
800}

◆ Ivy_FastMapRequired_rec()

void Ivy_FastMapRequired_rec ( Ivy_Man_t * pAig,
Ivy_Obj_t * pObj,
Ivy_Obj_t * pRoot,
int DelayR )

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

Synopsis [Sets the required times of the intermediate nodes.]

Description []

SideEffects []

SeeAlso []

Definition at line 813 of file ivyFastMap.c.

814{
815 Ivy_Supp_t * pSupp;
816 pSupp = Ivy_ObjSupp( pAig, pObj );
817 if ( pObj != pRoot && (pSupp->nRefs > 0 || Ivy_ObjIsCi(pObj)) )
818 return;
819 Ivy_FastMapRequired_rec( pAig, Ivy_ObjFanin0(pObj), pRoot, DelayR );
820 Ivy_FastMapRequired_rec( pAig, Ivy_ObjFanin1(pObj), pRoot, DelayR );
821// assert( pObj == pRoot || pSupp->DelayR == IVY_INFINITY );
822 pSupp->DelayR = DelayR;
823}
void Ivy_FastMapRequired_rec(Ivy_Man_t *pAig, Ivy_Obj_t *pObj, Ivy_Obj_t *pRoot, int DelayR)
Definition ivyFastMap.c:813
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Ivy_FastMapStop()

void Ivy_FastMapStop ( Ivy_Man_t * pAig)

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

Synopsis [Cleans memory used for decomposition.]

Description []

SideEffects []

SeeAlso []

Definition at line 194 of file ivyFastMap.c.

195{
196 Ivy_SuppMan_t * p = (Ivy_SuppMan_t *)pAig->pData;
197 Vec_VecFree( p->vLuts );
198 ABC_FREE( p->pMem );
199 ABC_FREE( p );
200 pAig->pData = NULL;
201}
#define ABC_FREE(obj)
Definition abc_global.h:267
Cube * p
Definition exorList.c:222
Here is the caller graph for this function:

Variable Documentation

◆ s_MappingMem

int s_MappingMem
extern

Definition at line 48 of file abcPrint.c.

◆ s_MappingTime

abctime s_MappingTime
extern

DECLARATIONS ///.

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

FileName [abcPrint.c]

SystemName [ABC: Logic synthesis and verification system.]

PackageName [Network and node package.]

Synopsis [Printing statistics.]

Author [Alan Mishchenko]

Affiliation [UC Berkeley]

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

Revision [

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

]

Definition at line 47 of file abcPrint.c.