Commit 4393a5fa by Alan Mishchenko

Added platform-independent random-number generator to 'fraig'.

parent cd2bd708
...@@ -72,7 +72,8 @@ ABC_NAMESPACE_HEADER_START ...@@ -72,7 +72,8 @@ ABC_NAMESPACE_HEADER_START
#define FRAIG_NUM_WORDS(n) (((n)>>5) + (((n)&31) > 0)) #define FRAIG_NUM_WORDS(n) (((n)>>5) + (((n)&31) > 0))
// generating random unsigned (#define RAND_MAX 0x7fff) // generating random unsigned (#define RAND_MAX 0x7fff)
#define FRAIG_RANDOM_UNSIGNED ((((unsigned)rand()) << 24) ^ (((unsigned)rand()) << 12) ^ ((unsigned)rand())) //#define FRAIG_RANDOM_UNSIGNED ((((unsigned)rand()) << 24) ^ (((unsigned)rand()) << 12) ^ ((unsigned)rand()))
#define FRAIG_RANDOM_UNSIGNED Aig_ManRandom(0)
// macros to get hold of the bits in a bit string // macros to get hold of the bits in a bit string
#define Fraig_BitStringSetBit(p,i) ((p)[(i)>>5] |= (1<<((i) & 31))) #define Fraig_BitStringSetBit(p,i) ((p)[(i)>>5] |= (1<<((i) & 31)))
...@@ -345,6 +346,9 @@ struct Fraig_HashTableStruct_t_ ...@@ -345,6 +346,9 @@ struct Fraig_HashTableStruct_t_
/// GLOBAL VARIABLES /// /// GLOBAL VARIABLES ///
//////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////
// random number generator imported from another package
extern unsigned Aig_ManRandom( int fReset );
//////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////
/// FUNCTION DEFINITIONS /// /// FUNCTION DEFINITIONS ///
//////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////
......
...@@ -188,7 +188,8 @@ Fraig_Man_t * Fraig_ManCreate( Fraig_Params_t * pParams ) ...@@ -188,7 +188,8 @@ Fraig_Man_t * Fraig_ManCreate( Fraig_Params_t * pParams )
// set the random seed for simulation // set the random seed for simulation
// srand( 0xFEEDDEAF ); // srand( 0xFEEDDEAF );
srand( 0xDEADCAFE ); // srand( 0xDEADCAFE );
Aig_ManRandom( 1 );
// set parameters for equivalence checking // set parameters for equivalence checking
if ( pParams == NULL ) if ( pParams == NULL )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment