149{
150
152 int piCopied = 0, loCopied = 0, loCreated = 0, liCopied = 0, liCreated = 0, poCopied = 0;
153
154 int i, nRegCount, hintSingalBeginningMarker, hintSingalEndMarker;
155 int combN_internal, combK_internal;
156 long longI, lCombinationCount;
157
158 Aig_Obj_t *pObj, *pObjLO_nCk, *pObjDisj_nCk;
159 Vec_Ptr_t *vLO_nCk, *vPODriver_nCk, *vDisj_nCk;
161
163
164
165
166
167
168
170 if( vCandidateMonotoneSignals == NULL )
171 {
172 printf("\nTraget Signal Set is Empty: Duplicating given AIG\n");
173 combN_internal = 0;
174 }
175 else
176 {
177
178
179 hintSingalBeginningMarker = Vec_IntEntry( vCandidateMonotoneSignals, 0 );
180 hintSingalEndMarker = Vec_IntEntry( vCandidateMonotoneSignals, Vec_IntSize(vCandidateMonotoneSignals) - 1 );
181 combN_internal = hintSingalEndMarker - hintSingalBeginningMarker + 1;
182 }
183
184
185
186
187
188
189
190
191
192
193
194
197 sprintf(pNewAig->pName,
"%s_%s", pAig->pName,
"nCk");
198 pNewAig->pSpec = NULL;
199
200
201 pObj = Aig_ManConst1( pAig );
202 pObj->
pData = Aig_ManConst1( pNewAig );
203
204
206 {
207 piCopied++;
209 }
210
211
213 {
214 loCopied++;
216 }
217
218
219 lCombinationCount = 0;
220 for(combK_internal=1; combK_internal<=combK; combK_internal++)
222 assert( lCombinationCount > 0 );
223 vLO_nCk = Vec_PtrAlloc(lCombinationCount);
224 for( longI = 0; longI < lCombinationCount; longI++ )
225 {
226 loCreated++;
228 Vec_PtrPush( vLO_nCk, pObj );
229 }
230
231
233 {
234 pObj->
pData =
Aig_And( pNewAig, Aig_ObjChild0Copy(pObj), Aig_ObjChild1Copy(pObj) );
235 }
236
237
238 vDisj_nCk = Vec_PtrAlloc(lCombinationCount);
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266 for( combK_internal=1; combK_internal<=combK; combK_internal++ )
268 vDisj_nCk, combN_internal, combK_internal );
269
270
271
272 vPODriver_nCk = Vec_PtrAlloc(lCombinationCount);
273 for( longI = 0; longI < lCombinationCount; longI++ )
274 {
275 pObjLO_nCk = (
Aig_Obj_t *)(Vec_PtrEntry( vLO_nCk, longI ));
276 pObjDisj_nCk = (
Aig_Obj_t *)(Vec_PtrEntry( vDisj_nCk, longI ));
277
278 pObj =
Aig_Or( pNewAig, Aig_Not(pObjDisj_nCk), pObjLO_nCk);
279 Vec_PtrPush(vPODriver_nCk, pObj);
280 }
281
282
284 {
285 poCopied++;
287 }
288
289
290 for( longI = 0; longI < lCombinationCount; longI++ )
291 {
293 }
294
295
297 {
298 liCopied++;
300 }
301
302
303 for( longI = 0; longI < lCombinationCount; longI++ )
304 {
305 liCreated++;
307 }
308
309
310 assert( liCopied + liCreated == loCopied + loCreated );
311 nRegCount = loCopied + loCreated;
312
316
317
318 return pNewAig;
319}
struct Abc_Ntk_t_ Abc_Ntk_t
void Aig_ManSetRegNum(Aig_Man_t *p, int nRegs)
Aig_Obj_t * Aig_And(Aig_Man_t *p, Aig_Obj_t *p0, Aig_Obj_t *p1)
Aig_Obj_t * Aig_ObjCreateCo(Aig_Man_t *p, Aig_Obj_t *pDriver)
Aig_Man_t * Aig_ManStart(int nNodesMax)
DECLARATIONS ///.
#define Aig_ManForEachNode(p, pObj, i)
typedefABC_NAMESPACE_HEADER_START struct Aig_Man_t_ Aig_Man_t
INCLUDES ///.
int Aig_ManCleanup(Aig_Man_t *p)
Aig_Obj_t * Aig_ObjCreateCi(Aig_Man_t *p)
DECLARATIONS ///.
ABC_DLL int Aig_ManCheck(Aig_Man_t *p)
FUNCTION DECLARATIONS ///.
int generateCombinatorialStabil(Aig_Man_t *pAigNew, Aig_Man_t *pAigOld, Vec_Int_t *vCandidateMonotoneSignals_, Vec_Ptr_t *vDisj_nCk_, int combN, int combK)
Vec_Int_t * findHintOutputs(Abc_Ntk_t *pNtk)
#define Saig_ManForEachLi(p, pObj, i)
#define Saig_ManForEachPo(p, pObj, i)
#define Saig_ManForEachLo(p, pObj, i)
#define Saig_ManForEachPi(p, pObj, i)
typedefABC_NAMESPACE_HEADER_START struct Vec_Ptr_t_ Vec_Ptr_t
INCLUDES ///.