abc-master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
mapper.h File Reference

Go to the source code of this file.

Data Structures

struct  Map_TimeStruct_t_
 

Macros

#define Map_IsComplement(p)   (((int)((ABC_PTRUINT_T) (p) & 01)))
 GLOBAL VARIABLES ///. More...
 
#define Map_Regular(p)   ((Map_Node_t *)((ABC_PTRUINT_T)(p) & ~01))
 
#define Map_Not(p)   ((Map_Node_t *)((ABC_PTRUINT_T)(p) ^ 01))
 
#define Map_NotCond(p, c)   ((Map_Node_t *)((ABC_PTRUINT_T)(p) ^ (c)))
 

Typedefs

typedef
typedefABC_NAMESPACE_HEADER_START
struct Map_ManStruct_t_ 
Map_Man_t
 INCLUDES ///. More...
 
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 ///. More...
 
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 ///. More...
 
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)
 
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)
 
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)
 
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 ///. More...
 
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 ///. More...
 
void Map_CutCreateFromNode (Map_Man_t *p, Map_Super_t *pSuper, int iRoot, unsigned uPhaseRoot, int *pLeaves, int nLeaves, unsigned uPhaseLeaves)
 
int Map_Mapping (Map_Man_t *p)
 DECLARATIONS ///. More...
 
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

#define Map_IsComplement (   p)    (((int)((ABC_PTRUINT_T) (p) & 01)))

GLOBAL VARIABLES ///.

MACRO DEFINITIONS ///

Definition at line 67 of file mapper.h.

#define Map_Not (   p)    ((Map_Node_t *)((ABC_PTRUINT_T)(p) ^ 01))

Definition at line 69 of file mapper.h.

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

Definition at line 70 of file mapper.h.

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

Definition at line 68 of file mapper.h.

Typedef Documentation

typedef struct Map_CutStruct_t_ Map_Cut_t

Definition at line 43 of file mapper.h.

Definition at line 48 of file mapper.h.

Definition at line 47 of file mapper.h.

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.

Definition at line 44 of file mapper.h.

typedef struct Map_NodeStruct_t_ Map_Node_t

Definition at line 41 of file mapper.h.

Definition at line 42 of file mapper.h.

Definition at line 45 of file mapper.h.

Definition at line 46 of file mapper.h.

typedef struct Map_TimeStruct_t_ Map_Time_t

Definition at line 49 of file mapper.h.

Function Documentation

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

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 }
static Llb_Mgr_t * p
Definition: llb3Image.c:950
for(p=first;p->value< newval;p=p->next)
unsigned Extra_TruthPolarize(unsigned uTruth, int Polarity, int nVars)
#define assert(ex)
Definition: util_old.h:213
int Map_CanonComputeSlow(unsigned uTruths[][2], int nVarsMax, int nVarsReal, unsigned uTruth[], unsigned char *puPhases, unsigned uTruthRes[])
FUNCTION DEFINITIONS ///.
Definition: mapperCanon.c:48
int Map_CanonComputeSlow ( unsigned  uTruths[][2],
int  nVarsMax,
int  nVarsReal,
unsigned  uTruth[],
unsigned char *  puPhases,
unsigned  uTruthRes[] 
)

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:51
static void Map_CanonComputePhase6(unsigned uTruths[][2], int nVars, unsigned uTruth[], unsigned uPhase, unsigned uTruthRes[])
Definition: mapperCanon.c:132
#define assert(ex)
Definition: util_old.h:213
static ABC_NAMESPACE_IMPL_START unsigned Map_CanonComputePhase(unsigned uTruths[][2], int nVars, unsigned uTruth, unsigned uPhase)
DECLARATIONS ///.
Definition: mapperCanon.c:112
st__table* Map_CreateTableGate2Super ( Map_Man_t pMan)

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;
618  tTable = st__init_table(strcmp, st__strhash);
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 }
int st__insert(st__table *table, const char *key, char *value)
Definition: st.c:171
int strcmp()
st__table * st__init_table(st__compare_func_type compare, st__hash_func_type hash)
Definition: st.c:72
int Mio_GateReadPinNum(Mio_Gate_t *pGate)
Definition: mioApi.c:151
Mio_Gate_t * pRoot
Definition: mapperInt.h:288
int st__strhash(const char *string, int modulus)
Definition: st.c:449
Definition: st.h:52
Map_Super_t * pFanins[6]
Definition: mapperInt.h:287
#define assert(ex)
Definition: util_old.h:213
Map_Cut_t* Map_CutAlloc ( Map_Man_t p)

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 * memset()
#define MAP_FLOAT_LARGE
Definition: mapperInt.h:60
static Llb_Mgr_t * p
Definition: llb3Image.c:950
char * Extra_MmFixedEntryFetch(Extra_MmFixed_t *p)
Map_Time_t tArrive
Definition: mapperInt.h:255
Map_Match_t M[2]
Definition: mapperInt.h:271
void Map_CutCreateFromNode ( Map_Man_t p,
Map_Super_t pSuper,
int  iRoot,
unsigned  uPhaseRoot,
int *  pLeaves,
int  nLeaves,
unsigned  uPhaseLeaves 
)
Map_Node_t** Map_CutReadLeaves ( Map_Cut_t p)

Definition at line 133 of file mapperCreate.c.

133 { return p->ppLeaves; }
Map_Node_t * ppLeaves[6]
Definition: mapperInt.h:265
int Map_CutReadLeavesNum ( Map_Cut_t p)

Definition at line 132 of file mapperCreate.c.

132 { return p->nLeaves; }
Map_Cut_t* Map_CutReadNext ( Map_Cut_t p)

Definition at line 137 of file mapperCreate.c.

137 { return p->pNext; }
Map_Cut_t * pNext
Definition: mapperInt.h:262
unsigned Map_CutReadPhase0 ( Map_Cut_t p)

Definition at line 135 of file mapperCreate.c.

135 { return p->M[0].uPhaseBest;}
unsigned uPhaseBest
Definition: mapperInt.h:252
Map_Match_t M[2]
Definition: mapperInt.h:271
unsigned Map_CutReadPhase1 ( Map_Cut_t p)

Definition at line 136 of file mapperCreate.c.

136 { return p->M[1].uPhaseBest;}
unsigned uPhaseBest
Definition: mapperInt.h:252
Map_Match_t M[2]
Definition: mapperInt.h:271
unsigned Map_CutReadPhaseBest ( Map_Cut_t p,
int  fPhase 
)

Definition at line 134 of file mapperCreate.c.

134 { return p->M[fPhase].uPhaseBest;}
unsigned uPhaseBest
Definition: mapperInt.h:252
Map_Match_t M[2]
Definition: mapperInt.h:271
Map_Super_t* Map_CutReadSuper0 ( Map_Cut_t p)

Definition at line 130 of file mapperCreate.c.

130 { return p->M[0].pSuperBest;}
Map_Super_t * pSuperBest
Definition: mapperInt.h:253
Map_Match_t M[2]
Definition: mapperInt.h:271
Map_Super_t* Map_CutReadSuper1 ( Map_Cut_t p)

Definition at line 131 of file mapperCreate.c.

131 { return p->M[1].pSuperBest;}
Map_Super_t * pSuperBest
Definition: mapperInt.h:253
Map_Match_t M[2]
Definition: mapperInt.h:271
Map_Super_t* Map_CutReadSuperBest ( Map_Cut_t p,
int  fPhase 
)

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

Synopsis [Reads parameters from the cut.]

Description []

SideEffects []

SeeAlso []

Definition at line 129 of file mapperCreate.c.

129 { return p->M[fPhase].pSuperBest;}
Map_Super_t * pSuperBest
Definition: mapperInt.h:253
Map_Match_t M[2]
Definition: mapperInt.h:271
char* Map_LibraryReadFormulaStep ( char *  pFormula,
char *  pStrings[],
int *  pnStrings 
)

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 paranthesis
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 paranthesis
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 }
#define assert(ex)
Definition: util_old.h:213
int Map_ManCheckConsistency ( Map_Man_t p)

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 }
static Llb_Mgr_t * p
Definition: llb3Image.c:950
int Map_NodeIsConst(Map_Node_t *p)
Definition: mapperCreate.c:112
Map_Node_t ** pArray
Definition: mapperInt.h:301
int Map_NodeIsVar(Map_Node_t *p)
Definition: mapperCreate.c:113
Map_NodeVec_t * Map_MappingDfs(Map_Man_t *pMan, int fCollectEquiv)
Definition: mapperUtils.c:77
Map_Node_t * p2
Definition: mapperInt.h:222
Map_Node_t * p1
Definition: mapperInt.h:221
#define Map_Regular(p)
Definition: mapper.h:68
void Map_NodeVecFree(Map_NodeVec_t *p)
Definition: mapperVec.c:68
Map_Node_t * pRepr
Definition: mapperInt.h:224
void Map_ManCleanData ( Map_Man_t p)

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 }
static Llb_Mgr_t * p
Definition: llb3Image.c:950
Map_Man_t* Map_ManCreate ( int  nInputs,
int  nOutputs,
int  fVerbose 
)

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 184 of file mapperCreate.c.

185 {
186  Map_Man_t * p;
187  int i;
188 
189  // derive the supergate library
190  if ( Abc_FrameReadLibSuper() == NULL )
191  {
192  printf( "The supergate library is not specified. Use \"read_super\".\n" );
193  return NULL;
194  }
195 
196  // start the manager
197  p = ABC_ALLOC( Map_Man_t, 1 );
198  memset( p, 0, sizeof(Map_Man_t) );
199  p->pSuperLib = (Map_SuperLib_t *)Abc_FrameReadLibSuper();
200  p->nVarsMax = p->pSuperLib->nVarsMax;
201  p->fVerbose = fVerbose;
202  p->fEpsilon = (float)0.001;
203  assert( p->nVarsMax > 0 );
204 
205  if ( p->nVarsMax == 5 )
206  Extra_Truth4VarN( &p->uCanons, &p->uPhases, &p->pCounters, 8 );
207 
208  // start various data structures
209  Map_TableCreate( p );
210  Map_MappingSetupTruthTables( p->uTruths );
211  Map_MappingSetupTruthTablesLarge( p->uTruthsLarge );
212 // printf( "Node = %d bytes. Cut = %d bytes. Super = %d bytes.\n", sizeof(Map_Node_t), sizeof(Map_Cut_t), sizeof(Map_Super_t) );
213  p->mmNodes = Extra_MmFixedStart( sizeof(Map_Node_t) );
214  p->mmCuts = Extra_MmFixedStart( sizeof(Map_Cut_t) );
215 
216  // make sure the constant node will get index -1
217  p->nNodes = -1;
218  // create the constant node
219  p->pConst1 = Map_NodeCreate( p, NULL, NULL );
220  p->vMapObjs = Map_NodeVecAlloc( 100 );
221  p->vMapBufs = Map_NodeVecAlloc( 100 );
222  p->vVisited = Map_NodeVecAlloc( 100 );
223 
224  // create the PI nodes
225  p->nInputs = nInputs;
226  p->pInputs = ABC_ALLOC( Map_Node_t *, nInputs );
227  for ( i = 0; i < nInputs; i++ )
228  p->pInputs[i] = Map_NodeCreate( p, NULL, NULL );
229 
230  // create the place for the output nodes
231  p->nOutputs = nOutputs;
232  p->pOutputs = ABC_ALLOC( Map_Node_t *, nOutputs );
233  memset( p->pOutputs, 0, sizeof(Map_Node_t *) * nOutputs );
234  return p;
235 }
char * memset()
Map_NodeVec_t * Map_NodeVecAlloc(int nCap)
FUNCTION DEFINITIONS ///.
Definition: mapperVec.c:45
static Llb_Mgr_t * p
Definition: llb3Image.c:950
#define ABC_ALLOC(type, num)
Definition: abc_global.h:229
static ABC_NAMESPACE_IMPL_START void Map_TableCreate(Map_Man_t *p)
DECLARATIONS ///.
Definition: mapperCreate.c:424
Extra_MmFixed_t * Extra_MmFixedStart(int nEntrySize)
ABC_DLL void * Abc_FrameReadLibSuper()
Definition: mainFrame.c:58
void Extra_Truth4VarN(unsigned short **puCanons, char ***puPhases, char **ppCounters, int nPhasesMax)
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)
Definition: mapperCreate.c:364
#define assert(ex)
Definition: util_old.h:213
void Map_MappingSetupTruthTablesLarge(unsigned uTruths[][32])
Definition: mapperUtils.c:361
void Map_MappingSetupTruthTables(unsigned uTruths[][2])
Definition: mapperUtils.c:335
void Map_ManCreateNodeDelays ( Map_Man_t p,
int  LogFan 
)

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

Synopsis [Creates node delays.]

Description []

SideEffects []

SeeAlso []

Definition at line 284 of file mapperCreate.c.

285 {
286  Map_Node_t * pNode;
287  int k;
288  assert( p->pNodeDelays == NULL );
289  p->pNodeDelays = ABC_CALLOC( float, p->vMapObjs->nSize );
290  for ( k = 0; k < p->vMapObjs->nSize; k++ )
291  {
292  pNode = p->vMapObjs->pArray[k];
293  if ( pNode->nRefs == 0 )
294  continue;
295  p->pNodeDelays[k] = 0.014426 * LogFan * p->pSuperLib->tDelayInv.Worst * log( (double)pNode->nRefs ); // 1.4426 = 1/ln(2)
296 // printf( "%d = %d (%.2f) ", k, pNode->nRefs, p->pNodeDelays[k] );
297  }
298 // printf( "\n" );
299 }
static Llb_Mgr_t * p
Definition: llb3Image.c:950
#define ABC_CALLOC(type, num)
Definition: abc_global.h:230
#define assert(ex)
Definition: util_old.h:213
void Map_ManFree ( Map_Man_t p)

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

Synopsis [Deallocates the mapping manager.]

Description []

SideEffects []

SeeAlso []

Definition at line 248 of file mapperCreate.c.

249 {
250 // int i;
251 // for ( i = 0; i < p->vMapObjs->nSize; i++ )
252 // Map_NodeVecFree( p->vMapObjs->pArray[i]->vFanouts );
253 // Map_NodeVecFree( p->pConst1->vFanouts );
254  Map_NodeVecFree( p->vMapObjs );
255  Map_NodeVecFree( p->vMapBufs );
256  Map_NodeVecFree( p->vVisited );
257  if ( p->uCanons ) ABC_FREE( p->uCanons );
258  if ( p->uPhases ) ABC_FREE( p->uPhases );
259  if ( p->pCounters ) ABC_FREE( p->pCounters );
260  Extra_MmFixedStop( p->mmNodes );
261  Extra_MmFixedStop( p->mmCuts );
262  ABC_FREE( p->pNodeDelays );
263  ABC_FREE( p->pInputArrivals );
264  ABC_FREE( p->pOutputRequireds );
265  ABC_FREE( p->pInputs );
266  ABC_FREE( p->pOutputs );
267  ABC_FREE( p->pBins );
268  ABC_FREE( p->ppOutputNames );
269  ABC_FREE( p );
270 }
static Llb_Mgr_t * p
Definition: llb3Image.c:950
void Extra_MmFixedStop(Extra_MmFixed_t *p)
void Map_NodeVecFree(Map_NodeVec_t *p)
Definition: mapperVec.c:68
#define ABC_FREE(obj)
Definition: abc_global.h:232
void Map_ManPrintStatsToFile ( char *  pName,
float  Area,
float  Delay,
abctime  Time 
)

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

Synopsis [Prints the mapping stats.]

Description []

SideEffects []

SeeAlso []

Definition at line 341 of file mapperCreate.c.

342 {
343  FILE * pTable;
344  pTable = fopen( "map_stats.txt", "a+" );
345  fprintf( pTable, "%s ", pName );
346  fprintf( pTable, "%4.2f ", Area );
347  fprintf( pTable, "%4.2f ", Delay );
348  fprintf( pTable, "%4.2f\n", (float)(Time)/(float)(CLOCKS_PER_SEC) );
349  fclose( pTable );
350 }
void Map_ManPrintTimeStats ( Map_Man_t p)

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

Synopsis [Deallocates the mapping manager.]

Description []

SideEffects []

SeeAlso []

Definition at line 313 of file mapperCreate.c.

314 {
315  printf( "N-canonical = %d. Matchings = %d. Phases = %d. ", p->nCanons, p->nMatches, p->nPhases );
316  printf( "Choice nodes = %d. Choices = %d.\n", p->nChoiceNodes, p->nChoices );
317  ABC_PRT( "ToMap", p->timeToMap );
318  ABC_PRT( "Cuts ", p->timeCuts );
319  ABC_PRT( "Truth", p->timeTruth );
320  ABC_PRT( "Match", p->timeMatch );
321  ABC_PRT( "Area ", p->timeArea );
322  ABC_PRT( "Sweep", p->timeSweep );
323  ABC_PRT( "ToNet", p->timeToNet );
324  ABC_PRT( "TOTAL", p->timeTotal );
325  if ( p->time1 ) { ABC_PRT( "time1", p->time1 ); }
326  if ( p->time2 ) { ABC_PRT( "time2", p->time2 ); }
327  if ( p->time3 ) { ABC_PRT( "time3", p->time3 ); }
328 }
static Llb_Mgr_t * p
Definition: llb3Image.c:950
#define ABC_PRT(a, t)
Definition: abc_global.h:220
float Map_ManReadAreaFinal ( Map_Man_t p)

Definition at line 61 of file mapperCreate.c.

61 { return p->AreaFinal; }
static Llb_Mgr_t * p
Definition: llb3Image.c:950
Map_Node_t* Map_ManReadBufDriver ( Map_Man_t p,
int  i 
)

Definition at line 55 of file mapperCreate.c.

55 { return Map_ManReadBufs(p)[i]->p1; }
static Llb_Mgr_t * p
Definition: llb3Image.c:950
Map_Node_t ** Map_ManReadBufs(Map_Man_t *p)
Definition: mapperCreate.c:54
Map_Node_t * p1
Definition: mapperInt.h:221
int Map_ManReadBufNum ( Map_Man_t p)

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
static Llb_Mgr_t * p
Definition: llb3Image.c:950
Map_Node_t** Map_ManReadBufs ( Map_Man_t p)

Definition at line 54 of file mapperCreate.c.

54 { return Map_NodeVecReadArray(p->vMapBufs); }
static Llb_Mgr_t * p
Definition: llb3Image.c:950
Map_Node_t ** Map_NodeVecReadArray(Map_NodeVec_t *p)
Definition: mapperVec.c:106
Map_Node_t* Map_ManReadConst1 ( Map_Man_t p)

Definition at line 56 of file mapperCreate.c.

56 { return p->pConst1; }
static Llb_Mgr_t * p
Definition: llb3Image.c:950
int Map_ManReadFanoutViolations ( Map_Man_t p)

Definition at line 70 of file mapperCreate.c.

70 { return p->nFanoutViolations; }
static Llb_Mgr_t * p
Definition: llb3Image.c:950
Mio_Library_t* Map_ManReadGenLib ( Map_Man_t p)

Definition at line 59 of file mapperCreate.c.

59 { return p->pSuperLib->pGenlib; }
static Llb_Mgr_t * p
Definition: llb3Image.c:950
Map_Time_t* Map_ManReadInputArrivals ( Map_Man_t p)

Definition at line 57 of file mapperCreate.c.

57 { return p->pInputArrivals; }
static Llb_Mgr_t * p
Definition: llb3Image.c:950
int Map_ManReadInputNum ( Map_Man_t p)

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; }
static Llb_Mgr_t * p
Definition: llb3Image.c:950
Map_Node_t** Map_ManReadInputs ( Map_Man_t p)

Definition at line 52 of file mapperCreate.c.

52 { return p->pInputs; }
static Llb_Mgr_t * p
Definition: llb3Image.c:950
int Map_ManReadOutputNum ( Map_Man_t p)

Definition at line 50 of file mapperCreate.c.

50 { return p->nOutputs; }
static Llb_Mgr_t * p
Definition: llb3Image.c:950
Map_Node_t** Map_ManReadOutputs ( Map_Man_t p)

Definition at line 53 of file mapperCreate.c.

53 { return p->pOutputs; }
static Llb_Mgr_t * p
Definition: llb3Image.c:950
int Map_ManReadPass ( Map_Man_t p)
float Map_ManReadRequiredGlo ( Map_Man_t p)

Definition at line 62 of file mapperCreate.c.

62 { return p->fRequiredGlo; }
static Llb_Mgr_t * p
Definition: llb3Image.c:950
int Map_ManReadVerbose ( Map_Man_t p)

Definition at line 60 of file mapperCreate.c.

60 { return p->fVerbose; }
static Llb_Mgr_t * p
Definition: llb3Image.c:950
void Map_ManSetAreaRecovery ( Map_Man_t p,
int  fAreaRecovery 
)

Definition at line 64 of file mapperCreate.c.

64 { p->fAreaRecovery = fAreaRecovery;}
static Llb_Mgr_t * p
Definition: llb3Image.c:950
void Map_ManSetChoiceNodeNum ( Map_Man_t p,
int  nChoiceNodes 
)

Definition at line 72 of file mapperCreate.c.

72 { p->nChoiceNodes = nChoiceNodes; }
static Llb_Mgr_t * p
Definition: llb3Image.c:950
void Map_ManSetChoiceNum ( Map_Man_t p,
int  nChoices 
)

Definition at line 73 of file mapperCreate.c.

73 { p->nChoices = nChoices; }
static Llb_Mgr_t * p
Definition: llb3Image.c:950
void Map_ManSetDelayTarget ( Map_Man_t p,
float  DelayTarget 
)

Definition at line 65 of file mapperCreate.c.

65 { p->DelayTarget = DelayTarget;}
static Llb_Mgr_t * p
Definition: llb3Image.c:950
void Map_ManSetFanoutViolations ( Map_Man_t p,
int  nVio 
)

Definition at line 71 of file mapperCreate.c.

71 { p->nFanoutViolations = nVio; }
static Llb_Mgr_t * p
Definition: llb3Image.c:950
void Map_ManSetInputArrivals ( Map_Man_t p,
Map_Time_t pArrivals 
)

Definition at line 66 of file mapperCreate.c.

66 { p->pInputArrivals = pArrivals; }
static Llb_Mgr_t * p
Definition: llb3Image.c:950
void Map_ManSetNumIterations ( Map_Man_t p,
int  nNumIterations 
)

Definition at line 69 of file mapperCreate.c.

69 { p->nIterations = nIterations; }
static Llb_Mgr_t * p
Definition: llb3Image.c:950
void Map_ManSetObeyFanoutLimits ( Map_Man_t p,
int  fObeyFanoutLimits 
)

Definition at line 68 of file mapperCreate.c.

68 { p->fObeyFanoutLimits = fObeyFanoutLimits; }
static Llb_Mgr_t * p
Definition: llb3Image.c:950
void Map_ManSetOutputNames ( Map_Man_t p,
char **  ppNames 
)

Definition at line 63 of file mapperCreate.c.

63 { p->ppOutputNames = ppNames;}
static Llb_Mgr_t * p
Definition: llb3Image.c:950
void Map_ManSetOutputRequireds ( Map_Man_t p,
Map_Time_t pArrivals 
)

Definition at line 67 of file mapperCreate.c.

67 { p->pOutputRequireds = pRequireds; }
static Llb_Mgr_t * p
Definition: llb3Image.c:950
void Map_ManSetPass ( Map_Man_t p,
int  nPass 
)
void Map_ManSetSwitching ( Map_Man_t p,
int  fSwitching 
)

Definition at line 75 of file mapperCreate.c.

75 { p->fSwitching = fSwitching; }
static Llb_Mgr_t * p
Definition: llb3Image.c:950
void Map_ManSetVerbose ( Map_Man_t p,
int  fVerbose 
)

Definition at line 74 of file mapperCreate.c.

74 { p->fVerbose = fVerbose; }
static Llb_Mgr_t * p
Definition: llb3Image.c:950
int Map_Mapping ( Map_Man_t p)

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 
58  //////////////////////////////////////////////////////////////////////
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();
67  Map_MappingCuts( p );
68  p->timeCuts = Abc_Clock() - clk;
69  // derive the truth tables
70  clk = Abc_Clock();
72  p->timeTruth = Abc_Clock() - clk;
73  //////////////////////////////////////////////////////////////////////
74 //ABC_PRT( "Truths", Abc_Clock() - clk );
75 
76  //////////////////////////////////////////////////////////////////////
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 );
86 if ( p->fVerbose )
87 {
88 printf( "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 );
92 ABC_PRT( "Time", p->timeMatch );
93 }
94  //////////////////////////////////////////////////////////////////////
95 
96  if ( !p->fAreaRecovery )
97  {
98  if ( p->fVerbose )
100  return 1;
101  }
102 
103  //////////////////////////////////////////////////////////////////////
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 );
116 if ( p->fVerbose )
117 {
118 printf( "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 );
123 ABC_PRT( "Time", Abc_Clock() - clk );
124 }
125  }
126  p->timeArea += Abc_Clock() - clk;
127  //////////////////////////////////////////////////////////////////////
128 
129  //////////////////////////////////////////////////////////////////////
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 );
142 if ( p->fVerbose )
143 {
144 printf( "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 );
149 ABC_PRT( "Time", Abc_Clock() - clk );
150 }
151  }
152  p->timeArea += Abc_Clock() - clk;
153  //////////////////////////////////////////////////////////////////////
154 
155  //////////////////////////////////////////////////////////////////////
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 );
168 if ( p->fVerbose )
169 {
170 printf( "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 );
175 ABC_PRT( "Time", Abc_Clock() - clk );
176 }
177  }
178  p->timeArea += Abc_Clock() - clk;
179  //////////////////////////////////////////////////////////////////////
180 
181  //////////////////////////////////////////////////////////////////////
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 );
194 if ( p->fVerbose )
195 {
196 printf( "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 );
201 ABC_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 );
212 if ( p->fVerbose )
213 {
214 printf( "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 );
219 ABC_PRT( "Time", Abc_Clock() - clk );
220 }
221  }
222  p->timeArea += Abc_Clock() - clk;
223  //////////////////////////////////////////////////////////////////////
224 
225  // print the arrival times of the latest outputs
226  if ( p->fVerbose )
228  return 1;
229 }
float Map_MappingGetSwitching(Map_Man_t *pMan)
Definition: mapperSwitch.c:187
static Llb_Mgr_t * p
Definition: llb3Image.c:950
void Map_MappingSetRefs(Map_Man_t *pMan)
Definition: mapperRefs.c:441
int Map_MappingMatches(Map_Man_t *p)
Definition: mapperMatch.c:553
static abctime Abc_Clock()
Definition: abc_global.h:279
void Map_MappingTruths(Map_Man_t *pMan)
FUNCTION DEFINITIONS ///.
Definition: mapperTruth.c:47
void Map_MappingSetChoiceLevels(Map_Man_t *pMan)
Definition: mapperUtils.c:821
float Map_MappingGetAreaFlow(Map_Man_t *p)
Definition: mapperUtils.c:487
void Map_TimeComputeRequiredGlobal(Map_Man_t *p)
Definition: mapperTime.c:381
#define ABC_PRT(a, t)
Definition: abc_global.h:220
void Map_MappingReportChoices(Map_Man_t *pMan)
Definition: mapperUtils.c:842
float Map_MappingGetArea(Map_Man_t *pMan)
Definition: mapperRefs.c:474
void Map_MappingCuts(Map_Man_t *p)
GLOBAL VARIABLES ///.
Definition: mapperCut.c:172
ABC_INT64_T abctime
Definition: abc_global.h:278
void Map_MappingPrintOutputArrivals(Map_Man_t *p)
Definition: mapperUtils.c:289
void Map_MappingSetupTruthTables ( unsigned  uTruths[][2])

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:52
void Map_MappingSetupTruthTablesLarge ( unsigned  uTruths[][32])

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 }
#define MAP_FULL
Definition: mapperInt.h:52
void Map_NetworkSweep ( Abc_Ntk_t pNet)
Map_Node_t* Map_NodeAnd ( Map_Man_t pMan,
Map_Node_t p1,
Map_Node_t p2 
)

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 447 of file mapperCreate.c.

448 {
449  Map_Node_t * pEnt;
450  unsigned Key;
451 
452  if ( p1 == p2 )
453  return p1;
454  if ( p1 == Map_Not(p2) )
455  return Map_Not(pMan->pConst1);
456  if ( Map_NodeIsConst(p1) )
457  {
458  if ( p1 == pMan->pConst1 )
459  return p2;
460  return Map_Not(pMan->pConst1);
461  }
462  if ( Map_NodeIsConst(p2) )
463  {
464  if ( p2 == pMan->pConst1 )
465  return p1;
466  return Map_Not(pMan->pConst1);
467  }
468 
469  if ( Map_Regular(p1)->Num > Map_Regular(p2)->Num )
470  pEnt = p1, p1 = p2, p2 = pEnt;
471 
472  Key = Map_HashKey2( p1, p2, pMan->nBins );
473  for ( pEnt = pMan->pBins[Key]; pEnt; pEnt = pEnt->pNext )
474  if ( pEnt->p1 == p1 && pEnt->p2 == p2 )
475  return pEnt;
476  // resize the table
477  if ( pMan->nNodes >= 2 * pMan->nBins )
478  {
479  Map_TableResize( pMan );
480  Key = Map_HashKey2( p1, p2, pMan->nBins );
481  }
482  // create the new node
483  pEnt = Map_NodeCreate( pMan, p1, p2 );
484  // add the node to the corresponding linked list in the table
485  pEnt->pNext = pMan->pBins[Key];
486  pMan->pBins[Key] = pEnt;
487  return pEnt;
488 }
Map_Node_t * pNext
Definition: mapperInt.h:205
static unsigned Map_HashKey2(Map_Node_t *p0, Map_Node_t *p1, int TableSize)
Definition: mapperCreate.c:32
int Map_NodeIsConst(Map_Node_t *p)
Definition: mapperCreate.c:112
static void Map_TableResize(Map_Man_t *p)
Definition: mapperCreate.c:502
Map_Node_t * p2
Definition: mapperInt.h:222
Map_Node_t * p1
Definition: mapperInt.h:221
#define Map_Regular(p)
Definition: mapper.h:68
Map_Node_t * Map_NodeCreate(Map_Man_t *p, Map_Node_t *p1, Map_Node_t *p2)
Definition: mapperCreate.c:364
#define Map_Not(p)
Definition: mapper.h:69
Map_Node_t* Map_NodeBuf ( Map_Man_t p,
Map_Node_t p1 
)

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

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 552 of file mapperCreate.c.

553 {
554  Map_Node_t * pNode = Map_NodeCreate( p, p1, NULL );
555  Map_NodeVecPush( p->vMapBufs, pNode );
556  return pNode;
557 }
static Llb_Mgr_t * p
Definition: llb3Image.c:950
Map_Node_t * Map_NodeCreate(Map_Man_t *p, Map_Node_t *p1, Map_Node_t *p2)
Definition: mapperCreate.c:364
void Map_NodeVecPush(Map_NodeVec_t *p, Map_Node_t *Entry)
Definition: mapperVec.c:190
int Map_NodeComparePhase ( Map_Node_t p1,
Map_Node_t p2 
)

Definition at line 116 of file mapperCreate.c.

116 { assert( !Map_IsComplement(p1) ); assert( !Map_IsComplement(p2) ); return p1->fInv ^ p2->fInv; }
#define Map_IsComplement(p)
GLOBAL VARIABLES ///.
Definition: mapper.h:67
#define assert(ex)
Definition: util_old.h:213
Map_Node_t* Map_NodeCreate ( Map_Man_t p,
Map_Node_t p1,
Map_Node_t p2 
)

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 364 of file mapperCreate.c.

365 {
366  Map_Node_t * pNode;
367  // create the node
368  pNode = (Map_Node_t *)Extra_MmFixedEntryFetch( p->mmNodes );
369  memset( pNode, 0, sizeof(Map_Node_t) );
370  pNode->tRequired[0].Rise = pNode->tRequired[0].Fall = pNode->tRequired[0].Worst = MAP_FLOAT_LARGE;
371  pNode->tRequired[1].Rise = pNode->tRequired[1].Fall = pNode->tRequired[1].Worst = MAP_FLOAT_LARGE;
372  pNode->p1 = p1;
373  pNode->p2 = p2;
374  pNode->p = p;
375  // set the number of this node
376  pNode->Num = p->nNodes++;
377  // place to store the fanouts
378 // pNode->vFanouts = Map_NodeVecAlloc( 5 );
379  // store this node in the internal array
380  if ( pNode->Num >= 0 )
381  Map_NodeVecPush( p->vMapObjs, pNode );
382  else
383  pNode->fInv = 1;
384  // set the level of this node
385  if ( p1 )
386  {
387 #ifdef MAP_ALLOCATE_FANOUT
388  // create the fanout info
389  Map_NodeAddFaninFanout( Map_Regular(p1), pNode );
390  if ( p2 )
391  Map_NodeAddFaninFanout( Map_Regular(p2), pNode );
392 #endif
393 
394  if ( p2 )
395  {
396  pNode->Level = 1 + MAP_MAX(Map_Regular(pNode->p1)->Level, Map_Regular(pNode->p2)->Level);
398  }
399  else
400  {
401  pNode->Level = Map_Regular(pNode->p1)->Level;
402  pNode->fInv = Map_NodeIsSimComplement(p1);
403  }
404  }
405  // reference the inputs (will be used to compute the number of fanouts)
406  if ( p1 ) Map_NodeRef(p1);
407  if ( p2 ) Map_NodeRef(p2);
408 
409  pNode->nRefEst[0] = pNode->nRefEst[1] = -1;
410  return pNode;
411 }
char * memset()
void Map_NodeAddFaninFanout(Map_Node_t *pFanin, Map_Node_t *pFanout)
Map_Man_t * p
Definition: mapperInt.h:204
#define MAP_FLOAT_LARGE
Definition: mapperInt.h:60
static Llb_Mgr_t * p
Definition: llb3Image.c:950
Map_Time_t tRequired[2]
Definition: mapperInt.h:236
char * Extra_MmFixedEntryFetch(Extra_MmFixed_t *p)
unsigned Level
Definition: mapperInt.h:214
#define Map_NodeRef(p)
Definition: mapperInt.h:74
Map_Node_t * p2
Definition: mapperInt.h:222
Map_Node_t * p1
Definition: mapperInt.h:221
float nRefEst[3]
Definition: mapperInt.h:217
#define Map_Regular(p)
Definition: mapper.h:68
void Map_NodeVecPush(Map_NodeVec_t *p, Map_Node_t *Entry)
Definition: mapperVec.c:190
#define Map_NodeIsSimComplement(p)
Definition: mapperInt.h:83
#define MAP_MAX(a, b)
Definition: mapperInt.h:57
int Map_NodeIsAnd ( Map_Node_t p)

Definition at line 115 of file mapperCreate.c.

115 { return (Map_Regular(p))->p1 != NULL && (Map_Regular(p))->p2 != NULL; }
#define Map_Regular(p)
Definition: mapper.h:68
int Map_NodeIsBuf ( Map_Node_t p)

Definition at line 114 of file mapperCreate.c.

114 { return (Map_Regular(p))->p1 != NULL && (Map_Regular(p))->p2 == NULL; }
#define Map_Regular(p)
Definition: mapper.h:68
int Map_NodeIsConst ( Map_Node_t p)

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

Synopsis [Checks the type of the node.]

Description []

SideEffects []

SeeAlso []

Definition at line 112 of file mapperCreate.c.

112 { return (Map_Regular(p))->Num == -1; }
#define Map_Regular(p)
Definition: mapper.h:68
int Map_NodeIsVar ( Map_Node_t p)

Definition at line 113 of file mapperCreate.c.

113 { return (Map_Regular(p))->p1 == NULL && (Map_Regular(p))->Num >= 0; }
#define Map_Regular(p)
Definition: mapper.h:68
Map_Cut_t* Map_NodeReadCutBest ( Map_Node_t p,
int  fPhase 
)

Definition at line 93 of file mapperCreate.c.

93 { return p->pCutBest[fPhase]; }
Map_Cut_t * pCutBest[2]
Definition: mapperInt.h:239
Map_Cut_t* Map_NodeReadCuts ( Map_Node_t p)

Definition at line 92 of file mapperCreate.c.

92 { return p->pCuts; }
Map_Cut_t * pCuts
Definition: mapperInt.h:240
char* Map_NodeReadData ( Map_Node_t p,
int  fPhase 
)

Definition at line 89 of file mapperCreate.c.

89 { return fPhase? p->pData1 : p->pData0; }
int Map_NodeReadLevel ( Map_Node_t p)

Definition at line 91 of file mapperCreate.c.

91 { return Map_Regular(p)->Level; }
#define Map_Regular(p)
Definition: mapper.h:68
Map_Man_t* Map_NodeReadMan ( Map_Node_t p)

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

Synopsis [Reads parameters from the mapping node.]

Description []

SideEffects []

SeeAlso []

Definition at line 88 of file mapperCreate.c.

88 { return p->p; }
Map_Man_t * p
Definition: mapperInt.h:204
int Map_NodeReadNum ( Map_Node_t p)

Definition at line 90 of file mapperCreate.c.

90 { return p->Num; }
Map_Node_t* Map_NodeReadOne ( Map_Node_t p)

Definition at line 94 of file mapperCreate.c.

94 { return p->p1; }
Map_Node_t * p1
Definition: mapperInt.h:221
Map_Node_t* Map_NodeReadTwo ( Map_Node_t p)

Definition at line 95 of file mapperCreate.c.

95 { return p->p2; }
Map_Node_t * p2
Definition: mapperInt.h:222
void Map_NodeSetChoice ( Map_Man_t pMan,
Map_Node_t pNodeOld,
Map_Node_t pNodeNew 
)

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 571 of file mapperCreate.c.

572 {
573  pNodeNew->pNextE = pNodeOld->pNextE;
574  pNodeOld->pNextE = pNodeNew;
575  pNodeNew->pRepr = pNodeOld;
576 }
Map_Node_t * pNextE
Definition: mapperInt.h:223
Map_Node_t * pRepr
Definition: mapperInt.h:224
void Map_NodeSetData ( Map_Node_t p,
int  fPhase,
char *  pData 
)

Definition at line 96 of file mapperCreate.c.

96 { if (fPhase) p->pData1 = pData; else p->pData0 = pData; }
void Map_NodeSetNextE ( Map_Node_t p,
Map_Node_t pNextE 
)

Definition at line 97 of file mapperCreate.c.

97 { p->pNextE = pNextE; }
Map_Node_t * pNextE
Definition: mapperInt.h:223
void Map_NodeSetRepr ( Map_Node_t p,
Map_Node_t pRepr 
)

Definition at line 98 of file mapperCreate.c.

98 { p->pRepr = pRepr; }
Map_Node_t * pRepr
Definition: mapperInt.h:224
void Map_NodeSetSwitching ( Map_Node_t p,
float  Switching 
)

Definition at line 99 of file mapperCreate.c.

99 { p->Switching = Switching; }
int Map_SuperLibDeriveFromGenlib ( Mio_Library_t pLib,
int  fVerbose 
)

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

Synopsis [Derives the library from the genlib library.]

Description []

SideEffects []

SeeAlso []

Definition at line 199 of file mapperLib.c.

200 {
201  Map_SuperLib_t * pLibSuper;
202  Vec_Str_t * vStr;
203  char * pFileName;
204  if ( pLib == NULL )
205  return 0;
206 
207  // compute supergates
208  vStr = Super_PrecomputeStr( pLib, 5, 1, 100000000, 10000000, 10000000, 100, 1, 0 );
209  if ( vStr == NULL )
210  return 0;
211 
212  // create supergate library
213  pFileName = Extra_FileNameGenericAppend( Mio_LibraryReadName(pLib), ".super" );
214  pLibSuper = Map_SuperLibCreate( pLib, vStr, pFileName, NULL, 1, 0 );
215  Vec_StrFree( vStr );
216 
217  // replace the library
219  Abc_FrameSetLibSuper( pLibSuper );
220  return 1;
221 }
ABC_DLL void Abc_FrameSetLibSuper(void *pLib)
Definition: mainFrame.c:84
char * Mio_LibraryReadName(Mio_Library_t *pLib)
DECLARATIONS ///.
Definition: mioApi.c:43
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:58
static void Vec_StrFree(Vec_Str_t *p)
Definition: bblif.c:616
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:172
void Map_SuperLibFree(Map_SuperLib_t *p)
Definition: mapperLib.c:167
ABC_DLL void * Abc_FrameReadLibSuper()
Definition: mainFrame.c:58
char * Extra_FileNameGenericAppend(char *pBase, char *pSuffix)
void Map_SuperLibFree ( Map_SuperLib_t p)

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

Synopsis [Deallocates the supergate library.]

Description []

SideEffects []

SeeAlso []

Definition at line 167 of file mapperLib.c.

168 {
169  if ( p == NULL ) return;
170  if ( p->pGenlib )
171  {
172  if ( p->pGenlib != Abc_FrameReadLibGen() )
174  p->pGenlib = NULL;
175  }
176  if ( p->tTableC )
178  if ( p->tTable )
183  ABC_FREE( p->ppSupers );
184  ABC_FREE( p->pName );
185  ABC_FREE( p );
186 }
ABC_DLL void * Abc_FrameReadLibGen()
Definition: mainFrame.c:56
void Mio_LibraryDelete(Mio_Library_t *pLib)
DECLARATIONS ///.
Definition: mioUtils.c:48
void Extra_MmFixedStop(Extra_MmFixed_t *p)
Map_Super_t ** ppSupers
Definition: mapperInt.h:179
Mio_Library_t * pGenlib
Definition: mapperInt.h:169
Extra_MmFixed_t * mmSupers
Definition: mapperInt.h:195
Map_HashTable_t * tTable
Definition: mapperInt.h:181
Extra_MmFixed_t * mmEntries
Definition: mapperInt.h:196
#define ABC_FREE(obj)
Definition: abc_global.h:232
void Map_SuperTableFree(Map_HashTable_t *p)
Definition: mapperTable.c:74
Map_HashTable_t * tTableC
Definition: mapperInt.h:180
Extra_MmFlex_t * mmForms
Definition: mapperInt.h:197
void Extra_MmFlexStop(Extra_MmFlex_t *p)
float Map_SuperLibReadAreaInv ( Map_SuperLib_t p)

Definition at line 161 of file mapperCreate.c.

161 { return p->AreaInv; }
Map_Time_t Map_SuperLibReadDelayInv ( Map_SuperLib_t p)

Definition at line 162 of file mapperCreate.c.

162 { return p->tDelayInv;}
Map_Time_t tDelayInv
Definition: mapperInt.h:189
Mio_Library_t* Map_SuperLibReadGenLib ( Map_SuperLib_t p)

Definition at line 160 of file mapperCreate.c.

160 { return p->pGenlib; }
Mio_Library_t * pGenlib
Definition: mapperInt.h:169
int Map_SuperLibReadVarsMax ( Map_SuperLib_t p)

Definition at line 163 of file mapperCreate.c.

163 { return p->nVarsMax; }
int Map_SuperReadFaninNum ( Map_Super_t p)

Definition at line 154 of file mapperCreate.c.

154 { return p->nFanins; }
unsigned nFanins
Definition: mapperInt.h:280
Map_Super_t** Map_SuperReadFanins ( Map_Super_t p)

Definition at line 153 of file mapperCreate.c.

153 { return p->pFanins; }
Map_Super_t * pFanins[6]
Definition: mapperInt.h:287
int Map_SuperReadFanoutLimit ( Map_Super_t p)

Definition at line 158 of file mapperCreate.c.

158 { return p->nFanLimit;}
unsigned nFanLimit
Definition: mapperInt.h:282
char* Map_SuperReadFormula ( Map_Super_t p)

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

Synopsis [Reads parameters from the supergate.]

Description []

SideEffects []

SeeAlso []

Definition at line 150 of file mapperCreate.c.

150 { return p->pFormula; }
Map_Super_t* Map_SuperReadNext ( Map_Super_t p)

Definition at line 155 of file mapperCreate.c.

155 { return p->pNext; }
Map_Super_t * pNext
Definition: mapperInt.h:295
int Map_SuperReadNum ( Map_Super_t p)

Definition at line 152 of file mapperCreate.c.

152 { return p->Num; }
int Map_SuperReadNumPhases ( Map_Super_t p)

Definition at line 156 of file mapperCreate.c.

156 { return p->nPhases; }
unsigned nPhases
Definition: mapperInt.h:284
unsigned char* Map_SuperReadPhases ( Map_Super_t p)

Definition at line 157 of file mapperCreate.c.

157 { return p->uPhases; }
unsigned char uPhases[4]
Definition: mapperInt.h:285
Mio_Gate_t* Map_SuperReadRoot ( Map_Super_t p)

Definition at line 151 of file mapperCreate.c.

151 { return p->pRoot; }
Mio_Gate_t * pRoot
Definition: mapperInt.h:288
Map_Super_t* Map_SuperTableLookupC ( Map_SuperLib_t p,
unsigned  uTruth[] 
)

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 }
Map_HashEntry_t * pNext
Definition: mapperInt.h:321
#define MAP_TABLE_HASH(u1, u2, nSize)
DECLARATIONS ///.
Definition: mapperTable.c:29
Map_HashEntry_t ** pBins
Definition: mapperInt.h:309
unsigned uTruth[2]
Definition: mapperInt.h:318
Map_Super_t * pGates
Definition: mapperInt.h:320
Map_HashTable_t * tTableC
Definition: mapperInt.h:180