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

Go to the source code of this file.

Functions

void If_ManSetDefaultPars (If_Par_t *pPars)
 FUNCTION DEFINITIONS ///. More...
 
int If_ManPerformMapping (If_Man_t *p)
 
int If_ManPerformMappingComb (If_Man_t *p)
 

Variables

ABC_NAMESPACE_IMPL_START abctime s_MappingTime
 DECLARATIONS ///. More...
 

Function Documentation

int If_ManPerformMapping ( If_Man_t p)

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

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 80 of file ifCore.c.

81 {
82  p->pPars->fAreaOnly = p->pPars->fArea; // temporary
83  // create the CI cutsets
85  // allocate memory for other cutsets
87  // derive reverse top order
88  p->vObjsRev = If_ManReverseOrder( p );
89  return If_ManPerformMappingComb( p );
90 }
int If_ManPerformMappingComb(If_Man_t *p)
Definition: ifCore.c:104
Vec_Ptr_t * vObjsRev
Definition: if.h:190
void If_ManSetupSetAll(If_Man_t *p, int nCrossCut)
Definition: ifMan.c:675
int fAreaOnly
Definition: if.h:145
Vec_Ptr_t * If_ManReverseOrder(If_Man_t *p)
Definition: ifUtil.c:363
int If_ManCrossCut(If_Man_t *p)
Definition: ifUtil.c:316
void If_ManSetupCiCutSets(If_Man_t *p)
Definition: ifMan.c:548
If_Par_t * pPars
Definition: if.h:184
int fArea
Definition: if.h:114
int If_ManPerformMappingComb ( If_Man_t p)

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

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 104 of file ifCore.c.

105 {
106  If_Obj_t * pObj;
107  abctime clkTotal = Abc_Clock();
108  int i;
109 
110  // set arrival times and fanout estimates
111  If_ManForEachCi( p, pObj, i )
112  {
113  If_ObjSetArrTime( pObj, p->pPars->pTimesArr ? p->pPars->pTimesArr[i] : (float)0.0 );
114  pObj->EstRefs = (float)1.0;
115  }
116 
117  // delay oriented mapping
118  if ( p->pPars->fPreprocess && !p->pPars->fArea )
119  {
120  // map for delay
121  If_ManPerformMappingRound( p, p->pPars->nCutsMax, 0, 1, 1, "Delay" );
122  // map for delay second option
123  p->pPars->fFancy = 1;
125  If_ManPerformMappingRound( p, p->pPars->nCutsMax, 0, 1, 0, "Delay-2" );
126  p->pPars->fFancy = 0;
127  // map for area
128  p->pPars->fArea = 1;
130  If_ManPerformMappingRound( p, p->pPars->nCutsMax, 0, 1, 0, "Area" );
131  p->pPars->fArea = 0;
132  }
133  else
134  If_ManPerformMappingRound( p, p->pPars->nCutsMax, 0, 0, 1, "Delay" );
135 
136  // try to improve area by expanding and reducing the cuts
137  if ( p->pPars->fExpRed )
139 
140  // area flow oriented mapping
141  for ( i = 0; i < p->pPars->nFlowIters; i++ )
142  {
143  If_ManPerformMappingRound( p, p->pPars->nCutsMax, 1, 0, 0, "Flow" );
144  if ( p->pPars->fExpRed )
146  }
147 
148  // area oriented mapping
149  for ( i = 0; i < p->pPars->nAreaIters; i++ )
150  {
151  If_ManPerformMappingRound( p, p->pPars->nCutsMax, 2, 0, 0, "Area" );
152  if ( p->pPars->fExpRed )
154  }
155 
156  if ( p->pPars->fVerbose )
157  {
158 // Abc_Print( 1, "Total memory = %7.2f MB. Peak cut memory = %7.2f MB. ",
159 // 1.0 * (p->nObjBytes + 2*sizeof(void *)) * If_ManObjNum(p) / (1<<20),
160 // 1.0 * p->nSetBytes * Mem_FixedReadMaxEntriesUsed(p->pMemSet) / (1<<20) );
161  Abc_PrintTime( 1, "Total time", Abc_Clock() - clkTotal );
162  }
163 // Abc_Print( 1, "Cross cut memory = %d.\n", Mem_FixedReadMaxEntriesUsed(p->pMemSet) );
164  s_MappingTime = Abc_Clock() - clkTotal;
165 // Abc_Print( 1, "Special POs = %d.\n", If_ManCountSpecialPos(p) );
166 
167 /*
168  {
169  static char * pLastName = NULL;
170  FILE * pTable = fopen( "fpga/ucsb/stats.txt", "a+" );
171  if ( pLastName == NULL || strcmp(pLastName, p->pName) )
172  {
173  fprintf( pTable, "\n" );
174  fprintf( pTable, "%s ", p->pName );
175 
176  fprintf( pTable, "%d ", If_ManCiNum(p) );
177  fprintf( pTable, "%d ", If_ManCoNum(p) );
178  fprintf( pTable, "%d ", If_ManAndNum(p) );
179 
180  ABC_FREE( pLastName );
181  pLastName = Abc_UtilStrsav( p->pName );
182  }
183 
184  fprintf( pTable, "%d ", (int)p->AreaGlo );
185  fprintf( pTable, "%d ", (int)p->RequiredGlo );
186  fclose( pTable );
187  }
188 */
189  p->pPars->FinalDelay = p->RequiredGlo;
190  return 1;
191 }
void If_ManResetOriginalRefs(If_Man_t *p)
Definition: ifUtil.c:287
Definition: if.h:303
int fVerbose
Definition: if.h:140
ABC_NAMESPACE_IMPL_START abctime s_MappingTime
DECLARATIONS ///.
Definition: abcPrint.c:44
int If_ManPerformMappingRound(If_Man_t *p, int nCutsUsed, int Mode, int fPreprocess, int fFirst, char *pLabel)
Definition: ifMap.c:491
static abctime Abc_Clock()
Definition: abc_global.h:279
int fExpRed
Definition: if.h:116
int nFlowIters
Definition: if.h:105
static void Abc_PrintTime(int level, const char *pStr, abctime time)
Definition: abc_global.h:367
#define If_ManForEachCi(p, pObj, i)
Definition: if.h:445
int fPreprocess
Definition: if.h:113
float RequiredGlo
Definition: if.h:196
float * pTimesArr
Definition: if.h:161
static void If_ObjSetArrTime(If_Obj_t *pObj, float ArrTime)
Definition: if.h:406
int fFancy
Definition: if.h:115
float FinalDelay
Definition: if.h:159
If_Par_t * pPars
Definition: if.h:184
int nAreaIters
Definition: if.h:106
float EstRefs
Definition: if.h:324
int nCutsMax
Definition: if.h:104
int fArea
Definition: if.h:114
void If_ManImproveMapping(If_Man_t *p)
FUNCTION DEFINITIONS ///.
Definition: ifReduce.c:51
ABC_INT64_T abctime
Definition: abc_global.h:278
void If_ManSetDefaultPars ( If_Par_t pPars)

FUNCTION DEFINITIONS ///.

FUNCTION DECLARATIONS ///.

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

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 47 of file ifCore.c.

48 {
49  memset( pPars, 0, sizeof(If_Par_t) );
50  pPars->nLutSize = -1;
51  pPars->nCutsMax = 8;
52  pPars->nFlowIters = 1;
53  pPars->nAreaIters = 2;
54  pPars->DelayTarget = -1;
55  pPars->Epsilon = (float)0.005;
56  pPars->fPreprocess = 1;
57  pPars->fArea = 0;
58  pPars->fFancy = 0;
59  pPars->fExpRed = 1;
60  pPars->fLatchPaths = 0;
61  pPars->fEdge = 1;
62  pPars->fPower = 0;
63  pPars->fCutMin = 0;
64  pPars->fBidec = 0;
65  pPars->fVerbose = 0;
66 }
char * memset()
int nLutSize
Definition: if.h:103
Definition: if.h:100
int fVerbose
Definition: if.h:140
int fExpRed
Definition: if.h:116
int nFlowIters
Definition: if.h:105
int fEdge
Definition: if.h:118
int fPreprocess
Definition: if.h:113
int fLatchPaths
Definition: if.h:117
int fBidec
Definition: if.h:125
float Epsilon
Definition: if.h:110
int fFancy
Definition: if.h:115
float DelayTarget
Definition: if.h:109
int nAreaIters
Definition: if.h:106
int fPower
Definition: if.h:119
int fCutMin
Definition: if.h:120
int nCutsMax
Definition: if.h:104
int fArea
Definition: if.h:114

Variable Documentation

DECLARATIONS ///.

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

FileName [ifCore.c]

SystemName [ABC: Logic synthesis and verification system.]

PackageName [FPGA mapping based on priority cuts.]

Synopsis [The central part of the mapper.]

Author [Alan Mishchenko]

Affiliation [UC Berkeley]

Date [Ver. 1.0. Started - November 21, 2006.]

Revision [

Id:
ifCore.c,v 1.00 2006/11/21 00:00:00 alanmi Exp

]

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.