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

Go to the source code of this file.

Functions

static ABC_NAMESPACE_IMPL_START int Fpga_MappingPostProcess (Fpga_Man_t *p)
 DECLARATIONS ///. More...
 
int Fpga_Mapping (Fpga_Man_t *p)
 FUNCTION DEFINITIONS ///. More...
 

Variables

clock_t s_MappingTime
 DECLARATIONS ///. More...
 
int s_MappingMem
 

Function Documentation

int Fpga_Mapping ( Fpga_Man_t p)

FUNCTION DEFINITIONS ///.

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

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

Description [The object graph is stored in the mapping manager. First, all the AND-nodes, which fanout into the POs, are collected in the DFS fashion. Next, three steps are performed: the k-feasible cuts are computed for each node, the truth tables are computed for each cut, and the delay-optimal matches are assigned for each node.]

SideEffects []

SeeAlso []

Definition at line 53 of file fpgaCore.c.

54 {
55  clock_t clk, clkTotal = clock();
56 
57  // collect the nodes reachable from POs in the DFS order (including the choices)
58  p->vAnds = Fpga_MappingDfs( p, 1 );
59  Fpga_ManReportChoices( p ); // recomputes levels
61 
62  // compute the cuts of nodes in the DFS order
63  clk = clock();
64  Fpga_MappingCuts( p );
65  p->timeCuts = clock() - clk;
66 
67  // match the truth tables to the supergates
68  clk = clock();
69  if ( !Fpga_MappingMatches( p, 1 ) )
70  return 0;
71  p->timeMatch = clock() - clk;
72 
73  // perform area recovery
74  clk = clock();
75  if ( !Fpga_MappingPostProcess( p ) )
76  return 0;
77  p->timeRecover = clock() - clk;
78 //ABC_PRT( "Total mapping time", clock() - clkTotal );
79 
80  s_MappingTime = clock() - clkTotal;
81  s_MappingMem = Fpga_CutCountAll(p) * (sizeof(Fpga_Cut_t) - sizeof(int) * (FPGA_MAX_LEAVES - p->nVarsMax));
82 
83  // print the AI-graph used for mapping
84  //Fpga_ManShow( p, "test" );
85 // if ( p->fVerbose )
86 // Fpga_MappingPrintOutputArrivals( p );
87  if ( p->fVerbose )
88  {
89  ABC_PRT( "Total time", clock() - clkTotal );
90  }
91  return 1;
92 }
struct Fpga_CutStruct_t_ Fpga_Cut_t
Definition: fpga.h:46
#define FPGA_MAX_LEAVES
INCLUDES ///.
Definition: fpgaInt.h:52
clock_t timeCuts
Definition: fpgaInt.h:159
int s_MappingMem
Definition: abcPrint.c:45
int Fpga_CutCountAll(Fpga_Man_t *pMan)
Definition: fpgaCut.c:767
int Fpga_MappingMatches(Fpga_Man_t *p, int fDelayOriented)
FUNCTION DEFINITIONS ///.
Definition: fpgaMatch.c:67
void Fpga_MappingSetChoiceLevels(Fpga_Man_t *pMan)
Definition: fpgaUtils.c:876
Fpga_NodeVec_t * Fpga_MappingDfs(Fpga_Man_t *pMan, int fCollectEquiv)
FUNCTION DEFINITIONS ///.
Definition: fpgaUtils.c:54
clock_t timeRecover
Definition: fpgaInt.h:162
void Fpga_ManReportChoices(Fpga_Man_t *pMan)
Definition: fpgaUtils.c:897
static ABC_NAMESPACE_IMPL_START int Fpga_MappingPostProcess(Fpga_Man_t *p)
DECLARATIONS ///.
Definition: fpgaCore.c:109
#define ABC_PRT(a, t)
Definition: abc_global.h:220
clock_t s_MappingTime
DECLARATIONS ///.
Definition: abcPrint.c:44
Fpga_NodeVec_t * vAnds
Definition: fpgaInt.h:112
clock_t timeMatch
Definition: fpgaInt.h:161
void Fpga_MappingCuts(Fpga_Man_t *p)
FUNCTION DEFINITIONS ///.
Definition: fpgaCut.c:130
int Fpga_MappingPostProcess ( Fpga_Man_t p)
static

DECLARATIONS ///.

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

FileName [fpgaCore.c]

PackageName [MVSIS 1.3: Multi-valued logic synthesis system.]

Synopsis [Technology mapping for variable-size-LUT FPGAs.]

Author [MVSIS Group]

Affiliation [UC Berkeley]

Date [Ver. 2.0. Started - August 18, 2004.]

Revision [

Id:
fpgaCore.c,v 1.7 2004/10/01 23:41:04 satrajit Exp

]

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

Synopsis [Postprocesses the mapped network for area recovery.]

Description [This procedure assumes that the mapping is assigned. It iterates the loop, in which the required times are computed and the mapping is updated. It is conceptually similar to the paper: V. Manohararajah, S. D. Brown, Z. G. Vranesic, Heuristics for area minimization in LUT-based FPGA technology mapping. Proc. IWLS '04.]

SideEffects []

SeeAlso []

Definition at line 109 of file fpgaCore.c.

110 {
111  int fShowSwitching = 0;
112  int fRecoverAreaFlow = 1;
113  int fRecoverArea = 1;
114  float aAreaTotalCur, aAreaTotalCur2;
115  int Iter;
116  clock_t clk;
117 
118 //if ( p->fVerbose )
119 // printf( "Best clock period = %5.2f\n", Fpga_TimeComputeArrivalMax(p) );
120 
121  // compute area, set references, and collect nodes used in the mapping
122  Iter = 1;
123  aAreaTotalCur = Fpga_MappingSetRefsAndArea( p );
124 if ( p->fVerbose )
125 {
126 printf( "Iteration %dD : Area = %8.1f ", Iter++, aAreaTotalCur );
127 if ( fShowSwitching )
128 printf( "Switch = %8.1f ", Fpga_MappingGetSwitching(p,p->vMapping) );
129 else
130 printf( "Delay = %5.2f ", Fpga_TimeComputeArrivalMax(p) );
131 
132 ABC_PRT( "Time", p->timeMatch );
133 }
134 
135  if ( !p->fAreaRecovery )
136  return 1;
137 
138  if ( fRecoverAreaFlow )
139  {
140 clk = clock();
141  // compute the required times and the fanouts
143  // remap topologically
144  Fpga_MappingMatches( p, 0 );
145  // get the resulting area
146 // aAreaTotalCur = Fpga_MappingSetRefsAndArea( p );
147  aAreaTotalCur = Fpga_MappingAreaTrav( p );
148  // note that here we do not update the reference counter
149  // for some reason, this works better on benchmarks
150 if ( p->fVerbose )
151 {
152 printf( "Iteration %dF : Area = %8.1f ", Iter++, aAreaTotalCur );
153 if ( fShowSwitching )
154 printf( "Switch = %8.1f ", Fpga_MappingGetSwitching(p,p->vMapping) );
155 else
156 printf( "Delay = %5.2f ", Fpga_TimeComputeArrivalMax(p) );
157 ABC_PRT( "Time", clock() - clk );
158 }
159  }
160 
161  // update reference counters
162  aAreaTotalCur2 = Fpga_MappingSetRefsAndArea( p );
163  assert( aAreaTotalCur == aAreaTotalCur2 );
164 
165  if ( fRecoverArea )
166  {
167 clk = clock();
168  // compute the required times and the fanouts
170  // remap topologically
171  if ( p->fSwitching )
173  else
175  // get the resulting area
176  aAreaTotalCur = Fpga_MappingSetRefsAndArea( p );
177 if ( p->fVerbose )
178 {
179 printf( "Iteration %d%s : Area = %8.1f ", Iter++, (p->fSwitching?"S":"A"), aAreaTotalCur );
180 if ( fShowSwitching )
181 printf( "Switch = %8.1f ", Fpga_MappingGetSwitching(p,p->vMapping) );
182 else
183 printf( "Delay = %5.2f ", Fpga_TimeComputeArrivalMax(p) );
184 ABC_PRT( "Time", clock() - clk );
185 }
186  }
187 
188  p->fAreaGlo = aAreaTotalCur;
189  return 1;
190 }
int Fpga_MappingMatchesSwitch(Fpga_Man_t *p)
Definition: fpgaMatch.c:349
float Fpga_MappingSetRefsAndArea(Fpga_Man_t *pMan)
Definition: fpgaUtils.c:299
float Fpga_MappingAreaTrav(Fpga_Man_t *pMan)
Definition: fpgaUtils.c:239
void Fpga_TimeComputeRequiredGlobal(Fpga_Man_t *p, int fFirstTime)
Definition: fpgaTime.c:136
int Fpga_MappingMatchesArea(Fpga_Man_t *p)
Definition: fpgaMatch.c:196
Fpga_NodeVec_t * vMapping
Definition: fpgaInt.h:113
int Fpga_MappingMatches(Fpga_Man_t *p, int fDelayOriented)
FUNCTION DEFINITIONS ///.
Definition: fpgaMatch.c:67
#define ABC_PRT(a, t)
Definition: abc_global.h:220
#define assert(ex)
Definition: util_old.h:213
clock_t timeMatch
Definition: fpgaInt.h:161
float Fpga_TimeComputeArrivalMax(Fpga_Man_t *p)
Definition: fpgaTime.c:89
float Fpga_MappingGetSwitching(Fpga_Man_t *pMan, Fpga_NodeVec_t *vMapping)
Definition: fpgaSwitch.c:127

Variable Documentation

int s_MappingMem

Definition at line 45 of file abcPrint.c.

clock_t s_MappingTime

DECLARATIONS ///.

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

FileName [abcPrint.c]

SystemName [ABC: Logic synthesis and verification system.]

PackageName [Network and node package.]

Synopsis [Printing statistics.]

Author [Alan Mishchenko]

Affiliation [UC Berkeley]

Date [Ver. 1.0. Started - June 20, 2005.]

Revision [

Id:
abcPrint.c,v 1.00 2005/06/20 00:00:00 alanmi Exp

]

Definition at line 44 of file abcPrint.c.