48 int nSuppSize0, nSuppSize1, nSuppSizeS, nSuppSizeL;
49 int Var, Area, Polarity, Delay, Delay0, Delay1, DelayA, DelayB;
51 assert(
p->uSupp == Kit_BitMask(
p->nVars) );
57 nSuppSize0 = Kit_WordCountOnes(
p->puSupps[2*
Var+0]);
58 nSuppSize1 = Kit_WordCountOnes(
p->puSupps[2*
Var+1]);
59 assert( nSuppSize0 < (
int)
p->nVars );
60 assert( nSuppSize1 < (
int)
p->nVars );
61 if ( nSuppSize0 < 1 || nSuppSize1 < 1 )
64 if ( nSuppSize0 <= (
int)
p->nLutK - 2 && nSuppSize1 <= (
int)
p->nLutK - 2 )
69 Delay0 = Abc_MaxInt( DelayA, DelayB + 1 );
73 Delay1 = Abc_MaxInt( DelayA, DelayB + 1 );
75 Delay = Abc_MinInt( Delay0, Delay1 );
77 Polarity = (int)(Delay == Delay1);
79 else if ( nSuppSize0 <= (
int)
p->nLutK - 2 )
83 Delay = Abc_MaxInt( DelayA, DelayB + 1 );
84 Area = 1 + Lpk_LutNumLuts( nSuppSize1,
p->nLutK );
87 else if ( nSuppSize1 <= (
int)
p->nLutK - 2 )
91 Delay = Abc_MaxInt( DelayA, DelayB + 1 );
92 Area = 1 + Lpk_LutNumLuts( nSuppSize0,
p->nLutK );
95 else if ( nSuppSize0 <= (
int)
p->nLutK )
99 Delay = Abc_MaxInt( DelayA, DelayB + 1 );
100 Area = 1 + Lpk_LutNumLuts( nSuppSize1+2,
p->nLutK );
103 else if ( nSuppSize1 <= (
int)
p->nLutK )
107 Delay = Abc_MaxInt( DelayA, DelayB + 1 );
108 Area = 1 + Lpk_LutNumLuts( nSuppSize0+2,
p->nLutK );
116 Delay0 = Abc_MaxInt( DelayA, DelayB + 1 );
120 Delay1 = Abc_MaxInt( DelayA, DelayB + 1 );
122 Delay = Abc_MinInt( Delay0, Delay1 );
123 if ( Delay == Delay0 )
124 Area = Lpk_LutNumLuts( nSuppSize0+2,
p->nLutK ) + Lpk_LutNumLuts( nSuppSize1,
p->nLutK );
126 Area = Lpk_LutNumLuts( nSuppSize1+2,
p->nLutK ) + Lpk_LutNumLuts( nSuppSize0,
p->nLutK );
127 Polarity = (int)(Delay == Delay1);
130 if ( Delay > (
int)
p->nDelayLim )
132 if ( Area > (
int)
p->nAreaLim )
134 nSuppSizeS = Abc_MinInt( nSuppSize0 + 2 *!Polarity, nSuppSize1 + 2 * Polarity );
135 nSuppSizeL = Abc_MaxInt( nSuppSize0 + 2 *!Polarity, nSuppSize1 + 2 * Polarity );
136 if ( nSuppSizeL > (
int)
p->nVars )
150 return pRes->
Variable == -1 ? NULL : pRes;
167 unsigned * pTruth = Lpk_FunTruth(
p, 0 );
168 unsigned * pTruth0 = Lpk_FunTruth(
p, 1 );
169 unsigned * pTruth1 = Lpk_FunTruth(
p, 2 );
174 assert(
p->uSupp == Kit_BitMask(
p->nVars) );
189 p->uSupp |= (1 <<
Var);
191 iVarVac = Kit_WordFindFirstBit( ~
p->uSupp );
192 assert( iVarVac < (
int)
p->nVars );
193 p->uSupp |= (1 << iVarVac);
194 Kit_TruthIthVar( pTruth,
p->nVars, iVarVac );
201 p->pFanins[iVarVac] = pNew->
Id;
202 p->pDelays[iVarVac] =
p->nDelayLim - 1;
212 p->nAreaLim =
p->nAreaLim - 1;
214 else if (
p->nVars <=
p->nLutK )
219 else if (
p->nVars < pNew->
nVars )
221 pNew->
nAreaLim =
p->nAreaLim / 2 +
p->nAreaLim % 2;
222 p->nAreaLim =
p->nAreaLim / 2 -
p->nAreaLim % 2;
226 pNew->
nAreaLim =
p->nAreaLim / 2 -
p->nAreaLim % 2;
227 p->nAreaLim =
p->nAreaLim / 2 +
p->nAreaLim % 2;