diff options
author | Alan Mishchenko <alanmi@berkeley.edu> | 2020-03-05 14:33:02 -0800 |
---|---|---|
committer | Alan Mishchenko <alanmi@berkeley.edu> | 2020-03-05 14:33:02 -0800 |
commit | 7efe9c1d65cfd7f4e78defd7db1f3e75c1f97b1c (patch) | |
tree | 6b7e906f02595dbc668a4774abb7804d7cce9afa /src/misc | |
parent | 4359311d448d47bfd9ef861ada46d9267a888ae2 (diff) | |
download | abc-7efe9c1d65cfd7f4e78defd7db1f3e75c1f97b1c.tar.gz abc-7efe9c1d65cfd7f4e78defd7db1f3e75c1f97b1c.tar.bz2 abc-7efe9c1d65cfd7f4e78defd7db1f3e75c1f97b1c.zip |
Updating and extending simulation data structures.
Diffstat (limited to 'src/misc')
-rw-r--r-- | src/misc/util/utilTruth.h | 7 | ||||
-rw-r--r-- | src/misc/vec/vecWrd.h | 7 |
2 files changed, 14 insertions, 0 deletions
diff --git a/src/misc/util/utilTruth.h b/src/misc/util/utilTruth.h index 10196959..d913eda7 100644 --- a/src/misc/util/utilTruth.h +++ b/src/misc/util/utilTruth.h @@ -1835,6 +1835,13 @@ static inline int Abc_TtCountOnesVecMask( word * x, word * pMask, int nWords, in Count += Abc_TtCountOnes( pMask[w] & x[w] ); return Count; } +static inline int Abc_TtCountOnesVecXor( word * x, word * y, int nWords ) +{ + int w, Count = 0; + for ( w = 0; w < nWords; w++ ) + Count += Abc_TtCountOnes( x[w] ^ y[w] ); + return Count; +} /**Function************************************************************* diff --git a/src/misc/vec/vecWrd.h b/src/misc/vec/vecWrd.h index 45df1c97..e123c054 100644 --- a/src/misc/vec/vecWrd.h +++ b/src/misc/vec/vecWrd.h @@ -160,6 +160,13 @@ static inline Vec_Wrd_t * Vec_WrdStartNatural( int nSize ) p->pArray[i] = i; return p; } +static inline Vec_Wrd_t * Vec_WrdStartRandom( int nSize ) +{ + Vec_Wrd_t * vSims = Vec_WrdStart( nSize ); int i; + for ( i = 0; i < nSize; i++ ) + vSims->pArray[i] = Abc_RandomW(0); + return vSims; +} /**Function************************************************************* |