Skip to content

Commit ec70146

Browse files
committed
Experiments with exact synthesis.
1 parent 3bd528c commit ec70146

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

src/sat/bmc/bmcMaj.c

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1063,7 +1063,7 @@ Vec_Wec_t * Exa3_ChooseInputVars_int( int nVars, int nLuts, int nLutSize )
10631063
Vec_Int_t * vLevel; int i;
10641064
Vec_WecForEachLevel( p, vLevel, i ) {
10651065
do {
1066-
int iVar = (Abc_Random(0) ^ Abc_Random(0) ^ Abc_Random(0)) % nVars;
1066+
int iVar = rand() % nVars;
10671067
Vec_IntPushUniqueOrder( vLevel, iVar );
10681068
}
10691069
while ( Vec_IntSize(vLevel) < nLutSize-(int)(i>0) );
@@ -1079,8 +1079,16 @@ Vec_Int_t * Exa3_CountInputVars( int nVars, Vec_Wec_t * p )
10791079
Vec_IntAddToEntry( vCounts, Obj, 1 );
10801080
return vCounts;
10811081
}
1082-
Vec_Wec_t * Exa3_ChooseInputVars( int nVars, int nLuts, int nLutSize )
1082+
Vec_Wec_t * Exa3_ChooseInputVars( int nVars, int nLuts, int nLutSize, int Seed )
10831083
{
1084+
if ( Seed )
1085+
srand(Seed);
1086+
else {
1087+
struct timespec ts;
1088+
clock_gettime(CLOCK_REALTIME, &ts);
1089+
unsigned int seed = (unsigned int)(ts.tv_sec ^ ts.tv_nsec);
1090+
srand(seed);
1091+
}
10841092
for ( int i = 0; i < 1000; i++ ) {
10851093
Vec_Wec_t * p = Exa3_ChooseInputVars_int( nVars, nLuts, nLutSize );
10861094
Vec_Int_t * q = Exa3_CountInputVars( nVars, p );
@@ -1172,7 +1180,7 @@ static int Exa3_ManMarkup( Exa3_Man_t * p )
11721180
if ( p->pPars->pPermStr )
11731181
p->vInVars = Exa3_ChooseInputVars2( p->nVars, p->nNodes, p->nLutSize, p->pPars->pPermStr );
11741182
else
1175-
p->vInVars = Exa3_ChooseInputVars( p->nVars, p->nNodes, p->nLutSize );
1183+
p->vInVars = Exa3_ChooseInputVars( p->nVars, p->nNodes, p->nLutSize, p->pPars->Seed );
11761184
if ( !p->pPars->fSilent ) {
11771185
Vec_Int_t * vLevel; int i, Var;
11781186
printf( "Using fixed input assignment %s%s:\n",

0 commit comments

Comments
 (0)