data.bitarray ≡
template < auto Size, auto WordWidth, template <typename, auto> typename Memory = memory > class bitarray §
A fixed sized array of bits, stored internally as a memory of words. Provides methods to read or write at bit and word granularity.
Parameters
-
auto SizeNumber of bits in the bit vector.
-
auto WordWidthNumber of bits in each word.
-
template <typename, auto> typename Memory = memory
Memory implementation.
Aliases
Methods
-
inline bool read_bit(bitarray::bit_addr_t addr) §
Get the value of a single bit from the bitarray.
Arguments
-
bitarray::bit_addr_t addr
Address of bit to read.
-
-
inline void write_bit(bitarray::bit_addr_t addr, bool val) §
Set the value of a single bit in the bitarray. Note that this is implemented with a read-modify write. If
Memoryismemory_norepthen concurrent reads and writes of the bitarray are not allowed. IfMemoryismemory, then each call site ofread_bit,write_bit, andread_wordadd another replica.Arguments
-
bitarray::bit_addr_t addr
Address of the bit to write.
-
bool val
Value to write.
-
-
inline bitarray::word_t read_word(bitarray::word_addr_t addr) §
Get the value of a word.
Arguments
-
bitarray::word_addr_t addr
Address of the word to read. Note that this is in terms of words, not bits.
-
-
inline void write_word(bitarray::word_addr_t addr, bitarray::word_t word) §
Set the value of a word.
Arguments
-
bitarray::word_addr_t addr
Address of the word to read. Note that this is in terms of words, not bits.
-
bitarray::word_t word
Word to write.
-
General
-
(0 == (Size % WordWidth))