data.bitarray.banked ≡
template < auto Size, auto WordWidth, auto Banks, template <typename, auto> typename Memory = memory > class bitarray §
A fixed sized array of bits, stored internally as a set of banks, where each bank is an array of words. Provides methods to read or write at multiple bits or words
Parameters
-
auto SizeNumber of bits in the bit vector.
-
auto WordWidthNumber of bits in each word.
-
auto BanksNumber of banks. Higher values increase throughput and resource usage.
-
template <typename, auto> typename Memory = memory
Memory implementation.
Aliases
Methods
-
template <auto MaxCount> inline vector<bool, MaxCount> read_bits(vector<bitarray::bit_addr_t, MaxCount> addresses) §
Get the value of multiple bits.
Arguments
-
vector<bitarray::bit_addr_t, MaxCount> addresses
Addresses of bits to read.
-
-
inline bool read_bit(bitarray::bit_addr_t address) §
Get the value of one bit.
Arguments
-
bitarray::bit_addr_t address
Address of bit to read.
-
-
template <auto MaxCount> inline vector<bitarray::word_t, MaxCount> read_words(vector<bitarray::word_addr_t, MaxCount> addresses) §
Get the value of multiple words.
Arguments
-
vector<bitarray::word_addr_t, MaxCount> addresses
Addresses of words to read.
-
-
inline bitarray::word_t read_word(bitarray::word_addr_t address) §
Get the value of a single multiple word.
Arguments
-
bitarray::word_addr_t address
Addresses of the word to read.
-
-
template <auto MaxCount> inline void write_bits( vector<pair<bitarray::bit_addr_t, bool>, MaxCount> addresses_and_values ) §
Set the values of multiple bits.
Arguments
-
vector<pair<bitarray::bit_addr_t, bool>, MaxCount> addresses_and_values
Addresses and values of bits to write.
-
-
inline void write_bit(bitarray::bit_addr_t address, bool value) §
Set the value of one bit.
Arguments
-
bitarray::bit_addr_t address
Address of bit to write.
-
bool value
Value to write.
-
-
template <auto MaxCount> inline void write_words( vector< pair<bitarray::word_addr_t, bitarray::word_t>, MaxCount > addresses_and_values ) §
-
inline void write_word(bitarray::word_addr_t address, bitarray::word_t value) §
Set the value of one word.
Arguments
-
bitarray::word_addr_t address
Address of word to write.
-
bitarray::word_t value
Value to write.
-
General
-
(0 == (Size % WordWidth)) -
(0 == (bitarray::WordCount % Banks))