giaSplit.c 18.3 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
/**CFile****************************************************************

  FileName    [giaSplit.c]

  SystemName  [ABC: Logic synthesis and verification system.]

  PackageName [Scalable AIG package.]

  Synopsis    [Structural AIG splitting.]

  Author      [Alan Mishchenko]
  
  Affiliation [UC Berkeley]

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

  Revision    [$Id: giaSplit.c,v 1.00 2005/06/20 00:00:00 alanmi Exp $]

***********************************************************************/

#include "gia.h"
#include "misc/extra/extra.h"

ABC_NAMESPACE_IMPL_START


////////////////////////////////////////////////////////////////////////
///                        DECLARATIONS                              ///
////////////////////////////////////////////////////////////////////////

typedef struct Spl_Man_t_ Spl_Man_t;
struct Spl_Man_t_
{
    // input data
    Gia_Man_t *      pGia;       // user AIG with nodes marked
    int              iObj;       // object ID
    int              Limit;      // limit on AIG nodes
38
    int              fReverse;   // enable reverse search
39 40 41 42
    // intermediate
    Vec_Bit_t *      vMarksCIO;  // CI/CO marks
    Vec_Bit_t *      vMarksIn;   // input marks
    Vec_Bit_t *      vMarksNo;   // node marks
43
    Vec_Bit_t *      vMarksAnd;  // AND node marks
44
    Vec_Int_t *      vRoots;     // nodes pointing to Nodes
45
    Vec_Int_t *      vNodes;     // nodes used in the window
46
    Vec_Int_t *      vLeaves;    // nodes pointed by Nodes
47
    Vec_Int_t *      vAnds;      // AND nodes used in the window
48 49 50 51 52 53 54 55 56 57 58 59
    // temporary 
    Vec_Int_t *      vFanouts;   // fanouts of the node
    Vec_Int_t *      vCands;     // candidate nodes
    Vec_Int_t *      vInputs;    // non-trivial inputs
};

////////////////////////////////////////////////////////////////////////
///                     FUNCTION DEFINITIONS                         ///
////////////////////////////////////////////////////////////////////////

/**Function*************************************************************

60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101
  Synopsis    [Transforming to the internal LUT representation.]

  Description []
               
  SideEffects []

  SeeAlso     []

***********************************************************************/
Vec_Wec_t * Spl_ManToWecMapping( Gia_Man_t * p )
{
    Vec_Wec_t * vMapping = Vec_WecStart( Gia_ManObjNum(p) );
    int Obj, Fanin, k;
    assert( Gia_ManHasMapping(p) );
    Gia_ManForEachLut( p, Obj )
        Gia_LutForEachFanin( p, Obj, Fanin, k )
            Vec_WecPush( vMapping, Obj, Fanin );
    return vMapping;
}
Vec_Int_t * Spl_ManFromWecMapping( Gia_Man_t * p, Vec_Wec_t * vMap )
{
    Vec_Int_t * vMapping, * vVec; int i, k, Obj;
    assert( Gia_ManHasMapping2(p) );
    vMapping = Vec_IntAlloc( Gia_ManObjNum(p) + Vec_WecSizeSize(vMap) + 2*Vec_WecSizeUsed(vMap) );
    Vec_IntFill( vMapping, Gia_ManObjNum(p), 0 );
    Vec_WecForEachLevel( vMap, vVec, i )
        if ( Vec_IntSize(vVec) > 0 )
        {
            Vec_IntWriteEntry( vMapping, i, Vec_IntSize(vMapping) );
            Vec_IntPush( vMapping, Vec_IntSize(vVec) );
            Vec_IntForEachEntry( vVec, Obj, k )
                Vec_IntPush( vMapping, Obj );
            Vec_IntPush( vMapping, i );
        }
    assert( Vec_IntSize(vMapping) < 16 || Vec_IntSize(vMapping) == Vec_IntCap(vMapping) );
    return vMapping;
}


/**Function*************************************************************

  Synopsis    [Creating manager.]
102 103 104 105 106 107 108 109

  Description []
               
  SideEffects []

  SeeAlso     []

***********************************************************************/
110
Spl_Man_t * Spl_ManAlloc( Gia_Man_t * pGia, int Limit, int fReverse )
111 112 113 114 115
{
    int i, iObj;
    Spl_Man_t * p = ABC_CALLOC( Spl_Man_t, 1 );
    p->pGia       = pGia;
    p->Limit      = Limit;
116
    p->fReverse   = fReverse;
117 118 119 120
    // intermediate
    p->vMarksCIO  = Vec_BitStart( Gia_ManObjNum(pGia) );
    p->vMarksIn   = Vec_BitStart( Gia_ManObjNum(pGia) );
    p->vMarksNo   = Vec_BitStart( Gia_ManObjNum(pGia) );
121
    p->vMarksAnd  = Vec_BitStart( Gia_ManObjNum(pGia) );
122 123 124
    p->vRoots     = Vec_IntAlloc( 100 );
    p->vNodes     = Vec_IntAlloc( 100 );
    p->vLeaves    = Vec_IntAlloc( 100 );
125
    p->vAnds      = Vec_IntAlloc( 100 );
126 127 128 129 130
    // temporary 
    p->vFanouts   = Vec_IntAlloc( 100 );
    p->vCands     = Vec_IntAlloc( 100 );
    p->vInputs    = Vec_IntAlloc( 100 );
    // mark CIs/COs
131
    Vec_BitWriteEntry( p->vMarksCIO, 0, 1 );
132 133 134 135
    Gia_ManForEachCiId( pGia, iObj, i )
        Vec_BitWriteEntry( p->vMarksCIO, iObj, 1 );
    Gia_ManForEachCoId( pGia, iObj, i )
        Vec_BitWriteEntry( p->vMarksCIO, iObj, 1 );
136 137
    // mapping
    ABC_FREE( pGia->pRefs );
138
    Gia_ManCreateRefs( pGia );
139 140 141 142 143 144 145
    Gia_ManSetLutRefs( pGia );
    assert( Gia_ManHasMapping(pGia) );
    assert( !Gia_ManHasMapping2(pGia) );
    pGia->vMapping2 = Spl_ManToWecMapping( pGia );
    Vec_IntFreeP( &pGia->vMapping );
    // fanout
    Gia_ManStaticFanoutStart( pGia );
146 147 148 149
    return p;
}
void Spl_ManStop( Spl_Man_t * p )
{
150
    // fanout
151
    Gia_ManStaticFanoutStop( p->pGia );
152 153 154 155 156
    // mapping
    assert( !Gia_ManHasMapping(p->pGia) );
    assert( Gia_ManHasMapping2(p->pGia) );
    p->pGia->vMapping = Spl_ManFromWecMapping( p->pGia, p->pGia->vMapping2 );
    Vec_WecFreeP( &p->pGia->vMapping2 );
157 158 159 160
    // intermediate
    Vec_BitFree( p->vMarksCIO );
    Vec_BitFree( p->vMarksIn );
    Vec_BitFree( p->vMarksNo );
161
    Vec_BitFree( p->vMarksAnd );
162 163 164
    Vec_IntFree( p->vRoots );
    Vec_IntFree( p->vNodes );
    Vec_IntFree( p->vLeaves );
165
    Vec_IntFree( p->vAnds );
166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185
    // temporary 
    Vec_IntFree( p->vFanouts );
    Vec_IntFree( p->vCands );
    Vec_IntFree( p->vInputs );
    ABC_FREE( p );
}

/**Function*************************************************************

  Synopsis    [Takes Nodes and Marks. Returns Leaves and Roots.]

  Description []
               
  SideEffects []

  SeeAlso     []

***********************************************************************/
void Spl_ManWinFindLeavesRoots( Spl_Man_t * p )
{
186
    Vec_Int_t * vVec;
187 188
    int iObj, iFan, i, k;
    // collect leaves
189
/*
190
    Vec_IntClear( p->vLeaves );
191
    Gia_ManForEachLut2Vec( p->vNodes, p->pGia, vVec, iObj, i )
192 193
    {
        assert( Vec_BitEntry(p->vMarksNo, iObj) );
194
        Vec_IntForEachEntry( vVec, iFan, k )
195 196 197 198 199 200
            if ( !Vec_BitEntry(p->vMarksNo, iFan) )
            {
                Vec_BitWriteEntry(p->vMarksNo, iFan, 1);
                Vec_IntPush( p->vLeaves, iFan );
            }
    }
201 202 203 204 205 206 207 208 209 210 211
    Vec_IntForEachEntry( p->vLeaves, iFan, i )
        Vec_BitWriteEntry(p->vMarksNo, iFan, 0);
*/
    Vec_IntClear( p->vLeaves );
    Vec_IntForEachEntry( p->vAnds, iObj, i )
    {
        Gia_Obj_t * pObj = Gia_ManObj( p->pGia, iObj );
        assert( Vec_BitEntry(p->vMarksAnd, iObj) );
        iFan = Gia_ObjFaninId0( pObj, iObj );
        if ( !Vec_BitEntry(p->vMarksAnd, iFan) )
        {
212
            assert( Gia_ObjIsLut2(p->pGia, iFan) || Vec_BitEntry(p->vMarksCIO, iFan) );
213 214 215 216 217 218
            Vec_BitWriteEntry(p->vMarksAnd, iFan, 1);
            Vec_IntPush( p->vLeaves, iFan );
        }
        iFan = Gia_ObjFaninId1( pObj, iObj );
        if ( !Vec_BitEntry(p->vMarksAnd, iFan) )
        {
219
            assert( Gia_ObjIsLut2(p->pGia, iFan) || Vec_BitEntry(p->vMarksCIO, iFan) );
220 221 222 223 224 225 226
            Vec_BitWriteEntry(p->vMarksAnd, iFan, 1);
            Vec_IntPush( p->vLeaves, iFan );
        }
    }
    Vec_IntForEachEntry( p->vLeaves, iFan, i )
        Vec_BitWriteEntry(p->vMarksAnd, iFan, 0);

227 228
    // collect roots
    Vec_IntClear( p->vRoots );
229 230
    Gia_ManForEachLut2Vec( p->vNodes, p->pGia, vVec, iObj, i )
        Vec_IntForEachEntry( vVec, iFan, k )
231
            Gia_ObjLutRefDecId( p->pGia, iFan );
232
    Vec_IntForEachEntry( p->vAnds, iObj, i )
233 234
        if ( Gia_ObjLutRefNumId(p->pGia, iObj) )
            Vec_IntPush( p->vRoots, iObj );
235 236
    Gia_ManForEachLut2Vec( p->vNodes, p->pGia, vVec, iObj, i )
        Vec_IntForEachEntry( vVec, iFan, k )
237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258
            Gia_ObjLutRefIncId( p->pGia, iFan );
}




/**Function*************************************************************

  Synopsis    [Computes LUTs that are fanouts of the node outside of the cone.]

  Description []
               
  SideEffects []

  SeeAlso     []

***********************************************************************/
void Spl_ManLutFanouts_rec( Gia_Man_t * p, int iObj, Vec_Int_t * vFanouts, Vec_Bit_t * vMarksNo, Vec_Bit_t * vMarksCIO )
{
    int iFanout, i;
    if ( Vec_BitEntry(vMarksNo, iObj) || Vec_BitEntry(vMarksCIO, iObj) )
        return;
259
    if ( Gia_ObjIsLut2(p, iObj) )
260 261 262 263 264 265 266 267 268 269 270
    {
        Vec_BitWriteEntry( vMarksCIO, iObj, 1 );
        Vec_IntPush( vFanouts, iObj );
        return;
    }
    Gia_ObjForEachFanoutStaticId( p, iObj, iFanout, i )
        Spl_ManLutFanouts_rec( p, iFanout, vFanouts, vMarksNo, vMarksCIO );
}
int Spl_ManLutFanouts( Gia_Man_t * p, int iObj, Vec_Int_t * vFanouts, Vec_Bit_t * vMarksNo, Vec_Bit_t * vMarksCIO )
{
    int i, iFanout;
271
    assert( Gia_ObjIsLut2(p, iObj) );
272 273 274 275 276 277 278 279 280 281 282 283
    Vec_IntClear( vFanouts );
    Gia_ObjForEachFanoutStaticId( p, iObj, iFanout, i )
        Spl_ManLutFanouts_rec( p, iFanout, vFanouts, vMarksNo, vMarksCIO );
    // clean up
    Vec_IntForEachEntry( vFanouts, iFanout, i )
        Vec_BitWriteEntry( vMarksCIO, iFanout, 0 );
    return Vec_IntSize(vFanouts);
}


/**Function*************************************************************

284
  Synopsis    [Returns the number of fanins beloning to the set.]
285 286 287 288 289 290 291 292 293 294

  Description []
               
  SideEffects []

  SeeAlso     []

***********************************************************************/
int Spl_ManCountMarkedFanins( Gia_Man_t * p, int iObj, Vec_Bit_t * vMarks )
{
295 296 297
    int i, iFan, Count = 0;
    Vec_Int_t * vFanins = Gia_ObjLutFanins2(p, iObj);
    Vec_IntForEachEntry( vFanins, iFan, i )
298 299 300 301
        if ( Vec_BitEntry(vMarks, iFan) )
            Count++;
    return Count;
}
302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323
int Spl_ManFindGoodCand( Spl_Man_t * p )
{
    int i, iObj;
    int Res = 0, InCount, InCountMax = -1; 
    // mark leaves
    Vec_IntForEachEntry( p->vInputs, iObj, i )
        Vec_BitWriteEntry( p->vMarksIn, iObj, 1 );
    // find candidate with maximum input overlap
    Vec_IntForEachEntry( p->vCands, iObj, i )
    {
        InCount = Spl_ManCountMarkedFanins( p->pGia, iObj, p->vMarksIn );
        if ( InCountMax < InCount )
        {
            InCountMax = InCount;
            Res = iObj;
        }
    }
    // unmark leaves
    Vec_IntForEachEntry( p->vInputs, iObj, i )
        Vec_BitWriteEntry( p->vMarksIn, iObj, 0 );
    return Res;
}
324 325 326 327 328 329 330 331 332 333 334 335 336 337

/**Function*************************************************************

  Synopsis    []

  Description []
               
  SideEffects []

  SeeAlso     []

***********************************************************************/
int Spl_ManFindOne( Spl_Man_t * p )
{
338
    Vec_Int_t * vVec;
339
    int nFanouts, iObj, iFan, i, k;
340 341
    int Res = 0; 

342
    // deref
343 344
    Gia_ManForEachLut2Vec( p->vNodes, p->pGia, vVec, iObj, i )
        Vec_IntForEachEntry( vVec, iFan, k )
345
            Gia_ObjLutRefDecId( p->pGia, iFan );
346 347 348

    // collect external nodes
    if ( p->fReverse && (Vec_IntSize(p->vNodes) & 1) )
349
    {
350 351 352 353 354 355 356 357 358 359 360 361 362 363 364
        Vec_IntForEachEntry( p->vNodes, iObj, i )
        {
            if ( Gia_ObjLutRefNumId(p->pGia, iObj) == 0 )
                continue;
            assert( Gia_ObjLutRefNumId(p->pGia, iObj) > 0 );
            if ( Gia_ObjLutRefNumId(p->pGia, iObj) >= 5 )  // skip nodes with high fanout!
                continue;
            nFanouts = Spl_ManLutFanouts( p->pGia, iObj, p->vFanouts, p->vMarksNo, p->vMarksCIO );
            if ( Gia_ObjLutRefNumId(p->pGia, iObj) == 1 && nFanouts == 1 )
            {
                Res = Vec_IntEntry(p->vFanouts, 0);
                goto finish;
            }
            //Vec_IntAppend( p->vCands, p->vFanouts );
        }
365
    }
366

367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391
    // consider LUT inputs - get one that has no refs
    Vec_IntClear( p->vCands );
    Vec_IntClear( p->vInputs );
    Gia_ManForEachLut2Vec( p->vNodes, p->pGia, vVec, iObj, i )
        Vec_IntForEachEntry( vVec, iFan, k )
            if ( !Vec_BitEntry(p->vMarksNo, iFan) && !Vec_BitEntry(p->vMarksCIO, iFan) && !Gia_ObjLutRefNumId(p->pGia, iFan) )
            {
                Vec_IntPush( p->vCands, iFan );
                Vec_IntPush( p->vInputs, iFan );
            }
    Res = Spl_ManFindGoodCand( p );
    if ( Res )
        goto finish;

    // collect candidates
    Vec_IntClear( p->vCands );
    Vec_IntClear( p->vInputs );
    Gia_ManForEachLut2Vec( p->vNodes, p->pGia, vVec, iObj, i )
        Vec_IntForEachEntry( vVec, iFan, k )
            if ( !Vec_BitEntry(p->vMarksNo, iFan) && !Vec_BitEntry(p->vMarksCIO, iFan) )
            {
                Vec_IntPush( p->vCands, iFan );
                Vec_IntPush( p->vInputs, iFan );
            }

392 393 394 395 396 397
    // all inputs have refs - collect external nodes
    Vec_IntForEachEntry( p->vNodes, iObj, i )
    {
        if ( Gia_ObjLutRefNumId(p->pGia, iObj) == 0 )
            continue;
        assert( Gia_ObjLutRefNumId(p->pGia, iObj) > 0 );
398
        if ( Gia_ObjLutRefNumId(p->pGia, iObj) >= 5 )  // skip nodes with high fanout!
399 400 401 402 403 404 405 406 407 408
            continue;
        nFanouts = Spl_ManLutFanouts( p->pGia, iObj, p->vFanouts, p->vMarksNo, p->vMarksCIO );
        if ( Gia_ObjLutRefNumId(p->pGia, iObj) == 1 && nFanouts == 1 )
        {
            Res = Vec_IntEntry(p->vFanouts, 0);
            goto finish;
        }
        Vec_IntAppend( p->vCands, p->vFanouts );
    }

409 410 411 412
    // choose among not-so-good ones
    Res = Spl_ManFindGoodCand( p );
    if ( Res )
        goto finish;
413 414 415 416 417 418

    // get the first candidate
    if ( Res == 0 && Vec_IntSize(p->vCands) > 0 )
        Res = Vec_IntEntry( p->vCands, 0 );

finish:
419 420 421
    // ref
    Gia_ManForEachLut2Vec( p->vNodes, p->pGia, vVec, iObj, i )
        Vec_IntForEachEntry( vVec, iFan, k )
422 423 424 425 426 427 428 429
            Gia_ObjLutRefIncId( p->pGia, iFan );
    return Res;
}



/**Function*************************************************************

430
  Synopsis    [Computing window for one pivot node.]
431 432 433 434 435 436 437 438

  Description []
               
  SideEffects []

  SeeAlso     []

***********************************************************************/
439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461
int Spl_ManLutMffcSize( Gia_Man_t * p, int iObj, Vec_Int_t * vTemp, Vec_Bit_t * vMarksAnd )
{
    int iTemp, i, k = 0;
    assert( Gia_ObjIsLut2(p, iObj) );
//Vec_IntPrint( Gia_ObjLutFanins2(p, iObj) );
    Gia_ManIncrementTravId( p );
    Gia_ManCollectAnds( p, &iObj, 1, vTemp, Gia_ObjLutFanins2(p, iObj) );
    Vec_IntForEachEntry( vTemp, iTemp, i )
        if ( !Vec_BitEntry(vMarksAnd, iTemp) )
            Vec_IntWriteEntry( vTemp, k++, iTemp );
    Vec_IntShrink( vTemp, k );
    return k;
}
void Spl_ManAddNode( Spl_Man_t * p, int iPivot, Vec_Int_t * vCands )
{
    int i, iObj;
    Vec_IntPush( p->vNodes, iPivot );
    Vec_BitWriteEntry( p->vMarksNo, iPivot, 1 );
    Vec_IntAppend( p->vAnds, vCands );
    Vec_IntForEachEntry( vCands, iObj, i )
        Vec_BitWriteEntry( p->vMarksAnd, iObj, 1 );
}
int Spl_ManComputeOne( Spl_Man_t * p, int iPivot )
462 463
{
    int CountAdd, iObj, i;
464 465
    assert( Gia_ObjIsLut2(p->pGia, iPivot) );
//Gia_ManPrintCone2( p->pGia, Gia_ManObj(p->pGia, iPivot) );
466 467 468
    // assume it was previously filled in
    Vec_IntForEachEntry( p->vNodes, iObj, i )
        Vec_BitWriteEntry( p->vMarksNo, iObj, 0 );
469 470
    Vec_IntForEachEntry( p->vAnds, iObj, i )
        Vec_BitWriteEntry( p->vMarksAnd, iObj, 0 );
471
    // double check that it is empty
472
    //Gia_ManForEachLut2( p->pGia, iObj )
473
    //    assert( !Vec_BitEntry(p->vMarksNo, iObj) );
474 475 476 477 478
    //Gia_ManForEachLut2( p->pGia, iObj )
    //    assert( !Vec_BitEntry(p->vMarksAnd, iObj) );
    // clean arrays
    Vec_IntClear( p->vNodes );
    Vec_IntClear( p->vAnds );
479
    // add root node
480 481 482 483
    Spl_ManLutMffcSize( p->pGia, iPivot, p->vCands, p->vMarksAnd );
    Spl_ManAddNode( p, iPivot, p->vCands );
    if ( Vec_IntSize(p->vAnds) > p->Limit )
        return 0;
484 485 486 487
    //printf( "%d ", iPivot );
    // add one node at a time
    while ( (iObj = Spl_ManFindOne(p)) )
    {
488 489 490 491
        assert( Gia_ObjIsLut2(p->pGia, iObj) );
        assert( !Vec_BitEntry(p->vMarksNo, iObj) );
        CountAdd = Spl_ManLutMffcSize( p->pGia, iObj, p->vCands, p->vMarksAnd );
        if ( Vec_IntSize(p->vAnds) + CountAdd > p->Limit )
492
            break;
493
        Spl_ManAddNode( p, iObj, p->vCands );
494 495 496 497
        //printf( "+%d ", iObj );
    }
    //printf( "\n" );
    Vec_IntSort( p->vNodes, 0 );
498 499 500 501 502
    Vec_IntSort( p->vAnds, 0 );
    Spl_ManWinFindLeavesRoots( p );
    Vec_IntSort( p->vLeaves, 0 );
    Vec_IntSort( p->vRoots, 0 );
    return 1;
503 504
}

505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540
/**Function*************************************************************

  Synopsis    [External procedures.]

  Description []
               
  SideEffects []

  SeeAlso     []

***********************************************************************/
int Gia_ManComputeOneWin( Gia_Man_t * pGia, int iPivot, Vec_Int_t ** pvRoots, Vec_Int_t ** pvNodes, Vec_Int_t ** pvLeaves, Vec_Int_t ** pvAnds )
{
    Spl_Man_t * p = (Spl_Man_t *)pGia->pSatlutWinman;
    assert( p != NULL );
    if ( iPivot == -1 )
    {
        Spl_ManStop( p );
        pGia->pSatlutWinman = NULL;
        return 0;
    }
    if ( !Spl_ManComputeOne( p, iPivot ) )
    {
        *pvRoots  = NULL;
        *pvNodes  = NULL;
        *pvLeaves = NULL;
        *pvAnds   = NULL;
        return 0;
    }
    *pvRoots  = p->vRoots;
    *pvNodes  = p->vNodes;
    *pvLeaves = p->vLeaves;
    *pvAnds   = p->vAnds;
    // Vec_IntPrint( p->vNodes );
    return Vec_IntSize(p->vAnds);
}
541
void Gia_ManComputeOneWinStart( Gia_Man_t * pGia, int nAnds, int fReverse )
542 543
{
    assert( pGia->pSatlutWinman == NULL );
544
    pGia->pSatlutWinman = Spl_ManAlloc( pGia, nAnds, fReverse );
545 546 547 548 549 550 551 552 553 554 555 556 557
}

/**Function*************************************************************

  Synopsis    [Testing procedure.]

  Description []
               
  SideEffects []

  SeeAlso     []

***********************************************************************/
558 559
void Spl_ManComputeOneTest( Gia_Man_t * pGia )
{
560
    int iLut, Count;
561
    Gia_ManComputeOneWinStart( pGia, 64, 0 );
562
    Gia_ManForEachLut2( pGia, iLut )
563
    {
564 565
        Vec_Int_t * vRoots, * vNodes, * vLeaves, * vAnds;
        Count = Gia_ManComputeOneWin( pGia, iLut, &vRoots, &vNodes, &vLeaves, &vAnds );
566
        printf( "Obj = %6d : Leaf = %2d.  Node = %2d.  Root = %2d.    AND = %3d.\n", 
567
            iLut, Vec_IntSize(vLeaves), Vec_IntSize(vNodes), Vec_IntSize(vRoots), Count ); 
568
    }
569
    Gia_ManComputeOneWin( pGia, -1, NULL, NULL, NULL, NULL );
570 571 572 573 574 575 576 577 578
}

////////////////////////////////////////////////////////////////////////
///                       END OF FILE                                ///
////////////////////////////////////////////////////////////////////////


ABC_NAMESPACE_IMPL_END