abc-master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
mapper.h
Go to the documentation of this file.
1 /**CFile****************************************************************
2 
3  FileName [mapper.h]
4 
5  PackageName [MVSIS 2.0: Multi-valued logic synthesis system.]
6 
7  Synopsis [Generic technology mapping engine.]
8 
9  Author [MVSIS Group]
10 
11  Affiliation [UC Berkeley]
12 
13  Date [Ver. 2.0. Started - June 1, 2004.]
14 
15  Revision [$Id: mapper.h,v 1.11 2005/02/28 05:34:26 alanmi Exp $]
16 
17 ***********************************************************************/
18 
19 #ifndef ABC__map__mapper__mapper_h
20 #define ABC__map__mapper__mapper_h
21 
22 
23 ////////////////////////////////////////////////////////////////////////
24 /// INCLUDES ///
25 ////////////////////////////////////////////////////////////////////////
26 
27 ////////////////////////////////////////////////////////////////////////
28 /// PARAMETERS ///
29 ////////////////////////////////////////////////////////////////////////
30 
31 
32 
34 
35 
36 ////////////////////////////////////////////////////////////////////////
37 /// STRUCTURE DEFINITIONS ///
38 ////////////////////////////////////////////////////////////////////////
39 
40 typedef struct Map_ManStruct_t_ Map_Man_t;
43 typedef struct Map_CutStruct_t_ Map_Cut_t;
50 
51 // the pair of rise/fall time parameters
53 {
54  float Rise;
55  float Fall;
56  float Worst;
57 };
58 
59 ////////////////////////////////////////////////////////////////////////
60 /// GLOBAL VARIABLES ///
61 ////////////////////////////////////////////////////////////////////////
62 
63 ////////////////////////////////////////////////////////////////////////
64 /// MACRO DEFINITIONS ///
65 ////////////////////////////////////////////////////////////////////////
66 
67 #define Map_IsComplement(p) (((int)((ABC_PTRUINT_T) (p) & 01)))
68 #define Map_Regular(p) ((Map_Node_t *)((ABC_PTRUINT_T)(p) & ~01))
69 #define Map_Not(p) ((Map_Node_t *)((ABC_PTRUINT_T)(p) ^ 01))
70 #define Map_NotCond(p,c) ((Map_Node_t *)((ABC_PTRUINT_T)(p) ^ (c)))
71 
72 ////////////////////////////////////////////////////////////////////////
73 /// FUNCTION DEFINITIONS ///
74 ////////////////////////////////////////////////////////////////////////
75 
76 /*=== mapperCreate.c =============================================================*/
77 extern Map_Man_t * Map_ManCreate( int nInputs, int nOutputs, int fVerbose );
78 extern Map_Node_t * Map_NodeCreate( Map_Man_t * p, Map_Node_t * p1, Map_Node_t * p2 );
79 extern void Map_ManCreateNodeDelays( Map_Man_t * p, int LogFan );
80 extern void Map_ManFree( Map_Man_t * pMan );
81 extern void Map_ManPrintTimeStats( Map_Man_t * p );
82 extern void Map_ManPrintStatsToFile( char * pName, float Area, float Delay, abctime Time );
83 extern int Map_ManReadInputNum( Map_Man_t * p );
84 extern int Map_ManReadOutputNum( Map_Man_t * p );
85 extern int Map_ManReadBufNum( Map_Man_t * p );
86 extern Map_Node_t ** Map_ManReadInputs ( Map_Man_t * p );
88 extern Map_Node_t ** Map_ManReadBufs( Map_Man_t * p );
89 extern Map_Node_t * Map_ManReadBufDriver( Map_Man_t * p, int i );
93 extern int Map_ManReadVerbose( Map_Man_t * p );
94 extern float Map_ManReadAreaFinal( Map_Man_t * p );
95 extern float Map_ManReadRequiredGlo( Map_Man_t * p );
96 extern void Map_ManSetOutputNames( Map_Man_t * p, char ** ppNames );
97 extern void Map_ManSetAreaRecovery( Map_Man_t * p, int fAreaRecovery );
98 extern void Map_ManSetDelayTarget( Map_Man_t * p, float DelayTarget );
99 extern void Map_ManSetInputArrivals( Map_Man_t * p, Map_Time_t * pArrivals );
100 extern void Map_ManSetOutputRequireds( Map_Man_t * p, Map_Time_t * pArrivals );
101 extern void Map_ManSetObeyFanoutLimits( Map_Man_t * p, int fObeyFanoutLimits );
102 extern void Map_ManSetNumIterations( Map_Man_t * p, int nNumIterations );
103 extern int Map_ManReadPass( Map_Man_t * p );
104 extern void Map_ManSetPass( Map_Man_t * p, int nPass );
105 extern int Map_ManReadFanoutViolations( Map_Man_t * p );
106 extern void Map_ManSetFanoutViolations( Map_Man_t * p, int nVio );
107 extern void Map_ManSetChoiceNodeNum( Map_Man_t * p, int nChoiceNodes );
108 extern void Map_ManSetChoiceNum( Map_Man_t * p, int nChoices );
109 extern void Map_ManSetVerbose( Map_Man_t * p, int fVerbose );
110 extern void Map_ManSetSwitching( Map_Man_t * p, int fSwitching );
111 
112 extern Map_Man_t * Map_NodeReadMan( Map_Node_t * p );
113 extern char * Map_NodeReadData( Map_Node_t * p, int fPhase );
114 extern int Map_NodeReadNum( Map_Node_t * p );
115 extern int Map_NodeReadLevel( Map_Node_t * p );
116 extern Map_Cut_t * Map_NodeReadCuts( Map_Node_t * p );
117 extern Map_Cut_t * Map_NodeReadCutBest( Map_Node_t * p, int fPhase );
118 extern Map_Node_t * Map_NodeReadOne( Map_Node_t * p );
119 extern Map_Node_t * Map_NodeReadTwo( Map_Node_t * p );
120 extern void Map_NodeSetData( Map_Node_t * p, int fPhase, char * pData );
121 extern void Map_NodeSetNextE( Map_Node_t * p, Map_Node_t * pNextE );
122 extern void Map_NodeSetRepr( Map_Node_t * p, Map_Node_t * pRepr );
123 extern void Map_NodeSetSwitching( Map_Node_t * p, float Switching );
124 
125 extern int Map_NodeIsConst( Map_Node_t * p );
126 extern int Map_NodeIsVar( Map_Node_t * p );
127 extern int Map_NodeIsBuf( Map_Node_t * p );
128 extern int Map_NodeIsAnd( Map_Node_t * p );
129 extern int Map_NodeComparePhase( Map_Node_t * p1, Map_Node_t * p2 );
130 
131 extern Map_Super_t * Map_CutReadSuperBest( Map_Cut_t * p, int fPhase );
134 extern int Map_CutReadLeavesNum( Map_Cut_t * p );
135 extern Map_Node_t ** Map_CutReadLeaves( Map_Cut_t * p );
136 extern unsigned Map_CutReadPhaseBest( Map_Cut_t * p, int fPhase );
137 extern unsigned Map_CutReadPhase0( Map_Cut_t * p );
138 extern unsigned Map_CutReadPhase1( Map_Cut_t * p );
139 extern Map_Cut_t * Map_CutReadNext( Map_Cut_t * p );
140 
141 extern char * Map_SuperReadFormula( Map_Super_t * p );
143 extern int Map_SuperReadNum( Map_Super_t * p );
145 extern int Map_SuperReadFaninNum( Map_Super_t * p );
147 extern int Map_SuperReadNumPhases( Map_Super_t * p );
148 extern unsigned char * Map_SuperReadPhases( Map_Super_t * p );
149 extern int Map_SuperReadFanoutLimit( Map_Super_t * p );
150 
152 extern float Map_SuperLibReadAreaInv( Map_SuperLib_t * p );
155 
156 extern Map_Node_t * Map_NodeAnd( Map_Man_t * p, Map_Node_t * p1, Map_Node_t * p2 );
157 extern Map_Node_t * Map_NodeBuf( Map_Man_t * p, Map_Node_t * p1 );
158 extern void Map_NodeSetChoice( Map_Man_t * pMan, Map_Node_t * pNodeOld, Map_Node_t * pNodeNew );
159 
160 /*=== resmCanon.c =============================================================*/
161 extern int Map_CanonComputeSlow( unsigned uTruths[][2], int nVarsMax, int nVarsReal, unsigned uTruth[], unsigned char * puPhases, unsigned uTruthRes[] );
162 extern int Map_CanonComputeFast( Map_Man_t * p, int nVarsMax, int nVarsReal, unsigned uTruth[], unsigned char * puPhases, unsigned uTruthRes[] );
163 /*=== mapperCut.c =============================================================*/
164 extern Map_Cut_t * Map_CutAlloc( Map_Man_t * p );
165 /*=== mapperCutUtils.c =============================================================*/
166 extern void Map_CutCreateFromNode( Map_Man_t * p, Map_Super_t * pSuper, int iRoot, unsigned uPhaseRoot,
167  int * pLeaves, int nLeaves, unsigned uPhaseLeaves );
168 /*=== mapperCore.c =============================================================*/
169 extern int Map_Mapping( Map_Man_t * p );
170 /*=== mapperLib.c =============================================================*/
171 extern int Map_SuperLibDeriveFromGenlib( Mio_Library_t * pLib, int fVerbose );
172 extern void Map_SuperLibFree( Map_SuperLib_t * p );
173 /*=== mapperMntk.c =============================================================*/
174 //extern Mntk_Man_t * Map_ConvertMappingToMntk( Map_Man_t * pMan );
175 /*=== mapperSuper.c =============================================================*/
176 extern char * Map_LibraryReadFormulaStep( char * pFormula, char * pStrings[], int * pnStrings );
177 /*=== mapperSweep.c =============================================================*/
178 extern void Map_NetworkSweep( Abc_Ntk_t * pNet );
179 /*=== mapperTable.c =============================================================*/
180 extern Map_Super_t * Map_SuperTableLookupC( Map_SuperLib_t * pLib, unsigned uTruth[] );
181 /*=== mapperTime.c =============================================================*/
182 /*=== mapperUtil.c =============================================================*/
183 extern int Map_ManCheckConsistency( Map_Man_t * p );
185 extern void Map_ManCleanData( Map_Man_t * p );
186 extern void Map_MappingSetupTruthTables( unsigned uTruths[][2] );
187 extern void Map_MappingSetupTruthTablesLarge( unsigned uTruths[][32] );
188 
189 
190 
192 
193 
194 
195 #endif
196 
197 ////////////////////////////////////////////////////////////////////////
198 /// END OF FILE ///
199 ////////////////////////////////////////////////////////////////////////
float Map_SuperLibReadAreaInv(Map_SuperLib_t *p)
Definition: mapperCreate.c:161
Map_Node_t * Map_ManReadConst1(Map_Man_t *p)
Definition: mapperCreate.c:56
void Map_SuperLibFree(Map_SuperLib_t *p)
Definition: mapperLib.c:167
Map_Node_t ** Map_ManReadBufs(Map_Man_t *p)
Definition: mapperCreate.c:54
Mio_Library_t * Map_ManReadGenLib(Map_Man_t *p)
Definition: mapperCreate.c:59
Map_Man_t * Map_ManCreate(int nInputs, int nOutputs, int fVerbose)
FUNCTION DEFINITIONS ///.
Definition: mapperCreate.c:184
int Map_NodeIsAnd(Map_Node_t *p)
Definition: mapperCreate.c:115
int Map_NodeReadNum(Map_Node_t *p)
Definition: mapperCreate.c:90
void Map_ManSetNumIterations(Map_Man_t *p, int nNumIterations)
Definition: mapperCreate.c:69
Map_Cut_t * Map_NodeReadCuts(Map_Node_t *p)
Definition: mapperCreate.c:92
static Llb_Mgr_t * p
Definition: llb3Image.c:950
Map_Cut_t * Map_CutAlloc(Map_Man_t *p)
DECLARATIONS ///.
int Map_NodeReadLevel(Map_Node_t *p)
Definition: mapperCreate.c:91
int Map_SuperReadNumPhases(Map_Super_t *p)
Definition: mapperCreate.c:156
void Map_ManSetOutputNames(Map_Man_t *p, char **ppNames)
Definition: mapperCreate.c:63
Map_Super_t ** Map_SuperReadFanins(Map_Super_t *p)
Definition: mapperCreate.c:153
void Map_NetworkSweep(Abc_Ntk_t *pNet)
unsigned Map_CutReadPhase0(Map_Cut_t *p)
Definition: mapperCreate.c:135
Map_Cut_t * Map_CutReadNext(Map_Cut_t *p)
Definition: mapperCreate.c:137
char * Map_LibraryReadFormulaStep(char *pFormula, char *pStrings[], int *pnStrings)
Definition: mapperSuper.c:256
int Map_ManReadPass(Map_Man_t *p)
void Map_NodeSetData(Map_Node_t *p, int fPhase, char *pData)
Definition: mapperCreate.c:96
int Map_NodeIsBuf(Map_Node_t *p)
Definition: mapperCreate.c:114
int Map_NodeComparePhase(Map_Node_t *p1, Map_Node_t *p2)
Definition: mapperCreate.c:116
void Map_ManSetObeyFanoutLimits(Map_Man_t *p, int fObeyFanoutLimits)
Definition: mapperCreate.c:68
void Map_ManSetInputArrivals(Map_Man_t *p, Map_Time_t *pArrivals)
Definition: mapperCreate.c:66
Map_Man_t * Map_NodeReadMan(Map_Node_t *p)
Definition: mapperCreate.c:88
int Map_SuperReadFanoutLimit(Map_Super_t *p)
Definition: mapperCreate.c:158
int Map_NodeIsConst(Map_Node_t *p)
Definition: mapperCreate.c:112
void Map_ManPrintTimeStats(Map_Man_t *p)
Definition: mapperCreate.c:313
void Map_ManSetVerbose(Map_Man_t *p, int fVerbose)
Definition: mapperCreate.c:74
void Map_CutCreateFromNode(Map_Man_t *p, Map_Super_t *pSuper, int iRoot, unsigned uPhaseRoot, int *pLeaves, int nLeaves, unsigned uPhaseLeaves)
unsigned Map_CutReadPhase1(Map_Cut_t *p)
Definition: mapperCreate.c:136
Map_Super_t * Map_CutReadSuperBest(Map_Cut_t *p, int fPhase)
Definition: mapperCreate.c:129
void Map_NodeSetRepr(Map_Node_t *p, Map_Node_t *pRepr)
Definition: mapperCreate.c:98
void Map_ManSetDelayTarget(Map_Man_t *p, float DelayTarget)
Definition: mapperCreate.c:65
int Map_ManReadFanoutViolations(Map_Man_t *p)
Definition: mapperCreate.c:70
Map_Time_t * Map_ManReadInputArrivals(Map_Man_t *p)
Definition: mapperCreate.c:57
Map_Super_t * Map_SuperTableLookupC(Map_SuperLib_t *pLib, unsigned uTruth[])
Definition: mapperTable.c:183
Definition: st.h:52
Map_Node_t ** Map_ManReadInputs(Map_Man_t *p)
Definition: mapperCreate.c:52
int Map_ManCheckConsistency(Map_Man_t *p)
Definition: mapperUtils.c:427
void Map_ManPrintStatsToFile(char *pName, float Area, float Delay, abctime Time)
Definition: mapperCreate.c:341
void Map_ManSetOutputRequireds(Map_Man_t *p, Map_Time_t *pArrivals)
Definition: mapperCreate.c:67
int Map_ManReadBufNum(Map_Man_t *p)
Definition: mapperCreate.c:51
int Map_NodeIsVar(Map_Node_t *p)
Definition: mapperCreate.c:113
int Map_ManReadOutputNum(Map_Man_t *p)
Definition: mapperCreate.c:50
int Map_SuperLibDeriveFromGenlib(Mio_Library_t *pLib, int fVerbose)
Definition: mapperLib.c:199
int Map_ManReadInputNum(Map_Man_t *p)
FUNCTION DEFINITIONS ///.
Definition: mapperCreate.c:49
STRUCTURE DEFINITIONS ///.
Definition: mioInt.h:61
int Map_CutReadLeavesNum(Map_Cut_t *p)
Definition: mapperCreate.c:132
#define ABC_NAMESPACE_HEADER_START
NAMESPACES ///.
Definition: abc_global.h:105
Mio_Library_t * Map_SuperLibReadGenLib(Map_SuperLib_t *p)
Definition: mapperCreate.c:160
Map_Node_t ** Map_CutReadLeaves(Map_Cut_t *p)
Definition: mapperCreate.c:133
void Map_ManSetPass(Map_Man_t *p, int nPass)
st__table * Map_CreateTableGate2Super(Map_Man_t *p)
Definition: mapperUtils.c:613
void Map_ManSetSwitching(Map_Man_t *p, int fSwitching)
Definition: mapperCreate.c:75
#define ABC_NAMESPACE_HEADER_END
Definition: abc_global.h:106
char * Map_NodeReadData(Map_Node_t *p, int fPhase)
Definition: mapperCreate.c:89
int Map_ManReadVerbose(Map_Man_t *p)
Definition: mapperCreate.c:60
Map_Node_t * Map_NodeReadOne(Map_Node_t *p)
Definition: mapperCreate.c:94
Map_Node_t * Map_NodeCreate(Map_Man_t *p, Map_Node_t *p1, Map_Node_t *p2)
Definition: mapperCreate.c:364
typedefABC_NAMESPACE_HEADER_START struct Map_ManStruct_t_ Map_Man_t
INCLUDES ///.
Definition: mapper.h:40
unsigned char * Map_SuperReadPhases(Map_Super_t *p)
Definition: mapperCreate.c:157
float Map_ManReadAreaFinal(Map_Man_t *p)
Definition: mapperCreate.c:61
Map_Node_t ** Map_ManReadOutputs(Map_Man_t *p)
Definition: mapperCreate.c:53
int Map_CanonComputeSlow(unsigned uTruths[][2], int nVarsMax, int nVarsReal, unsigned uTruth[], unsigned char *puPhases, unsigned uTruthRes[])
FUNCTION DEFINITIONS ///.
Definition: mapperCanon.c:48
void Map_ManCreateNodeDelays(Map_Man_t *p, int LogFan)
Definition: mapperCreate.c:284
char * Map_SuperReadFormula(Map_Super_t *p)
Definition: mapperCreate.c:150
Map_Node_t * Map_NodeAnd(Map_Man_t *p, Map_Node_t *p1, Map_Node_t *p2)
Definition: mapperCreate.c:447
void Map_ManSetAreaRecovery(Map_Man_t *p, int fAreaRecovery)
Definition: mapperCreate.c:64
Map_Super_t * Map_CutReadSuper1(Map_Cut_t *p)
Definition: mapperCreate.c:131
float Map_ManReadRequiredGlo(Map_Man_t *p)
Definition: mapperCreate.c:62
void Map_ManFree(Map_Man_t *pMan)
Definition: mapperCreate.c:248
Map_Node_t * Map_NodeBuf(Map_Man_t *p, Map_Node_t *p1)
Definition: mapperCreate.c:552
int Map_SuperReadFaninNum(Map_Super_t *p)
Definition: mapperCreate.c:154
int Map_Mapping(Map_Man_t *p)
DECLARATIONS ///.
Definition: mapperCore.c:50
Map_Time_t Map_SuperLibReadDelayInv(Map_SuperLib_t *p)
Definition: mapperCreate.c:162
Mio_Gate_t * Map_SuperReadRoot(Map_Super_t *p)
Definition: mapperCreate.c:151
Map_Node_t * Map_NodeReadTwo(Map_Node_t *p)
Definition: mapperCreate.c:95
void Map_ManSetFanoutViolations(Map_Man_t *p, int nVio)
Definition: mapperCreate.c:71
void Map_MappingSetupTruthTablesLarge(unsigned uTruths[][32])
Definition: mapperUtils.c:361
Map_Super_t * Map_SuperReadNext(Map_Super_t *p)
Definition: mapperCreate.c:155
void Map_NodeSetSwitching(Map_Node_t *p, float Switching)
Definition: mapperCreate.c:99
Map_Node_t * Map_ManReadBufDriver(Map_Man_t *p, int i)
Definition: mapperCreate.c:55
STRUCTURE DEFINITIONS ///.
Definition: mapperInt.h:90
int Map_SuperReadNum(Map_Super_t *p)
Definition: mapperCreate.c:152
void Map_ManCleanData(Map_Man_t *p)
Definition: mapperUtils.c:652
int Map_SuperLibReadVarsMax(Map_SuperLib_t *p)
Definition: mapperCreate.c:163
void Map_NodeSetChoice(Map_Man_t *pMan, Map_Node_t *pNodeOld, Map_Node_t *pNodeNew)
Definition: mapperCreate.c:571
void Map_ManSetChoiceNum(Map_Man_t *p, int nChoices)
Definition: mapperCreate.c:73
Map_Super_t * Map_CutReadSuper0(Map_Cut_t *p)
Definition: mapperCreate.c:130
unsigned Map_CutReadPhaseBest(Map_Cut_t *p, int fPhase)
Definition: mapperCreate.c:134
void Map_NodeSetNextE(Map_Node_t *p, Map_Node_t *pNextE)
Definition: mapperCreate.c:97
ABC_INT64_T abctime
Definition: abc_global.h:278
Map_Cut_t * Map_NodeReadCutBest(Map_Node_t *p, int fPhase)
Definition: mapperCreate.c:93
void Map_ManSetChoiceNodeNum(Map_Man_t *p, int nChoiceNodes)
Definition: mapperCreate.c:72
void Map_MappingSetupTruthTables(unsigned uTruths[][2])
Definition: mapperUtils.c:335
int Map_CanonComputeFast(Map_Man_t *p, int nVarsMax, int nVarsReal, unsigned uTruth[], unsigned char *puPhases, unsigned uTruthRes[])
Definition: mapperCanon.c:173