ABC: A System for Sequential Synthesis and Verification
 
Loading...
Searching...
No Matches
mapperInt.h File Reference
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <float.h>
#include <math.h>
#include "base/main/main.h"
#include "map/mio/mio.h"
#include "mapper.h"
Include dependency graph for mapperInt.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  Map_ManStruct_t_
 STRUCTURE DEFINITIONS ///. More...
 
struct  Map_SuperLibStruct_t_
 
struct  Map_NodeStruct_t_
 
struct  Map_MatchStruct_t_
 
struct  Map_CutStruct_t_
 
struct  Map_SuperStruct_t_
 
struct  Map_NodeVecStruct_t_
 
struct  Map_HashTableStruct_t_
 
struct  Map_HashEntryStruct_t_
 

Macros

#define MAP_MASK(n)
 INCLUDES ///.
 
#define MAP_FULL   (~((unsigned)0))
 
#define MAP_NO_VAR   (-9999.0)
 
#define MAP_MIN(a, b)
 
#define MAP_MAX(a, b)
 
#define MAP_FLOAT_LARGE   ((float)(FLT_MAX/10))
 
#define MAP_FLOAT_SMALL   ((float)1.0e-03)
 
#define MAP_RANDOM_UNSIGNED   ((((unsigned)rand()) << 24) ^ (((unsigned)rand()) << 12) ^ ((unsigned)rand()))
 
#define Map_CutIsComplement(p)
 
#define Map_CutRegular(p)
 
#define Map_CutNot(p)
 
#define Map_CutNotCond(p, c)
 
#define Map_NodeReadRef(p)
 
#define Map_NodeRef(p)
 
#define Map_InfoSetVar(p, i)
 
#define Map_InfoRemVar(p, i)
 
#define Map_InfoFlipVar(p, i)
 
#define Map_InfoReadVar(p, i)
 
#define Map_NodeIsSimComplement(p)
 
#define Map_NodeReadNextFanout(pNode, pFanout)
 
#define Map_NodeReadNextFanoutPlace(pNode, pFanout)
 
#define Map_NodeForEachFanout(pNode, pFanout)
 
#define Map_NodeForEachFanoutSafe(pNode, pFanout, pFanout2)
 

Functions

void Map_MappingCuts (Map_Man_t *p)
 GLOBAL VARIABLES ///.
 
Map_Cut_tMap_CutAlloc (Map_Man_t *p)
 DECLARATIONS ///.
 
void Map_CutFree (Map_Man_t *p, Map_Cut_t *pCut)
 
void Map_CutPrint (Map_Man_t *p, Map_Node_t *pRoot, Map_Cut_t *pCut, int fPhase)
 
float Map_CutGetRootArea (Map_Cut_t *pCut, int fPhase)
 
int Map_CutGetLeafPhase (Map_Cut_t *pCut, int fPhase, int iLeaf)
 
int Map_NodeGetLeafPhase (Map_Node_t *pNode, int fPhase, int iLeaf)
 
Map_Cut_tMap_CutListAppend (Map_Cut_t *pSetAll, Map_Cut_t *pSets)
 
void Map_CutListRecycle (Map_Man_t *p, Map_Cut_t *pSetList, Map_Cut_t *pSave)
 
int Map_CutListCount (Map_Cut_t *pSets)
 
void Map_CutRemoveFanouts (Map_Node_t *pNode, Map_Cut_t *pCut, int fPhase)
 
void Map_CutInsertFanouts (Map_Node_t *pNode, Map_Cut_t *pCut, int fPhase)
 
void Map_NodeAddFaninFanout (Map_Node_t *pFanin, Map_Node_t *pFanout)
 
void Map_NodeRemoveFaninFanout (Map_Node_t *pFanin, Map_Node_t *pFanoutToRemove)
 
int Map_NodeGetFanoutNum (Map_Node_t *pNode)
 
Map_SuperLib_tMap_SuperLibCreate (Mio_Library_t *pGenlib, Vec_Str_t *vStr, char *pFileName, char *pExcludeFile, int fAlgorithm, int fVerbose)
 DECLARATIONS ///.
 
void Map_SuperLibFree (Map_SuperLib_t *p)
 
int Map_MappingMatches (Map_Man_t *p)
 
void Map_MappingEstimateRefsInit (Map_Man_t *p)
 
void Map_MappingEstimateRefs (Map_Man_t *p)
 
float Map_CutGetAreaFlow (Map_Cut_t *pCut, int fPhase)
 
float Map_CutGetAreaRefed (Map_Cut_t *pCut, int fPhase)
 
float Map_CutGetAreaDerefed (Map_Cut_t *pCut, int fPhase)
 
float Map_CutRef (Map_Cut_t *pCut, int fPhase, int fProfile)
 
float Map_CutDeref (Map_Cut_t *pCut, int fPhase, int fProfile)
 
void Map_MappingSetRefs (Map_Man_t *pMan)
 
float Map_MappingGetArea (Map_Man_t *pMan)
 
float Map_SwitchCutGetDerefed (Map_Node_t *pNode, Map_Cut_t *pCut, int fPhase)
 FUNCTION DEFINITIONS ///.
 
float Map_SwitchCutRef (Map_Node_t *pNode, Map_Cut_t *pCut, int fPhase)
 
float Map_SwitchCutDeref (Map_Node_t *pNode, Map_Cut_t *pCut, int fPhase)
 
float Map_MappingGetSwitching (Map_Man_t *pMan)
 
int Map_LibraryDeriveGateInfo (Map_SuperLib_t *pLib, st__table *tExcludeGate)
 
int Map_LibraryReadFileTreeStr (Map_SuperLib_t *pLib, Mio_Library_t *pGenlib, Vec_Str_t *vStr, char *pFileName)
 
int Map_LibraryReadTree (Map_SuperLib_t *pLib, Mio_Library_t *pGenlib, char *pFileName, char *pExcludeFile)
 
void Map_LibraryPrintTree (Map_SuperLib_t *pLib)
 
int Map_LibraryRead (Map_SuperLib_t *p, char *pFileName)
 FUNCTION DEFINITIONS ///.
 
void Map_LibraryPrintSupergate (Map_Super_t *pGate)
 
Map_HashTable_tMap_SuperTableCreate (Map_SuperLib_t *pLib)
 FUNCTION DEFINITIONS ///.
 
void Map_SuperTableFree (Map_HashTable_t *p)
 
int Map_SuperTableInsertC (Map_HashTable_t *pLib, unsigned uTruthC[], Map_Super_t *pGate)
 
int Map_SuperTableInsert (Map_HashTable_t *pLib, unsigned uTruth[], Map_Super_t *pGate, unsigned uPhase)
 
Map_Super_tMap_SuperTableLookup (Map_HashTable_t *p, unsigned uTruth[], unsigned *puPhase)
 
void Map_SuperTableSortSupergates (Map_HashTable_t *p, int nSupersMax)
 
void Map_SuperTableSortSupergatesByDelay (Map_HashTable_t *p, int nSupersMax)
 
float Map_TimeCutComputeArrival (Map_Node_t *pNode, Map_Cut_t *pCut, int fPhase, float tWorstCaseLimit)
 
float Map_TimeComputeArrivalMax (Map_Man_t *p)
 DECLARATIONS ///.
 
void Map_TimeComputeRequiredGlobal (Map_Man_t *p)
 
void Map_MappingTruths (Map_Man_t *pMan)
 FUNCTION DEFINITIONS ///.
 
int Map_TruthsCutDontCare (Map_Man_t *pMan, Map_Cut_t *pCut, unsigned *uTruthDc)
 
int Map_TruthCountOnes (unsigned *uTruth, int nLeaves)
 
int Map_TruthDetectTwoFirst (unsigned *uTruth, int nLeaves)
 
Map_NodeVec_tMap_MappingDfs (Map_Man_t *pMan, int fCollectEquiv)
 
int Map_MappingCountLevels (Map_Man_t *pMan)
 
void Map_MappingUnmark (Map_Man_t *pMan)
 
void Map_MappingMark_rec (Map_Node_t *pNode)
 
void Map_MappingUnmark_rec (Map_Node_t *pNode)
 
void Map_MappingPrintOutputArrivals (Map_Man_t *p)
 
void Map_MappingSetupMask (unsigned uMask[], int nVarsMax)
 
int Map_MappingNodeIsViolator (Map_Node_t *pNode, Map_Cut_t *pCut, int fPosPol)
 
float Map_MappingGetAreaFlow (Map_Man_t *p)
 
void Map_MappingSortByLevel (Map_Man_t *pMan, Map_NodeVec_t *vNodes)
 
int Map_MappingCountDoubles (Map_Man_t *pMan, Map_NodeVec_t *vNodes)
 
void Map_MappingExpandTruth (unsigned uTruth[2], int nVars)
 
float Map_MappingPrintSwitching (Map_Man_t *pMan)
 
void Map_MappingSetPlacementInfo (Map_Man_t *p)
 
float Map_MappingPrintWirelength (Map_Man_t *p)
 
void Map_MappingWireReport (Map_Man_t *p)
 
float Map_MappingComputeDelayWithFanouts (Map_Man_t *p)
 
int Map_MappingGetMaxLevel (Map_Man_t *pMan)
 
void Map_MappingSetChoiceLevels (Map_Man_t *pMan)
 
void Map_MappingReportChoices (Map_Man_t *pMan)
 
Map_NodeVec_tMap_NodeVecAlloc (int nCap)
 FUNCTION DEFINITIONS ///.
 
void Map_NodeVecFree (Map_NodeVec_t *p)
 
Map_NodeVec_tMap_NodeVecDup (Map_NodeVec_t *p)
 
Map_Node_t ** Map_NodeVecReadArray (Map_NodeVec_t *p)
 
int Map_NodeVecReadSize (Map_NodeVec_t *p)
 
void Map_NodeVecGrow (Map_NodeVec_t *p, int nCapMin)
 
void Map_NodeVecShrink (Map_NodeVec_t *p, int nSizeNew)
 
void Map_NodeVecClear (Map_NodeVec_t *p)
 
void Map_NodeVecPush (Map_NodeVec_t *p, Map_Node_t *Entry)
 
int Map_NodeVecPushUnique (Map_NodeVec_t *p, Map_Node_t *Entry)
 
Map_Node_tMap_NodeVecPop (Map_NodeVec_t *p)
 
void Map_NodeVecRemove (Map_NodeVec_t *p, Map_Node_t *Entry)
 
void Map_NodeVecWriteEntry (Map_NodeVec_t *p, int i, Map_Node_t *Entry)
 
Map_Node_tMap_NodeVecReadEntry (Map_NodeVec_t *p, int i)
 
void Map_NodeVecSortByLevel (Map_NodeVec_t *p)
 

Macro Definition Documentation

◆ Map_CutIsComplement

#define Map_CutIsComplement ( p)
Value:
(((int)((ABC_PTRUINT_T) (p) & 01)))
Cube * p
Definition exorList.c:222

Definition at line 68 of file mapperInt.h.

◆ Map_CutNot

#define Map_CutNot ( p)
Value:
((Map_Cut_t *)((ABC_PTRUINT_T)(p) ^ 01))
struct Map_CutStruct_t_ Map_Cut_t
Definition mapper.h:43

Definition at line 70 of file mapperInt.h.

◆ Map_CutNotCond

#define Map_CutNotCond ( p,
c )
Value:
((Map_Cut_t *)((ABC_PTRUINT_T)(p) ^ (c)))

Definition at line 71 of file mapperInt.h.

◆ Map_CutRegular

#define Map_CutRegular ( p)
Value:
((Map_Cut_t *)((ABC_PTRUINT_T)(p) & ~01))

Definition at line 69 of file mapperInt.h.

◆ MAP_FLOAT_LARGE

#define MAP_FLOAT_LARGE   ((float)(FLT_MAX/10))

Definition at line 61 of file mapperInt.h.

◆ MAP_FLOAT_SMALL

#define MAP_FLOAT_SMALL   ((float)1.0e-03)

Definition at line 62 of file mapperInt.h.

◆ MAP_FULL

#define MAP_FULL   (~((unsigned)0))

Definition at line 53 of file mapperInt.h.

◆ Map_InfoFlipVar

#define Map_InfoFlipVar ( p,
i )
Value:
(p[(i)>>5] ^= (1<<((i) & 31)))

Definition at line 80 of file mapperInt.h.

◆ Map_InfoReadVar

#define Map_InfoReadVar ( p,
i )
Value:
((p[(i)>>5] & (1<<((i) & 31))) > 0)

Definition at line 81 of file mapperInt.h.

◆ Map_InfoRemVar

#define Map_InfoRemVar ( p,
i )
Value:
(p[(i)>>5] &= ~(1<<((i) & 31)))

Definition at line 79 of file mapperInt.h.

◆ Map_InfoSetVar

#define Map_InfoSetVar ( p,
i )
Value:
(p[(i)>>5] |= (1<<((i) & 31)))

Definition at line 78 of file mapperInt.h.

◆ MAP_MASK

#define MAP_MASK ( n)
Value:
((~((unsigned)0)) >> (32-(n)))

INCLUDES ///.

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

FileName [mapperInt.h]

PackageName [MVSIS 2.0: Multi-valued logic synthesis system.]

Synopsis [Generic technology mapping engine.]

Author [MVSIS Group]

Affiliation [UC Berkeley]

Date [Ver. 2.0. Started - June 1, 2004.]

Revision [

Id
mapperInt.h,v 1.8 2004/09/30 21:18:10 satrajit Exp

] PARAMETERS /// MACRO DEFINITIONS ///

Definition at line 52 of file mapperInt.h.

◆ MAP_MAX

#define MAP_MAX ( a,
b )
Value:
(((a) > (b))? (a) : (b))

Definition at line 58 of file mapperInt.h.

◆ MAP_MIN

#define MAP_MIN ( a,
b )
Value:
(((a) < (b))? (a) : (b))

Definition at line 57 of file mapperInt.h.

◆ MAP_NO_VAR

#define MAP_NO_VAR   (-9999.0)

Definition at line 54 of file mapperInt.h.

◆ Map_NodeForEachFanout

#define Map_NodeForEachFanout ( pNode,
pFanout )
Value:
for ( pFanout = (pNode)->pFanPivot; pFanout; \
pFanout = Map_NodeReadNextFanout(pNode, pFanout) )
#define Map_NodeReadNextFanout(pNode, pFanout)
Definition mapperInt.h:329

Definition at line 340 of file mapperInt.h.

340#define Map_NodeForEachFanout( pNode, pFanout ) \
341 for ( pFanout = (pNode)->pFanPivot; pFanout; \
342 pFanout = Map_NodeReadNextFanout(pNode, pFanout) )

◆ Map_NodeForEachFanoutSafe

#define Map_NodeForEachFanoutSafe ( pNode,
pFanout,
pFanout2 )
Value:
for ( pFanout = (pNode)->pFanPivot, \
pFanout2 = Map_NodeReadNextFanout(pNode, pFanout); \
pFanout; \
pFanout = pFanout2, \
pFanout2 = Map_NodeReadNextFanout(pNode, pFanout) )

Definition at line 345 of file mapperInt.h.

345#define Map_NodeForEachFanoutSafe( pNode, pFanout, pFanout2 ) \
346 for ( pFanout = (pNode)->pFanPivot, \
347 pFanout2 = Map_NodeReadNextFanout(pNode, pFanout); \
348 pFanout; \
349 pFanout = pFanout2, \
350 pFanout2 = Map_NodeReadNextFanout(pNode, pFanout) )

◆ Map_NodeIsSimComplement

#define Map_NodeIsSimComplement ( p)
Value:
(Map_IsComplement(p)? !(Map_Regular(p)->fInv) : (p)->fInv)
#define Map_Regular(p)
Definition mapper.h:68
#define Map_IsComplement(p)
GLOBAL VARIABLES ///.
Definition mapper.h:67

Definition at line 84 of file mapperInt.h.

◆ Map_NodeReadNextFanout

#define Map_NodeReadNextFanout ( pNode,
pFanout )
Value:
( ( pFanout == NULL )? NULL : \
((Map_Regular((pFanout)->p1) == (pNode))? \
(pFanout)->pFanFanin1 : (pFanout)->pFanFanin2) )

Definition at line 329 of file mapperInt.h.

329#define Map_NodeReadNextFanout( pNode, pFanout ) \
330 ( ( pFanout == NULL )? NULL : \
331 ((Map_Regular((pFanout)->p1) == (pNode))? \
332 (pFanout)->pFanFanin1 : (pFanout)->pFanFanin2) )

◆ Map_NodeReadNextFanoutPlace

#define Map_NodeReadNextFanoutPlace ( pNode,
pFanout )
Value:
( (Map_Regular((pFanout)->p1) == (pNode))? \
&(pFanout)->pFanFanin1 : &(pFanout)->pFanFanin2 )

Definition at line 335 of file mapperInt.h.

335#define Map_NodeReadNextFanoutPlace( pNode, pFanout ) \
336 ( (Map_Regular((pFanout)->p1) == (pNode))? \
337 &(pFanout)->pFanFanin1 : &(pFanout)->pFanFanin2 )

◆ Map_NodeReadRef

#define Map_NodeReadRef ( p)
Value:
((Map_Regular(p))->nRefs)

Definition at line 74 of file mapperInt.h.

◆ Map_NodeRef

#define Map_NodeRef ( p)
Value:
((Map_Regular(p))->nRefs++)

Definition at line 75 of file mapperInt.h.

◆ MAP_RANDOM_UNSIGNED

#define MAP_RANDOM_UNSIGNED   ((((unsigned)rand()) << 24) ^ (((unsigned)rand()) << 12) ^ ((unsigned)rand()))

Definition at line 65 of file mapperInt.h.

Function Documentation

◆ Map_CutAlloc()

Map_Cut_t * Map_CutAlloc ( Map_Man_t * p)
extern

DECLARATIONS ///.

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

FileName [mapperCutUtils.c]

PackageName [MVSIS 1.3: Multi-valued logic synthesis system.]

Synopsis [Generic technology mapping engine.]

Author [MVSIS Group]

Affiliation [UC Berkeley]

Date [Ver. 2.0. Started - June 1, 2004.]

Revision [

Id
mapperCutUtils.h,v 1.0 2003/09/08 00:00:00 alanmi Exp

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

Synopsis [Allocates the cut.]

Description []

SideEffects []

SeeAlso []

Definition at line 43 of file mapperCutUtils.c.

44{
45 Map_Cut_t * pCut;
46 Map_Match_t * pMatch;
47 pCut = (Map_Cut_t *)Extra_MmFixedEntryFetch( p->mmCuts );
48 memset( pCut, 0, sizeof(Map_Cut_t) );
49
50 pMatch = pCut->M;
51 pMatch->AreaFlow = MAP_FLOAT_LARGE; // unassigned
52 pMatch->tArrive.Rise = MAP_FLOAT_LARGE; // unassigned
53 pMatch->tArrive.Fall = MAP_FLOAT_LARGE; // unassigned
54 pMatch->tArrive.Worst = MAP_FLOAT_LARGE; // unassigned
55
56 pMatch = pCut->M + 1;
57 pMatch->AreaFlow = MAP_FLOAT_LARGE; // unassigned
58 pMatch->tArrive.Rise = MAP_FLOAT_LARGE; // unassigned
59 pMatch->tArrive.Fall = MAP_FLOAT_LARGE; // unassigned
60 pMatch->tArrive.Worst = MAP_FLOAT_LARGE; // unassigned
61 return pCut;
62}
char * Extra_MmFixedEntryFetch(Extra_MmFixed_t *p)
#define MAP_FLOAT_LARGE
Definition mapperInt.h:61
struct Map_MatchStruct_t_ Map_Match_t
Definition mapper.h:44
Map_Match_t M[2]
Definition mapperInt.h:275
Map_Time_t tArrive
Definition mapperInt.h:259
char * memset()

◆ Map_CutDeref()

float Map_CutDeref ( Map_Cut_t * pCut,
int fPhase,
int fProfile )
extern

function*************************************************************

synopsis [Dereferences the cut.]

description []

sideeffects []

seealso []

Definition at line 391 of file mapperRefs.c.

392{
393 return Map_CutRefDeref( pCut, fPhase, 0, fProfile ); // dereference
394}
float Map_CutRefDeref(Map_Cut_t *pCut, int fPhase, int fReference, int fUpdateProf)
Definition mapperRefs.c:229
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Map_CutFree()

void Map_CutFree ( Map_Man_t * p,
Map_Cut_t * pCut )
extern

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

Synopsis [Deallocates the cut.]

Description []

SideEffects []

SeeAlso []

Definition at line 75 of file mapperCutUtils.c.

76{
77 if ( pCut )
78 Extra_MmFixedEntryRecycle( p->mmCuts, (char *)pCut );
79}
void Extra_MmFixedEntryRecycle(Extra_MmFixed_t *p, char *pEntry)
Here is the call graph for this function:

◆ Map_CutGetAreaDerefed()

float Map_CutGetAreaDerefed ( Map_Cut_t * pCut,
int fPhase )
extern

function*************************************************************

synopsis [Computes the exact area associated with the cut.]

description []

sideeffects []

seealso []

Definition at line 355 of file mapperRefs.c.

356{
357 float aResult, aResult2;
358 aResult2 = Map_CutRefDeref( pCut, fPhase, 1, 0 ); // reference
359 aResult = Map_CutRefDeref( pCut, fPhase, 0, 0 ); // dereference
360// assert( aResult == aResult2 );
361 return aResult;
362}
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Map_CutGetAreaFlow()

float Map_CutGetAreaFlow ( Map_Cut_t * pCut,
int fPhase )
extern

function*************************************************************

synopsis [Computes the area flow of the cut.]

description [Computes the area flow of the cut if it is implemented using the best supergate with the best phase.]

sideeffects []

seealso []

Definition at line 179 of file mapperRefs.c.

180{
181 Map_Match_t * pM = pCut->M + fPhase;
182 Map_Super_t * pSuper = pM->pSuperBest;
183 unsigned uPhaseTot = pM->uPhaseBest;
184 Map_Cut_t * pCutFanin;
185 float aFlowRes, aFlowFanin, nRefs;
186 int i, fPinPhasePos;
187
188 // start the resulting area flow
189 aFlowRes = pSuper->Area;
190 // iterate through the leaves
191 for ( i = 0; i < pCut->nLeaves; i++ )
192 {
193 // get the phase of this fanin
194 fPinPhasePos = ((uPhaseTot & (1 << i)) == 0);
195 // get the cut implementing this phase of the fanin
196 pCutFanin = pCut->ppLeaves[i]->pCutBest[fPinPhasePos];
197 // if the cut is not available, we have to use the opposite phase
198 if ( pCutFanin == NULL )
199 {
200 fPinPhasePos = !fPinPhasePos;
201 pCutFanin = pCut->ppLeaves[i]->pCutBest[fPinPhasePos];
202 }
203 aFlowFanin = pCutFanin->M[fPinPhasePos].AreaFlow; // ignores the area of the interter
204 // get the fanout count of the cut in the given phase
205 nRefs = Map_NodeReadRefPhaseEst( pCut->ppLeaves[i], fPinPhasePos );
206 // if the node does no fanout, assume fanout count equal to 1
207 if ( nRefs == (float)0.0 )
208 nRefs = (float)1.0;
209 // add the area flow due to the fanin
210 aFlowRes += aFlowFanin / nRefs;
211 }
212 pM->AreaFlow = aFlowRes;
213 return aFlowRes;
214}
float Map_NodeReadRefPhaseEst(Map_Node_t *pNode, int fPhase)
Definition mapperRefs.c:63
struct Map_SuperStruct_t_ Map_Super_t
Definition mapper.h:45
Map_Node_t * ppLeaves[6]
Definition mapperInt.h:269
Map_Super_t * pSuperBest
Definition mapperInt.h:257
unsigned uPhaseBest
Definition mapperInt.h:256
Map_Cut_t * pCutBest[2]
Definition mapperInt.h:243
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Map_CutGetAreaRefed()

float Map_CutGetAreaRefed ( Map_Cut_t * pCut,
int fPhase )
extern

function*************************************************************

synopsis [Computes the exact area associated with the cut.]

description [Assumes that the cut is referenced.]

sideeffects []

seealso []

Definition at line 335 of file mapperRefs.c.

336{
337 float aResult, aResult2;
338 aResult2 = Map_CutRefDeref( pCut, fPhase, 0, 0 ); // dereference
339 aResult = Map_CutRefDeref( pCut, fPhase, 1, 0 ); // reference
340// assert( aResult == aResult2 );
341 return aResult;
342}
Here is the call graph for this function:

◆ Map_CutGetLeafPhase()

int Map_CutGetLeafPhase ( Map_Cut_t * pCut,
int fPhase,
int iLeaf )
extern

function*************************************************************

synopsis [Computes the exact area associated with the cut.]

description []

sideeffects []

seealso []

Definition at line 131 of file mapperCutUtils.c.

132{
133 assert( pCut->M[fPhase].pSuperBest );
134 return (( pCut->M[fPhase].uPhaseBest & (1<<iLeaf) ) == 0);
135}
#define assert(ex)
Definition util_old.h:213
Here is the caller graph for this function:

◆ Map_CutGetRootArea()

float Map_CutGetRootArea ( Map_Cut_t * pCut,
int fPhase )
extern

function*************************************************************

synopsis [Computes the exact area associated with the cut.]

description []

sideeffects []

seealso []

Definition at line 114 of file mapperCutUtils.c.

115{
116 assert( pCut->M[fPhase].pSuperBest );
117 return pCut->M[fPhase].pSuperBest->Area;
118}
Here is the caller graph for this function:

◆ Map_CutInsertFanouts()

void Map_CutInsertFanouts ( Map_Node_t * pNode,
Map_Cut_t * pCut,
int fPhase )
extern

◆ Map_CutListAppend()

Map_Cut_t * Map_CutListAppend ( Map_Cut_t * pSetAll,
Map_Cut_t * pSets )
extern

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

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 165 of file mapperCutUtils.c.

166{
167 Map_Cut_t * pPrev = NULL; // Suppress "might be used uninitialized"
168 Map_Cut_t * pTemp;
169 if ( pSetAll == NULL )
170 return pSets;
171 if ( pSets == NULL )
172 return pSetAll;
173 // find the last one
174 for ( pTemp = pSets; pTemp; pTemp = pTemp->pNext )
175 pPrev = pTemp;
176 // append all the end of the current set
177 assert( pPrev->pNext == NULL );
178 pPrev->pNext = pSetAll;
179 return pSets;
180}
Map_Cut_t * pNext
Definition mapperInt.h:266

◆ Map_CutListCount()

int Map_CutListCount ( Map_Cut_t * pSets)
extern

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

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 214 of file mapperCutUtils.c.

215{
216 Map_Cut_t * pTemp;
217 int i;
218 for ( i = 0, pTemp = pSets; pTemp; pTemp = pTemp->pNext, i++ );
219 return i;
220}

◆ Map_CutListRecycle()

void Map_CutListRecycle ( Map_Man_t * p,
Map_Cut_t * pSetList,
Map_Cut_t * pSave )
extern

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

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 193 of file mapperCutUtils.c.

194{
195 Map_Cut_t * pNext, * pTemp;
196 for ( pTemp = pSetList, pNext = pTemp? pTemp->pNext : NULL;
197 pTemp;
198 pTemp = pNext, pNext = pNext? pNext->pNext : NULL )
199 if ( pTemp != pSave )
200 Extra_MmFixedEntryRecycle( p->mmCuts, (char *)pTemp );
201}
Here is the call graph for this function:

◆ Map_CutPrint()

void Map_CutPrint ( Map_Man_t * p,
Map_Node_t * pRoot,
Map_Cut_t * pCut,
int fPhase )
extern

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

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 92 of file mapperCutUtils.c.

93{
94 int i;
95 printf( "CUT: Delay = (%4.2f, %4.2f). Area = %4.2f. Nodes = %d -> {",
96 pCut->M[fPhase].tArrive.Rise, pCut->M[fPhase].tArrive.Fall, pCut->M[fPhase].AreaFlow, pRoot->Num );
97 for ( i = 0; i < pCut->nLeaves; i++ )
98 printf( " %d", pCut->ppLeaves[i]->Num );
99 printf( " } \n" );
100}

◆ Map_CutRef()

float Map_CutRef ( Map_Cut_t * pCut,
int fPhase,
int fProfile )
extern

function*************************************************************

synopsis [References the cut.]

description []

sideeffects []

seealso []

Definition at line 375 of file mapperRefs.c.

376{
377 return Map_CutRefDeref( pCut, fPhase, 1, fProfile ); // reference
378}
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Map_CutRemoveFanouts()

void Map_CutRemoveFanouts ( Map_Node_t * pNode,
Map_Cut_t * pCut,
int fPhase )
extern

◆ Map_LibraryDeriveGateInfo()

int Map_LibraryDeriveGateInfo ( Map_SuperLib_t * pLib,
st__table * tExcludeGate )
extern

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

Synopsis [Derives information about the library.]

Description []

SideEffects []

SeeAlso []

Definition at line 586 of file mapperTree.c.

587{
588 Map_Super_t * pGate, * pFanin;
589 Mio_Pin_t * pPin;
590 unsigned uCanon[2];
591 unsigned uTruths[6][2];
592 int i, k, nRealVars;
593
594 // set all the derivable info related to the supergates
595 for ( i = pLib->nVarsMax; i < (int)pLib->nLines; i++ )
596 {
597 pGate = pLib->ppSupers[i];
598
599 if ( tExcludeGate )
600 {
601 if ( st__is_member( tExcludeGate, Mio_GateReadName( pGate->pRoot ) ) )
602 pGate->fExclude = 1;
603 for ( k = 0; k < (int)pGate->nFanins; k++ )
604 {
605 pFanin = pGate->pFanins[k];
606 if ( pFanin->fExclude )
607 {
608 pGate->fExclude = 1;
609 continue;
610 }
611 }
612 }
613
614 // collect the truth tables of the fanins
615 for ( k = 0; k < (int)pGate->nFanins; k++ )
616 {
617 pFanin = pGate->pFanins[k];
618 uTruths[k][0] = pFanin->uTruth[0];
619 uTruths[k][1] = pFanin->uTruth[1];
620 }
621 // derive the new truth table
622 Mio_DeriveTruthTable( pGate->pRoot, uTruths, pGate->nFanins, 6, pGate->uTruth );
623
624 // set the initial delays of the supergate
625 for ( k = 0; k < pLib->nVarsMax; k++ )
626 {
627 pGate->tDelaysR[k].Rise = pGate->tDelaysR[k].Fall = MAP_NO_VAR;
628 pGate->tDelaysF[k].Rise = pGate->tDelaysF[k].Fall = MAP_NO_VAR;
629 }
630 // get the linked list of pins for the given root gate
631 pPin = Mio_GateReadPins( pGate->pRoot );
632 // update the initial delay of the supergate using info from the corresponding pin
633 for ( k = 0; k < (int)pGate->nFanins; k++, pPin = Mio_PinReadNext(pPin) )
634 {
635 // if there is no corresponding pin, this is a bug, return fail
636 if ( pPin == NULL )
637 {
638 printf( "There are less pins than gate inputs.\n" );
639 return 0;
640 }
641 // update the delay information of k-th fanins info from the corresponding pin
642 Map_LibraryAddFaninDelays( pLib, pGate, pGate->pFanins[k], pPin );
643 }
644 // if there are some pins left, this is a bug, return fail
645 if ( pPin != NULL )
646 {
647 printf( "There are more pins than gate inputs.\n" );
648 return 0;
649 }
650 // find the max delay
651 pGate->tDelayMax.Rise = pGate->tDelayMax.Fall = MAP_NO_VAR;
652 for ( k = 0; k < pLib->nVarsMax; k++ )
653 {
654 // the rise of the output depends on the rise and fall of the output
655 if ( pGate->tDelayMax.Rise < pGate->tDelaysR[k].Rise )
656 pGate->tDelayMax.Rise = pGate->tDelaysR[k].Rise;
657 if ( pGate->tDelayMax.Rise < pGate->tDelaysR[k].Fall )
658 pGate->tDelayMax.Rise = pGate->tDelaysR[k].Fall;
659 // the fall of the output depends on the rise and fall of the output
660 if ( pGate->tDelayMax.Fall < pGate->tDelaysF[k].Rise )
661 pGate->tDelayMax.Fall = pGate->tDelaysF[k].Rise;
662 if ( pGate->tDelayMax.Fall < pGate->tDelaysF[k].Fall )
663 pGate->tDelayMax.Fall = pGate->tDelaysF[k].Fall;
664
665 pGate->tDelaysF[k].Worst = MAP_MAX( pGate->tDelaysF[k].Fall, pGate->tDelaysF[k].Rise );
666 pGate->tDelaysR[k].Worst = MAP_MAX( pGate->tDelaysR[k].Fall, pGate->tDelaysR[k].Rise );
667 }
668
669 // count gates and area of the supergate
670 pGate->nGates = 1;
671 pGate->Area = (float)Mio_GateReadArea(pGate->pRoot);
672 for ( k = 0; k < (int)pGate->nFanins; k++ )
673 {
674 pGate->nGates += pGate->pFanins[k]->nGates;
675 pGate->Area += pGate->pFanins[k]->Area;
676 }
677 // do not add the gate to the table, if this gate is an internal gate
678 // of some supegate and does not correspond to a supergate output
679 if ( ( !pGate->fSuper ) || pGate->fExclude )
680 continue;
681
682 // find the maximum index of a variable in the support of the supergates
683 // this is important for two reasons:
684 // (1) to limit the number of permutations considered for canonicization
685 // (2) to get rid of equivalence phases to speed-up matching
686 nRealVars = Map_LibraryGetMaxSuperPi_rec( pGate ) + 1;
687 assert( nRealVars > 0 && nRealVars <= pLib->nVarsMax );
688 // if there are some problems with this code, try this instead
689// nRealVars = pLib->nVarsMax;
690
691 // find the N-canonical form of this supergate
692 pGate->nPhases = Map_CanonComputeSlow( pLib->uTruths, pLib->nVarsMax, nRealVars, pGate->uTruth, pGate->uPhases, uCanon );
693 // add the supergate into the table by its N-canonical table
694 Map_SuperTableInsertC( pLib->tTableC, uCanon, pGate );
695/*
696 {
697 int uCanon1, uCanon2;
698 uCanon1 = uCanon[0];
699 pGate->uTruth[0] = ~pGate->uTruth[0];
700 pGate->uTruth[1] = ~pGate->uTruth[1];
701 Map_CanonComputeSlow( pLib->uTruths, pLib->nVarsMax, nRealVars, pGate->uTruth, pGate->uPhases, uCanon );
702 uCanon2 = uCanon[0];
703Rwt_Man5ExploreCount( uCanon1 < uCanon2 ? uCanon1 : uCanon2 );
704 }
705*/
706 }
707 // sort the gates in each line
709
710 // let the glory be manifest
711// Map_LibraryPrintTree( pLib );
712 return 1;
713}
#define MAP_MAX(a, b)
Definition mapperInt.h:58
#define MAP_NO_VAR
Definition mapperInt.h:54
int Map_SuperTableInsertC(Map_HashTable_t *pLib, unsigned uTruthC[], Map_Super_t *pGate)
Definition mapperTable.c:92
void Map_SuperTableSortSupergatesByDelay(Map_HashTable_t *p, int nSupersMax)
int Map_CanonComputeSlow(unsigned uTruths[][2], int nVarsMax, int nVarsReal, unsigned uTruth[], unsigned char *puPhases, unsigned uTruthRes[])
FUNCTION DEFINITIONS ///.
Definition mapperCanon.c:48
Mio_Pin_t * Mio_GateReadPins(Mio_Gate_t *pGate)
Definition mioApi.c:173
void Mio_DeriveTruthTable(Mio_Gate_t *pGate, unsigned uTruthsIn[][2], int nSigns, int nInputs, unsigned uTruthRes[])
Definition mioUtils.c:1036
double Mio_GateReadArea(Mio_Gate_t *pGate)
Definition mioApi.c:171
char * Mio_GateReadName(Mio_Gate_t *pGate)
Definition mioApi.c:169
Mio_Pin_t * Mio_PinReadNext(Mio_Pin_t *pPin)
Definition mioApi.c:217
struct Mio_PinStruct_t_ Mio_Pin_t
Definition mio.h:44
#define st__is_member(table, key)
Definition st.h:70
unsigned uTruths[6][2]
Definition mapperInt.h:188
Map_HashTable_t * tTableC
Definition mapperInt.h:184
Map_Super_t ** ppSupers
Definition mapperInt.h:183
Mio_Gate_t * pRoot
Definition mapperInt.h:292
unsigned uTruth[2]
Definition mapperInt.h:293
Map_Time_t tDelayMax
Definition mapperInt.h:296
Map_Time_t tDelaysF[6]
Definition mapperInt.h:295
Map_Time_t tDelaysR[6]
Definition mapperInt.h:294
unsigned char uPhases[4]
Definition mapperInt.h:289
Map_Super_t * pFanins[6]
Definition mapperInt.h:291
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Map_LibraryPrintSupergate()

void Map_LibraryPrintSupergate ( Map_Super_t * pGate)
extern

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

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 403 of file mapperSuper.c.

404{
405 printf( "%5d : ", pGate->nUsed );
406 printf( "%5d ", pGate->Num );
407 printf( "A = %5.2f ", pGate->Area );
408 printf( "D = %5.2f/%5.2f/%5.2f ", pGate->tDelayMax.Rise, pGate->tDelayMax.Fall, pGate->tDelayMax.Worst );
409 printf( "%s", pGate->pFormula );
410 printf( "\n" );
411}

◆ Map_LibraryPrintTree()

void Map_LibraryPrintTree ( Map_SuperLib_t * pLib)
extern

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

Synopsis [Prints the supergate library after deriving parameters.]

Description [This procedure is very useful to see the library after it has been read into the mapper by "read_super" and all the information about the supergates derived.]

SideEffects []

SeeAlso []

Definition at line 979 of file mapperTree.c.

980{
981 Map_Super_t * pGate;
982 int i, k;
983
984 // print all the info related to the supergates
985// for ( i = pLib->nVarsMax; i < (int)pLib->nLines; i++ )
986 for ( i = pLib->nVarsMax; i < 20; i++ )
987 {
988 pGate = pLib->ppSupers[i];
989
990 // write the gate's fanin info and formula
991 printf( "%6d ", pGate->Num );
992 printf( "%c ", pGate->fSuper? '*' : ' ' );
993 printf( "%6s", Mio_GateReadName(pGate->pRoot) );
994 for ( k = 0; k < (int)pGate->nFanins; k++ )
995 printf( " %6d", pGate->pFanins[k]->Num );
996 printf( " %s", pGate->pFormula );
997 printf( "\n" );
998
999 // write the gate's derived info
1000 Extra_PrintBinary( stdout, pGate->uTruth, 64 );
1001 printf( " %3d", pGate->nGates );
1002 printf( " %6.2f", pGate->Area );
1003 printf( " (%4.2f, %4.2f)", pGate->tDelayMax.Rise, pGate->tDelayMax.Fall );
1004 printf( "\n" );
1005 for ( k = 0; k < pLib->nVarsMax; k++ )
1006 {
1007 // print the constraint on the rise of the gate in the form (D1, D2),
1008 // where D1 is the constraint related to the rise of the k-th PI
1009 // where D2 is the constraint related to the fall of the k-th PI
1010 if ( pGate->tDelaysR[k].Rise < 0 && pGate->tDelaysR[k].Fall < 0 )
1011 printf( " (----, ----)" );
1012 else if ( pGate->tDelaysR[k].Fall < 0 )
1013 printf( " (%4.2f, ----)", pGate->tDelaysR[k].Rise );
1014 else if ( pGate->tDelaysR[k].Rise < 0 )
1015 printf( " (----, %4.2f)", pGate->tDelaysR[k].Fall );
1016 else
1017 printf( " (%4.2f, %4.2f)", pGate->tDelaysR[k].Rise, pGate->tDelaysR[k].Fall );
1018
1019 // print the constraint on the fall of the gate in the form (D1, D2),
1020 // where D1 is the constraint related to the rise of the k-th PI
1021 // where D2 is the constraint related to the fall of the k-th PI
1022 if ( pGate->tDelaysF[k].Rise < 0 && pGate->tDelaysF[k].Fall < 0 )
1023 printf( " (----, ----)" );
1024 else if ( pGate->tDelaysF[k].Fall < 0 )
1025 printf( " (%4.2f, ----)", pGate->tDelaysF[k].Rise );
1026 else if ( pGate->tDelaysF[k].Rise < 0 )
1027 printf( " (----, %4.2f)", pGate->tDelaysF[k].Fall );
1028 else
1029 printf( " (%4.2f, %4.2f)", pGate->tDelaysF[k].Rise, pGate->tDelaysF[k].Fall );
1030 printf( "\n" );
1031 }
1032 printf( "\n" );
1033 }
1034}
void Extra_PrintBinary(FILE *pFile, unsigned Sign[], int nBits)
Here is the call graph for this function:

◆ Map_LibraryRead()

int Map_LibraryRead ( Map_SuperLib_t * pLib,
char * pFileName )
extern

FUNCTION DEFINITIONS ///.

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

Synopsis [Reads the supergate library from file.]

Description []

SideEffects []

SeeAlso []

Definition at line 50 of file mapperSuper.c.

51{
52 FILE * pFile;
53 int Status;
54 // read the beginning of the file
55 assert( pLib->pGenlib == NULL );
56 pFile = fopen( pFileName, "r" );
57 if ( pFile == NULL )
58 {
59 printf( "Cannot open input file \"%s\".\n", pFileName );
60 return 0;
61 }
62 Status = Map_LibraryReadFile( pLib, pFile );
63 fclose( pFile );
64// Map_LibraryPrintClasses( pLib );
65 return Status;
66}
Mio_Library_t * pGenlib
Definition mapperInt.h:173
Here is the caller graph for this function:

◆ Map_LibraryReadFileTreeStr()

int Map_LibraryReadFileTreeStr ( Map_SuperLib_t * pLib,
Mio_Library_t * pGenlib,
Vec_Str_t * vStr,
char * pFileName )
extern

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

Synopsis [Reads the supergate library from file.]

Description []

SideEffects []

SeeAlso []

Definition at line 391 of file mapperTree.c.

392{
393 ProgressBar * pProgress;
394 char pBuffer[5000];
395 Map_Super_t * pGate;
396 char * pTemp = 0, * pLibName;
397 int nCounter, k, i;
398 int RetValue, nPos = 0;
399
400 // skip empty and comment lines
401// while ( fgets( pBuffer, 5000, pFile ) != NULL )
402 while ( 1 )
403 {
404 RetValue = Vec_StrGets( pBuffer, 5000, vStr, &nPos );
405 if ( RetValue == 0 )
406 return 0;
407 // skip leading spaces
408 for ( pTemp = pBuffer; *pTemp == ' ' || *pTemp == '\r' || *pTemp == '\n'; pTemp++ );
409 // skip comment lines and empty lines
410 if ( *pTemp != 0 && *pTemp != '#' )
411 break;
412 }
413
414 pLibName = strtok( pTemp, " \t\r\n" );
415// pLib->pGenlib = (Mio_Library_t *)Abc_FrameReadLibGen();
416 pLib->pGenlib = pGenlib;
417// if ( pLib->pGenlib == NULL || strcmp( , pLibName ) )
418 if ( pLib->pGenlib == NULL || Map_LibraryCompareLibNames(Mio_LibraryReadName(pLib->pGenlib), pLibName) )
419 {
420 printf( "Supergate library \"%s\" requires the use of genlib library \"%s\".\n", pFileName, pLibName );
421 return 0;
422 }
423
424 // read the number of variables
425 RetValue = Vec_StrGets( pBuffer, 5000, vStr, &nPos );
426 if ( RetValue == 0 )
427 return 0;
428 RetValue = sscanf( pBuffer, "%d\n", &pLib->nVarsMax );
429 if ( pLib->nVarsMax < 2 || pLib->nVarsMax > 10 )
430 {
431 printf( "Suspicious number of variables (%d).\n", pLib->nVarsMax );
432 return 0;
433 }
434
435 // read the number of gates
436 RetValue = Vec_StrGets( pBuffer, 5000, vStr, &nPos );
437 if ( RetValue == 0 )
438 return 0;
439 RetValue = sscanf( pBuffer, "%d\n", &pLib->nSupersReal );
440 if ( pLib->nSupersReal < 1 || pLib->nSupersReal > 10000000 )
441 {
442 printf( "Suspicious number of gates (%d).\n", pLib->nSupersReal );
443 return 0;
444 }
445
446 // read the number of lines
447 RetValue = Vec_StrGets( pBuffer, 5000, vStr, &nPos );
448 if ( RetValue == 0 )
449 return 0;
450 RetValue = sscanf( pBuffer, "%d\n", &pLib->nLines );
451 if ( pLib->nLines < 1 || pLib->nLines > 10000000 )
452 {
453 printf( "Suspicious number of lines (%d).\n", pLib->nLines );
454 return 0;
455 }
456
457 // allocate room for supergate pointers
458 pLib->ppSupers = ABC_ALLOC( Map_Super_t *, pLib->nLines + 10000 );
459
460 // create the elementary supergates
461 for ( i = 0; i < pLib->nVarsMax; i++ )
462 {
463 // get a new gate
464 pGate = (Map_Super_t *)Extra_MmFixedEntryFetch( pLib->mmSupers );
465 memset( pGate, 0, sizeof(Map_Super_t) );
466 // assign the elementary variable, the truth table, and the delays
467 pGate->Num = i;
468 // set the truth table
469 pGate->uTruth[0] = pLib->uTruths[i][0];
470 pGate->uTruth[1] = pLib->uTruths[i][1];
471 // set the arrival times of all input to non-existent delay
472 for ( k = 0; k < pLib->nVarsMax; k++ )
473 {
474 pGate->tDelaysR[k].Rise = pGate->tDelaysR[k].Fall = MAP_NO_VAR;
475 pGate->tDelaysF[k].Rise = pGate->tDelaysF[k].Fall = MAP_NO_VAR;
476 }
477 // set an existent arrival time for rise and fall
478 pGate->tDelaysR[i].Rise = 0.0;
479 pGate->tDelaysF[i].Fall = 0.0;
480 // set the gate
481 pLib->ppSupers[i] = pGate;
482 }
483
484 // read the lines
485 nCounter = pLib->nVarsMax;
486 pProgress = Extra_ProgressBarStart( stdout, pLib->nLines );
487// while ( fgets( pBuffer, 5000, pFile ) != NULL )
488 while ( Vec_StrGets( pBuffer, 5000, vStr, &nPos ) )
489 {
490 for ( pTemp = pBuffer; *pTemp == ' ' || *pTemp == '\r' || *pTemp == '\n'; pTemp++ );
491 if ( pTemp[0] == '\0' )
492 continue;
493// if ( pTemp[0] == 'a' || pTemp[2] == 'a' )
494// {
495// pLib->nLines--;
496// continue;
497// }
498
499 // get the gate
500 pGate = Map_LibraryReadGateTree( pLib, pTemp, nCounter, pLib->nVarsMax );
501 if ( pGate == NULL )
502 {
503 Extra_ProgressBarStop( pProgress );
504 return 0;
505 }
506 pLib->ppSupers[nCounter++] = pGate;
507 // later we will derive: truth table, delays, area, number of component gates, etc
508
509 // update the progress bar
510 Extra_ProgressBarUpdate( pProgress, nCounter, NULL );
511 }
512 Extra_ProgressBarStop( pProgress );
513 if ( nCounter != pLib->nLines )
514 printf( "The number of lines read (%d) is different from what the file says (%d).\n", nCounter, pLib->nLines );
515 pLib->nSupersAll = nCounter;
516 // count the number of real supergates
517 nCounter = 0;
518 for ( k = 0; k < pLib->nLines; k++ )
519 nCounter += pLib->ppSupers[k]->fSuper;
520 if ( nCounter != pLib->nSupersReal )
521 printf( "The number of gates read (%d) is different what the file says (%d).\n", nCounter, pLib->nSupersReal );
522 pLib->nSupersReal = nCounter;
523 return 1;
524}
#define ABC_ALLOC(type, num)
Definition abc_global.h:264
ABC_NAMESPACE_IMPL_START typedef char ProgressBar
Definition bbrNtbdd.c:27
void Extra_ProgressBarStop(ProgressBar *p)
ProgressBar * Extra_ProgressBarStart(FILE *pFile, int nItemsTotal)
FUNCTION DEFINITIONS ///.
Map_Super_t * Map_LibraryReadGateTree(Map_SuperLib_t *pLib, char *pBuffer, int Number, int nVarsMax)
FUNCTION DEFINITIONS ///.
Definition mapperTree.c:54
int Vec_StrGets(char *pBuffer, int nBufferSize, Vec_Str_t *vStr, int *pPos)
Definition mapperTree.c:316
int Map_LibraryCompareLibNames(char *pName1, char *pName2)
Definition mapperTree.c:363
char * Mio_LibraryReadName(Mio_Library_t *pLib)
DECLARATIONS ///.
Definition mioApi.c:43
Extra_MmFixed_t * mmSupers
Definition mapperInt.h:199
char * strtok()
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Map_LibraryReadTree()

int Map_LibraryReadTree ( Map_SuperLib_t * pLib,
Mio_Library_t * pGenlib,
char * pFileName,
char * pExcludeFile )
extern

Definition at line 525 of file mapperTree.c.

526{
527 char * pBuffer;
528 Vec_Str_t * vStr;
529 int Status, num;
530 Abc_Frame_t * pAbc;
531 st__table * tExcludeGate = 0;
532
533 // read the beginning of the file
534 assert( pLib->pGenlib == NULL );
535// pFile = Io_FileOpen( pFileName, "open_path", "r", 1 );
536 pBuffer = Mio_ReadFile( pFileName, 0 );
537 if ( pBuffer == NULL )
538 {
539 printf( "Cannot open input file \"%s\".\n", pFileName );
540 return 0;
541 }
542 vStr = Vec_StrAllocArray( pBuffer, strlen(pBuffer) );
543
544 if ( pExcludeFile )
545 {
547
548 tExcludeGate = st__init_table(strcmp, st__strhash);
549 if ( (num = Mio_LibraryReadExclude( pExcludeFile, tExcludeGate )) == -1 )
550 {
551 st__free_table( tExcludeGate );
552 tExcludeGate = 0;
553 Vec_StrFree( vStr );
554 return 0;
555 }
556
557 fprintf ( Abc_FrameReadOut( pAbc ), "Read %d gates from exclude file\n", num );
558 }
559
560 Status = Map_LibraryReadFileTreeStr( pLib, pGenlib, vStr, pFileName );
561 Vec_StrFree( vStr );
562 if ( Status == 0 )
563 return 0;
564 // prepare the info about the library
565 return Map_LibraryDeriveGateInfo( pLib, tExcludeGate );
566}
typedefABC_NAMESPACE_HEADER_START struct Abc_Frame_t_ Abc_Frame_t
INCLUDES ///.
Definition abcapis.h:38
ABC_DLL Abc_Frame_t * Abc_FrameGetGlobalFrame()
Definition mainFrame.c:643
ABC_DLL FILE * Abc_FrameReadOut(Abc_Frame_t *p)
Definition mainFrame.c:359
struct Vec_Str_t_ Vec_Str_t
Definition bblif.c:46
int Map_LibraryDeriveGateInfo(Map_SuperLib_t *pLib, st__table *tExcludeGate)
Definition mapperTree.c:586
int Map_LibraryReadFileTreeStr(Map_SuperLib_t *pLib, Mio_Library_t *pGenlib, Vec_Str_t *vStr, char *pFileName)
Definition mapperTree.c:391
char * Mio_ReadFile(char *FileName, int fAddEnd)
Definition mioRead.c:115
int Mio_LibraryReadExclude(char *ExcludeFile, st__table *tExcludeGate)
Definition mioRead.c:699
int st__strhash(const char *string, int modulus)
Definition st.c:449
st__table * st__init_table(st__compare_func_type compare, st__hash_func_type hash)
Definition st.c:72
void st__free_table(st__table *table)
Definition st.c:81
Definition st.h:52
int strlen()
int strcmp()
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Map_MappingComputeDelayWithFanouts()

float Map_MappingComputeDelayWithFanouts ( Map_Man_t * p)
extern

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

Synopsis [Compute the arrival times.]

Description []

SideEffects []

SeeAlso []

Definition at line 713 of file mapperUtils.c.

714{
715 Map_Node_t * pNode;
716 float Result;
717 int i;
718 for ( i = 0; i < p->vMapObjs->nSize; i++ )
719 {
720 // skip primary inputs
721 pNode = p->vMapObjs->pArray[i];
722 if ( !Map_NodeIsAnd( pNode ) )
723 continue;
724 // skip a secondary node
725 if ( pNode->pRepr )
726 continue;
727 // count the switching nodes
728 if ( pNode->nRefAct[0] > 0 )
729 Map_TimeCutComputeArrival( pNode, pNode->pCutBest[0], 0, MAP_FLOAT_LARGE );
730 if ( pNode->nRefAct[1] > 0 )
731 Map_TimeCutComputeArrival( pNode, pNode->pCutBest[1], 1, MAP_FLOAT_LARGE );
732 }
734 printf( "Max arrival times with fanouts = %10.2f.\n", Result );
735 return Result;
736}
float Map_TimeComputeArrivalMax(Map_Man_t *p)
DECLARATIONS ///.
Definition mapperTime.c:45
float Map_TimeCutComputeArrival(Map_Node_t *pNode, Map_Cut_t *pCut, int fPhase, float tWorstCaseLimit)
Definition mapperTime.c:75
int Map_NodeIsAnd(Map_Node_t *p)
struct Map_NodeStruct_t_ Map_Node_t
Definition mapper.h:41
Map_Node_t * pRepr
Definition mapperInt.h:228
Here is the call graph for this function:

◆ Map_MappingCountDoubles()

int Map_MappingCountDoubles ( Map_Man_t * pMan,
Map_NodeVec_t * vNodes )
extern

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

Synopsis [Counts how many AIG nodes are mapped in both polarities.]

Description []

SideEffects []

SeeAlso []

Definition at line 583 of file mapperUtils.c.

584{
585 Map_Node_t * pNode;
586 int Counter, i;
587 // count the number of equal adjacent nodes
588 Counter = 0;
589 for ( i = 0; i < vNodes->nSize; i++ )
590 {
591 pNode = vNodes->pArray[i];
592 if ( !Map_NodeIsAnd(pNode) )
593 continue;
594 if ( (pNode->nRefAct[0] && pNode->pCutBest[0]) &&
595 (pNode->nRefAct[1] && pNode->pCutBest[1]) )
596 Counter++;
597 }
598 return Counter;
599}
Map_Node_t ** pArray
Definition mapperInt.h:305
Here is the call graph for this function:

◆ Map_MappingCountLevels()

int Map_MappingCountLevels ( Map_Man_t * pMan)
extern

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

Synopsis [Computes the number of logic levels not counting PIs/POs.]

Description []

SideEffects [Note that this procedure will reassign the levels assigned originally by NodeCreate() because it counts the number of levels with choices differently!]

SeeAlso []

Definition at line 105 of file mapperUtils.c.

106{
107 int i, LevelsMax, LevelsCur;
108 // perform the traversal
109 LevelsMax = -1;
110 for ( i = 0; i < pMan->nOutputs; i++ )
111 {
112 LevelsCur = Map_MappingCountLevels_rec( Map_Regular(pMan->pOutputs[i]) );
113 if ( LevelsMax < LevelsCur )
114 LevelsMax = LevelsCur;
115 }
116 for ( i = 0; i < pMan->nOutputs; i++ )
117 Map_MappingUnmark_rec( Map_Regular(pMan->pOutputs[i]) );
118 return LevelsMax;
119}
void Map_MappingUnmark_rec(Map_Node_t *pNode)
Here is the call graph for this function:

◆ Map_MappingCuts()

void Map_MappingCuts ( Map_Man_t * p)
extern

GLOBAL VARIABLES ///.

FUNCTION DEFINITIONS ///

Definition at line 172 of file mapperCut.c.

173{
174 ProgressBar * pProgress;
175 Map_CutTable_t * pTable;
176 Map_Node_t * pNode;
177 int nCuts, nNodes, i;
178 abctime clk = Abc_Clock();
179 // set the elementary cuts for the PI variables
180 assert( p->nVarsMax > 1 && p->nVarsMax < 7 );
181 for ( i = 0; i < p->nInputs; i++ )
182 Map_MappingCutsInput( p, p->pInputs[i] );
183
184 // compute the cuts for the internal nodes
185 nNodes = p->vMapObjs->nSize;
186 pProgress = Extra_ProgressBarStart( stdout, nNodes );
187 pTable = Map_CutTableStart( p );
188 for ( i = 0; i < nNodes; i++ )
189 {
190 pNode = p->vMapObjs->pArray[i];
191 if ( Map_NodeIsBuf(pNode) )
192 Map_MappingCutsInput( p, pNode );
193 else if ( Map_NodeIsAnd(pNode) )
194 Map_CutCompute( p, pTable, pNode );
195 else continue;
196 Extra_ProgressBarUpdate( pProgress, i, "Cuts ..." );
197 }
198 Extra_ProgressBarStop( pProgress );
199 Map_CutTableStop( pTable );
200
201 // report the stats
202 if ( p->fVerbose )
203 {
204 nCuts = Map_MappingCountAllCuts(p);
205 printf( "Nodes = %6d. Total %d-feasible cuts = %10d. Per node = %.1f. ",
206 p->nNodes, p->nVarsMax, nCuts, ((float)nCuts)/p->nNodes );
207 ABC_PRT( "Time", Abc_Clock() - clk );
208 }
209
210 // print the cuts for the first primary output
211// Map_CutListPrint( p, Map_Regular(p->pOutputs[0]) );
212}
ABC_INT64_T abctime
Definition abc_global.h:332
#define ABC_PRT(a, t)
Definition abc_global.h:255
int Map_MappingCountAllCuts(Map_Man_t *pMan)
FUNCTION DEFINITIONS ///.
Definition mapperCut.c:100
void Map_MappingCutsInput(Map_Man_t *p, Map_Node_t *pNode)
Definition mapperCut.c:158
struct Map_CutTableStrutct_t Map_CutTable_t
Definition mapperCut.c:34
int Map_NodeIsBuf(Map_Node_t *p)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Map_MappingDfs()

Map_NodeVec_t * Map_MappingDfs ( Map_Man_t * pMan,
int fCollectEquiv )
extern

Definition at line 77 of file mapperUtils.c.

78{
79 Map_NodeVec_t * vNodes;
80 int i;
81 // perform the traversal
82 vNodes = Map_NodeVecAlloc( 100 );
83 for ( i = 0; i < pMan->nOutputs; i++ )
84 Map_MappingDfs_rec( Map_Regular(pMan->pOutputs[i]), vNodes, fCollectEquiv );
85 for ( i = 0; i < vNodes->nSize; i++ )
86 vNodes->pArray[i]->fMark0 = 0;
87// for ( i = 0; i < pMan->nOutputs; i++ )
88// Map_MappingUnmark_rec( Map_Regular(pMan->pOutputs[i]) );
89 return vNodes;
90}
Map_NodeVec_t * Map_NodeVecAlloc(int nCap)
FUNCTION DEFINITIONS ///.
Definition mapperVec.c:45
void Map_MappingDfs_rec(Map_Node_t *pNode, Map_NodeVec_t *vNodes, int fCollectEquiv)
FUNCTION DEFINITIONS ///.
Definition mapperUtils.c:56
struct Map_NodeVecStruct_t_ Map_NodeVec_t
Definition mapper.h:42
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Map_MappingEstimateRefs()

void Map_MappingEstimateRefs ( Map_Man_t * p)
extern

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

Synopsis [Sets the estimated reference counter.]

Description [When this procedure is called for the first time, the reference counter is estimated from the AIG. Otherwise, it is a linear combination of reference counters in the last two iterations.]

SideEffects []

SeeAlso []

Definition at line 151 of file mapperRefs.c.

152{
153 Map_Node_t * pNode;
154 int i;
155 for ( i = 0; i < p->vMapObjs->nSize; i++ )
156 {
157 pNode = p->vMapObjs->pArray[i];
158// pNode->nRefEst[0] = (float)((2.0 * pNode->nRefEst[0] + 1.0 * pNode->nRefAct[0]) / 3.0);
159// pNode->nRefEst[1] = (float)((2.0 * pNode->nRefEst[1] + 1.0 * pNode->nRefAct[1]) / 3.0);
160// pNode->nRefEst[2] = (float)((2.0 * pNode->nRefEst[2] + 1.0 * pNode->nRefAct[2]) / 3.0);
161 pNode->nRefEst[0] = (float)((3.0 * pNode->nRefEst[0] + 1.0 * pNode->nRefAct[0]) / 4.0);
162 pNode->nRefEst[1] = (float)((3.0 * pNode->nRefEst[1] + 1.0 * pNode->nRefAct[1]) / 4.0);
163 pNode->nRefEst[2] = (float)((3.0 * pNode->nRefEst[2] + 1.0 * pNode->nRefAct[2]) / 4.0);
164 }
165}
Here is the caller graph for this function:

◆ Map_MappingEstimateRefsInit()

void Map_MappingEstimateRefsInit ( Map_Man_t * p)
extern

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

Synopsis [Sets the estimated reference counter for the PIs.]

Description []

SideEffects []

SeeAlso []

Definition at line 126 of file mapperRefs.c.

127{
128 Map_Node_t * pNode;
129 int i;
130 for ( i = 0; i < p->vMapObjs->nSize; i++ )
131 {
132 pNode = p->vMapObjs->pArray[i];
133// pNode->nRefEst[0] = pNode->nRefEst[1] = ((float)pNode->nRefs)*(float)2.0;
134 pNode->nRefEst[0] = pNode->nRefEst[1] = pNode->nRefEst[2] = ((float)pNode->nRefs);
135 }
136}
Here is the caller graph for this function:

◆ Map_MappingExpandTruth()

void Map_MappingExpandTruth ( unsigned uTruth[2],
int nVars )
extern

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

Synopsis [Expand the truth table]

Description []

SideEffects []

SeeAlso []

Definition at line 670 of file mapperUtils.c.

671{
672 assert( nVars < 7 );
673 if ( nVars == 6 )
674 return;
675 if ( nVars < 5 )
676 {
677 uTruth[0] &= MAP_MASK( (1<<nVars) );
678 uTruth[0] = Map_MappingExpandTruth_rec( uTruth[0], nVars );
679 }
680 uTruth[1] = uTruth[0];
681}
#define MAP_MASK(n)
INCLUDES ///.
Definition mapperInt.h:52

◆ Map_MappingGetArea()

float Map_MappingGetArea ( Map_Man_t * pMan)
extern

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

Synopsis [Computes the array of mapping.]

Description []

SideEffects []

SeeAlso []

Definition at line 485 of file mapperRefs.c.

486{
487 Map_Node_t * pNode;
488 float Area = 0.0;
489 int i;
490 if ( pMan->fUseProfile )
491 Mio_LibraryCleanProfile2( pMan->pSuperLib->pGenlib );
492 for ( i = 0; i < pMan->vMapObjs->nSize; i++ )
493 {
494 pNode = pMan->vMapObjs->pArray[i];
495 if ( pNode->nRefAct[2] == 0 )
496 continue;
497 if ( Map_NodeIsBuf(pNode) )
498 continue;
499 // at least one phase has the best cut assigned
500 assert( pNode->pCutBest[0] != NULL || pNode->pCutBest[1] != NULL );
501 // at least one phase is used in the mapping
502 assert( pNode->nRefAct[0] > 0 || pNode->nRefAct[1] > 0 );
503 // compute the array due to the supergate
504 if ( Map_NodeIsAnd(pNode) )
505 {
506 // count area of the negative phase
507 if ( pNode->pCutBest[0] && (pNode->nRefAct[0] > 0 || pNode->pCutBest[1] == NULL) )
508 {
509 Area += pNode->pCutBest[0]->M[0].pSuperBest->Area;
510 if ( pMan->fUseProfile )
512 }
513 // count area of the positive phase
514 if ( pNode->pCutBest[1] && (pNode->nRefAct[1] > 0 || pNode->pCutBest[0] == NULL) )
515 {
516 Area += pNode->pCutBest[1]->M[1].pSuperBest->Area;
517 if ( pMan->fUseProfile )
519 }
520 }
521 // count area of the interver if we need to implement one phase with another phase
522 if ( (pNode->pCutBest[0] == NULL && pNode->nRefAct[0] > 0) ||
523 (pNode->pCutBest[1] == NULL && pNode->nRefAct[1] > 0) )
524 Area += pMan->pSuperLib->AreaInv;
525 }
526 // add buffers for each CO driven by a CI
527 for ( i = 0; i < pMan->nOutputs; i++ )
528 if ( Map_NodeIsVar(pMan->pOutputs[i]) && !Map_IsComplement(pMan->pOutputs[i]) )
529 Area += pMan->pSuperLib->AreaBuf;
530 return Area;
531}
int Map_NodeIsVar(Map_Node_t *p)
void Mio_LibraryCleanProfile2(Mio_Library_t *pLib)
Definition mioUtils.c:1616
void Mio_GateIncProfile2(Mio_Gate_t *pGate)
Definition mioApi.c:191
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Map_MappingGetAreaFlow()

float Map_MappingGetAreaFlow ( Map_Man_t * p)
extern

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

Synopsis [Computes the total are flow of the network.]

Description []

SideEffects []

SeeAlso []

Definition at line 487 of file mapperUtils.c.

488{
489 Map_Node_t * pNode;
490 Map_Cut_t * pCut;
491 float aFlowFlowTotal = 0;
492 int fPosPol, i;
493 for ( i = 0; i < p->nOutputs; i++ )
494 {
495 pNode = Map_Regular(p->pOutputs[i]);
496 if ( !Map_NodeIsAnd(pNode) )
497 continue;
498 fPosPol = !Map_IsComplement(p->pOutputs[i]);
499 pCut = pNode->pCutBest[fPosPol];
500 if ( pCut == NULL )
501 {
502 fPosPol = !fPosPol;
503 pCut = pNode->pCutBest[fPosPol];
504 }
505 aFlowFlowTotal += pNode->pCutBest[fPosPol]->M[fPosPol].AreaFlow;
506 }
507 return aFlowFlowTotal;
508}
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Map_MappingGetMaxLevel()

int Map_MappingGetMaxLevel ( Map_Man_t * pMan)
extern

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

Synopsis [Sets up the mask.]

Description []

SideEffects []

SeeAlso []

Definition at line 750 of file mapperUtils.c.

751{
752 int nLevelMax, i;
753 nLevelMax = 0;
754 for ( i = 0; i < pMan->nOutputs; i++ )
755 nLevelMax = ((unsigned)nLevelMax) > Map_Regular(pMan->pOutputs[i])->Level?
756 nLevelMax : Map_Regular(pMan->pOutputs[i])->Level;
757 return nLevelMax;
758}
Here is the caller graph for this function:

◆ Map_MappingGetSwitching()

float Map_MappingGetSwitching ( Map_Man_t * pMan)
extern

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

Synopsis [Computes the array of mapping.]

Description []

SideEffects []

SeeAlso []

Definition at line 187 of file mapperSwitch.c.

188{
189 Map_Node_t * pNode;
190 float Switch = 0.0;
191 int i;
192 for ( i = 0; i < pMan->vMapObjs->nSize; i++ )
193 {
194 pNode = pMan->vMapObjs->pArray[i];
195 if ( pNode->nRefAct[2] == 0 )
196 continue;
197 // at least one phase has the best cut assigned
198 assert( pNode->pCutBest[0] != NULL || pNode->pCutBest[1] != NULL );
199 // at least one phase is used in the mapping
200 assert( pNode->nRefAct[0] > 0 || pNode->nRefAct[1] > 0 );
201 // compute the array due to the supergate
202 if ( Map_NodeIsAnd(pNode) )
203 {
204 // count switching of the negative phase
205 if ( pNode->pCutBest[0] && (pNode->nRefAct[0] > 0 || pNode->pCutBest[1] == NULL) )
206 Switch += pNode->Switching;
207 // count switching of the positive phase
208 if ( pNode->pCutBest[1] && (pNode->nRefAct[1] > 0 || pNode->pCutBest[0] == NULL) )
209 Switch += pNode->Switching;
210 }
211 // count switching of the interver if we need to implement one phase with another phase
212 if ( (pNode->pCutBest[0] == NULL && pNode->nRefAct[0] > 0) ||
213 (pNode->pCutBest[1] == NULL && pNode->nRefAct[1] > 0) )
214 Switch += pNode->Switching; // inverter switches the same as the node
215 }
216 // add buffers for each CO driven by a CI
217 for ( i = 0; i < pMan->nOutputs; i++ )
218 if ( Map_NodeIsVar(pMan->pOutputs[i]) && !Map_IsComplement(pMan->pOutputs[i]) )
219 Switch += pMan->pOutputs[i]->Switching;
220 return Switch;
221}
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Map_MappingMark_rec()

void Map_MappingMark_rec ( Map_Node_t * pNode)
extern

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

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 207 of file mapperUtils.c.

208{
209 assert( !Map_IsComplement(pNode) );
210 if ( pNode->fMark0 == 1 )
211 return;
212 pNode->fMark0 = 1;
213 if ( !Map_NodeIsAnd(pNode) )
214 return;
215 // visit the transitive fanin of the selected cut
218}
void Map_MappingMark_rec(Map_Node_t *pNode)
Map_Node_t * p2
Definition mapperInt.h:226
Map_Node_t * p1
Definition mapperInt.h:225
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Map_MappingMatches()

int Map_MappingMatches ( Map_Man_t * p)
extern

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

Synopsis [Computes the best matches of the nodes.]

Description [Uses parameter p->fMappingMode to decide how to assign the matches for both polarities of the node. While the matches are being assigned, one of them may turn out to be better than the other (in terms of delay, for example). In this case, the worse match can be permanently dropped, and the corresponding pointer set to NULL.]

SideEffects []

SeeAlso []

Definition at line 581 of file mapperMatch.c.

582{
583 ProgressBar * pProgress;
584 Map_Node_t * pNode;
585 int i;
586
587 assert( p->fMappingMode >= 0 && p->fMappingMode <= 4 );
588
589 // use the externally given PI arrival times
590 if ( p->fMappingMode == 0 )
592
593 // estimate the fanouts
594 if ( p->fMappingMode == 0 )
596 else if ( p->fMappingMode == 1 )
598
599 // the PI cuts are matched in the cut computation package
600 // in the loop below we match the internal nodes
601 pProgress = Extra_ProgressBarStart( stdout, p->vMapObjs->nSize );
602 for ( i = 0; i < p->vMapObjs->nSize; i++ )
603 {
604 pNode = p->vMapObjs->pArray[i];
605 if ( Map_NodeIsBuf(pNode) )
606 {
607 assert( pNode->p2 == NULL );
608 pNode->tArrival[0] = Map_Regular(pNode->p1)->tArrival[ Map_IsComplement(pNode->p1)];
609 pNode->tArrival[1] = Map_Regular(pNode->p1)->tArrival[!Map_IsComplement(pNode->p1)];
610 continue;
611 }
612
613 // skip primary inputs and secondary nodes if mapping with choices
614 if ( !Map_NodeIsAnd( pNode ) || pNode->pRepr )
615 continue;
616
617 // make sure that at least one non-trival cut is present
618 if ( pNode->pCuts->pNext == NULL )
619 {
620 Extra_ProgressBarStop( pProgress );
621 printf( "\nError: A node in the mapping graph does not have feasible cuts.\n" );
622 return 0;
623 }
624
625 // match negative phase
626 if ( !Map_MatchNodePhase( p, pNode, 0 ) )
627 {
628 Extra_ProgressBarStop( pProgress );
629 return 0;
630 }
631 // match positive phase
632 if ( !Map_MatchNodePhase( p, pNode, 1 ) )
633 {
634 Extra_ProgressBarStop( pProgress );
635 return 0;
636 }
637
638 // make sure that at least one phase is mapped
639 if ( pNode->pCutBest[0] == NULL && pNode->pCutBest[1] == NULL )
640 {
641 printf( "\nError: Could not match both phases of AIG node %d.\n", pNode->Num );
642 printf( "Please make sure that the supergate library has equivalents of AND2 or NAND2.\n" );
643 printf( "If such supergates exist in the library, report a bug.\n" );
644 Extra_ProgressBarStop( pProgress );
645 return 0;
646 }
647
648 // if both phases are assigned, check if one of them can be dropped
650 // set the arrival times of the node using the best cuts
652
653 // update the progress bar
654 Extra_ProgressBarUpdate( pProgress, i, "Matches ..." );
655 }
656 Extra_ProgressBarStop( pProgress );
657 return 1;
658}
void Map_MappingEstimateRefsInit(Map_Man_t *p)
Definition mapperRefs.c:126
void Map_MappingEstimateRefs(Map_Man_t *p)
Definition mapperRefs.c:151
int Map_MatchNodePhase(Map_Man_t *p, Map_Node_t *pNode, int fPhase)
void Map_NodeTransferArrivalTimes(Map_Man_t *p, Map_Node_t *pNode)
void Map_MappingSetPiArrivalTimes(Map_Man_t *p)
void Map_NodeTryDroppingOnePhase(Map_Man_t *p, Map_Node_t *pNode)
Map_Time_t tArrival[2]
Definition mapperInt.h:239
Map_Cut_t * pCuts
Definition mapperInt.h:244
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Map_MappingNodeIsViolator()

int Map_MappingNodeIsViolator ( Map_Node_t * pNode,
Map_Cut_t * pCut,
int fPosPol )
extern

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

Synopsis [Returns 1 if current mapping of the node violates fanout limits.]

Description []

SideEffects []

SeeAlso []

Definition at line 471 of file mapperUtils.c.

472{
473 return pNode->nRefAct[fPosPol] > (int)pCut->M[fPosPol].pSuperBest->nFanLimit;
474}

◆ Map_MappingPrintOutputArrivals()

void Map_MappingPrintOutputArrivals ( Map_Man_t * p)
extern

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

Synopsis [Prints a bunch of latest arriving outputs.]

Description []

SideEffects []

SeeAlso []

Definition at line 289 of file mapperUtils.c.

290{
291 int pSorted[MAP_CO_LIST_SIZE];
292 Map_Time_t * pTimes;
293 Map_Node_t * pNode;
294 int fPhase, Limit, i;
295 int MaxNameSize;
296
297 // determine the number of nodes to print
298 Limit = (p->nOutputs > MAP_CO_LIST_SIZE)? MAP_CO_LIST_SIZE : p->nOutputs;
299
300 // determine the order
301 Map_MappingFindLatest( p, pSorted, Limit );
302
303 // determine max size of the node's name
304 MaxNameSize = 0;
305 for ( i = 0; i < Limit; i++ )
306 if ( MaxNameSize < (int)strlen(p->ppOutputNames[pSorted[i]]) )
307 MaxNameSize = strlen(p->ppOutputNames[pSorted[i]]);
308
309 // print the latest outputs
310 for ( i = 0; i < Limit; i++ )
311 {
312 // get the i-th latest output
313 pNode = Map_Regular(p->pOutputs[pSorted[i]]);
314 fPhase =!Map_IsComplement(p->pOutputs[pSorted[i]]);
315 pTimes = pNode->tArrival + fPhase;
316 // print out the best arrival time
317 printf( "Output %-*s : ", MaxNameSize + 3, p->ppOutputNames[pSorted[i]] );
318 printf( "Delay = (%5.2f, %5.2f) ", (double)pTimes->Rise, (double)pTimes->Fall );
319 printf( "%s", fPhase? "POS" : "NEG" );
320 printf( "\n" );
321 }
322}
#define MAP_CO_LIST_SIZE
DECLARATIONS ///.
Definition mapperUtils.c:28
struct Map_TimeStruct_t_ Map_Time_t
Definition mapper.h:49
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Map_MappingPrintSwitching()

float Map_MappingPrintSwitching ( Map_Man_t * pMan)
extern

◆ Map_MappingPrintWirelength()

float Map_MappingPrintWirelength ( Map_Man_t * p)
extern

◆ Map_MappingReportChoices()

void Map_MappingReportChoices ( Map_Man_t * pMan)
extern

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

Synopsis [Reports statistics on choice nodes.]

Description [The number of choice nodes is the number of primary nodes, which has pNextE set to a pointer. The number of choices is the number of entries in the equivalent-node lists of the primary nodes.]

SideEffects []

SeeAlso []

Definition at line 842 of file mapperUtils.c.

843{
844 Map_Node_t * pNode, * pTemp;
845 int nChoiceNodes, nChoices;
846 int i, LevelMax1, LevelMax2;
847
848 // report the number of levels
849 LevelMax1 = Map_MappingGetMaxLevel( pMan );
850 pMan->nTravIds++;
851 for ( i = 0; i < pMan->nOutputs; i++ )
852 Map_MappingUpdateLevel_rec( pMan, Map_Regular(pMan->pOutputs[i]), 0 );
853 LevelMax2 = Map_MappingGetMaxLevel( pMan );
854
855 // report statistics about choices
856 nChoiceNodes = nChoices = 0;
857 for ( i = 0; i < pMan->vMapObjs->nSize; i++ )
858 {
859 pNode = pMan->vMapObjs->pArray[i];
860 if ( pNode->pRepr == NULL && pNode->pNextE != NULL )
861 { // this is a choice node = the primary node that has equivalent nodes
862 nChoiceNodes++;
863 for ( pTemp = pNode; pTemp; pTemp = pTemp->pNextE )
864 nChoices++;
865 }
866 }
867 printf( "Maximum level: Original = %d. Reduced due to choices = %d.\n", LevelMax1, LevelMax2 );
868 printf( "Choice stats: Choice nodes = %d. Total choices = %d.\n", nChoiceNodes, nChoices );
869}
int Map_MappingGetMaxLevel(Map_Man_t *pMan)
int Map_MappingUpdateLevel_rec(Map_Man_t *pMan, Map_Node_t *pNode, int fMaximum)
Map_Node_t * pNextE
Definition mapperInt.h:227
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Map_MappingSetChoiceLevels()

void Map_MappingSetChoiceLevels ( Map_Man_t * pMan)
extern

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

Synopsis [Resets the levels of the nodes in the choice graph.]

Description [Makes the level of the choice nodes to be equal to the maximum of the level of the nodes in the equivalence class. This way sorting by level leads to the reverse topological order, which is needed for the required time computation.]

SideEffects []

SeeAlso []

Definition at line 821 of file mapperUtils.c.

822{
823 int i;
824 pMan->nTravIds++;
825 for ( i = 0; i < pMan->nOutputs; i++ )
826 Map_MappingUpdateLevel_rec( pMan, Map_Regular(pMan->pOutputs[i]), 1 );
827}
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Map_MappingSetPlacementInfo()

void Map_MappingSetPlacementInfo ( Map_Man_t * p)
extern

◆ Map_MappingSetRefs()

void Map_MappingSetRefs ( Map_Man_t * pMan)
extern

Definition at line 450 of file mapperRefs.c.

451{
452 Map_Node_t * pNode;
453 int i;
454 if ( pMan->fUseProfile )
455 Mio_LibraryCleanProfile2( pMan->pSuperLib->pGenlib );
456 // clean all references
457 for ( i = 0; i < pMan->vMapObjs->nSize; i++ )
458 {
459 pNode = pMan->vMapObjs->pArray[i];
460 pNode->nRefAct[0] = 0;
461 pNode->nRefAct[1] = 0;
462 pNode->nRefAct[2] = 0;
463 }
464 // visit nodes reachable from POs in the DFS order through the best cuts
465 for ( i = 0; i < pMan->nOutputs; i++ )
466 {
467 pNode = pMan->pOutputs[i];
468 if ( !Map_NodeIsConst(pNode) )
469 Map_MappingSetRefs_rec( pMan, pNode );
470 }
471}
void Map_MappingSetRefs_rec(Map_Man_t *pMan, Map_Node_t *pNode)
Definition mapperRefs.c:410
int Map_NodeIsConst(Map_Node_t *p)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Map_MappingSetupMask()

void Map_MappingSetupMask ( unsigned uMask[],
int nVarsMax )
extern

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

Synopsis [Sets up the mask.]

Description []

SideEffects []

SeeAlso []

Definition at line 402 of file mapperUtils.c.

403{
404 if ( nVarsMax == 6 )
405 uMask[0] = uMask[1] = MAP_FULL;
406 else
407 {
408 uMask[0] = MAP_MASK(1 << nVarsMax);
409 uMask[1] = 0;
410 }
411}
#define MAP_FULL
Definition mapperInt.h:53

◆ Map_MappingSortByLevel()

void Map_MappingSortByLevel ( Map_Man_t * pMan,
Map_NodeVec_t * vNodes )
extern

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

Synopsis [Orders the nodes in the decreasing order of levels.]

Description []

SideEffects []

SeeAlso []

Definition at line 544 of file mapperUtils.c.

545{
546 qsort( (void *)vNodes->pArray, (size_t)vNodes->nSize, sizeof(Map_Node_t *),
547 (int (*)(const void *, const void *)) Map_CompareNodesByLevel );
548// assert( Map_CompareNodesByLevel( vNodes->pArray, vNodes->pArray + vNodes->nSize - 1 ) <= 0 );
549}
int Map_CompareNodesByLevel(Map_Node_t **ppS1, Map_Node_t **ppS2)
Here is the call graph for this function:

◆ Map_MappingTruths()

void Map_MappingTruths ( Map_Man_t * pMan)
extern

FUNCTION DEFINITIONS ///.

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

Synopsis [Derives truth tables for each cut.]

Description []

SideEffects []

SeeAlso []

Definition at line 47 of file mapperTruth.c.

48{
49 ProgressBar * pProgress;
50 Map_Node_t * pNode;
51 Map_Cut_t * pCut;
52 int nNodes, i;
53 // compute the cuts for the POs
54 nNodes = pMan->vMapObjs->nSize;
55 pProgress = Extra_ProgressBarStart( stdout, nNodes );
56 for ( i = 0; i < nNodes; i++ )
57 {
58 pNode = pMan->vMapObjs->pArray[i];
59 if ( !Map_NodeIsAnd( pNode ) )
60 continue;
61 assert( pNode->pCuts );
62 assert( pNode->pCuts->nLeaves == 1 );
63
64 // match the simple cut
65 pNode->pCuts->M[0].uPhase = 0;
66 pNode->pCuts->M[0].pSupers = pMan->pSuperLib->pSuperInv;
67 pNode->pCuts->M[0].uPhaseBest = 0;
68 pNode->pCuts->M[0].pSuperBest = pMan->pSuperLib->pSuperInv;
69
70 pNode->pCuts->M[1].uPhase = 0;
71 pNode->pCuts->M[1].pSupers = pMan->pSuperLib->pSuperInv;
72 pNode->pCuts->M[1].uPhaseBest = 1;
73 pNode->pCuts->M[1].pSuperBest = pMan->pSuperLib->pSuperInv;
74
75 // match the rest of the cuts
76 for ( pCut = pNode->pCuts->pNext; pCut; pCut = pCut->pNext )
77 Map_TruthsCut( pMan, pCut );
78 Extra_ProgressBarUpdate( pProgress, i, "Tables ..." );
79 }
80 Extra_ProgressBarStop( pProgress );
81}
Map_Super_t * pSupers
Definition mapperInt.h:253
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Map_MappingUnmark()

void Map_MappingUnmark ( Map_Man_t * pMan)
extern

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

Synopsis [Unmarks the nodes.]

Description []

SideEffects []

SeeAlso []

Definition at line 163 of file mapperUtils.c.

164{
165 int i;
166 for ( i = 0; i < pMan->nOutputs; i++ )
167 Map_MappingUnmark_rec( Map_Regular(pMan->pOutputs[i]) );
168}
Here is the call graph for this function:

◆ Map_MappingUnmark_rec()

void Map_MappingUnmark_rec ( Map_Node_t * pNode)
extern

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

Synopsis [Recursively unmarks the nodes.]

Description []

SideEffects []

SeeAlso []

Definition at line 181 of file mapperUtils.c.

182{
183 assert( !Map_IsComplement(pNode) );
184 if ( pNode->fMark0 == 0 )
185 return;
186 pNode->fMark0 = 0;
187 if ( !Map_NodeIsAnd(pNode) )
188 return;
191 // visit the equivalent nodes
192 if ( pNode->pNextE )
194}
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Map_MappingWireReport()

void Map_MappingWireReport ( Map_Man_t * p)
extern

◆ Map_NodeAddFaninFanout()

void Map_NodeAddFaninFanout ( Map_Node_t * pFanin,
Map_Node_t * pFanout )
extern
Here is the caller graph for this function:

◆ Map_NodeGetFanoutNum()

int Map_NodeGetFanoutNum ( Map_Node_t * pNode)
extern

◆ Map_NodeGetLeafPhase()

int Map_NodeGetLeafPhase ( Map_Node_t * pNode,
int fPhase,
int iLeaf )
extern

function*************************************************************

synopsis [Computes the exact area associated with the cut.]

description []

sideeffects []

seealso []

Definition at line 148 of file mapperCutUtils.c.

149{
150 assert( pNode->pCutBest[fPhase]->M[fPhase].pSuperBest );
151 return (( pNode->pCutBest[fPhase]->M[fPhase].uPhaseBest & (1<<iLeaf) ) == 0);
152}

◆ Map_NodeRemoveFaninFanout()

void Map_NodeRemoveFaninFanout ( Map_Node_t * pFanin,
Map_Node_t * pFanoutToRemove )
extern

◆ Map_NodeVecAlloc()

Map_NodeVec_t * Map_NodeVecAlloc ( int nCap)
extern

FUNCTION DEFINITIONS ///.

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

Synopsis [Allocates a vector with the given capacity.]

Description []

SideEffects []

SeeAlso []

Definition at line 45 of file mapperVec.c.

46{
49 if ( nCap > 0 && nCap < 16 )
50 nCap = 16;
51 p->nSize = 0;
52 p->nCap = nCap;
53 p->pArray = p->nCap? ABC_ALLOC( Map_Node_t *, p->nCap ) : NULL;
54 return p;
55}
Here is the caller graph for this function:

◆ Map_NodeVecClear()

void Map_NodeVecClear ( Map_NodeVec_t * p)
extern

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

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 174 of file mapperVec.c.

175{
176 p->nSize = 0;
177}

◆ Map_NodeVecDup()

Map_NodeVec_t * Map_NodeVecDup ( Map_NodeVec_t * p)
extern

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

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 87 of file mapperVec.c.

88{
89 Map_NodeVec_t * pNew = Map_NodeVecAlloc( p->nSize );
90 memcpy( pNew->pArray, p->pArray, sizeof(int) * p->nSize );
91 pNew->nSize = p->nSize;
92 return pNew;
93}
Map_NodeVec_t * Map_NodeVecAlloc(int nCap)
FUNCTION DEFINITIONS ///.
Definition mapperVec.c:45
char * memcpy()
Here is the call graph for this function:

◆ Map_NodeVecFree()

void Map_NodeVecFree ( Map_NodeVec_t * p)
extern

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

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 68 of file mapperVec.c.

69{
70 if ( p == NULL )
71 return;
72 ABC_FREE( p->pArray );
73 ABC_FREE( p );
74}
#define ABC_FREE(obj)
Definition abc_global.h:267
Here is the caller graph for this function:

◆ Map_NodeVecGrow()

void Map_NodeVecGrow ( Map_NodeVec_t * p,
int nCapMin )
extern

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

Synopsis [Resizes the vector to the given capacity.]

Description []

SideEffects []

SeeAlso []

Definition at line 138 of file mapperVec.c.

139{
140 if ( p->nCap >= nCapMin )
141 return;
142 p->pArray = ABC_REALLOC( Map_Node_t *, p->pArray, nCapMin );
143 p->nCap = nCapMin;
144}
#define ABC_REALLOC(type, obj, num)
Definition abc_global.h:268
Here is the caller graph for this function:

◆ Map_NodeVecPop()

Map_Node_t * Map_NodeVecPop ( Map_NodeVec_t * p)
extern

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

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 234 of file mapperVec.c.

235{
236 return p->pArray[--p->nSize];
237}

◆ Map_NodeVecPush()

void Map_NodeVecPush ( Map_NodeVec_t * p,
Map_Node_t * Entry )
extern

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

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 190 of file mapperVec.c.

191{
192 if ( p->nSize == p->nCap )
193 {
194 if ( p->nCap < 16 )
195 Map_NodeVecGrow( p, 16 );
196 else
197 Map_NodeVecGrow( p, 2 * p->nCap );
198 }
199 p->pArray[p->nSize++] = Entry;
200}
void Map_NodeVecGrow(Map_NodeVec_t *p, int nCapMin)
Definition mapperVec.c:138
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Map_NodeVecPushUnique()

int Map_NodeVecPushUnique ( Map_NodeVec_t * p,
Map_Node_t * Entry )
extern

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

Synopsis [Add the element while ensuring uniqueness.]

Description [Returns 1 if the element was found, and 0 if it was new. ]

SideEffects []

SeeAlso []

Definition at line 213 of file mapperVec.c.

214{
215 int i;
216 for ( i = 0; i < p->nSize; i++ )
217 if ( p->pArray[i] == Entry )
218 return 1;
219 Map_NodeVecPush( p, Entry );
220 return 0;
221}
void Map_NodeVecPush(Map_NodeVec_t *p, Map_Node_t *Entry)
Definition mapperVec.c:190
Here is the call graph for this function:

◆ Map_NodeVecReadArray()

Map_Node_t ** Map_NodeVecReadArray ( Map_NodeVec_t * p)
extern

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

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 106 of file mapperVec.c.

107{
108 return p->pArray;
109}
Here is the caller graph for this function:

◆ Map_NodeVecReadEntry()

Map_Node_t * Map_NodeVecReadEntry ( Map_NodeVec_t * p,
int i )
extern

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

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 290 of file mapperVec.c.

291{
292 assert( i >= 0 && i < p->nSize );
293 return p->pArray[i];
294}

◆ Map_NodeVecReadSize()

int Map_NodeVecReadSize ( Map_NodeVec_t * p)
extern

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

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 122 of file mapperVec.c.

123{
124 return p->nSize;
125}
Here is the caller graph for this function:

◆ Map_NodeVecRemove()

void Map_NodeVecRemove ( Map_NodeVec_t * p,
Map_Node_t * Entry )
extern

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

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 250 of file mapperVec.c.

251{
252 int i;
253 for ( i = 0; i < p->nSize; i++ )
254 if ( p->pArray[i] == Entry )
255 break;
256 assert( i < p->nSize );
257 for ( i++; i < p->nSize; i++ )
258 p->pArray[i-1] = p->pArray[i];
259 p->nSize--;
260}

◆ Map_NodeVecShrink()

void Map_NodeVecShrink ( Map_NodeVec_t * p,
int nSizeNew )
extern

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

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 157 of file mapperVec.c.

158{
159 assert( p->nSize >= nSizeNew );
160 p->nSize = nSizeNew;
161}

◆ Map_NodeVecSortByLevel()

void Map_NodeVecSortByLevel ( Map_NodeVec_t * p)
extern

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

Synopsis [Sorting the entries by their integer value.]

Description []

SideEffects []

SeeAlso []

Definition at line 307 of file mapperVec.c.

308{
309 qsort( (void *)p->pArray, (size_t)p->nSize, sizeof(Map_Node_t *),
310 (int (*)(const void *, const void *)) Map_NodeVecCompareLevels );
311}

◆ Map_NodeVecWriteEntry()

void Map_NodeVecWriteEntry ( Map_NodeVec_t * p,
int i,
Map_Node_t * Entry )
extern

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

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 273 of file mapperVec.c.

274{
275 assert( i >= 0 && i < p->nSize );
276 p->pArray[i] = Entry;
277}

◆ Map_SuperLibCreate()

Map_SuperLib_t * Map_SuperLibCreate ( Mio_Library_t * pGenlib,
Vec_Str_t * vStr,
char * pFileName,
char * pExcludeFile,
int fAlgorithm,
int fVerbose )
extern

DECLARATIONS ///.

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

Synopsis [Reads in the supergate library and prepares it for use.]

Description [The supergates library comes in a .super file. This file contains descriptions of supergates along with some relevant information. This procedure reads the supergate file, canonicizes the supergates, and constructs an additional lookup table, which can be used to map truth tables of the cuts into the pair (phase, supergate). The phase indicates how the current truth table should be phase assigned to match the canonical form of the supergate. The resulting phase is the bitwise EXOR of the phase needed to canonicize the supergate and the phase needed to transform the truth table into its canonical form.]

SideEffects []

SeeAlso []

Definition at line 61 of file mapperLib.c.

62{
64 abctime clk;
65
66 // start the supergate library
68 memset( p, 0, sizeof(Map_SuperLib_t) );
69 p->pName = Abc_UtilStrsav(pFileName);
70 p->fVerbose = fVerbose;
71 p->mmSupers = Extra_MmFixedStart( sizeof(Map_Super_t) );
72 p->mmEntries = Extra_MmFixedStart( sizeof(Map_HashEntry_t) );
73 p->mmForms = Extra_MmFlexStart();
75
76 // start the hash table
77 p->tTableC = Map_SuperTableCreate( p );
78 p->tTable = Map_SuperTableCreate( p );
79
80 // read the supergate library from file
81clk = Abc_Clock();
82 if ( vStr != NULL )
83 {
84 // read the supergate library from file
85 int Status = Map_LibraryReadFileTreeStr( p, pGenlib, vStr, pFileName );
86 if ( Status == 0 )
87 {
89 return NULL;
90 }
91 // prepare the info about the library
93 if ( Status == 0 )
94 {
96 return NULL;
97 }
98 assert( p->nVarsMax > 0 );
99 }
100 else if ( fAlgorithm )
101 {
102 if ( !Map_LibraryReadTree( p, pGenlib, pFileName, pExcludeFile ) )
103 {
105 return NULL;
106 }
107 }
108 else
109 {
110 if ( pExcludeFile != 0 )
111 {
113 printf ("Error: Exclude file support not present for old format. Stop.\n");
114 return NULL;
115 }
116 if ( !Map_LibraryRead( p, pFileName ) )
117 {
119 return NULL;
120 }
121 }
122 assert( p->nVarsMax > 0 );
123
124 // report the stats
125 if ( fVerbose )
126 {
127 printf( "Loaded %d unique %d-input supergates from \"%s\". ",
128 p->nSupersReal, p->nVarsMax, pFileName );
129 ABC_PRT( "Time", Abc_Clock() - clk );
130 }
131
132 // assign the interver parameters
133 p->pGateInv = Mio_LibraryReadInv( p->pGenlib );
134 p->tDelayInv.Rise = Mio_LibraryReadDelayInvRise( p->pGenlib );
135 p->tDelayInv.Fall = Mio_LibraryReadDelayInvFall( p->pGenlib );
136 p->tDelayInv.Worst = MAP_MAX( p->tDelayInv.Rise, p->tDelayInv.Fall );
137 p->AreaInv = Mio_LibraryReadAreaInv( p->pGenlib );
138 p->AreaBuf = Mio_LibraryReadAreaBuf( p->pGenlib );
139
140 // assign the interver supergate
141 p->pSuperInv = (Map_Super_t *)Extra_MmFixedEntryFetch( p->mmSupers );
142 memset( p->pSuperInv, 0, sizeof(Map_Super_t) );
143 p->pSuperInv->Num = -1;
144 p->pSuperInv->nGates = 1;
145 p->pSuperInv->nFanins = 1;
146 p->pSuperInv->nFanLimit = 10;
147 p->pSuperInv->pFanins[0] = p->ppSupers[0];
148 p->pSuperInv->pRoot = p->pGateInv;
149 p->pSuperInv->Area = p->AreaInv;
150 p->pSuperInv->tDelayMax = p->tDelayInv;
151 p->pSuperInv->tDelaysR[0].Rise = MAP_NO_VAR;
152 p->pSuperInv->tDelaysR[0].Fall = p->tDelayInv.Rise;
153 p->pSuperInv->tDelaysF[0].Rise = p->tDelayInv.Fall;
154 p->pSuperInv->tDelaysF[0].Fall = MAP_NO_VAR;
155 return p;
156}
Extra_MmFixed_t * Extra_MmFixedStart(int nEntrySize)
Extra_MmFlex_t * Extra_MmFlexStart()
int Map_LibraryRead(Map_SuperLib_t *p, char *pFileName)
FUNCTION DEFINITIONS ///.
Definition mapperSuper.c:50
int Map_LibraryReadTree(Map_SuperLib_t *pLib, Mio_Library_t *pGenlib, char *pFileName, char *pExcludeFile)
Definition mapperTree.c:525
int Map_LibraryDeriveGateInfo(Map_SuperLib_t *pLib, st__table *tExcludeGate)
Definition mapperTree.c:586
int Map_LibraryReadFileTreeStr(Map_SuperLib_t *pLib, Mio_Library_t *pGenlib, Vec_Str_t *vStr, char *pFileName)
Definition mapperTree.c:391
Map_HashTable_t * Map_SuperTableCreate(Map_SuperLib_t *pLib)
FUNCTION DEFINITIONS ///.
Definition mapperTable.c:48
void Map_SuperLibFree(Map_SuperLib_t *p)
Definition mapperLib.c:170
struct Map_SuperLibStruct_t_ Map_SuperLib_t
Definition mapper.h:46
struct Map_HashEntryStruct_t_ Map_HashEntry_t
Definition mapper.h:48
void Map_MappingSetupTruthTables(unsigned uTruths[][2])
float Mio_LibraryReadDelayInvFall(Mio_Library_t *pLib)
Definition mioApi.c:58
float Mio_LibraryReadAreaBuf(Mio_Library_t *pLib)
Definition mioApi.c:66
float Mio_LibraryReadAreaInv(Mio_Library_t *pLib)
Definition mioApi.c:65
float Mio_LibraryReadDelayInvRise(Mio_Library_t *pLib)
Definition mioApi.c:57
Mio_Gate_t * Mio_LibraryReadInv(Mio_Library_t *pLib)
Definition mioApi.c:50
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Map_SuperLibFree()

void Map_SuperLibFree ( Map_SuperLib_t * p)
extern

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

Synopsis [Deallocates the supergate library.]

Description []

SideEffects []

SeeAlso []

Definition at line 170 of file mapperLib.c.

171{
172 if ( p == NULL ) return;
173 if ( p->pGenlib )
174 {
175 if ( p->pGenlib != Abc_FrameReadLibGen() )
176 Mio_LibraryDelete( p->pGenlib );
177 p->pGenlib = NULL;
178 }
179 if ( p->tTableC )
180 Map_SuperTableFree( p->tTableC );
181 if ( p->tTable )
182 Map_SuperTableFree( p->tTable );
183 Extra_MmFixedStop( p->mmSupers );
184 Extra_MmFixedStop( p->mmEntries );
185 Extra_MmFlexStop( p->mmForms );
186 ABC_FREE( p->ppSupers );
187 ABC_FREE( p->pName );
188 ABC_FREE( p );
189}
ABC_DLL void * Abc_FrameReadLibGen()
Definition mainFrame.c:59
void Extra_MmFixedStop(Extra_MmFixed_t *p)
void Extra_MmFlexStop(Extra_MmFlex_t *p)
void Map_SuperTableFree(Map_HashTable_t *p)
Definition mapperTable.c:74
void Mio_LibraryDelete(Mio_Library_t *pLib)
DECLARATIONS ///.
Definition mioUtils.c:51
Here is the caller graph for this function:

◆ Map_SuperTableCreate()

Map_HashTable_t * Map_SuperTableCreate ( Map_SuperLib_t * pLib)
extern

FUNCTION DEFINITIONS ///.

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

Synopsis [Creates the hash table for supergates.]

Description []

SideEffects []

SeeAlso []

Definition at line 48 of file mapperTable.c.

49{
51 // allocate the table
53 memset( p, 0, sizeof(Map_HashTable_t) );
54 p->mmMan = pLib->mmEntries;
55 // allocate and clean the bins
56 p->nBins = Abc_PrimeCudd(20000);
57 p->pBins = ABC_ALLOC( Map_HashEntry_t *, p->nBins );
58 memset( p->pBins, 0, sizeof(Map_HashEntry_t *) * p->nBins );
59 return p;
60}
struct Map_HashTableStruct_t_ Map_HashTable_t
Definition mapper.h:47
Extra_MmFixed_t * mmEntries
Definition mapperInt.h:200
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Map_SuperTableFree()

void Map_SuperTableFree ( Map_HashTable_t * p)
extern

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

Synopsis [Deallocates the supergate hash table.]

Description []

SideEffects []

SeeAlso []

Definition at line 74 of file mapperTable.c.

75{
76 ABC_FREE( p->pBins );
77 ABC_FREE( p );
78}
Here is the caller graph for this function:

◆ Map_SuperTableInsert()

int Map_SuperTableInsert ( Map_HashTable_t * p,
unsigned uTruth[],
Map_Super_t * pGate,
unsigned uPhase )
extern

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

Synopsis [Inserts a new entry into the library.]

Description [This function inserts the new gate (pGate), which will be accessible through its unfolded function (uTruth).]

SideEffects []

SeeAlso []

Definition at line 137 of file mapperTable.c.

138{
139 Map_HashEntry_t * pEnt;
140 unsigned Key;
141 // resize the table
142 if ( p->nEntries >= 2 * p->nBins )
143 Map_SuperTableResize( p );
144 // check if this entry already exists
145 Key = MAP_TABLE_HASH( uTruth[0], uTruth[1], p->nBins );
146 for ( pEnt = p->pBins[Key]; pEnt; pEnt = pEnt->pNext )
147 if ( pEnt->uTruth[0] == uTruth[0] && pEnt->uTruth[1] == uTruth[1] )
148 return 1;
149 // add the new hash table entry to the table
150 pEnt = (Map_HashEntry_t *)Extra_MmFixedEntryFetch( p->mmMan );
151 memset( pEnt, 0, sizeof(Map_HashEntry_t) );
152 pEnt->uTruth[0] = uTruth[0];
153 pEnt->uTruth[1] = uTruth[1];
154 pEnt->pGates = pGate;
155 pEnt->uPhase = uPhase;
156 // add the hash table to the corresponding linked list in the table
157 pEnt->pNext = p->pBins[Key];
158 p->pBins[Key] = pEnt;
159 p->nEntries++;
160/*
161printf( "Adding gate: %10u ", Key );
162Map_LibraryPrintSupergate( pGate );
163Extra_PrintBinary( stdout, uTruth, 32 );
164printf( "\n" );
165*/
166 return 0;
167}
#define MAP_TABLE_HASH(u1, u2, nSize)
DECLARATIONS ///.
Definition mapperTable.c:29
Map_HashEntry_t * pNext
Definition mapperInt.h:325
Map_Super_t * pGates
Definition mapperInt.h:324
Here is the call graph for this function:

◆ Map_SuperTableInsertC()

int Map_SuperTableInsertC ( Map_HashTable_t * p,
unsigned uTruthC[],
Map_Super_t * pGate )
extern

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

Synopsis [Inserts a new entry into the hash table.]

Description [This function inserts the new gate (pGate), which will be accessible through its canonical form (uTruthC).]

SideEffects []

SeeAlso []

Definition at line 92 of file mapperTable.c.

93{
94 Map_HashEntry_t * pEnt;
95 unsigned Key;
96 // resize the table
97 if ( p->nEntries >= 2 * p->nBins )
98 Map_SuperTableResize( p );
99 // check if another supergate with the same canonical form exists
100 Key = MAP_TABLE_HASH( uTruthC[0], uTruthC[1], p->nBins );
101 for ( pEnt = p->pBins[Key]; pEnt; pEnt = pEnt->pNext )
102 if ( pEnt->uTruth[0] == uTruthC[0] && pEnt->uTruth[1] == uTruthC[1] )
103 break;
104 // create a new entry if it does not exist
105 if ( pEnt == NULL )
106 {
107 // add the new entry to the table
108 pEnt = (Map_HashEntry_t *)Extra_MmFixedEntryFetch( p->mmMan );
109 memset( pEnt, 0, sizeof(Map_HashEntry_t) );
110 pEnt->uTruth[0] = uTruthC[0];
111 pEnt->uTruth[1] = uTruthC[1];
112 // add the hash table entry to the corresponding linked list in the table
113 pEnt->pNext = p->pBins[Key];
114 p->pBins[Key] = pEnt;
115 p->nEntries++;
116 }
117 // add the supergate to the entry
118 pGate->pNext = pEnt->pGates;
119 pEnt->pGates = pGate;
120 return 0;
121}
Map_Super_t * pNext
Definition mapperInt.h:299
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Map_SuperTableLookup()

Map_Super_t * Map_SuperTableLookup ( Map_HashTable_t * p,
unsigned uTruth[],
unsigned * puPhase )
extern

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

Synopsis [Looks up an entry in the library.]

Description [This function looks up the function, given by its truth table, and return two things: (1) the linked list of supergates, which can implement the functions of this N-class; (2) the phase, which should be applied to the given function, in order to derive the canonical form of this N-class.]

SideEffects []

SeeAlso []

Definition at line 208 of file mapperTable.c.

209{
210 Map_HashEntry_t * pEnt;
211 unsigned Key;
212 Key = MAP_TABLE_HASH( uTruth[0], uTruth[1], p->nBins );
213 for ( pEnt = p->pBins[Key]; pEnt; pEnt = pEnt->pNext )
214 if ( pEnt->uTruth[0] == uTruth[0] && pEnt->uTruth[1] == uTruth[1] )
215 {
216 *puPhase = pEnt->uPhase;
217 return pEnt->pGates;
218 }
219 return NULL;
220}

◆ Map_SuperTableSortSupergates()

void Map_SuperTableSortSupergates ( Map_HashTable_t * p,
int nSupersMax )
extern

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

Synopsis [Sorts supergates by usefulness and prints out most useful.]

Description []

SideEffects []

SeeAlso []

Definition at line 315 of file mapperTable.c.

316{
317 Map_HashEntry_t * pEnt;
318 Map_Super_t ** ppSupers;
319 Map_Super_t * pSuper;
320 int nSupers, i;
321
322 // copy all the supergates into one array
323 ppSupers = ABC_ALLOC( Map_Super_t *, nSupersMax );
324 nSupers = 0;
325 for ( i = 0; i < p->nBins; i++ )
326 for ( pEnt = p->pBins[i]; pEnt; pEnt = pEnt->pNext )
327 for ( pSuper = pEnt->pGates; pSuper; pSuper = pSuper->pNext )
328 ppSupers[nSupers++] = pSuper;
329
330 // sort by usage
331 qsort( (void *)ppSupers, (size_t)nSupers, sizeof(Map_Super_t *),
332 (int (*)(const void *, const void *)) Map_SuperTableCompareSupergates );
333 assert( Map_SuperTableCompareSupergates( ppSupers, ppSupers + nSupers - 1 ) <= 0 );
334
335 // print out the "top ten"
336// for ( i = 0; i < nSupers; i++ )
337 for ( i = 0; i < 10; i++ )
338 {
339 if ( ppSupers[i]->nUsed == 0 )
340 break;
341 printf( "%5d : ", ppSupers[i]->nUsed );
342 printf( "%5d ", ppSupers[i]->Num );
343 printf( "A = %5.2f ", ppSupers[i]->Area );
344 printf( "D = %5.2f ", ppSupers[i]->tDelayMax.Rise );
345 printf( "%s", ppSupers[i]->pFormula );
346 printf( "\n" );
347 }
348 ABC_FREE( ppSupers );
349}
int Map_SuperTableCompareSupergates(Map_Super_t **ppS1, Map_Super_t **ppS2)
Here is the call graph for this function:

◆ Map_SuperTableSortSupergatesByDelay()

void Map_SuperTableSortSupergatesByDelay ( Map_HashTable_t * p,
int nSupersMax )
extern

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

Synopsis [Sorts supergates by max delay for each truth table.]

Description []

SideEffects []

SeeAlso []

Definition at line 362 of file mapperTable.c.

363{
364 Map_HashEntry_t * pEnt;
365 Map_Super_t ** ppSupers;
366 Map_Super_t * pSuper;
367 int nSupers, i, k;
368
369 ppSupers = ABC_ALLOC( Map_Super_t *, nSupersMax );
370 for ( i = 0; i < p->nBins; i++ )
371 for ( pEnt = p->pBins[i]; pEnt; pEnt = pEnt->pNext )
372 {
373 // collect the gates in this entry
374 nSupers = 0;
375 for ( pSuper = pEnt->pGates; pSuper; pSuper = pSuper->pNext )
376 {
377 // skip supergates, whose root is the AND gate
378// if ( strcmp( Mio_GateReadName(pSuper->pRoot), "and" ) == 0 )
379// continue;
380 ppSupers[nSupers++] = pSuper;
381 }
382 pEnt->pGates = NULL;
383 if ( nSupers == 0 )
384 continue;
385 // sort the gates by delay
386 qsort( (void *)ppSupers, (size_t)nSupers, sizeof(Map_Super_t *),
387 (int (*)(const void *, const void *)) Map_SuperTableCompareGatesInList );
388 assert( Map_SuperTableCompareGatesInList( ppSupers, ppSupers + nSupers - 1 ) <= 0 );
389 // link them in the reverse order
390 for ( k = 0; k < nSupers; k++ )
391 {
392 ppSupers[k]->pNext = pEnt->pGates;
393 pEnt->pGates = ppSupers[k];
394 }
395 // save the number of supergates in the list
396 pEnt->pGates->nSupers = nSupers;
397 }
398 ABC_FREE( ppSupers );
399}
int Map_SuperTableCompareGatesInList(Map_Super_t **ppS1, Map_Super_t **ppS2)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Map_SwitchCutDeref()

float Map_SwitchCutDeref ( Map_Node_t * pNode,
Map_Cut_t * pCut,
int fPhase )
extern

function*************************************************************

synopsis [References the cut.]

description []

sideeffects []

seealso []

Definition at line 82 of file mapperSwitch.c.

83{
84 return Map_SwitchCutRefDeref( pNode, pCut, fPhase, 0 ); // dereference
85}
Here is the caller graph for this function:

◆ Map_SwitchCutGetDerefed()

float Map_SwitchCutGetDerefed ( Map_Node_t * pNode,
Map_Cut_t * pCut,
int fPhase )
extern

FUNCTION DEFINITIONS ///.

function*************************************************************

synopsis [Computes the exact area associated with the cut.]

description []

sideeffects []

seealso []

Definition at line 45 of file mapperSwitch.c.

46{
47 float aResult, aResult2;
48// assert( pNode->Switching > 0 );
49 aResult2 = Map_SwitchCutRefDeref( pNode, pCut, fPhase, 1 ); // reference
50 aResult = Map_SwitchCutRefDeref( pNode, pCut, fPhase, 0 ); // dereference
51// assert( aResult == aResult2 );
52 return aResult;
53}
Here is the caller graph for this function:

◆ Map_SwitchCutRef()

float Map_SwitchCutRef ( Map_Node_t * pNode,
Map_Cut_t * pCut,
int fPhase )
extern

function*************************************************************

synopsis [References the cut.]

description []

sideeffects []

seealso []

Definition at line 66 of file mapperSwitch.c.

67{
68 return Map_SwitchCutRefDeref( pNode, pCut, fPhase, 1 ); // reference
69}
Here is the caller graph for this function:

◆ Map_TimeComputeArrivalMax()

float Map_TimeComputeArrivalMax ( Map_Man_t * p)
extern

DECLARATIONS ///.

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

FileName [mapperTime.c]

PackageName [MVSIS 1.3: Multi-valued logic synthesis system.]

Synopsis [Generic technology mapping engine.]

Author [MVSIS Group]

Affiliation [UC Berkeley]

Date [Ver. 2.0. Started - June 1, 2004.]

Revision [

Id
mapperTime.c,v 1.3 2005/03/02 02:35:54 alanmi Exp

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

Synopsis [Computes the maximum arrival times.]

Description []

SideEffects []

SeeAlso []

Definition at line 45 of file mapperTime.c.

46{
47 float tReqMax, tReq;
48 int i, fPhase;
49 // get the critical PO arrival time
50 tReqMax = -MAP_FLOAT_LARGE;
51 for ( i = 0; i < p->nOutputs; i++ )
52 {
53 if ( Map_NodeIsConst(p->pOutputs[i]) )
54 continue;
55 fPhase = !Map_IsComplement(p->pOutputs[i]);
56 tReq = Map_Regular(p->pOutputs[i])->tArrival[fPhase].Worst;
57 tReqMax = MAP_MAX( tReqMax, tReq );
58 }
59 return tReqMax;
60}
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Map_TimeComputeRequiredGlobal()

void Map_TimeComputeRequiredGlobal ( Map_Man_t * p)
extern

Definition at line 385 of file mapperTime.c.

386{
387 int fUseConMan = Scl_ConIsRunning() && Scl_ConHasOutReqs();
388 Map_Time_t * ptTime, * ptTimeA;
389 int fPhase, i;
390 // update the required times according to the target
391 p->fRequiredGlo = Map_TimeComputeArrivalMax( p );
392 if ( p->DelayTarget != -1 )
393 {
394 if ( p->fRequiredGlo > p->DelayTarget + p->fEpsilon )
395 {
396 if ( p->fMappingMode == 1 )
397 printf( "Cannot meet the target required times (%4.2f). Continue anyway.\n", p->DelayTarget );
398 }
399 else if ( p->fRequiredGlo < p->DelayTarget - p->fEpsilon )
400 {
401 if ( p->fMappingMode == 1 && p->fVerbose )
402 printf( "Relaxing the required times from (%4.2f) to the target (%4.2f).\n", p->fRequiredGlo, p->DelayTarget );
403 p->fRequiredGlo = p->DelayTarget;
404 }
405 }
406 // clean the required times
407 for ( i = 0; i < p->vMapObjs->nSize; i++ )
408 {
409 p->vMapObjs->pArray[i]->tRequired[0].Rise = MAP_FLOAT_LARGE;
410 p->vMapObjs->pArray[i]->tRequired[0].Fall = MAP_FLOAT_LARGE;
411 p->vMapObjs->pArray[i]->tRequired[0].Worst = MAP_FLOAT_LARGE;
412 p->vMapObjs->pArray[i]->tRequired[1].Rise = MAP_FLOAT_LARGE;
413 p->vMapObjs->pArray[i]->tRequired[1].Fall = MAP_FLOAT_LARGE;
414 p->vMapObjs->pArray[i]->tRequired[1].Worst = MAP_FLOAT_LARGE;
415 }
416 // set the required times for the POs
417 for ( i = 0; i < p->nOutputs; i++ )
418 {
419 fPhase = !Map_IsComplement(p->pOutputs[i]);
420 ptTime = Map_Regular(p->pOutputs[i])->tRequired + fPhase;
421 ptTimeA = Map_Regular(p->pOutputs[i])->tArrival + fPhase;
422
423 if ( fUseConMan )
424 {
425 float Value = Scl_ConGetOutReqFloat(i);
426 // if external required time can be achieved, use it
427 if ( Value > 0 && ptTimeA->Worst <= Value )//&& Value <= p->fRequiredGlo )
428 ptTime->Rise = ptTime->Fall = ptTime->Worst = Value;
429 // if external required cannot be achieved, set the earliest possible arrival time
430 else if ( Value > 0 && ptTimeA->Worst > Value )
431 ptTime->Rise = ptTime->Fall = ptTime->Worst = ptTimeA->Worst;
432 // otherwise, set the global required time
433 else
434 ptTime->Rise = ptTime->Fall = ptTime->Worst = p->fRequiredGlo;
435 }
436 else
437 {
438 // if external required time can be achieved, use it
439 if ( p->pOutputRequireds && p->pOutputRequireds[i].Worst > 0 && ptTimeA->Worst <= p->pOutputRequireds[i].Worst )//&& p->pOutputRequireds[i].Worst <= p->fRequiredGlo )
440 ptTime->Rise = ptTime->Fall = ptTime->Worst = p->pOutputRequireds[i].Worst;
441 // if external required cannot be achieved, set the earliest possible arrival time
442 else if ( p->pOutputRequireds && p->pOutputRequireds[i].Worst > 0 && ptTimeA->Worst > p->pOutputRequireds[i].Worst )
443 ptTime->Rise = ptTime->Fall = ptTime->Worst = ptTimeA->Worst;
444 // otherwise, set the global required time
445 else
446 ptTime->Rise = ptTime->Fall = ptTime->Worst = p->fRequiredGlo;
447 }
448 }
449 // visit nodes in the reverse topological order
451}
ABC_NAMESPACE_IMPL_START float Map_TimeComputeArrivalMax(Map_Man_t *p)
DECLARATIONS ///.
Definition mapperTime.c:45
void Map_TimePropagateRequired(Map_Man_t *p)
Definition mapperTime.c:288
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Map_TimeCutComputeArrival()

float Map_TimeCutComputeArrival ( Map_Node_t * pNode,
Map_Cut_t * pCut,
int fPhase,
float tWorstLimit )
extern

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

Synopsis [Computes the arrival times of the cut.]

Description [Computes the arrival times of the cut if it is implemented using the given supergate with the given phase. Uses the constraint-type specification of rise/fall arrival times.]

SideEffects []

SeeAlso []

Definition at line 75 of file mapperTime.c.

76{
77 Map_Match_t * pM = pCut->M + fPhase;
78 Map_Super_t * pSuper = pM->pSuperBest;
79 unsigned uPhaseTot = pM->uPhaseBest;
80 Map_Time_t * ptArrRes = &pM->tArrive;
81 Map_Time_t * ptArrIn;
82 int fPinPhase;
83 float tDelay, tExtra;
84 int i;
85
86 tExtra = pNode->p->pNodeDelays ? pNode->p->pNodeDelays[pNode->Num] : 0;
87 ptArrRes->Rise = ptArrRes->Fall = 0.0;
88 ptArrRes->Worst = MAP_FLOAT_LARGE;
89 for ( i = pCut->nLeaves - 1; i >= 0; i-- )
90 {
91 // get the phase of the given pin
92 fPinPhase = ((uPhaseTot & (1 << i)) == 0);
93 ptArrIn = pCut->ppLeaves[i]->tArrival + fPinPhase;
94
95 // get the rise of the output due to rise of the inputs
96 if ( pSuper->tDelaysR[i].Rise > 0 )
97 {
98 tDelay = ptArrIn->Rise + pSuper->tDelaysR[i].Rise + tExtra;
99 if ( tDelay > tWorstLimit )
100 return MAP_FLOAT_LARGE;
101 if ( ptArrRes->Rise < tDelay )
102 ptArrRes->Rise = tDelay;
103 }
104
105 // get the rise of the output due to fall of the inputs
106 if ( pSuper->tDelaysR[i].Fall > 0 )
107 {
108 tDelay = ptArrIn->Fall + pSuper->tDelaysR[i].Fall + tExtra;
109 if ( tDelay > tWorstLimit )
110 return MAP_FLOAT_LARGE;
111 if ( ptArrRes->Rise < tDelay )
112 ptArrRes->Rise = tDelay;
113 }
114
115 // get the fall of the output due to rise of the inputs
116 if ( pSuper->tDelaysF[i].Rise > 0 )
117 {
118 tDelay = ptArrIn->Rise + pSuper->tDelaysF[i].Rise + tExtra;
119 if ( tDelay > tWorstLimit )
120 return MAP_FLOAT_LARGE;
121 if ( ptArrRes->Fall < tDelay )
122 ptArrRes->Fall = tDelay;
123 }
124
125 // get the fall of the output due to fall of the inputs
126 if ( pSuper->tDelaysF[i].Fall > 0 )
127 {
128 tDelay = ptArrIn->Fall + pSuper->tDelaysF[i].Fall + tExtra;
129 if ( tDelay > tWorstLimit )
130 return MAP_FLOAT_LARGE;
131 if ( ptArrRes->Fall < tDelay )
132 ptArrRes->Fall = tDelay;
133 }
134 }
135 // return the worst-case of rise/fall arrival times
136 ptArrRes->Worst = MAP_MAX(ptArrRes->Rise, ptArrRes->Fall);
137 return ptArrRes->Worst;
138}
Map_Man_t * p
Definition mapperInt.h:208
Here is the caller graph for this function:

◆ Map_TruthCountOnes()

int Map_TruthCountOnes ( unsigned * uTruth,
int nLeaves )
extern

◆ Map_TruthDetectTwoFirst()

int Map_TruthDetectTwoFirst ( unsigned * uTruth,
int nLeaves )
extern

◆ Map_TruthsCutDontCare()

int Map_TruthsCutDontCare ( Map_Man_t * pMan,
Map_Cut_t * pCut,
unsigned * uTruthDc )
extern