ABC: A System for Sequential Synthesis and Verification
 
Loading...
Searching...
No Matches
mapper.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  Map_TimeStruct_t_
 

Macros

#define Map_IsComplement(p)
 GLOBAL VARIABLES ///.
 
#define Map_Regular(p)
 
#define Map_Not(p)
 
#define Map_NotCond(p, c)
 

Typedefs

typedef typedefABC_NAMESPACE_HEADER_START struct Map_ManStruct_t_ Map_Man_t
 INCLUDES ///.
 
typedef struct Map_NodeStruct_t_ Map_Node_t
 
typedef struct Map_NodeVecStruct_t_ Map_NodeVec_t
 
typedef struct Map_CutStruct_t_ Map_Cut_t
 
typedef struct Map_MatchStruct_t_ Map_Match_t
 
typedef struct Map_SuperStruct_t_ Map_Super_t
 
typedef struct Map_SuperLibStruct_t_ Map_SuperLib_t
 
typedef struct Map_HashTableStruct_t_ Map_HashTable_t
 
typedef struct Map_HashEntryStruct_t_ Map_HashEntry_t
 
typedef struct Map_TimeStruct_t_ Map_Time_t
 

Functions

Map_Man_tMap_ManCreate (int nInputs, int nOutputs, int fVerbose)
 FUNCTION DEFINITIONS ///.
 
Map_Node_tMap_NodeCreate (Map_Man_t *p, Map_Node_t *p1, Map_Node_t *p2)
 
void Map_ManCreateNodeDelays (Map_Man_t *p, int LogFan)
 
void Map_ManFree (Map_Man_t *pMan)
 
void Map_ManPrintTimeStats (Map_Man_t *p)
 
void Map_ManPrintStatsToFile (char *pName, float Area, float Delay, abctime Time)
 
int Map_ManReadInputNum (Map_Man_t *p)
 FUNCTION DEFINITIONS ///.
 
int Map_ManReadOutputNum (Map_Man_t *p)
 
int Map_ManReadBufNum (Map_Man_t *p)
 
Map_Node_t ** Map_ManReadInputs (Map_Man_t *p)
 
Map_Node_t ** Map_ManReadOutputs (Map_Man_t *p)
 
Map_Node_t ** Map_ManReadBufs (Map_Man_t *p)
 
Map_Node_tMap_ManReadBufDriver (Map_Man_t *p, int i)
 
Map_Node_tMap_ManReadConst1 (Map_Man_t *p)
 
Map_Time_tMap_ManReadInputArrivals (Map_Man_t *p)
 
Mio_Library_tMap_ManReadGenLib (Map_Man_t *p)
 
int Map_ManReadVerbose (Map_Man_t *p)
 
float Map_ManReadAreaFinal (Map_Man_t *p)
 
float Map_ManReadRequiredGlo (Map_Man_t *p)
 
void Map_ManSetOutputNames (Map_Man_t *p, char **ppNames)
 
void Map_ManSetAreaRecovery (Map_Man_t *p, int fAreaRecovery)
 
void Map_ManSetDelayTarget (Map_Man_t *p, float DelayTarget)
 
void Map_ManSetInputArrivals (Map_Man_t *p, Map_Time_t *pArrivals)
 
void Map_ManSetOutputRequireds (Map_Man_t *p, Map_Time_t *pArrivals)
 
void Map_ManSetObeyFanoutLimits (Map_Man_t *p, int fObeyFanoutLimits)
 
void Map_ManSetNumIterations (Map_Man_t *p, int nNumIterations)
 
int Map_ManReadPass (Map_Man_t *p)
 
void Map_ManSetPass (Map_Man_t *p, int nPass)
 
int Map_ManReadFanoutViolations (Map_Man_t *p)
 
void Map_ManSetFanoutViolations (Map_Man_t *p, int nVio)
 
void Map_ManSetChoiceNodeNum (Map_Man_t *p, int nChoiceNodes)
 
void Map_ManSetChoiceNum (Map_Man_t *p, int nChoices)
 
void Map_ManSetVerbose (Map_Man_t *p, int fVerbose)
 
void Map_ManSetSwitching (Map_Man_t *p, int fSwitching)
 
void Map_ManSetSkipFanout (Map_Man_t *p, int fSkipFanout)
 
void Map_ManSetUseProfile (Map_Man_t *p)
 
void Map_ManCreateAigIds (Map_Man_t *p, int nObjs)
 
Map_Man_tMap_NodeReadMan (Map_Node_t *p)
 
char * Map_NodeReadData (Map_Node_t *p, int fPhase)
 
int Map_NodeReadNum (Map_Node_t *p)
 
int Map_NodeReadLevel (Map_Node_t *p)
 
int Map_NodeReadAigId (Map_Node_t *p)
 
Map_Cut_tMap_NodeReadCuts (Map_Node_t *p)
 
Map_Cut_tMap_NodeReadCutBest (Map_Node_t *p, int fPhase)
 
Map_Node_tMap_NodeReadOne (Map_Node_t *p)
 
Map_Node_tMap_NodeReadTwo (Map_Node_t *p)
 
void Map_NodeSetData (Map_Node_t *p, int fPhase, char *pData)
 
void Map_NodeSetNextE (Map_Node_t *p, Map_Node_t *pNextE)
 
void Map_NodeSetRepr (Map_Node_t *p, Map_Node_t *pRepr)
 
void Map_NodeSetSwitching (Map_Node_t *p, float Switching)
 
void Map_NodeSetAigId (Map_Node_t *p, int Id)
 
int Map_NodeIsConst (Map_Node_t *p)
 
int Map_NodeIsVar (Map_Node_t *p)
 
int Map_NodeIsBuf (Map_Node_t *p)
 
int Map_NodeIsAnd (Map_Node_t *p)
 
int Map_NodeComparePhase (Map_Node_t *p1, Map_Node_t *p2)
 
Map_Super_tMap_CutReadSuperBest (Map_Cut_t *p, int fPhase)
 
Map_Super_tMap_CutReadSuper0 (Map_Cut_t *p)
 
Map_Super_tMap_CutReadSuper1 (Map_Cut_t *p)
 
int Map_CutReadLeavesNum (Map_Cut_t *p)
 
Map_Node_t ** Map_CutReadLeaves (Map_Cut_t *p)
 
unsigned Map_CutReadPhaseBest (Map_Cut_t *p, int fPhase)
 
unsigned Map_CutReadPhase0 (Map_Cut_t *p)
 
unsigned Map_CutReadPhase1 (Map_Cut_t *p)
 
Map_Cut_tMap_CutReadNext (Map_Cut_t *p)
 
char * Map_SuperReadFormula (Map_Super_t *p)
 
Mio_Gate_tMap_SuperReadRoot (Map_Super_t *p)
 
int Map_SuperReadNum (Map_Super_t *p)
 
Map_Super_t ** Map_SuperReadFanins (Map_Super_t *p)
 
int Map_SuperReadFaninNum (Map_Super_t *p)
 
Map_Super_tMap_SuperReadNext (Map_Super_t *p)
 
int Map_SuperReadNumPhases (Map_Super_t *p)
 
unsigned char * Map_SuperReadPhases (Map_Super_t *p)
 
int Map_SuperReadFanoutLimit (Map_Super_t *p)
 
Mio_Library_tMap_SuperLibReadGenLib (Map_SuperLib_t *p)
 
float Map_SuperLibReadAreaInv (Map_SuperLib_t *p)
 
Map_Time_t Map_SuperLibReadDelayInv (Map_SuperLib_t *p)
 
int Map_SuperLibReadVarsMax (Map_SuperLib_t *p)
 
Map_Node_tMap_NodeAnd (Map_Man_t *p, Map_Node_t *p1, Map_Node_t *p2)
 
Map_Node_tMap_NodeBuf (Map_Man_t *p, Map_Node_t *p1)
 
void Map_NodeSetChoice (Map_Man_t *pMan, Map_Node_t *pNodeOld, Map_Node_t *pNodeNew)
 
int Map_CanonComputeSlow (unsigned uTruths[][2], int nVarsMax, int nVarsReal, unsigned uTruth[], unsigned char *puPhases, unsigned uTruthRes[])
 FUNCTION DEFINITIONS ///.
 
int Map_CanonComputeFast (Map_Man_t *p, int nVarsMax, int nVarsReal, unsigned uTruth[], unsigned char *puPhases, unsigned uTruthRes[])
 
Map_Cut_tMap_CutAlloc (Map_Man_t *p)
 DECLARATIONS ///.
 
void Map_CutCreateFromNode (Map_Man_t *p, Map_Super_t *pSuper, int iRoot, unsigned uPhaseRoot, int *pLeaves, int nLeaves, unsigned uPhaseLeaves)
 
Vec_Ptr_tMap_CutInternalNodes (Map_Node_t *pObj, Map_Cut_t *pCut)
 
int Map_Mapping (Map_Man_t *p)
 DECLARATIONS ///.
 
int Map_SuperLibDeriveFromGenlib (Mio_Library_t *pLib, int fVerbose)
 
void Map_SuperLibFree (Map_SuperLib_t *p)
 
char * Map_LibraryReadFormulaStep (char *pFormula, char *pStrings[], int *pnStrings)
 
void Map_NetworkSweep (Abc_Ntk_t *pNet)
 
Map_Super_tMap_SuperTableLookupC (Map_SuperLib_t *pLib, unsigned uTruth[])
 
int Map_ManCheckConsistency (Map_Man_t *p)
 
st__tableMap_CreateTableGate2Super (Map_Man_t *p)
 
void Map_ManCleanData (Map_Man_t *p)
 
void Map_MappingSetupTruthTables (unsigned uTruths[][2])
 
void Map_MappingSetupTruthTablesLarge (unsigned uTruths[][32])
 

Macro Definition Documentation

◆ Map_IsComplement

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

GLOBAL VARIABLES ///.

MACRO DEFINITIONS ///

Definition at line 67 of file mapper.h.

◆ Map_Not

#define Map_Not ( p)
Value:
((Map_Node_t *)((ABC_PTRUINT_T)(p) ^ 01))
struct Map_NodeStruct_t_ Map_Node_t
Definition mapper.h:41

Definition at line 69 of file mapper.h.

◆ Map_NotCond

#define Map_NotCond ( p,
c )
Value:
((Map_Node_t *)((ABC_PTRUINT_T)(p) ^ (c)))

Definition at line 70 of file mapper.h.

◆ Map_Regular

#define Map_Regular ( p)
Value:
((Map_Node_t *)((ABC_PTRUINT_T)(p) & ~01))

Definition at line 68 of file mapper.h.

Typedef Documentation

◆ Map_Cut_t

typedef struct Map_CutStruct_t_ Map_Cut_t

Definition at line 43 of file mapper.h.

◆ Map_HashEntry_t

Definition at line 48 of file mapper.h.

◆ Map_HashTable_t

Definition at line 47 of file mapper.h.

◆ Map_Man_t

typedef typedefABC_NAMESPACE_HEADER_START struct Map_ManStruct_t_ Map_Man_t

INCLUDES ///.

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

FileName [mapper.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
mapper.h,v 1.11 2005/02/28 05:34:26 alanmi Exp

] PARAMETERS /// STRUCTURE DEFINITIONS ///

Definition at line 40 of file mapper.h.

◆ Map_Match_t

Definition at line 44 of file mapper.h.

◆ Map_Node_t

typedef struct Map_NodeStruct_t_ Map_Node_t

Definition at line 41 of file mapper.h.

◆ Map_NodeVec_t

Definition at line 42 of file mapper.h.

◆ Map_Super_t

Definition at line 45 of file mapper.h.

◆ Map_SuperLib_t

Definition at line 46 of file mapper.h.

◆ Map_Time_t

typedef struct Map_TimeStruct_t_ Map_Time_t

Definition at line 49 of file mapper.h.

Function Documentation

◆ Map_CanonComputeFast()

int Map_CanonComputeFast ( Map_Man_t * p,
int nVarsMax,
int nVarsReal,
unsigned uTruth[],
unsigned char * puPhases,
unsigned uTruthRes[] )
extern

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

Synopsis [Computes the N-canonical form of the Boolean function.]

Description [The N-canonical form is defined as the truth table with the minimum integer value. This function exhaustively enumerates through the complete set of 2^N phase assignments.]

SideEffects []

SeeAlso []

Definition at line 173 of file mapperCanon.c.

174{
175 unsigned uTruth0, uTruth1;
176 unsigned uCanon0, uCanon1, uCanonBest;
177 unsigned uPhaseBest = 16; // Suppress "might be used uninitialized" (asserts require < 16)
178 int i, Limit;
179
180 if ( nVarsMax == 6 )
181 return Map_CanonComputeSlow( p->uTruths, nVarsMax, nVarsReal, uTruth, puPhases, uTruthRes );
182
183 if ( nVarsReal < 5 )
184 {
185// return Map_CanonComputeSlow( p->uTruths, nVarsMax, nVarsReal, uTruth, puPhases, uTruthRes );
186
187 uTruth0 = uTruth[0] & 0xFFFF;
188 assert( p->pCounters[uTruth0] > 0 );
189 uTruthRes[0] = (p->uCanons[uTruth0] << 16) | p->uCanons[uTruth0];
190 uTruthRes[1] = uTruthRes[0];
191 puPhases[0] = p->uPhases[uTruth0][0];
192 return 1;
193 }
194
195 assert( nVarsMax == 5 );
196 assert( nVarsReal == 5 );
197 uTruth0 = uTruth[0] & 0xFFFF;
198 uTruth1 = (uTruth[0] >> 16);
199 if ( uTruth1 == 0 )
200 {
201 uTruthRes[0] = p->uCanons[uTruth0];
202 uTruthRes[1] = uTruthRes[0];
203 Limit = (p->pCounters[uTruth0] > 4)? 4 : p->pCounters[uTruth0];
204 for ( i = 0; i < Limit; i++ )
205 puPhases[i] = p->uPhases[uTruth0][i];
206 return Limit;
207 }
208 else if ( uTruth0 == 0 )
209 {
210 uTruthRes[0] = p->uCanons[uTruth1];
211 uTruthRes[1] = uTruthRes[0];
212 Limit = (p->pCounters[uTruth1] > 4)? 4 : p->pCounters[uTruth1];
213 for ( i = 0; i < Limit; i++ )
214 {
215 puPhases[i] = p->uPhases[uTruth1][i];
216 puPhases[i] |= (1 << 4);
217 }
218 return Limit;
219 }
220 uCanon0 = p->uCanons[uTruth0];
221 uCanon1 = p->uCanons[uTruth1];
222 if ( uCanon0 >= uCanon1 ) // using nCanon1 as the main one
223 {
224 assert( p->pCounters[uTruth1] > 0 );
225 uCanonBest = 0xFFFFFFFF;
226 for ( i = 0; i < p->pCounters[uTruth1]; i++ )
227 {
228 uCanon0 = Extra_TruthPolarize( uTruth0, p->uPhases[uTruth1][i], 4 );
229 if ( uCanonBest > uCanon0 )
230 {
231 uCanonBest = uCanon0;
232 uPhaseBest = p->uPhases[uTruth1][i];
233 assert( uPhaseBest < 16 );
234 }
235 }
236 uTruthRes[0] = (uCanon1 << 16) | uCanonBest;
237 uTruthRes[1] = uTruthRes[0];
238 puPhases[0] = uPhaseBest;
239 return 1;
240 }
241 else if ( uCanon0 < uCanon1 )
242 {
243 assert( p->pCounters[uTruth0] > 0 );
244 uCanonBest = 0xFFFFFFFF;
245 for ( i = 0; i < p->pCounters[uTruth0]; i++ )
246 {
247 uCanon1 = Extra_TruthPolarize( uTruth1, p->uPhases[uTruth0][i], 4 );
248 if ( uCanonBest > uCanon1 )
249 {
250 uCanonBest = uCanon1;
251 uPhaseBest = p->uPhases[uTruth0][i];
252 assert( uPhaseBest < 16 );
253 }
254 }
255 uTruthRes[0] = (uCanon0 << 16) | uCanonBest;
256 uTruthRes[1] = uTruthRes[0];
257 puPhases[0] = uPhaseBest | (1 << 4);
258 return 1;
259 }
260 else
261 {
262 assert( 0 );
263 return Map_CanonComputeSlow( p->uTruths, nVarsMax, nVarsReal, uTruth, puPhases, uTruthRes );
264 }
265}
unsigned Extra_TruthPolarize(unsigned uTruth, int Polarity, int nVars)
int Map_CanonComputeSlow(unsigned uTruths[][2], int nVarsMax, int nVarsReal, unsigned uTruth[], unsigned char *puPhases, unsigned uTruthRes[])
FUNCTION DEFINITIONS ///.
Definition mapperCanon.c:48
#define assert(ex)
Definition util_old.h:213
Here is the call graph for this function:

◆ Map_CanonComputeSlow()

int Map_CanonComputeSlow ( unsigned uTruths[][2],
int nVarsMax,
int nVarsReal,
unsigned uTruth[],
unsigned char * puPhases,
unsigned uTruthRes[] )
extern

FUNCTION DEFINITIONS ///.

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

Synopsis [Computes the N-canonical form of the Boolean function.]

Description [The N-canonical form is defined as the truth table with the minimum integer value. This function exhaustively enumerates through the complete set of 2^N phase assignments.]

SideEffects []

SeeAlso []

Definition at line 48 of file mapperCanon.c.

49{
50 unsigned uTruthPerm[2];
51 int nMints, nPhases, m;
52
53 nPhases = 0;
54 nMints = (1 << nVarsReal);
55 if ( nVarsMax < 6 )
56 {
57 uTruthRes[0] = MAP_MASK(32);
58 for ( m = 0; m < nMints; m++ )
59 {
60 uTruthPerm[0] = Map_CanonComputePhase( uTruths, nVarsMax, uTruth[0], m );
61 if ( uTruthRes[0] > uTruthPerm[0] )
62 {
63 uTruthRes[0] = uTruthPerm[0];
64 nPhases = 0;
65 puPhases[nPhases++] = (unsigned char)m;
66 }
67 else if ( uTruthRes[0] == uTruthPerm[0] )
68 {
69 if ( nPhases < 4 ) // the max number of phases in Map_Super_t
70 puPhases[nPhases++] = (unsigned char)m;
71 }
72 }
73 uTruthRes[1] = uTruthRes[0];
74 }
75 else
76 {
77 uTruthRes[0] = MAP_MASK(32);
78 uTruthRes[1] = MAP_MASK(32);
79 for ( m = 0; m < nMints; m++ )
80 {
81 Map_CanonComputePhase6( uTruths, nVarsMax, uTruth, m, uTruthPerm );
82 if ( uTruthRes[1] > uTruthPerm[1] || (uTruthRes[1] == uTruthPerm[1] && uTruthRes[0] > uTruthPerm[0]) )
83 {
84 uTruthRes[0] = uTruthPerm[0];
85 uTruthRes[1] = uTruthPerm[1];
86 nPhases = 0;
87 puPhases[nPhases++] = (unsigned char)m;
88 }
89 else if ( uTruthRes[1] == uTruthPerm[1] && uTruthRes[0] == uTruthPerm[0] )
90 {
91 if ( nPhases < 4 ) // the max number of phases in Map_Super_t
92 puPhases[nPhases++] = (unsigned char)m;
93 }
94 }
95 }
96 assert( nPhases > 0 );
97// printf( "%d ", nPhases );
98 return nPhases;
99}
#define MAP_MASK(n)
INCLUDES ///.
Definition mapperInt.h:52
Here is the caller graph for this function:

◆ Map_CreateTableGate2Super()

st__table * Map_CreateTableGate2Super ( Map_Man_t * pMan)
extern

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

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 613 of file mapperUtils.c.

614{
615 Map_Super_t * pSuper;
616 st__table * tTable;
617 int i, nInputs, v;
619 for ( i = 0; i < pMan->pSuperLib->nSupersAll; i++ )
620 {
621 pSuper = pMan->pSuperLib->ppSupers[i];
622 if ( pSuper->nGates == 1 )
623 {
624 // skip different versions of the same root gate
625 nInputs = Mio_GateReadPinNum(pSuper->pRoot);
626 for ( v = 0; v < nInputs; v++ )
627 if ( pSuper->pFanins[v]->Num != nInputs - 1 - v )
628 break;
629 if ( v != nInputs )
630 continue;
631// printf( "%s\n", Mio_GateReadName(pSuper->pRoot) );
632 if ( st__insert( tTable, (char *)pSuper->pRoot, (char *)pSuper ) )
633 {
634 assert( 0 );
635 }
636 }
637 }
638 return tTable;
639}
struct Map_SuperStruct_t_ Map_Super_t
Definition mapper.h:45
int Mio_GateReadPinNum(Mio_Gate_t *pGate)
Definition mioApi.c:177
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
int st__insert(st__table *table, const char *key, char *value)
Definition st.c:171
Mio_Gate_t * pRoot
Definition mapperInt.h:292
Map_Super_t * pFanins[6]
Definition mapperInt.h:291
Definition st.h:52
int strcmp()
Here is the call graph for this function:

◆ 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
struct Map_CutStruct_t_ Map_Cut_t
Definition mapper.h:43
Map_Match_t M[2]
Definition mapperInt.h:275
Map_Time_t tArrive
Definition mapperInt.h:259
char * memset()
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Map_CutCreateFromNode()

void Map_CutCreateFromNode ( Map_Man_t * p,
Map_Super_t * pSuper,
int iRoot,
unsigned uPhaseRoot,
int * pLeaves,
int nLeaves,
unsigned uPhaseLeaves )
extern

◆ Map_CutInternalNodes()

Vec_Ptr_t * Map_CutInternalNodes ( Map_Node_t * pObj,
Map_Cut_t * pCut )
extern

Definition at line 242 of file mapperCutUtils.c.

243{
244 Vec_Ptr_t * vAnds = Vec_PtrAlloc( 4 );
245 Map_Node_t * pTemp; int i;
246 pObj->p->nTravIds++;
247 for ( i = 0; i < pCut->nLeaves; i++ )
248 pCut->ppLeaves[i]->TravId = pObj->p->nTravIds;
249 Map_CutInternalNodes_rec( pObj, vAnds );
250 if ( 0 )
251 {
252 printf( "Leaves:\n" );
253 for ( i = 0; i < pCut->nLeaves; i++ )
254 printf( " %d", pCut->ppLeaves[i]->Num );
255 printf( "\n" );
256 printf( "Nodes:\n" );
257 Vec_PtrForEachEntry( Map_Node_t *, vAnds, pTemp, i )
258 printf( "%d = %s%d & %s%d\n", pTemp->Num,
259 Map_IsComplement(pTemp->p1) ? "~" : " ", Map_Regular(pTemp->p1)->Num,
260 Map_IsComplement(pTemp->p2) ? "~" : " ", Map_Regular(pTemp->p2)->Num );
261 printf( "\n" );
262 }
263 return vAnds;
264}
void Map_CutInternalNodes_rec(Map_Node_t *pObj, Vec_Ptr_t *vAnds)
#define Map_Regular(p)
Definition mapper.h:68
#define Map_IsComplement(p)
GLOBAL VARIABLES ///.
Definition mapper.h:67
Map_Node_t * ppLeaves[6]
Definition mapperInt.h:269
Map_Man_t * p
Definition mapperInt.h:208
Map_Node_t * p2
Definition mapperInt.h:226
Map_Node_t * p1
Definition mapperInt.h:225
typedefABC_NAMESPACE_HEADER_START struct Vec_Ptr_t_ Vec_Ptr_t
INCLUDES ///.
Definition vecPtr.h:42
#define Vec_PtrForEachEntry(Type, vVec, pEntry, i)
MACRO DEFINITIONS ///.
Definition vecPtr.h:55
Here is the call graph for this function:

◆ Map_CutReadLeaves()

Map_Node_t ** Map_CutReadLeaves ( Map_Cut_t * p)
extern

Definition at line 141 of file mapperCreate.c.

141{ return p->ppLeaves; }

◆ Map_CutReadLeavesNum()

int Map_CutReadLeavesNum ( Map_Cut_t * p)
extern

Definition at line 140 of file mapperCreate.c.

140{ return p->nLeaves; }

◆ Map_CutReadNext()

Map_Cut_t * Map_CutReadNext ( Map_Cut_t * p)
extern

Definition at line 145 of file mapperCreate.c.

145{ return p->pNext; }

◆ Map_CutReadPhase0()

unsigned Map_CutReadPhase0 ( Map_Cut_t * p)
extern

Definition at line 143 of file mapperCreate.c.

143{ return p->M[0].uPhaseBest;}

◆ Map_CutReadPhase1()

unsigned Map_CutReadPhase1 ( Map_Cut_t * p)
extern

Definition at line 144 of file mapperCreate.c.

144{ return p->M[1].uPhaseBest;}

◆ Map_CutReadPhaseBest()

unsigned Map_CutReadPhaseBest ( Map_Cut_t * p,
int fPhase )
extern

Definition at line 142 of file mapperCreate.c.

142{ return p->M[fPhase].uPhaseBest;}

◆ Map_CutReadSuper0()

Map_Super_t * Map_CutReadSuper0 ( Map_Cut_t * p)
extern

Definition at line 138 of file mapperCreate.c.

138{ return p->M[0].pSuperBest;}

◆ Map_CutReadSuper1()

Map_Super_t * Map_CutReadSuper1 ( Map_Cut_t * p)
extern

Definition at line 139 of file mapperCreate.c.

139{ return p->M[1].pSuperBest;}

◆ Map_CutReadSuperBest()

Map_Super_t * Map_CutReadSuperBest ( Map_Cut_t * p,
int fPhase )
extern

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

Synopsis [Reads parameters from the cut.]

Description []

SideEffects []

SeeAlso []

Definition at line 137 of file mapperCreate.c.

137{ return p->M[fPhase].pSuperBest;}

◆ Map_LibraryReadFormulaStep()

char * Map_LibraryReadFormulaStep ( char * pFormula,
char * pStrings[],
int * pnStrings )
extern

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

Synopsis [Performs one step of parsing the formula into parts.]

Description [This function will eventually be replaced when the tree-supergate library representation will become standard.]

SideEffects []

SeeAlso []

Definition at line 256 of file mapperSuper.c.

257{
258 char * pName, * pPar1, * pPar2, * pCur;
259 int nStrings, CountPars;
260
261 // skip leading spaces
262 for ( pName = pFormula; *pName && *pName == ' '; pName++ );
263 assert( *pName );
264 // find the first opening parenthesis
265 for ( pPar1 = pName; *pPar1 && *pPar1 != '('; pPar1++ );
266 if ( *pPar1 == 0 )
267 {
268 *pnStrings = 0;
269 return pName;
270 }
271 // overwrite it with space
272 assert( *pPar1 == '(' );
273 *pPar1 = 0;
274 // find the corresponding closing parenthesis
275 for ( CountPars = 1, pPar2 = pPar1 + 1; *pPar2 && CountPars; pPar2++ )
276 if ( *pPar2 == '(' )
277 CountPars++;
278 else if ( *pPar2 == ')' )
279 CountPars--;
280 pPar2--;
281 assert( CountPars == 0 );
282 // overwrite it with space
283 assert( *pPar2 == ')' );
284 *pPar2 = 0;
285 // save the intervals between the commas
286 nStrings = 0;
287 pCur = pPar1 + 1;
288 while ( 1 )
289 {
290 // save the current string
291 pStrings[ nStrings++ ] = pCur;
292 // find the beginning of the next string
293 for ( CountPars = 0; *pCur && (CountPars || *pCur != ','); pCur++ )
294 if ( *pCur == '(' )
295 CountPars++;
296 else if ( *pCur == ')' )
297 CountPars--;
298 if ( *pCur == 0 )
299 break;
300 assert( *pCur == ',' );
301 *pCur = 0;
302 pCur++;
303 }
304 // save the results and return
305 *pnStrings = nStrings;
306 return pName;
307}

◆ Map_ManCheckConsistency()

int Map_ManCheckConsistency ( Map_Man_t * p)
extern

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

Synopsis [Verify one useful property.]

Description [This procedure verifies one useful property. After the FRAIG construction with choice nodes is over, each primary node should have fanins that are primary nodes. The primary nodes is the one that does not have pNode->pRepr set to point to another node.]

SideEffects []

SeeAlso []

Definition at line 427 of file mapperUtils.c.

428{
429 Map_Node_t * pNode;
430 Map_NodeVec_t * pVec;
431 int i;
432 pVec = Map_MappingDfs( p, 0 );
433 for ( i = 0; i < pVec->nSize; i++ )
434 {
435 pNode = pVec->pArray[i];
436 if ( Map_NodeIsVar(pNode) )
437 {
438 if ( pNode->pRepr )
439 printf( "Primary input %d is a secondary node.\n", pNode->Num );
440 }
441 else if ( Map_NodeIsConst(pNode) )
442 {
443 if ( pNode->pRepr )
444 printf( "Constant 1 %d is a secondary node.\n", pNode->Num );
445 }
446 else
447 {
448 if ( pNode->pRepr )
449 printf( "Internal node %d is a secondary node.\n", pNode->Num );
450 if ( Map_Regular(pNode->p1)->pRepr )
451 printf( "Internal node %d has first fanin that is a secondary node.\n", pNode->Num );
452 if ( Map_Regular(pNode->p2)->pRepr )
453 printf( "Internal node %d has second fanin that is a secondary node.\n", pNode->Num );
454 }
455 }
456 Map_NodeVecFree( pVec );
457 return 1;
458}
void Map_NodeVecFree(Map_NodeVec_t *p)
Definition mapperVec.c:68
Map_NodeVec_t * Map_MappingDfs(Map_Man_t *pMan, int fCollectEquiv)
Definition mapperUtils.c:77
int Map_NodeIsConst(Map_Node_t *p)
int Map_NodeIsVar(Map_Node_t *p)
struct Map_NodeVecStruct_t_ Map_NodeVec_t
Definition mapper.h:42
Map_Node_t * pRepr
Definition mapperInt.h:228
Map_Node_t ** pArray
Definition mapperInt.h:305
Here is the call graph for this function:

◆ Map_ManCleanData()

void Map_ManCleanData ( Map_Man_t * p)
extern

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

Synopsis [Get the FRAIG node with phase.]

Description []

SideEffects []

SeeAlso []

Definition at line 652 of file mapperUtils.c.

653{
654 int i;
655 for ( i = 0; i < p->vMapObjs->nSize; i++ )
656 p->vMapObjs->pArray[i]->pData0 = p->vMapObjs->pArray[i]->pData1 = 0;
657}
Here is the caller graph for this function:

◆ Map_ManCreate()

Map_Man_t * Map_ManCreate ( int nInputs,
int nOutputs,
int fVerbose )
extern

FUNCTION DEFINITIONS ///.

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

Synopsis [Create the mapping manager.]

Description [The number of inputs and outputs is assumed to be known is advance. It is much simpler to have them fixed upfront. When it comes to representing the object graph in the form of AIG, the resulting manager is similar to the regular AIG manager, except that it does not use reference counting (and therefore does not have garbage collections). It does have table resizing. The data structure is more flexible to represent additional information needed for mapping.]

SideEffects []

SeeAlso []

Definition at line 192 of file mapperCreate.c.

193{
194 Map_Man_t * p;
195 int i;
196
197 // derive the supergate library
198 if ( Abc_FrameReadLibSuper() == NULL )
199 {
200 printf( "The supergate library is not specified. Use \"read_super\".\n" );
201 return NULL;
202 }
203
204 // start the manager
205 p = ABC_ALLOC( Map_Man_t, 1 );
206 memset( p, 0, sizeof(Map_Man_t) );
207 p->pSuperLib = (Map_SuperLib_t *)Abc_FrameReadLibSuper();
208 p->nVarsMax = p->pSuperLib->nVarsMax;
209 p->fVerbose = fVerbose;
210 p->fEpsilon = (float)0.001;
211 assert( p->nVarsMax > 0 );
212
213 if ( p->nVarsMax == 5 )
214 Extra_Truth4VarN( &p->uCanons, &p->uPhases, &p->pCounters, 8 );
215
216 // start various data structures
217 Map_TableCreate( p );
218 Map_MappingSetupTruthTables( p->uTruths );
219 Map_MappingSetupTruthTablesLarge( p->uTruthsLarge );
220// printf( "Node = %d bytes. Cut = %d bytes. Super = %d bytes.\n", sizeof(Map_Node_t), sizeof(Map_Cut_t), sizeof(Map_Super_t) );
221 p->mmNodes = Extra_MmFixedStart( sizeof(Map_Node_t) );
222 p->mmCuts = Extra_MmFixedStart( sizeof(Map_Cut_t) );
223
224 // make sure the constant node will get index -1
225 p->nNodes = -1;
226 // create the constant node
227 p->pConst1 = Map_NodeCreate( p, NULL, NULL );
228 p->vMapObjs = Map_NodeVecAlloc( 100 );
229 p->vMapBufs = Map_NodeVecAlloc( 100 );
230 p->vVisited = Map_NodeVecAlloc( 100 );
231
232 // create the PI nodes
233 p->nInputs = nInputs;
234 p->pInputs = ABC_ALLOC( Map_Node_t *, nInputs );
235 for ( i = 0; i < nInputs; i++ )
236 p->pInputs[i] = Map_NodeCreate( p, NULL, NULL );
237
238 // create the place for the output nodes
239 p->nOutputs = nOutputs;
240 p->pOutputs = ABC_ALLOC( Map_Node_t *, nOutputs );
241 memset( p->pOutputs, 0, sizeof(Map_Node_t *) * nOutputs );
242 return p;
243}
#define ABC_ALLOC(type, num)
Definition abc_global.h:264
ABC_DLL void * Abc_FrameReadLibSuper()
Definition mainFrame.c:61
Extra_MmFixed_t * Extra_MmFixedStart(int nEntrySize)
void Extra_Truth4VarN(unsigned short **puCanons, char ***puPhases, char **ppCounters, int nPhasesMax)
Map_Node_t * Map_NodeCreate(Map_Man_t *p, Map_Node_t *p1, Map_Node_t *p2)
Map_NodeVec_t * Map_NodeVecAlloc(int nCap)
FUNCTION DEFINITIONS ///.
Definition mapperVec.c:45
void Map_MappingSetupTruthTablesLarge(unsigned uTruths[][32])
typedefABC_NAMESPACE_HEADER_START struct Map_ManStruct_t_ Map_Man_t
INCLUDES ///.
Definition mapper.h:40
Map_Node_t * Map_NodeCreate(Map_Man_t *p, Map_Node_t *p1, Map_Node_t *p2)
struct Map_SuperLibStruct_t_ Map_SuperLib_t
Definition mapper.h:46
void Map_MappingSetupTruthTables(unsigned uTruths[][2])
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Map_ManCreateAigIds()

void Map_ManCreateAigIds ( Map_Man_t * p,
int nObjs )
extern

Definition at line 78 of file mapperCreate.c.

78{ p->pAigNodeIDs = ABC_CALLOC( int, nObjs ); }
#define ABC_CALLOC(type, num)
Definition abc_global.h:265
Here is the caller graph for this function:

◆ Map_ManCreateNodeDelays()

void Map_ManCreateNodeDelays ( Map_Man_t * p,
int LogFan )
extern

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

Synopsis [Creates node delays.]

Description []

SideEffects []

SeeAlso []

Definition at line 293 of file mapperCreate.c.

294{
295 Map_Node_t * pNode;
296 int k;
297 assert( p->pNodeDelays == NULL );
298 p->pNodeDelays = ABC_CALLOC( float, p->vMapObjs->nSize );
299 for ( k = 0; k < p->vMapObjs->nSize; k++ )
300 {
301 pNode = p->vMapObjs->pArray[k];
302 if ( pNode->nRefs == 0 )
303 continue;
304 p->pNodeDelays[k] = 0.014426 * LogFan * p->pSuperLib->tDelayInv.Worst * log( (double)pNode->nRefs ); // 1.4426 = 1/ln(2)
305// printf( "%d = %d (%.2f) ", k, pNode->nRefs, p->pNodeDelays[k] );
306 }
307// printf( "\n" );
308}
Here is the caller graph for this function:

◆ Map_ManFree()

void Map_ManFree ( Map_Man_t * p)
extern

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

Synopsis [Deallocates the mapping manager.]

Description []

SideEffects []

SeeAlso []

Definition at line 256 of file mapperCreate.c.

257{
258// int i;
259// for ( i = 0; i < p->vMapObjs->nSize; i++ )
260// Map_NodeVecFree( p->vMapObjs->pArray[i]->vFanouts );
261// Map_NodeVecFree( p->pConst1->vFanouts );
262 Map_NodeVecFree( p->vMapObjs );
263 Map_NodeVecFree( p->vMapBufs );
264 Map_NodeVecFree( p->vVisited );
265 if ( p->uCanons ) ABC_FREE( p->uCanons );
266 if ( p->uPhases ) ABC_FREE( p->uPhases );
267 if ( p->pCounters ) ABC_FREE( p->pCounters );
268 Extra_MmFixedStop( p->mmNodes );
269 Extra_MmFixedStop( p->mmCuts );
270 ABC_FREE( p->pAigNodeIDs );
271 ABC_FREE( p->pNodeDelays );
272 ABC_FREE( p->pInputArrivals );
273 ABC_FREE( p->pOutputRequireds );
274 ABC_FREE( p->pInputs );
275 ABC_FREE( p->pOutputs );
276 ABC_FREE( p->pBins );
277 ABC_FREE( p->ppOutputNames );
278 ABC_FREE( p );
279}
#define ABC_FREE(obj)
Definition abc_global.h:267
void Extra_MmFixedStop(Extra_MmFixed_t *p)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Map_ManPrintStatsToFile()

void Map_ManPrintStatsToFile ( char * pName,
float Area,
float Delay,
abctime Time )
extern

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

Synopsis [Prints the mapping stats.]

Description []

SideEffects []

SeeAlso []

Definition at line 350 of file mapperCreate.c.

351{
352 FILE * pTable;
353 pTable = fopen( "map_stats.txt", "a+" );
354 fprintf( pTable, "%s ", pName );
355 fprintf( pTable, "%4.2f ", Area );
356 fprintf( pTable, "%4.2f ", Delay );
357 fprintf( pTable, "%4.2f\n", (float)(Time)/(float)(CLOCKS_PER_SEC) );
358 fclose( pTable );
359}

◆ Map_ManPrintTimeStats()

void Map_ManPrintTimeStats ( Map_Man_t * p)
extern

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

Synopsis [Deallocates the mapping manager.]

Description []

SideEffects []

SeeAlso []

Definition at line 322 of file mapperCreate.c.

323{
324 printf( "N-canonical = %d. Matchings = %d. Phases = %d. ", p->nCanons, p->nMatches, p->nPhases );
325 printf( "Choice nodes = %d. Choices = %d.\n", p->nChoiceNodes, p->nChoices );
326 ABC_PRT( "ToMap", p->timeToMap );
327 ABC_PRT( "Cuts ", p->timeCuts );
328 ABC_PRT( "Truth", p->timeTruth );
329 ABC_PRT( "Match", p->timeMatch );
330 ABC_PRT( "Area ", p->timeArea );
331 ABC_PRT( "Sweep", p->timeSweep );
332 ABC_PRT( "ToNet", p->timeToNet );
333 ABC_PRT( "TOTAL", p->timeTotal );
334 if ( p->time1 ) { ABC_PRT( "time1", p->time1 ); }
335 if ( p->time2 ) { ABC_PRT( "time2", p->time2 ); }
336 if ( p->time3 ) { ABC_PRT( "time3", p->time3 ); }
337}
#define ABC_PRT(a, t)
Definition abc_global.h:255

◆ Map_ManReadAreaFinal()

float Map_ManReadAreaFinal ( Map_Man_t * p)
extern

Definition at line 61 of file mapperCreate.c.

61{ return p->AreaFinal; }

◆ Map_ManReadBufDriver()

Map_Node_t * Map_ManReadBufDriver ( Map_Man_t * p,
int i )
extern

Definition at line 55 of file mapperCreate.c.

55{ return Map_ManReadBufs(p)[i]->p1; }
Map_Node_t ** Map_ManReadBufs(Map_Man_t *p)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Map_ManReadBufNum()

int Map_ManReadBufNum ( Map_Man_t * p)
extern

Definition at line 51 of file mapperCreate.c.

51{ return Map_NodeVecReadSize(p->vMapBufs); }
int Map_NodeVecReadSize(Map_NodeVec_t *p)
Definition mapperVec.c:122
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Map_ManReadBufs()

Map_Node_t ** Map_ManReadBufs ( Map_Man_t * p)
extern

Definition at line 54 of file mapperCreate.c.

54{ return Map_NodeVecReadArray(p->vMapBufs); }
Map_Node_t ** Map_NodeVecReadArray(Map_NodeVec_t *p)
Definition mapperVec.c:106
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Map_ManReadConst1()

Map_Node_t * Map_ManReadConst1 ( Map_Man_t * p)
extern

Definition at line 56 of file mapperCreate.c.

56{ return p->pConst1; }
Here is the caller graph for this function:

◆ Map_ManReadFanoutViolations()

int Map_ManReadFanoutViolations ( Map_Man_t * p)
extern

Definition at line 70 of file mapperCreate.c.

70{ return p->nFanoutViolations; }

◆ Map_ManReadGenLib()

Mio_Library_t * Map_ManReadGenLib ( Map_Man_t * p)
extern

Definition at line 59 of file mapperCreate.c.

59{ return p->pSuperLib->pGenlib; }

◆ Map_ManReadInputArrivals()

Map_Time_t * Map_ManReadInputArrivals ( Map_Man_t * p)
extern

Definition at line 57 of file mapperCreate.c.

57{ return p->pInputArrivals; }

◆ Map_ManReadInputNum()

int Map_ManReadInputNum ( Map_Man_t * p)
extern

FUNCTION DEFINITIONS ///.

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

Synopsis [Reads parameters from the mapping manager.]

Description []

SideEffects []

SeeAlso []

Definition at line 49 of file mapperCreate.c.

49{ return p->nInputs; }

◆ Map_ManReadInputs()

Map_Node_t ** Map_ManReadInputs ( Map_Man_t * p)
extern

Definition at line 52 of file mapperCreate.c.

52{ return p->pInputs; }
Here is the caller graph for this function:

◆ Map_ManReadOutputNum()

int Map_ManReadOutputNum ( Map_Man_t * p)
extern

Definition at line 50 of file mapperCreate.c.

50{ return p->nOutputs; }

◆ Map_ManReadOutputs()

Map_Node_t ** Map_ManReadOutputs ( Map_Man_t * p)
extern

Definition at line 53 of file mapperCreate.c.

53{ return p->pOutputs; }
Here is the caller graph for this function:

◆ Map_ManReadPass()

int Map_ManReadPass ( Map_Man_t * p)
extern

◆ Map_ManReadRequiredGlo()

float Map_ManReadRequiredGlo ( Map_Man_t * p)
extern

Definition at line 62 of file mapperCreate.c.

62{ return p->fRequiredGlo; }

◆ Map_ManReadVerbose()

int Map_ManReadVerbose ( Map_Man_t * p)
extern

Definition at line 60 of file mapperCreate.c.

60{ return p->fVerbose; }

◆ Map_ManSetAreaRecovery()

void Map_ManSetAreaRecovery ( Map_Man_t * p,
int fAreaRecovery )
extern

Definition at line 64 of file mapperCreate.c.

64{ p->fAreaRecovery = fAreaRecovery;}
Here is the caller graph for this function:

◆ Map_ManSetChoiceNodeNum()

void Map_ManSetChoiceNodeNum ( Map_Man_t * p,
int nChoiceNodes )
extern

Definition at line 72 of file mapperCreate.c.

72{ p->nChoiceNodes = nChoiceNodes; }

◆ Map_ManSetChoiceNum()

void Map_ManSetChoiceNum ( Map_Man_t * p,
int nChoices )
extern

Definition at line 73 of file mapperCreate.c.

73{ p->nChoices = nChoices; }

◆ Map_ManSetDelayTarget()

void Map_ManSetDelayTarget ( Map_Man_t * p,
float DelayTarget )
extern

Definition at line 65 of file mapperCreate.c.

65{ p->DelayTarget = DelayTarget;}
Here is the caller graph for this function:

◆ Map_ManSetFanoutViolations()

void Map_ManSetFanoutViolations ( Map_Man_t * p,
int nVio )
extern

Definition at line 71 of file mapperCreate.c.

71{ p->nFanoutViolations = nVio; }

◆ Map_ManSetInputArrivals()

void Map_ManSetInputArrivals ( Map_Man_t * p,
Map_Time_t * pArrivals )
extern

Definition at line 66 of file mapperCreate.c.

66{ p->pInputArrivals = pArrivals; }
Here is the caller graph for this function:

◆ Map_ManSetNumIterations()

void Map_ManSetNumIterations ( Map_Man_t * p,
int nNumIterations )
extern

Definition at line 69 of file mapperCreate.c.

69{ p->nIterations = nIterations; }

◆ Map_ManSetObeyFanoutLimits()

void Map_ManSetObeyFanoutLimits ( Map_Man_t * p,
int fObeyFanoutLimits )
extern

Definition at line 68 of file mapperCreate.c.

68{ p->fObeyFanoutLimits = fObeyFanoutLimits; }

◆ Map_ManSetOutputNames()

void Map_ManSetOutputNames ( Map_Man_t * p,
char ** ppNames )
extern

Definition at line 63 of file mapperCreate.c.

63{ p->ppOutputNames = ppNames;}
Here is the caller graph for this function:

◆ Map_ManSetOutputRequireds()

void Map_ManSetOutputRequireds ( Map_Man_t * p,
Map_Time_t * pArrivals )
extern

Definition at line 67 of file mapperCreate.c.

67{ p->pOutputRequireds = pRequireds; }
Here is the caller graph for this function:

◆ Map_ManSetPass()

void Map_ManSetPass ( Map_Man_t * p,
int nPass )
extern

◆ Map_ManSetSkipFanout()

void Map_ManSetSkipFanout ( Map_Man_t * p,
int fSkipFanout )
extern

Definition at line 76 of file mapperCreate.c.

76{ p->fSkipFanout = fSkipFanout; }
Here is the caller graph for this function:

◆ Map_ManSetSwitching()

void Map_ManSetSwitching ( Map_Man_t * p,
int fSwitching )
extern

Definition at line 75 of file mapperCreate.c.

75{ p->fSwitching = fSwitching; }
Here is the caller graph for this function:

◆ Map_ManSetUseProfile()

void Map_ManSetUseProfile ( Map_Man_t * p)
extern

Definition at line 77 of file mapperCreate.c.

77{ p->fUseProfile = 1; }
Here is the caller graph for this function:

◆ Map_ManSetVerbose()

void Map_ManSetVerbose ( Map_Man_t * p,
int fVerbose )
extern

Definition at line 74 of file mapperCreate.c.

74{ p->fVerbose = fVerbose; }

◆ Map_Mapping()

int Map_Mapping ( Map_Man_t * p)
extern

DECLARATIONS ///.

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

FileName [mapperCore.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
mapperCore.c,v 1.7 2004/10/01 23:41:04 satrajit Exp

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

Synopsis [Performs technology mapping for the given object graph.]

Description [The object graph is stored in the mapping manager. First, the AND nodes that fanout into POs are collected in the DFS order. Two preprocessing steps are performed: the k-feasible cuts are computed for each node and the truth tables are computed for each cut. Next, the delay-optimal matches are assigned for each node, followed by several iterations of area recoveryd: using area flow (global optimization) and using exact area at a node (local optimization).]

SideEffects []

SeeAlso []

Definition at line 50 of file mapperCore.c.

51{
52 int fShowSwitching = 0;
53 int fUseAreaFlow = 1;
54 int fUseExactArea = !p->fSwitching;
55 int fUseExactAreaWithPhase = !p->fSwitching;
56 abctime clk;
57
59 // perform pre-mapping computations
60 if ( p->fVerbose )
62 Map_MappingSetChoiceLevels( p ); // should always be called before mapping!
63// return 1;
64
65 // compute the cuts of nodes in the DFS order
66 clk = Abc_Clock();
68 p->timeCuts = Abc_Clock() - clk;
69 // derive the truth tables
70 clk = Abc_Clock();
72 p->timeTruth = Abc_Clock() - clk;
74//ABC_PRT( "Truths", Abc_Clock() - clk );
75
77 // compute the minimum-delay mapping
78 clk = Abc_Clock();
79 p->fMappingMode = 0;
80 if ( !Map_MappingMatches( p ) )
81 return 0;
82 p->timeMatch = Abc_Clock() - clk;
83 // compute the references and collect the nodes used in the mapping
85 p->AreaBase = Map_MappingGetArea( p );
86if ( p->fVerbose )
87{
88printf( "Delay : %s = %8.2f Flow = %11.1f Area = %11.1f %4.1f %% ",
89 fShowSwitching? "Switch" : "Delay",
90 fShowSwitching? Map_MappingGetSwitching(p) : p->fRequiredGlo,
91 Map_MappingGetAreaFlow(p), p->AreaBase, 0.0 );
92ABC_PRT( "Time", p->timeMatch );
93}
95
96 if ( !p->fAreaRecovery )
97 {
98 if ( p->fVerbose )
100 return 1;
101 }
102
104 // perform area recovery using area flow
105 clk = Abc_Clock();
106 if ( fUseAreaFlow )
107 {
108 // compute the required times
110 // recover area flow
111 p->fMappingMode = 1;
113 // compute the references and collect the nodes used in the mapping
115 p->AreaFinal = Map_MappingGetArea( p );
116if ( p->fVerbose )
117{
118printf( "AreaFlow : %s = %8.2f Flow = %11.1f Area = %11.1f %4.1f %% ",
119 fShowSwitching? "Switch" : "Delay",
120 fShowSwitching? Map_MappingGetSwitching(p) : p->fRequiredGlo,
121 Map_MappingGetAreaFlow(p), p->AreaFinal,
122 100.0*(p->AreaBase-p->AreaFinal)/p->AreaBase );
123ABC_PRT( "Time", Abc_Clock() - clk );
124}
125 }
126 p->timeArea += Abc_Clock() - clk;
128
130 // perform area recovery using exact area
131 clk = Abc_Clock();
132 if ( fUseExactArea )
133 {
134 // compute the required times
136 // recover area
137 p->fMappingMode = 2;
139 // compute the references and collect the nodes used in the mapping
141 p->AreaFinal = Map_MappingGetArea( p );
142if ( p->fVerbose )
143{
144printf( "Area : %s = %8.2f Flow = %11.1f Area = %11.1f %4.1f %% ",
145 fShowSwitching? "Switch" : "Delay",
146 fShowSwitching? Map_MappingGetSwitching(p) : p->fRequiredGlo,
147 0.0, p->AreaFinal,
148 100.0*(p->AreaBase-p->AreaFinal)/p->AreaBase );
149ABC_PRT( "Time", Abc_Clock() - clk );
150}
151 }
152 p->timeArea += Abc_Clock() - clk;
154
156 // perform area recovery using exact area
157 clk = Abc_Clock();
158 if ( fUseExactAreaWithPhase )
159 {
160 // compute the required times
162 // recover area
163 p->fMappingMode = 3;
165 // compute the references and collect the nodes used in the mapping
167 p->AreaFinal = Map_MappingGetArea( p );
168if ( p->fVerbose )
169{
170printf( "Area : %s = %8.2f Flow = %11.1f Area = %11.1f %4.1f %% ",
171 fShowSwitching? "Switch" : "Delay",
172 fShowSwitching? Map_MappingGetSwitching(p) : p->fRequiredGlo,
173 0.0, p->AreaFinal,
174 100.0*(p->AreaBase-p->AreaFinal)/p->AreaBase );
175ABC_PRT( "Time", Abc_Clock() - clk );
176}
177 }
178 p->timeArea += Abc_Clock() - clk;
180
182 // perform area recovery using exact area
183 clk = Abc_Clock();
184 if ( p->fSwitching )
185 {
186 // compute the required times
188 // recover switching activity
189 p->fMappingMode = 4;
191 // compute the references and collect the nodes used in the mapping
193 p->AreaFinal = Map_MappingGetArea( p );
194if ( p->fVerbose )
195{
196printf( "Switching: %s = %8.2f Flow = %11.1f Area = %11.1f %4.1f %% ",
197 fShowSwitching? "Switch" : "Delay",
198 fShowSwitching? Map_MappingGetSwitching(p) : p->fRequiredGlo,
199 0.0, p->AreaFinal,
200 100.0*(p->AreaBase-p->AreaFinal)/p->AreaBase );
201ABC_PRT( "Time", Abc_Clock() - clk );
202}
203
204 // compute the required times
206 // recover switching activity
207 p->fMappingMode = 4;
209 // compute the references and collect the nodes used in the mapping
211 p->AreaFinal = Map_MappingGetArea( p );
212if ( p->fVerbose )
213{
214printf( "Switching: %s = %8.2f Flow = %11.1f Area = %11.1f %4.1f %% ",
215 fShowSwitching? "Switch" : "Delay",
216 fShowSwitching? Map_MappingGetSwitching(p) : p->fRequiredGlo,
217 0.0, p->AreaFinal,
218 100.0*(p->AreaBase-p->AreaFinal)/p->AreaBase );
219ABC_PRT( "Time", Abc_Clock() - clk );
220}
221 }
222 p->timeArea += Abc_Clock() - clk;
224
225 // print the arrival times of the latest outputs
226 if ( p->fVerbose )
228 return 1;
229}
ABC_INT64_T abctime
Definition abc_global.h:332
void Map_MappingCuts(Map_Man_t *p)
GLOBAL VARIABLES ///.
Definition mapperCut.c:172
void Map_MappingSetRefs(Map_Man_t *pMan)
Definition mapperRefs.c:450
int Map_MappingMatches(Map_Man_t *p)
void Map_TimeComputeRequiredGlobal(Map_Man_t *p)
Definition mapperTime.c:385
void Map_MappingPrintOutputArrivals(Map_Man_t *p)
float Map_MappingGetAreaFlow(Map_Man_t *p)
void Map_MappingSetChoiceLevels(Map_Man_t *pMan)
void Map_MappingReportChoices(Map_Man_t *pMan)
void Map_MappingTruths(Map_Man_t *pMan)
FUNCTION DEFINITIONS ///.
Definition mapperTruth.c:47
float Map_MappingGetSwitching(Map_Man_t *pMan)
float Map_MappingGetArea(Map_Man_t *pMan)
Definition mapperRefs.c:485
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Map_MappingSetupTruthTables()

void Map_MappingSetupTruthTables ( unsigned uTruths[][2])
extern

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

Synopsis [Sets up the truth tables.]

Description []

SideEffects []

SeeAlso []

Definition at line 335 of file mapperUtils.c.

336{
337 int m, v;
338 // set up the truth tables
339 for ( m = 0; m < 32; m++ )
340 for ( v = 0; v < 5; v++ )
341 if ( m & (1 << v) )
342 uTruths[v][0] |= (1 << m);
343 // make adjustments for the case of 6 variables
344 for ( v = 0; v < 5; v++ )
345 uTruths[v][1] = uTruths[v][0];
346 uTruths[5][0] = 0;
347 uTruths[5][1] = MAP_FULL;
348}
#define MAP_FULL
Definition mapperInt.h:53
Here is the caller graph for this function:

◆ Map_MappingSetupTruthTablesLarge()

void Map_MappingSetupTruthTablesLarge ( unsigned uTruths[][32])
extern

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

Synopsis [Sets up the truth tables.]

Description []

SideEffects []

SeeAlso []

Definition at line 361 of file mapperUtils.c.

362{
363 int m, v;
364 // clean everything
365 for ( m = 0; m < 32; m++ )
366 for ( v = 0; v < 10; v++ )
367 uTruths[v][m] = 0;
368 // set up the truth tables
369 for ( m = 0; m < 32; m++ )
370 for ( v = 0; v < 5; v++ )
371 if ( m & (1 << v) )
372 {
373 uTruths[v][0] |= (1 << m);
374 uTruths[v+5][m] = MAP_FULL;
375 }
376 // extend this info for the rest of the first 5 variables
377 for ( m = 0; m < 32; m++ )
378 for ( v = 0; v < 5; v++ )
379 uTruths[v][m] = uTruths[v][0];
380/*
381 // verify
382 for ( m = 0; m < 1024; m++, printf("\n") )
383 for ( v = 0; v < 10; v++ )
384 if ( Map_InfoReadVar( uTruths[v], m ) )
385 printf( "1" );
386 else
387 printf( "0" );
388*/
389}
Here is the caller graph for this function:

◆ Map_NetworkSweep()

void Map_NetworkSweep ( Abc_Ntk_t * pNet)
extern

◆ Map_NodeAnd()

Map_Node_t * Map_NodeAnd ( Map_Man_t * pMan,
Map_Node_t * p1,
Map_Node_t * p2 )
extern

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

Synopsis [Looks up the AND2 node in the unique table.]

Description [This procedure implements one-level hashing. All the nodes are hashed by their children. If the node with the same children was already created, it is returned by the call to this procedure. If it does not exist, this procedure creates a new node with these children. ]

SideEffects []

SeeAlso []

Definition at line 456 of file mapperCreate.c.

457{
458 Map_Node_t * pEnt;
459 unsigned Key;
460
461 if ( p1 == p2 )
462 return p1;
463 if ( p1 == Map_Not(p2) )
464 return Map_Not(pMan->pConst1);
465 if ( Map_NodeIsConst(p1) )
466 {
467 if ( p1 == pMan->pConst1 )
468 return p2;
469 return Map_Not(pMan->pConst1);
470 }
471 if ( Map_NodeIsConst(p2) )
472 {
473 if ( p2 == pMan->pConst1 )
474 return p1;
475 return Map_Not(pMan->pConst1);
476 }
477
478 if ( Map_Regular(p1)->Num > Map_Regular(p2)->Num )
479 pEnt = p1, p1 = p2, p2 = pEnt;
480
481 Key = Map_HashKey2( p1, p2, pMan->nBins );
482 for ( pEnt = pMan->pBins[Key]; pEnt; pEnt = pEnt->pNext )
483 if ( pEnt->p1 == p1 && pEnt->p2 == p2 )
484 return pEnt;
485 // resize the table
486 if ( pMan->nNodes >= 2 * pMan->nBins )
487 {
488 Map_TableResize( pMan );
489 Key = Map_HashKey2( p1, p2, pMan->nBins );
490 }
491 // create the new node
492 pEnt = Map_NodeCreate( pMan, p1, p2 );
493 // add the node to the corresponding linked list in the table
494 pEnt->pNext = pMan->pBins[Key];
495 pMan->pBins[Key] = pEnt;
496 return pEnt;
497}
int Map_NodeIsConst(Map_Node_t *p)
#define Map_Not(p)
Definition mapper.h:69
Map_Node_t * pNext
Definition mapperInt.h:209
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Map_NodeBuf()

Map_Node_t * Map_NodeBuf ( Map_Man_t * p,
Map_Node_t * p1 )
extern

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

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 561 of file mapperCreate.c.

562{
563 Map_Node_t * pNode = Map_NodeCreate( p, p1, NULL );
564 Map_NodeVecPush( p->vMapBufs, pNode );
565 return pNode;
566}
void Map_NodeVecPush(Map_NodeVec_t *p, Map_Node_t *Entry)
Definition mapperVec.c:190
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Map_NodeComparePhase()

int Map_NodeComparePhase ( Map_Node_t * p1,
Map_Node_t * p2 )
extern

Definition at line 124 of file mapperCreate.c.

124{ assert( !Map_IsComplement(p1) ); assert( !Map_IsComplement(p2) ); return p1->fInv ^ p2->fInv; }

◆ Map_NodeCreate()

Map_Node_t * Map_NodeCreate ( Map_Man_t * p,
Map_Node_t * p1,
Map_Node_t * p2 )
extern

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

Synopsis [Creates a new node.]

Description [This procedure should be called to create the constant node and the PI nodes first.]

SideEffects []

SeeAlso []

Definition at line 373 of file mapperCreate.c.

374{
375 Map_Node_t * pNode;
376 // create the node
377 pNode = (Map_Node_t *)Extra_MmFixedEntryFetch( p->mmNodes );
378 memset( pNode, 0, sizeof(Map_Node_t) );
379 pNode->tRequired[0].Rise = pNode->tRequired[0].Fall = pNode->tRequired[0].Worst = MAP_FLOAT_LARGE;
380 pNode->tRequired[1].Rise = pNode->tRequired[1].Fall = pNode->tRequired[1].Worst = MAP_FLOAT_LARGE;
381 pNode->p1 = p1;
382 pNode->p2 = p2;
383 pNode->p = p;
384 // set the number of this node
385 pNode->Num = p->nNodes++;
386 // place to store the fanouts
387// pNode->vFanouts = Map_NodeVecAlloc( 5 );
388 // store this node in the internal array
389 if ( pNode->Num >= 0 )
390 Map_NodeVecPush( p->vMapObjs, pNode );
391 else
392 pNode->fInv = 1;
393 // set the level of this node
394 if ( p1 )
395 {
396#ifdef MAP_ALLOCATE_FANOUT
397 // create the fanout info
399 if ( p2 )
401#endif
402
403 if ( p2 )
404 {
405 pNode->Level = 1 + MAP_MAX(Map_Regular(pNode->p1)->Level, Map_Regular(pNode->p2)->Level);
407 }
408 else
409 {
410 pNode->Level = Map_Regular(pNode->p1)->Level;
411 pNode->fInv = Map_NodeIsSimComplement(p1);
412 }
413 }
414 // reference the inputs (will be used to compute the number of fanouts)
415 if ( p1 ) Map_NodeRef(p1);
416 if ( p2 ) Map_NodeRef(p2);
417
418 pNode->nRefEst[0] = pNode->nRefEst[1] = -1;
419 return pNode;
420}
#define MAP_MAX(a, b)
Definition mapperInt.h:58
#define Map_NodeRef(p)
Definition mapperInt.h:75
#define Map_NodeIsSimComplement(p)
Definition mapperInt.h:84
void Map_NodeAddFaninFanout(Map_Node_t *pFanin, Map_Node_t *pFanout)
Map_Time_t tRequired[2]
Definition mapperInt.h:240
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Map_NodeIsAnd()

int Map_NodeIsAnd ( Map_Node_t * p)
extern

Definition at line 123 of file mapperCreate.c.

123{ return (Map_Regular(p))->p1 != NULL && (Map_Regular(p))->p2 != NULL; }
Here is the caller graph for this function:

◆ Map_NodeIsBuf()

int Map_NodeIsBuf ( Map_Node_t * p)
extern

Definition at line 122 of file mapperCreate.c.

122{ return (Map_Regular(p))->p1 != NULL && (Map_Regular(p))->p2 == NULL; }
Here is the caller graph for this function:

◆ Map_NodeIsConst()

int Map_NodeIsConst ( Map_Node_t * p)
extern

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

Synopsis [Checks the type of the node.]

Description []

SideEffects []

SeeAlso []

Definition at line 120 of file mapperCreate.c.

120{ return (Map_Regular(p))->Num == -1; }
Here is the caller graph for this function:

◆ Map_NodeIsVar()

int Map_NodeIsVar ( Map_Node_t * p)
extern

Definition at line 121 of file mapperCreate.c.

121{ return (Map_Regular(p))->p1 == NULL && (Map_Regular(p))->Num >= 0; }
Here is the caller graph for this function:

◆ Map_NodeReadAigId()

int Map_NodeReadAigId ( Map_Node_t * p)
extern

Definition at line 95 of file mapperCreate.c.

95{ return p->p->pAigNodeIDs[p->Num]; }

◆ Map_NodeReadCutBest()

Map_Cut_t * Map_NodeReadCutBest ( Map_Node_t * p,
int fPhase )
extern

Definition at line 97 of file mapperCreate.c.

97{ return p->pCutBest[fPhase]; }

◆ Map_NodeReadCuts()

Map_Cut_t * Map_NodeReadCuts ( Map_Node_t * p)
extern

Definition at line 96 of file mapperCreate.c.

96{ return p->pCuts; }

◆ Map_NodeReadData()

char * Map_NodeReadData ( Map_Node_t * p,
int fPhase )
extern

Definition at line 92 of file mapperCreate.c.

92{ return fPhase? p->pData1 : p->pData0; }

◆ Map_NodeReadLevel()

int Map_NodeReadLevel ( Map_Node_t * p)
extern

Definition at line 94 of file mapperCreate.c.

94{ return Map_Regular(p)->Level; }

◆ Map_NodeReadMan()

Map_Man_t * Map_NodeReadMan ( Map_Node_t * p)
extern

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

Synopsis [Reads parameters from the mapping node.]

Description []

SideEffects []

SeeAlso []

Definition at line 91 of file mapperCreate.c.

91{ return p->p; }

◆ Map_NodeReadNum()

int Map_NodeReadNum ( Map_Node_t * p)
extern

Definition at line 93 of file mapperCreate.c.

93{ return p->Num; }

◆ Map_NodeReadOne()

Map_Node_t * Map_NodeReadOne ( Map_Node_t * p)
extern

Definition at line 98 of file mapperCreate.c.

98{ return p->p1; }

◆ Map_NodeReadTwo()

Map_Node_t * Map_NodeReadTwo ( Map_Node_t * p)
extern

Definition at line 99 of file mapperCreate.c.

99{ return p->p2; }

◆ Map_NodeSetAigId()

void Map_NodeSetAigId ( Map_Node_t * p,
int Id )
extern

Definition at line 104 of file mapperCreate.c.

104{ p->p->pAigNodeIDs[p->Num] = Id; }
Here is the caller graph for this function:

◆ Map_NodeSetChoice()

void Map_NodeSetChoice ( Map_Man_t * pMan,
Map_Node_t * pNodeOld,
Map_Node_t * pNodeNew )
extern

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

Synopsis [Sets the node to be equivalent to the given one.]

Description [This procedure is a work-around for the equivalence check. Does not verify the equivalence. Use at the user's risk.]

SideEffects []

SeeAlso []

Definition at line 580 of file mapperCreate.c.

581{
582 pNodeNew->pNextE = pNodeOld->pNextE;
583 pNodeOld->pNextE = pNodeNew;
584 pNodeNew->pRepr = pNodeOld;
585}
Map_Node_t * pNextE
Definition mapperInt.h:227

◆ Map_NodeSetData()

void Map_NodeSetData ( Map_Node_t * p,
int fPhase,
char * pData )
extern

Definition at line 100 of file mapperCreate.c.

100{ if (fPhase) p->pData1 = pData; else p->pData0 = pData; }
Here is the caller graph for this function:

◆ Map_NodeSetNextE()

void Map_NodeSetNextE ( Map_Node_t * p,
Map_Node_t * pNextE )
extern

Definition at line 101 of file mapperCreate.c.

101{ p->pNextE = pNextE; }
Here is the caller graph for this function:

◆ Map_NodeSetRepr()

void Map_NodeSetRepr ( Map_Node_t * p,
Map_Node_t * pRepr )
extern

Definition at line 102 of file mapperCreate.c.

102{ p->pRepr = pRepr; }
Here is the caller graph for this function:

◆ Map_NodeSetSwitching()

void Map_NodeSetSwitching ( Map_Node_t * p,
float Switching )
extern

Definition at line 103 of file mapperCreate.c.

103{ p->Switching = Switching; }
Here is the caller graph for this function:

◆ Map_SuperLibDeriveFromGenlib()

int Map_SuperLibDeriveFromGenlib ( Mio_Library_t * pLib,
int fVerbose )
extern

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

Synopsis [Derives the library from the genlib library.]

Description []

SideEffects []

SeeAlso []

Definition at line 202 of file mapperLib.c.

203{
204 Map_SuperLib_t * pLibSuper;
205 Vec_Str_t * vStr;
206 char * pFileName;
207 if ( pLib == NULL )
208 return 0;
209
210 // compute supergates
211 vStr = Super_PrecomputeStr( pLib, 5, 1, 100000000, 10000000, 10000000, 100, 1, 0 );
212 if ( vStr == NULL )
213 return 0;
214
215 // create supergate library
216 pFileName = Extra_FileNameGenericAppend( Mio_LibraryReadName(pLib), ".super" );
217 pLibSuper = Map_SuperLibCreate( pLib, vStr, pFileName, NULL, 1, 0 );
218 Vec_StrFree( vStr );
219
220 // replace the library
222 Abc_FrameSetLibSuper( pLibSuper );
223 return 1;
224}
ABC_DLL void Abc_FrameSetLibSuper(void *pLib)
Definition mainFrame.c:97
struct Vec_Str_t_ Vec_Str_t
Definition bblif.c:46
char * Extra_FileNameGenericAppend(char *pBase, char *pSuffix)
ABC_NAMESPACE_IMPL_START Map_SuperLib_t * Map_SuperLibCreate(Mio_Library_t *pGenlib, Vec_Str_t *vStr, char *pFileName, char *pExcludeFile, int fAlgorithm, int fVerbose)
DECLARATIONS ///.
Definition mapperLib.c:61
void Map_SuperLibFree(Map_SuperLib_t *p)
Definition mapperLib.c:170
char * Mio_LibraryReadName(Mio_Library_t *pLib)
DECLARATIONS ///.
Definition mioApi.c:43
Vec_Str_t * Super_PrecomputeStr(Mio_Library_t *pLibGen, int nVarsMax, int nLevels, int nGatesMax, float tDelayMax, float tAreaMax, int TimeLimit, int fSkipInv, int fVerbose)
Definition superGate.c:175
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_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 call graph for this function:
Here is the caller graph for this function:

◆ Map_SuperLibReadAreaInv()

float Map_SuperLibReadAreaInv ( Map_SuperLib_t * p)
extern

Definition at line 169 of file mapperCreate.c.

169{ return p->AreaInv; }

◆ Map_SuperLibReadDelayInv()

Map_Time_t Map_SuperLibReadDelayInv ( Map_SuperLib_t * p)
extern

Definition at line 170 of file mapperCreate.c.

170{ return p->tDelayInv;}

◆ Map_SuperLibReadGenLib()

Mio_Library_t * Map_SuperLibReadGenLib ( Map_SuperLib_t * p)
extern

Definition at line 168 of file mapperCreate.c.

168{ return p->pGenlib; }

◆ Map_SuperLibReadVarsMax()

int Map_SuperLibReadVarsMax ( Map_SuperLib_t * p)
extern

Definition at line 171 of file mapperCreate.c.

171{ return p->nVarsMax; }

◆ Map_SuperReadFaninNum()

int Map_SuperReadFaninNum ( Map_Super_t * p)
extern

Definition at line 162 of file mapperCreate.c.

162{ return p->nFanins; }
Here is the caller graph for this function:

◆ Map_SuperReadFanins()

Map_Super_t ** Map_SuperReadFanins ( Map_Super_t * p)
extern

Definition at line 161 of file mapperCreate.c.

161{ return p->pFanins; }
Here is the caller graph for this function:

◆ Map_SuperReadFanoutLimit()

int Map_SuperReadFanoutLimit ( Map_Super_t * p)
extern

Definition at line 166 of file mapperCreate.c.

166{ return p->nFanLimit;}

◆ Map_SuperReadFormula()

char * Map_SuperReadFormula ( Map_Super_t * p)
extern

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

Synopsis [Reads parameters from the supergate.]

Description []

SideEffects []

SeeAlso []

Definition at line 158 of file mapperCreate.c.

158{ return p->pFormula; }

◆ Map_SuperReadNext()

Map_Super_t * Map_SuperReadNext ( Map_Super_t * p)
extern

Definition at line 163 of file mapperCreate.c.

163{ return p->pNext; }

◆ Map_SuperReadNum()

int Map_SuperReadNum ( Map_Super_t * p)
extern

Definition at line 160 of file mapperCreate.c.

160{ return p->Num; }
Here is the caller graph for this function:

◆ Map_SuperReadNumPhases()

int Map_SuperReadNumPhases ( Map_Super_t * p)
extern

Definition at line 164 of file mapperCreate.c.

164{ return p->nPhases; }

◆ Map_SuperReadPhases()

unsigned char * Map_SuperReadPhases ( Map_Super_t * p)
extern

Definition at line 165 of file mapperCreate.c.

165{ return p->uPhases; }

◆ Map_SuperReadRoot()

Mio_Gate_t * Map_SuperReadRoot ( Map_Super_t * p)
extern

Definition at line 159 of file mapperCreate.c.

159{ return p->pRoot; }
Here is the caller graph for this function:

◆ Map_SuperTableLookupC()

Map_Super_t * Map_SuperTableLookupC ( Map_SuperLib_t * p,
unsigned uTruth[] )
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 183 of file mapperTable.c.

184{
185 Map_HashEntry_t * pEnt;
186 unsigned Key;
187 Key = MAP_TABLE_HASH( uTruth[0], uTruth[1], p->tTableC->nBins );
188 for ( pEnt = p->tTableC->pBins[Key]; pEnt; pEnt = pEnt->pNext )
189 if ( pEnt->uTruth[0] == uTruth[0] && pEnt->uTruth[1] == uTruth[1] )
190 return pEnt->pGates;
191 return NULL;
192}
#define MAP_TABLE_HASH(u1, u2, nSize)
DECLARATIONS ///.
Definition mapperTable.c:29
struct Map_HashEntryStruct_t_ Map_HashEntry_t
Definition mapper.h:48
Map_HashEntry_t * pNext
Definition mapperInt.h:325
Map_Super_t * pGates
Definition mapperInt.h:324