Skip to content

Commit 91d2f3d

Browse files
committed
Changes to "lutexact".
1 parent 169e288 commit 91d2f3d

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

src/base/abci/abc.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10826,11 +10826,15 @@ int Abc_CommandLutExact( Abc_Frame_t * pAbc, int argc, char ** argv )
1082610826
Abc_Print( -1, "Truth table should be given on the command line.\n" );
1082710827
return 1;
1082810828
}
10829+
if ( pPars->nVars == 0 && pPars->pTtStr )
10830+
pPars->nVars = 2 + Abc_Base2Log((int)strlen(pPars->pTtStr));
1082910831
if ( pPars->pTtStr && (1 << (pPars->nVars-2)) != (int)strlen(pPars->pTtStr) )
1083010832
{
1083110833
Abc_Print( -1, "Truth table is expected to have %d hex digits (instead of %d).\n", (1 << (pPars->nVars-2)), strlen(pPars->pTtStr) );
1083210834
return 1;
1083310835
}
10836+
if ( pPars->nVars == 0 && pPars->pSymStr )
10837+
pPars->nVars = (int)strlen(pPars->pSymStr) - 1;
1083410838
if ( pPars->pSymStr && pPars->nVars+1 != strlen(pPars->pSymStr) )
1083510839
{
1083610840
Abc_Print( -1, "The char string of the %d-variable symmetric function should have %d zeros and ones (instead of %d).\n", pPars->nVars, pPars->nVars+1, strlen(pPars->pSymStr) );
@@ -10843,7 +10847,7 @@ int Abc_CommandLutExact( Abc_Frame_t * pAbc, int argc, char ** argv )
1084310847
}
1084410848
if ( pPars->nVars > 12 )
1084510849
{
10846-
Abc_Print( -1, "Function should not have more than 10 inputs.\n" );
10850+
Abc_Print( -1, "Function should not have more than 12 inputs.\n" );
1084710851
return 1;
1084810852
}
1084910853
if ( pPars->nLutSize > 6 )

src/sat/bmc/bmcMaj.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1291,7 +1291,7 @@ static void Exa3_ManPrintSolution( Exa3_Man_t * p, int fCompl )
12911291
for ( i = p->nObjs - 1; i >= p->nVars; i-- )
12921292
{
12931293
int Val, iVarStart = 1 + p->LutMask*(i - p->nVars);
1294-
printf( "%02d = %d\'b", i, 1 << p->nLutSize );
1294+
printf( "%c = %d\'b", 'A'+i-p->nVars, 1 << p->nLutSize );
12951295
for ( k = p->LutMask - 1; k >= 0; k-- )
12961296
{
12971297
Val = bmcg_sat_solver_read_cex_varvalue(p->pSat, iVarStart+k);
@@ -1311,7 +1311,7 @@ static void Exa3_ManPrintSolution( Exa3_Man_t * p, int fCompl )
13111311
if ( iVar >= 0 && iVar < p->nVars )
13121312
printf( " %c", 'a'+iVar );
13131313
else
1314-
printf( " %02d", iVar );
1314+
printf( " %c", 'A'+iVar-p->nVars );
13151315
}
13161316
printf( " )\n" );
13171317
}
@@ -1332,7 +1332,7 @@ static void Exa3_ManDumpBlif( Exa3_Man_t * p, int fCompl )
13321332
{
13331333
int i, k, b, iVar;
13341334
char pFileName[1000];
1335-
char * pStr = Abc_UtilStrsav(p->pPars->pTtStr);
1335+
char * pStr = Abc_UtilStrsav(p->pPars->pSymStr ? p->pPars->pSymStr : p->pPars->pTtStr);
13361336
if ( strlen(pStr) > 16 ) {
13371337
pStr[16] = '_';
13381338
pStr[17] = '\0';

0 commit comments

Comments
 (0)