Class regbit_compound_t

Class Documentation

class regbit_compound_t

regbit_compound_t allows to model a register field that is split in separate locations Under the hood, it is an array of regbit_t, each representing a piece of the field. It can be iterated over, like a standard container, yielding the regbit pieces.

Public Functions

regbit_compound_t() = default
explicit regbit_compound_t(const regbit_t &rb)
explicit regbit_compound_t(const std::vector<regbit_t> &v)
regbit_compound_t(const regbit_compound_t &other)
void add(const regbit_t &rb)

Adds a regbit piece to the end.

inline std::vector<regbit_t>::const_iterator begin() const

Returns a iterator to the beginning of the regbit pieces.

inline std::vector<regbit_t>::const_iterator end() const

Returns a iterator to the end of the regbit pieces.

inline size_t size() const

Returns the number of pieces.

inline const regbit_t &operator[](size_t index) const

Returns a reference to the specified regbit.

bool addr_match(reg_addr_t addr) const

Returns true if the addr matches any of the regbit pieces.

uint64_t compound(uint8_t regvalue, size_t index) const

Returns a compound value that can be OR’s together with.

uint8_t extract(uint64_t v, size_t index) const

Extracts a compound value for a specified regbit piece.

int bitcount() const

Returns the number of bits in the field.

regbit_compound_t &operator=(const std::vector<regbit_t> &v)

Assigns the regbit pieces.

regbit_compound_t &operator=(const regbit_compound_t &other)

Assigns the compound.