ABC: A System for Sequential Synthesis and Verification
 
Loading...
Searching...
No Matches
ifCore.c
Go to the documentation of this file.
1
20
21#include "if.h"
22
24
25
29
31
35
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->fUserLutDec = 0;
66 pPars->fUserLut2D = 0;
67 pPars->fVerbose = 0;
68}
69
70
83{
84 p->pPars->fAreaOnly = p->pPars->fArea; // temporary
85 // create the CI cutsets
87 // allocate memory for other cutsets
89 // derive reverse top order
90 p->vObjsRev = If_ManReverseOrder( p );
92}
93
94
107{
108 If_Obj_t * pObj;
109 abctime clkTotal = Abc_Clock();
110 int i;
111
112 //p->vVisited2 = Vec_IntAlloc( 100 );
113 //p->vMarks = Vec_StrStart( If_ManObjNum(p) );
114
115 // set arrival times and fanout estimates
116 If_ManForEachCi( p, pObj, i )
117 {
118 If_ObjSetArrTime( pObj, p->pPars->pTimesArr ? p->pPars->pTimesArr[i] : (float)0.0 );
119 pObj->EstRefs = (float)1.0;
120 }
121
122 // delay oriented mapping
123 if ( p->pPars->fPreprocess && !p->pPars->fArea )
124 {
125 // map for delay
126 If_ManPerformMappingRound( p, p->pPars->nCutsMax, 0, 1, 1, "Delay" );
127
128 // map for delay second option
129 p->pPars->fFancy = 1;
131 If_ManPerformMappingRound( p, p->pPars->nCutsMax, 0, 1, 0, "Delay-2" );
132 p->pPars->fFancy = 0;
133 // map for area
134 p->pPars->fArea = 1;
136 If_ManPerformMappingRound( p, p->pPars->nCutsMax, 0, 1, 0, "Area" );
137 p->pPars->fArea = 0;
138 }
139 else
140 If_ManPerformMappingRound( p, p->pPars->nCutsMax, 0, 0, 1, "Delay" );
141
142 // try to improve area by expanding and reducing the cuts
143 if ( p->pPars->fExpRed )
145
146 // area flow oriented mapping
147 for ( i = 0; i < p->pPars->nFlowIters; i++ )
148 {
149 If_ManPerformMappingRound( p, p->pPars->nCutsMax, 1, 0, 0, "Flow" );
150 if ( p->pPars->fExpRed )
152 }
153
154 // area oriented mapping
155 for ( i = 0; i < p->pPars->nAreaIters; i++ )
156 {
157 If_ManPerformMappingRound( p, p->pPars->nCutsMax, 2, 0, 0, "Area" );
158 if ( p->pPars->fExpRed )
160 }
161
162 if ( p->pPars->fVerbose )
163 {
164// Abc_Print( 1, "Total memory = %7.2f MB. Peak cut memory = %7.2f MB. ",
165// 1.0 * (p->nObjBytes + 2*sizeof(void *)) * If_ManObjNum(p) / (1<<20),
166// 1.0 * p->nSetBytes * Mem_FixedReadMaxEntriesUsed(p->pMemSet) / (1<<20) );
167 Abc_PrintTime( 1, "Total time", Abc_Clock() - clkTotal );
168 }
169// Abc_Print( 1, "Cross cut memory = %d.\n", Mem_FixedReadMaxEntriesUsed(p->pMemSet) );
170 s_MappingTime = Abc_Clock() - clkTotal;
171// Abc_Print( 1, "Special POs = %d.\n", If_ManCountSpecialPos(p) );
172
173/*
174 {
175 static char * pLastName = NULL;
176 FILE * pTable = fopen( "fpga/ucsb/stats.txt", "a+" );
177 if ( pLastName == NULL || strcmp(pLastName, p->pName) )
178 {
179 fprintf( pTable, "\n" );
180 fprintf( pTable, "%s ", p->pName );
181
182 fprintf( pTable, "%d ", If_ManCiNum(p) );
183 fprintf( pTable, "%d ", If_ManCoNum(p) );
184 fprintf( pTable, "%d ", If_ManAndNum(p) );
185
186 ABC_FREE( pLastName );
187 pLastName = Abc_UtilStrsav( p->pName );
188 }
189
190 fprintf( pTable, "%d ", (int)p->AreaGlo );
191 fprintf( pTable, "%d ", (int)p->RequiredGlo );
192 fclose( pTable );
193 }
194*/
195 p->pPars->FinalDelay = p->RequiredGlo;
196 p->pPars->FinalArea = p->AreaGlo;
197 return 1;
198}
199
203
204
206
ABC_INT64_T abctime
Definition abc_global.h:332
#define ABC_NAMESPACE_IMPL_START
#define ABC_NAMESPACE_IMPL_END
Cube * p
Definition exorList.c:222
int If_ManPerformMappingComb(If_Man_t *p)
Definition ifCore.c:106
void If_ManSetDefaultPars(If_Par_t *pPars)
FUNCTION DEFINITIONS ///.
Definition ifCore.c:47
int If_ManPerformMapping(If_Man_t *p)
Definition ifCore.c:82
struct If_Par_t_ If_Par_t
Definition if.h:78
void If_ManSetupCiCutSets(If_Man_t *p)
Definition ifMan.c:566
void If_ManResetOriginalRefs(If_Man_t *p)
Definition ifUtil.c:287
Vec_Ptr_t * If_ManReverseOrder(If_Man_t *p)
Definition ifUtil.c:363
#define If_ManForEachCi(p, pObj, i)
Definition if.h:474
void If_ManSetupSetAll(If_Man_t *p, int nCrossCut)
Definition ifMan.c:693
int If_ManPerformMappingRound(If_Man_t *p, int nCutsUsed, int Mode, int fPreprocess, int fFirst, char *pLabel)
Definition ifMap.c:606
struct If_Man_t_ If_Man_t
BASIC TYPES ///.
Definition if.h:77
void If_ManImproveMapping(If_Man_t *p)
FUNCTION DEFINITIONS ///.
Definition ifReduce.c:51
struct If_Obj_t_ If_Obj_t
Definition if.h:79
int If_ManCrossCut(If_Man_t *p)
Definition ifUtil.c:316
abctime s_MappingTime
DECLARATIONS ///.
Definition abcPrint.c:47
float EstRefs
Definition if.h:352
int fLatchPaths
Definition if.h:121
int fUserLut2D
Definition if.h:151
float Epsilon
Definition if.h:111
int fPower
Definition if.h:124
int fUserLutDec
Definition if.h:150
int nLutSize
Definition if.h:104
int fExpRed
Definition if.h:120
int fEdge
Definition if.h:123
int nFlowIters
Definition if.h:106
int nAreaIters
Definition if.h:107
int fBidec
Definition if.h:131
int nCutsMax
Definition if.h:105
int fVerbose
Definition if.h:152
float DelayTarget
Definition if.h:110
int fCutMin
Definition if.h:125
int fPreprocess
Definition if.h:117
int fFancy
Definition if.h:119
int fArea
Definition if.h:118
char * memset()