regbit_compound_t Class Reference

yasimavr: regbit_compound_t Class Reference
yasimavr
Loading...
Searching...
No Matches
regbit_compound_t Class Reference

#include <sim_types.h>

Public Member Functions

constexpr regbit_compound_t ()=default
 
constexpr regbit_compound_t (const regbit_t &rb)
 
constexpr regbit_compound_t (const std::vector< regbit_t > &v)
 
constexpr regbit_compound_t (const regbit_compound_t &)=default
 
constexpr std::vector< regbit_t >::const_iterator begin () const
 Returns a iterator to the beginning of the regbit pieces.
 
constexpr std::vector< regbit_t >::const_iterator end () const
 Returns a iterator to the end of the regbit pieces.
 
constexpr size_t size () const
 Returns the number of pieces.
 
constexpr const regbit_toperator[] (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.
 
unsigned int bitcount () const
 Returns the number of bits in the field.
 
regbit_compound_toperator= (const std::vector< regbit_t > &v)
 Assigns the regbit pieces.
 
regbit_compound_toperator= (const regbit_compound_t &)=default
 Assigns the compound.
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ regbit_compound_t() [1/4]

constexpr regbit_compound_t::regbit_compound_t ( )
constexprdefault

◆ regbit_compound_t() [2/4]

constexpr regbit_compound_t::regbit_compound_t ( const regbit_t rb)
inlineexplicitconstexpr

◆ regbit_compound_t() [3/4]

constexpr regbit_compound_t::regbit_compound_t ( const std::vector< regbit_t > &  v)
inlineexplicitconstexpr

◆ regbit_compound_t() [4/4]

constexpr regbit_compound_t::regbit_compound_t ( const regbit_compound_t )
constexprdefault

Member Function Documentation

◆ addr_match()

YASIMAVR_USING_NAMESPACE bool regbit_compound_t::addr_match ( reg_addr_t  addr) const

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

◆ begin()

constexpr std::vector< regbit_t >::const_iterator regbit_compound_t::begin ( ) const
inlineconstexpr

Returns a iterator to the beginning of the regbit pieces.

◆ bitcount()

unsigned int regbit_compound_t::bitcount ( ) const

Returns the number of bits in the field.

◆ end()

constexpr std::vector< regbit_t >::const_iterator regbit_compound_t::end ( ) const
inlineconstexpr

Returns a iterator to the end of the regbit pieces.

◆ operator=() [1/2]

regbit_compound_t & regbit_compound_t::operator= ( const regbit_compound_t )
default

Assigns the compound.

◆ operator=() [2/2]

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

Assigns the regbit pieces.

◆ operator[]()

constexpr const regbit_t & regbit_compound_t::operator[] ( size_t  index) const
inlineconstexpr

Returns a reference to the specified regbit.

◆ size()

constexpr size_t regbit_compound_t::size ( ) const
inlineconstexpr

Returns the number of pieces.


The documentation for this class was generated from the following files: