ABC: A System for Sequential Synthesis and Verification
 
Loading...
Searching...
No Matches
plaFxch.c File Reference
#include "pla.h"
#include "misc/vec/vecHash.h"
#include "misc/vec/vecQue.h"
Include dependency graph for plaFxch.c:

Go to the source code of this file.

Classes

struct  Fxch_Obj_t_
 
struct  Fxch_Man_t_
 

Macros

#define Fxch_ManForEachCubeVec(vVec, vCubes, vCube, i)
 

Typedefs

typedef typedefABC_NAMESPACE_IMPL_START struct Fxch_Obj_t_ Fxch_Obj_t
 DECLARATIONS ///.
 
typedef struct Fxch_Man_t_ Fxch_Man_t
 TYPEDEF DECLARATIONS ///.
 

Functions

void Fxch_ManWriteBlif (char *pFileName, Vec_Wec_t *vCubes, Vec_Wrd_t *vDivs)
 FUNCTION DEFINITIONS ///.
 
Fxch_Man_tFxch_ManStart (Vec_Wec_t *vCubes, Vec_Wec_t *vLits)
 
void Fxch_ManStop (Fxch_Man_t *p)
 
int Fxch_DivisorAdd (Fxch_Man_t *p, int Lit0, int Lit1, int Weight)
 
void Fxch_DivisorRemove (Fxch_Man_t *p, int Lit0, int Lit1, int Weight)
 
int Fxch_TabSingleDivisors (Fxch_Man_t *p, int iCube, int fAdd)
 
int Fxch_TabDoubleDivisors (Fxch_Man_t *p, int iCube, int fAdd)
 
void Fxch_ManCreateDivisors (Fxch_Man_t *p)
 
void Fxch_ManUpdate (Fxch_Man_t *p, int iDiv)
 
int Fxch_ManFastExtract (Fxch_Man_t *p, int fVerbose, int fVeryVerbose)
 
int Pla_ManPerformFxch (Pla_Man_t *p)
 

Macro Definition Documentation

◆ Fxch_ManForEachCubeVec

#define Fxch_ManForEachCubeVec ( vVec,
vCubes,
vCube,
i )
Value:
for ( i = 0; (i < Vec_IntSize(vVec)) && ((vCube) = Vec_WecEntry(vCubes, Vec_IntEntry(vVec, i))); i++ )

Definition at line 72 of file plaFxch.c.

72#define Fxch_ManForEachCubeVec( vVec, vCubes, vCube, i ) \
73 for ( i = 0; (i < Vec_IntSize(vVec)) && ((vCube) = Vec_WecEntry(vCubes, Vec_IntEntry(vVec, i))); i++ )

Typedef Documentation

◆ Fxch_Man_t

typedef struct Fxch_Man_t_ Fxch_Man_t

TYPEDEF DECLARATIONS ///.

Definition at line 42 of file plaFxch.c.

◆ Fxch_Obj_t

typedef typedefABC_NAMESPACE_IMPL_START struct Fxch_Obj_t_ Fxch_Obj_t

DECLARATIONS ///.

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

FileName [plaFxch.c]

SystemName [ABC: Logic synthesis and verification system.]

PackageName [SOP manager.]

Synopsis [Scalable SOP transformations.]

Author [Alan Mishchenko]

Affiliation [UC Berkeley]

Date [Ver. 1.0. Started - March 18, 2015.]

Revision [

Id
plaFxch.c,v 1.00 2014/09/12 00:00:00 alanmi Exp

]

Definition at line 31 of file plaFxch.c.

Function Documentation

◆ Fxch_DivisorAdd()

int Fxch_DivisorAdd ( Fxch_Man_t * p,
int Lit0,
int Lit1,
int Weight )

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

Synopsis [Divisor addition removal.]

Description []

SideEffects []

SeeAlso []

Definition at line 344 of file plaFxch.c.

345{
346 int iDiv;
347 assert( Lit0 != Lit1 );
348 if ( Lit0 < Lit1 )
349 iDiv = Hash_Int2ManInsert( p->vHash, Lit0, Lit1, 0 );
350 else
351 iDiv = Hash_Int2ManInsert( p->vHash, Lit1, Lit0, 0 );
352 if ( iDiv == Vec_FltSize(&p->vWeights) )
353 {
354 Vec_FltPush( &p->vWeights, -2 );
355 Vec_WecPushLevel( &p->vPairs );
356 assert( Vec_FltSize(&p->vWeights) == Vec_WecSize(&p->vPairs) );
357 }
358 Vec_FltAddToEntry( &p->vWeights, iDiv, Weight );
359 if ( p->vPrio )
360 {
361 if ( Vec_QueIsMember(p->vPrio, iDiv) )
362 Vec_QueUpdate( p->vPrio, iDiv );
363 else
364 Vec_QuePush( p->vPrio, iDiv );
365 //assert( iDiv < Vec_QueSize(p->vPrio) );
366 }
367 return iDiv;
368}
Cube * p
Definition exorList.c:222
#define assert(ex)
Definition util_old.h:213
Here is the caller graph for this function:

◆ Fxch_DivisorRemove()

void Fxch_DivisorRemove ( Fxch_Man_t * p,
int Lit0,
int Lit1,
int Weight )

Definition at line 369 of file plaFxch.c.

370{
371 int iDiv;
372 assert( Lit0 != Lit1 );
373 if ( Lit0 < Lit1 )
374 iDiv = *Hash_Int2ManLookup( p->vHash, Lit0, Lit1 );
375 else
376 iDiv = *Hash_Int2ManLookup( p->vHash, Lit1, Lit0 );
377 assert( iDiv > 0 && iDiv < Vec_FltSize(&p->vWeights) );
378 Vec_FltAddToEntry( &p->vWeights, iDiv, -Weight );
379 if ( Vec_QueIsMember(p->vPrio, iDiv) )
380 Vec_QueUpdate( p->vPrio, iDiv );
381}
Here is the caller graph for this function:

◆ Fxch_ManCreateDivisors()

void Fxch_ManCreateDivisors ( Fxch_Man_t * p)

Definition at line 585 of file plaFxch.c.

586{
587 float Weight; int i;
588 // alloc hash table
589 assert( p->vHash == NULL );
590 p->vHash = Hash_IntManStart( 1000 );
591 // create single-cube two-literal divisors
592 for ( i = 0; i < Vec_WecSize(&p->vCubes); i++ )
593 Fxch_TabSingleDivisors( p, i, 1 ); // add - no update
594 // create two-cube divisors
595 for ( i = 0; i < Vec_WecSize(&p->vCubes); i++ )
596 Fxch_TabDoubleDivisors( p, i, 1 ); // add - no update
597 // create queue with all divisors
598 p->vPrio = Vec_QueAlloc( Vec_FltSize(&p->vWeights) );
599 Vec_QueSetPriority( p->vPrio, Vec_FltArrayP(&p->vWeights) );
600 Vec_FltForEachEntry( &p->vWeights, Weight, i )
601 if ( Weight > 0.0 )
602 Vec_QuePush( p->vPrio, i );
603}
int Fxch_TabDoubleDivisors(Fxch_Man_t *p, int iCube, int fAdd)
Definition plaFxch.c:567
int Fxch_TabSingleDivisors(Fxch_Man_t *p, int iCube, int fAdd)
Definition plaFxch.c:550
#define Vec_FltForEachEntry(vVec, Entry, i)
MACRO DEFINITIONS ///.
Definition vecFlt.h:54
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Fxch_ManFastExtract()

int Fxch_ManFastExtract ( Fxch_Man_t * p,
int fVerbose,
int fVeryVerbose )

Definition at line 798 of file plaFxch.c.

799{
800 int nNewNodesMax = ABC_INFINITY;
801 abctime clk = Abc_Clock();
802 int i, iDiv;
804// Fxch_PrintDivisors( p );
805 if ( fVerbose )
806 Fxch_PrintStats( p, Abc_Clock() - clk );
807 p->timeStart = Abc_Clock();
808 for ( i = 0; i < nNewNodesMax && Vec_QueTopPriority(p->vPrio) > 0.0; i++ )
809 {
810 iDiv = Vec_QuePop(p->vPrio);
811 //if ( fVerbose )
812 // Fxch_PrintStats( p, Abc_Clock() - clk );
813 if ( fVeryVerbose )
814 Fxch_PrintDivOne( p, iDiv );
815 Fxch_ManUpdate( p, iDiv );
816 }
817 if ( fVerbose )
818 Fxch_PrintStats( p, Abc_Clock() - clk );
819 return 1;
820}
ABC_INT64_T abctime
Definition abc_global.h:332
#define ABC_INFINITY
MACRO DEFINITIONS ///.
Definition abc_global.h:250
void Fxch_ManCreateDivisors(Fxch_Man_t *p)
Definition plaFxch.c:585
void Fxch_ManUpdate(Fxch_Man_t *p, int iDiv)
Definition plaFxch.c:617
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Fxch_ManStart()

Fxch_Man_t * Fxch_ManStart ( Vec_Wec_t * vCubes,
Vec_Wec_t * vLits )

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

Synopsis [Starting the manager.]

Description []

SideEffects []

SeeAlso []

Definition at line 164 of file plaFxch.c.

165{
166 Vec_Int_t * vCube; int i, LogSize;
168 p->vCubes = *vCubes;
169 p->vLits = *vLits;
170 p->nVars = Vec_WecSize(vLits)/2;
171 p->nLits = 0;
172 // random numbers
173 Gia_ManRandom( 1 );
174 Vec_IntGrow( &p->vRands, 2*p->nVars );
175 for ( i = 0; i < 2*p->nVars; i++ )
176 Vec_IntPush( &p->vRands, Gia_ManRandom(0) & 0x3FFFFFF ); // assert( LogSize <= 26 );
177 // create cube links
178 Vec_IntGrow( &p->vCubeLinks, Vec_WecSize(&p->vCubes) );
179 Vec_WecForEachLevel( vCubes, vCube, i )
180 {
181 Vec_IntPush( &p->vCubeLinks, p->nLits+1 );
182 p->nLits += Vec_IntSize(vCube);
183 }
184 assert( Vec_IntSize(&p->vCubeLinks) == Vec_WecSize(&p->vCubes) );
185 // create table
186 LogSize = Abc_Base2Log( p->nLits+1 );
187 assert( LogSize <= 26 );
188 p->SizeMask = (1 << LogSize) - 1;
189 p->pBins = ABC_CALLOC( Fxch_Obj_t, p->SizeMask + 1 );
190 assert( p->nLits+1 < p->SizeMask+1 );
191 // divisor weights and cube pairs
192 Vec_FltGrow( &p->vWeights, 1000 );
193 Vec_FltPush( &p->vWeights, -1 );
194 Vec_WecGrow( &p->vPairs, 1000 );
195 Vec_WecPushLevel( &p->vPairs );
196 // prepare divisors
197 Vec_WrdGrow( &p->vDivs, p->nVars + 1000 );
198 Vec_WrdFill( &p->vDivs, p->nVars, 0 );
199 return p;
200}
#define ABC_CALLOC(type, num)
Definition abc_global.h:265
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
Definition bblif.c:37
unsigned Gia_ManRandom(int fReset)
FUNCTION DEFINITIONS ///.
Definition giaUtil.c:49
typedefABC_NAMESPACE_IMPL_START struct Fxch_Obj_t_ Fxch_Obj_t
DECLARATIONS ///.
Definition plaFxch.c:31
struct Fxch_Man_t_ Fxch_Man_t
TYPEDEF DECLARATIONS ///.
Definition plaFxch.c:42
#define Vec_WecForEachLevel(vGlob, vVec, i)
MACRO DEFINITIONS ///.
Definition vecWec.h:55
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Fxch_ManStop()

void Fxch_ManStop ( Fxch_Man_t * p)

Definition at line 201 of file plaFxch.c.

202{
203 Vec_WecErase( &p->vCubes );
204 Vec_WecErase( &p->vLits );
205 Vec_IntErase( &p->vRands );
206 Vec_IntErase( &p->vCubeLinks );
207 Hash_IntManStop( p->vHash );
208 Vec_QueFree( p->vPrio );
209 Vec_FltErase( &p->vWeights );
210 Vec_WecErase( &p->vPairs );
211 Vec_WrdErase( &p->vDivs );
212 Vec_IntErase( &p->vCubesS );
213 Vec_IntErase( &p->vCubesD );
214 Vec_IntErase( &p->vCube1 );
215 Vec_IntErase( &p->vCube2 );
216 ABC_FREE( p->pBins );
217 ABC_FREE( p );
218}
#define ABC_FREE(obj)
Definition abc_global.h:267
Here is the caller graph for this function:

◆ Fxch_ManUpdate()

void Fxch_ManUpdate ( Fxch_Man_t * p,
int iDiv )

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

Synopsis [Updates the data-structure when one divisor is selected.]

Description []

SideEffects []

SeeAlso []

Definition at line 617 of file plaFxch.c.

618{
619 Vec_Int_t * vCube1, * vCube2, * vLitP, * vLitN;
620 //int nLitsNew = p->nLits - (int)Vec_FltEntry(&p->vWeights, iDiv);
621 int i, Lit0, Lit1, hCube1, hCube2, iVarNew;
622 //float Diff = Vec_FltEntry(&p->vWeights, iDiv) - (float)((int)Vec_FltEntry(&p->vWeights, iDiv));
623 //assert( Diff > 0.0 && Diff < 1.0 );
624
625 // get the divisor and select pivot variables
626 Vec_IntPush( &p->vRands, Gia_ManRandom(0) & 0x3FFFFFF );
627 Vec_IntPush( &p->vRands, Gia_ManRandom(0) & 0x3FFFFFF );
628 Lit0 = Hash_IntObjData0( p->vHash, iDiv );
629 Lit1 = Hash_IntObjData1( p->vHash, iDiv );
630 assert( Lit0 >= 0 && Lit1 >= 0 && Lit0 < Lit1 );
631 Vec_WrdPush( &p->vDivs, ((word)Lit1 << 32) | (word)Lit0 );
632
633 // if the input cover is not prime, it may happen that we are extracting divisor (x + !x)
634 // although it is not strictly correct, it seems to be fine to just skip such divisors
635// if ( Abc_Lit2Var(Lit0) == Abc_Lit2Var(Lit1) && Vec_IntSize(Hsh_VecReadEntry(p->vHash, iDiv)) == 2 )
636// return;
637
638 // collect single-cube-divisor cubes
639 vLitP = Vec_WecEntry(&p->vLits, Lit0);
640 vLitN = Vec_WecEntry(&p->vLits, Lit1);
641 Fxch_CompressCubes( p, vLitP );
642 Fxch_CompressCubes( p, vLitN );
643// Fxch_CollectSingles( vLitP, vLitN, &p->vCubesS );
644// assert( Vec_IntSize(&p->vCubesS) % 2 == 0 );
645 Vec_IntTwoRemoveCommon( vLitP, vLitN, &p->vCubesS );
646 Fxch_FilterCubes( p, &p->vCubesS, Lit0, Lit1 );
647
648 // collect double-cube-divisor cube pairs
649 Fxch_CollectDoubles( p, Vec_WecEntry(&p->vPairs, iDiv), &p->vCubesD, Abc_LitNot(Lit0), Abc_LitNot(Lit1) );
650 assert( Vec_IntSize(&p->vCubesD) % 2 == 0 );
651 Vec_IntUniqifyPairs( &p->vCubesD );
652 assert( Vec_IntSize(&p->vCubesD) % 2 == 0 );
653
654 // subtract cost of single-cube divisors
655// Vec_IntForEachEntryDouble( &p->vCubesS, hCube1, hCube2, i )
656 Vec_IntForEachEntry( &p->vCubesS, hCube1, i )
657 Fxch_TabSingleDivisors( p, Pla_CubeNum(hCube1), 0 ); // remove - update
658 Vec_IntForEachEntryDouble( &p->vCubesD, hCube1, hCube2, i )
659 Fxch_TabSingleDivisors( p, Pla_CubeNum(hCube1), 0 ), // remove - update
660 Fxch_TabSingleDivisors( p, Pla_CubeNum(hCube2), 0 ); // remove - update
661
662 // subtract cost of double-cube divisors
663// Vec_IntForEachEntryDouble( &p->vCubesS, hCube1, hCube2, i )
664 Vec_IntForEachEntry( &p->vCubesS, hCube1, i )
665 {
666 //printf( "%d ", Pla_CubeNum(hCube1) );
667 Fxch_TabDoubleDivisors( p, Pla_CubeNum(hCube1), 0 ); // remove - update
668 }
669 //printf( "\n" );
670
671 Vec_IntForEachEntryDouble( &p->vCubesD, hCube1, hCube2, i )
672 {
673 //printf( "%d ", Pla_CubeNum(hCube1) );
674 //printf( "%d ", Pla_CubeNum(hCube2) );
675 Fxch_TabDoubleDivisors( p, Pla_CubeNum(hCube1), 0 ), // remove - update
676 Fxch_TabDoubleDivisors( p, Pla_CubeNum(hCube2), 0 ); // remove - update
677 }
678 //printf( "\n" );
679
680 // create new literals
681 p->nLits += 2;
682 iVarNew = Vec_WecSize( &p->vLits ) / 2;
683 vLitP = Vec_WecPushLevel( &p->vLits );
684 vLitN = Vec_WecPushLevel( &p->vLits );
685 vLitP = Vec_WecEntry( &p->vLits, Vec_WecSize(&p->vLits) - 2 );
686 // update single-cube divisor cubes
687// Vec_IntForEachEntryDouble( &p->vCubesS, hCube1, hCube2, i )
688 Vec_IntForEachEntry( &p->vCubesS, hCube1, i )
689 {
690// int Lit0s, Lit1s;
691 vCube1 = Fxch_ManCube( p, hCube1 );
692// Lit0s = Vec_IntEntry(vCube1, Pla_CubeLit(hCube1));
693// Lit1s = Vec_IntEntry(vCube1, Pla_CubeLit(hCube2));
694// assert( Pla_CubeNum(hCube1) == Pla_CubeNum(hCube2) );
695// assert( Vec_IntEntry(vCube1, Pla_CubeLit(hCube1)) == Lit0 );
696// assert( Vec_IntEntry(vCube1, Pla_CubeLit(hCube2)) == Lit1 );
697 Fxch_CompressLiterals( vCube1, Lit0, Lit1 );
698// Vec_IntPush( vLitP, Pla_CubeHandle(Pla_CubeNum(hCube1), Vec_IntSize(vCube1)) );
699 Vec_IntPush( vLitP, Pla_CubeNum(hCube1) );
700 Vec_IntPush( vCube1, Abc_Var2Lit(iVarNew, 0) );
701
702 //if ( Pla_CubeNum(hCube1) == 3 )
703 // printf( "VecSize = %d\n", Vec_IntSize(vCube1) );
704
705 p->nLits--;
706 }
707 // update double-cube divisor cube pairs
708 Vec_IntForEachEntryDouble( &p->vCubesD, hCube1, hCube2, i )
709 {
710 vCube1 = Fxch_ManCube( p, hCube1 );
711 vCube2 = Fxch_ManCube( p, hCube2 );
712 assert( Vec_IntEntry(vCube1, Pla_CubeLit(hCube1)) == Abc_LitNot(Lit0) );
713 assert( Vec_IntEntry(vCube2, Pla_CubeLit(hCube2)) == Abc_LitNot(Lit1) );
714 Fxch_CompressLiterals2( vCube1, Pla_CubeLit(hCube1), -1 );
715// Vec_IntPush( vLitN, Pla_CubeHandle(Pla_CubeNum(hCube1), Vec_IntSize(vCube1)) );
716 Vec_IntPush( vLitN, Pla_CubeNum(hCube1) );
717 Vec_IntPush( vCube1, Abc_Var2Lit(iVarNew, 1) );
718 p->nLits -= Vec_IntSize(vCube2);
719
720 //if ( Pla_CubeNum(hCube1) == 3 )
721 // printf( "VecSize = %d\n", Vec_IntSize(vCube1) );
722
723 // remove second cube
724 Vec_IntClear( vCube2 );
725 }
726 Vec_IntSort( vLitN, 0 );
727 Vec_IntSort( vLitP, 0 );
728
729 // add cost of single-cube divisors
730// Vec_IntForEachEntryDouble( &p->vCubesS, hCube1, hCube2, i )
731 Vec_IntForEachEntry( &p->vCubesS, hCube1, i )
732 Fxch_TabSingleDivisors( p, Pla_CubeNum(hCube1), 1 ); // add - update
733 Vec_IntForEachEntryDouble( &p->vCubesD, hCube1, hCube2, i )
734 Fxch_TabSingleDivisors( p, Pla_CubeNum(hCube1), 1 ); // add - update
735
736 // add cost of double-cube divisors
737// Vec_IntForEachEntryDouble( &p->vCubesS, hCube1, hCube2, i )
738 Vec_IntForEachEntry( &p->vCubesS, hCube1, i )
739 Fxch_TabDoubleDivisors( p, Pla_CubeNum(hCube1), 1 ); // add - update
740 Vec_IntForEachEntryDouble( &p->vCubesD, hCube1, hCube2, i )
741 Fxch_TabDoubleDivisors( p, Pla_CubeNum(hCube1), 1 ); // add - update
742
743 // check predicted improvement: (new SOP lits == old SOP lits - divisor weight)
744 //assert( p->nLits == nLitsNew );
745}
unsigned __int64 word
DECLARATIONS ///.
Definition kitPerm.c:36
#define Vec_IntForEachEntryDouble(vVec, Entry1, Entry2, i)
Definition vecInt.h:72
#define Vec_IntForEachEntry(vVec, Entry, i)
MACRO DEFINITIONS ///.
Definition vecInt.h:54
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Fxch_ManWriteBlif()

void Fxch_ManWriteBlif ( char * pFileName,
Vec_Wec_t * vCubes,
Vec_Wrd_t * vDivs )

FUNCTION DEFINITIONS ///.

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

Synopsis [Writes the current state of the manager.]

Description []

SideEffects []

SeeAlso []

Definition at line 93 of file plaFxch.c.

94{
95 // find the number of original variables
96 int nVarsInit = Vec_WrdCountZero(vDivs);
97 FILE * pFile = fopen( pFileName, "wb" );
98 if ( pFile == NULL )
99 printf( "Cannot open file \"%s\" for writing.\n", pFileName );
100 else
101 {
102 //char * pLits = "-01?";
103 Vec_Str_t * vStr;
104 Vec_Int_t * vCube;
105 int i, k, Lit;
106 word Div;
107 // comment
108 fprintf( pFile, "# BLIF file written via PLA package in ABC on " );
109 fprintf( pFile, "%s", Extra_TimeStamp() );
110 fprintf( pFile, "\n\n" );
111 // header
112 fprintf( pFile, ".model %s\n", pFileName );
113 fprintf( pFile, ".inputs" );
114 for ( i = 0; i < nVarsInit; i++ )
115 fprintf( pFile, " i%d", i );
116 fprintf( pFile, "\n" );
117 fprintf( pFile, ".outputs o" );
118 fprintf( pFile, "\n" );
119 // SOP header
120 fprintf( pFile, ".names" );
121 for ( i = 0; i < Vec_WrdSize(vDivs); i++ )
122 fprintf( pFile, " i%d", i );
123 fprintf( pFile, " o\n" );
124 // SOP cubes
125 vStr = Vec_StrStart( Vec_WrdSize(vDivs) + 1 );
126 Vec_WecForEachLevel( vCubes, vCube, i )
127 {
128 if ( !Vec_IntSize(vCube) )
129 continue;
130 for ( k = 0; k < Vec_WrdSize(vDivs); k++ )
131 Vec_StrWriteEntry( vStr, k, '-' );
132 Vec_IntForEachEntry( vCube, Lit, k )
133 Vec_StrWriteEntry( vStr, Abc_Lit2Var(Lit), (char)(Abc_LitIsCompl(Lit) ? '0' : '1') );
134 fprintf( pFile, "%s 1\n", Vec_StrArray(vStr) );
135 }
136 Vec_StrFree( vStr );
137 // divisors
138 Vec_WrdForEachEntryStart( vDivs, Div, i, nVarsInit )
139 {
140 int pLits[2] = { (int)(Div & 0xFFFFFFFF), (int)(Div >> 32) };
141 fprintf( pFile, ".names" );
142 fprintf( pFile, " i%d", Abc_Lit2Var(pLits[0]) );
143 fprintf( pFile, " i%d", Abc_Lit2Var(pLits[1]) );
144 fprintf( pFile, " i%d\n", i );
145 fprintf( pFile, "%d%d 1\n", !Abc_LitIsCompl(pLits[0]), !Abc_LitIsCompl(pLits[1]) );
146 }
147 fprintf( pFile, ".end\n\n" );
148 fclose( pFile );
149 printf( "Written BLIF file \"%s\".\n", pFileName );
150 }
151}
struct Vec_Str_t_ Vec_Str_t
Definition bblif.c:46
char * Extra_TimeStamp()
#define Vec_WrdForEachEntryStart(vVec, Entry, i, Start)
Definition vecWrd.h:56
Here is the call graph for this function:

◆ Fxch_TabDoubleDivisors()

int Fxch_TabDoubleDivisors ( Fxch_Man_t * p,
int iCube,
int fAdd )

Definition at line 567 of file plaFxch.c.

568{
569 Vec_Int_t * vCube = Vec_WecEntry( &p->vCubes, iCube );
570 int iLinkFirst = Vec_IntEntry( &p->vCubeLinks, iCube );
571 int k, Lit, Value = 0;
572 Vec_IntForEachEntry( vCube, Lit, k )
573 Value += Vec_IntEntry(&p->vRands, Lit);
574 Vec_IntForEachEntry( vCube, Lit, k )
575 {
576 Value -= Vec_IntEntry(&p->vRands, Lit);
577 if ( fAdd )
578 Fxch_TabInsert( p, iLinkFirst + k, Value, Pla_CubeHandle(iCube, k) );
579 else
580 Fxch_TabExtract( p, iLinkFirst + k, Value, Pla_CubeHandle(iCube, k) );
581 Value += Vec_IntEntry(&p->vRands, Lit);
582 }
583 return 1;
584}
Here is the caller graph for this function:

◆ Fxch_TabSingleDivisors()

int Fxch_TabSingleDivisors ( Fxch_Man_t * p,
int iCube,
int fAdd )

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

Synopsis [Starting the manager.]

Description []

SideEffects []

SeeAlso []

Definition at line 550 of file plaFxch.c.

551{
552 Vec_Int_t * vCube = Vec_WecEntry( &p->vCubes, iCube );
553 int i, k, Lit, Lit2;
554 if ( Vec_IntSize(vCube) < 2 )
555 return 0;
556 Vec_IntForEachEntry( vCube, Lit, i )
557 Vec_IntForEachEntryStart( vCube, Lit2, k, i+1 )
558 {
559 assert( Lit < Lit2 );
560 if ( fAdd )
561 Fxch_DivisorAdd( p, Lit, Lit2, 1 ), p->nPairsS++;
562 else
563 Fxch_DivisorRemove( p, Lit, Lit2, 1 ), p->nPairsS--;
564 }
565 return Vec_IntSize(vCube) * (Vec_IntSize(vCube) - 1) / 2;
566}
void Fxch_DivisorRemove(Fxch_Man_t *p, int Lit0, int Lit1, int Weight)
Definition plaFxch.c:369
int Fxch_DivisorAdd(Fxch_Man_t *p, int Lit0, int Lit1, int Weight)
Definition plaFxch.c:344
#define Vec_IntForEachEntryStart(vVec, Entry, i, Start)
Definition vecInt.h:56
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Pla_ManPerformFxch()

int Pla_ManPerformFxch ( Pla_Man_t * p)

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

Synopsis [Implements the improved fast_extract algorithm.]

Description []

SideEffects []

SeeAlso []

Definition at line 833 of file plaFxch.c.

834{
835 char pFileName[1000];
836 Fxch_Man_t * pFxch;
838 pFxch = Fxch_ManStart( &p->vCubeLits, &p->vOccurs );
839 Vec_WecZero( &p->vCubeLits );
840 Vec_WecZero( &p->vOccurs );
841 Fxch_ManFastExtract( pFxch, 1, 0 );
842 sprintf( pFileName, "%s.blif", Pla_ManName(p) );
843 //Fxch_ManWriteBlif( pFileName, &pFxch->vCubes, &pFxch->vDivs );
844 Fxch_ManStop( pFxch );
845 return 1;
846}
void Fxch_ManStop(Fxch_Man_t *p)
Definition plaFxch.c:201
int Fxch_ManFastExtract(Fxch_Man_t *p, int fVerbose, int fVeryVerbose)
Definition plaFxch.c:798
Fxch_Man_t * Fxch_ManStart(Vec_Wec_t *vCubes, Vec_Wec_t *vLits)
Definition plaFxch.c:164
void Pla_ManConvertFromBits(Pla_Man_t *p)
Definition plaMan.c:221
char * sprintf()
Here is the call graph for this function: