ABC: A System for Sequential Synthesis and Verification
 
Loading...
Searching...
No Matches
mapperCore.c
Go to the documentation of this file.
1
18
19#include "mapperInt.h"
20//#include "resm.h"
21
23
24
28
32
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}
231
ABC_INT64_T abctime
Definition abc_global.h:332
#define ABC_PRT(a, t)
Definition abc_global.h:255
#define ABC_NAMESPACE_IMPL_START
#define ABC_NAMESPACE_IMPL_END
Cube * p
Definition exorList.c:222
ABC_NAMESPACE_IMPL_START int Map_Mapping(Map_Man_t *p)
DECLARATIONS ///.
Definition mapperCore.c:50
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
typedefABC_NAMESPACE_HEADER_START struct Map_ManStruct_t_ Map_Man_t
INCLUDES ///.
Definition mapper.h:40