abc-master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
mapperCore.c File Reference
#include "mapperInt.h"

Go to the source code of this file.

Functions

ABC_NAMESPACE_IMPL_START int Map_Mapping (Map_Man_t *p)
 DECLARATIONS ///. More...
 

Function Documentation

ABC_NAMESPACE_IMPL_START 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