gem5 v24.0.0.0
Loading...
Searching...
No Matches
gem5::RegisterBank< BankByteOrder >::Register< Data, RegByteOrder > Class Template Reference

#include <reg_bank.hh>

Inheritance diagram for gem5::RegisterBank< BankByteOrder >::Register< Data, RegByteOrder >:
gem5::RegisterBank< BankByteOrder >::RegisterBase gem5::RegisterBankBase::RegisterBaseBase

Public Types

using ReadFunc = std::function<Data (This &reg)>
 
using PartialReadFunc
 
using WriteFunc = std::function<void (This &reg, const Data &value)>
 
using PartialWriteFunc
 
using ResetFunc = std::function<void (This &reg)>
 

Public Member Functions

constexpr Register (const std::string &new_name)
 
constexpr Register (const std::string &new_name, const Data &new_data)
 
constexpr Register (const std::string &new_name, const Data &&new_data)
 
constexpr Thiswriteable (const Data &new_mask)
 
constexpr Thisreadonly ()
 
constexpr Thisreader (const ReadFunc &new_reader)
 
template<class Parent , class... Args>
constexpr Thisreader (Parent *parent, Data(Parent::*nr)(Args... args))
 
constexpr Thiswriter (const WriteFunc &new_writer)
 
template<class Parent , class... Args>
constexpr Thiswriter (Parent *parent, void(Parent::*nw)(Args... args))
 
constexpr ThispartialReader (const PartialReadFunc &new_reader)
 
template<class Parent , class... Args>
constexpr ThispartialReader (Parent *parent, Data(Parent::*nr)(Args... args))
 
constexpr ThispartialWriter (const PartialWriteFunc &new_writer)
 
template<class Parent , class... Args>
constexpr ThispartialWriter (Parent *parent, void(Parent::*nw)(Args... args))
 
constexpr Thisresetter (const ResetFunc &new_resetter)
 
template<class Parent , class... Args>
constexpr Thisresetter (Parent *parent, void(Parent::*nr)(Args... args))
 
const Data & initialValue () const
 
void resetInitialValue ()
 
const Data & writeable () const
 
const Data & get () const
 
Data & get ()
 
void update (const Data &new_data, const Data &bitmask)
 
void update (const Data &new_data)
 
void read (void *buf) override
 
void read (void *buf, off_t offset, size_t bytes) override
 
void write (const void *buf) override
 
void write (const void *buf, off_t offset, size_t bytes) override
 
void serialize (std::ostream &os) const override
 
bool unserialize (const std::string &s) override
 
void reset () override
 
- Public Member Functions inherited from gem5::RegisterBank< BankByteOrder >::RegisterBase
constexpr RegisterBase (const std::string &new_name, size_t new_size)
 
virtual ~RegisterBase ()
 
virtual const std::string & name () const
 
size_t size () const
 

Protected Types

using This = Register<Data, RegByteOrder>
 

Protected Member Functions

constexpr Data htoreg (Data data)
 
constexpr Data regtoh (Data data)
 

Static Protected Member Functions

static Data defaultReader (This &reg)
 
static Data defaultPartialReader (This &reg, int first, int last)
 
static void defaultWriter (This &reg, const Data &value)
 
static void defaultPartialWriter (This &reg, const Data &value, int first, int last)
 
static void defaultResetter (This &reg)
 

Private Attributes

Data _data = {}
 
Data _resetData = {}
 
Data _writeMask = mask(sizeof(Data) * 8)
 
ReadFunc _reader = defaultReader
 
WriteFunc _writer = defaultWriter
 
PartialWriteFunc _partialWriter = defaultPartialWriter
 
PartialReadFunc _partialReader = defaultPartialReader
 
ResetFunc _resetter = defaultResetter
 

Additional Inherited Members

- Protected Attributes inherited from gem5::RegisterBank< BankByteOrder >::RegisterBase
const std::string _name
 
size_t _size = 0
 

Detailed Description

template<ByteOrder BankByteOrder>
template<typename Data, ByteOrder RegByteOrder = BankByteOrder>
class gem5::RegisterBank< BankByteOrder >::Register< Data, RegByteOrder >

Definition at line 575 of file reg_bank.hh.

Member Typedef Documentation

◆ PartialReadFunc

template<ByteOrder BankByteOrder>
template<typename Data , ByteOrder RegByteOrder = BankByteOrder>
using gem5::RegisterBank< BankByteOrder >::Register< Data, RegByteOrder >::PartialReadFunc
Initial value:
std::function<
Data (This &reg, int first, int last)>
Register< Data, RegByteOrder > This
Definition reg_bank.hh:578
Bitfield< 5, 3 > reg
Definition types.hh:92

Definition at line 582 of file reg_bank.hh.

◆ PartialWriteFunc

template<ByteOrder BankByteOrder>
template<typename Data , ByteOrder RegByteOrder = BankByteOrder>
using gem5::RegisterBank< BankByteOrder >::Register< Data, RegByteOrder >::PartialWriteFunc
Initial value:
std::function<
void (This &reg, const Data &value, int first, int last)>

Definition at line 585 of file reg_bank.hh.

◆ ReadFunc

template<ByteOrder BankByteOrder>
template<typename Data , ByteOrder RegByteOrder = BankByteOrder>
using gem5::RegisterBank< BankByteOrder >::Register< Data, RegByteOrder >::ReadFunc = std::function<Data (This &reg)>

Definition at line 581 of file reg_bank.hh.

◆ ResetFunc

template<ByteOrder BankByteOrder>
template<typename Data , ByteOrder RegByteOrder = BankByteOrder>
using gem5::RegisterBank< BankByteOrder >::Register< Data, RegByteOrder >::ResetFunc = std::function<void (This &reg)>

Definition at line 587 of file reg_bank.hh.

◆ This

template<ByteOrder BankByteOrder>
template<typename Data , ByteOrder RegByteOrder = BankByteOrder>
using gem5::RegisterBank< BankByteOrder >::Register< Data, RegByteOrder >::This = Register<Data, RegByteOrder>
protected

Definition at line 578 of file reg_bank.hh.

◆ WriteFunc

template<ByteOrder BankByteOrder>
template<typename Data , ByteOrder RegByteOrder = BankByteOrder>
using gem5::RegisterBank< BankByteOrder >::Register< Data, RegByteOrder >::WriteFunc = std::function<void (This &reg, const Data &value)>

Definition at line 584 of file reg_bank.hh.

Constructor & Destructor Documentation

◆ Register() [1/3]

template<ByteOrder BankByteOrder>
template<typename Data , ByteOrder RegByteOrder = BankByteOrder>
gem5::RegisterBank< BankByteOrder >::Register< Data, RegByteOrder >::Register ( const std::string & new_name)
inlineconstexpr

Definition at line 661 of file reg_bank.hh.

◆ Register() [2/3]

template<ByteOrder BankByteOrder>
template<typename Data , ByteOrder RegByteOrder = BankByteOrder>
gem5::RegisterBank< BankByteOrder >::Register< Data, RegByteOrder >::Register ( const std::string & new_name,
const Data & new_data )
inlineconstexpr

Definition at line 666 of file reg_bank.hh.

◆ Register() [3/3]

template<ByteOrder BankByteOrder>
template<typename Data , ByteOrder RegByteOrder = BankByteOrder>
gem5::RegisterBank< BankByteOrder >::Register< Data, RegByteOrder >::Register ( const std::string & new_name,
const Data && new_data )
inlineconstexpr

Definition at line 670 of file reg_bank.hh.

Member Function Documentation

◆ defaultPartialReader()

template<ByteOrder BankByteOrder>
template<typename Data , ByteOrder RegByteOrder = BankByteOrder>
static Data gem5::RegisterBank< BankByteOrder >::Register< Data, RegByteOrder >::defaultPartialReader ( This & reg,
int first,
int last )
inlinestaticprotected

Definition at line 604 of file reg_bank.hh.

References gem5::mbits(), and gem5::X86ISA::reg.

◆ defaultPartialWriter()

template<ByteOrder BankByteOrder>
template<typename Data , ByteOrder RegByteOrder = BankByteOrder>
static void gem5::RegisterBank< BankByteOrder >::Register< Data, RegByteOrder >::defaultPartialWriter ( This & reg,
const Data & value,
int first,
int last )
inlinestaticprotected

◆ defaultReader()

template<ByteOrder BankByteOrder>
template<typename Data , ByteOrder RegByteOrder = BankByteOrder>
static Data gem5::RegisterBank< BankByteOrder >::Register< Data, RegByteOrder >::defaultReader ( This & reg)
inlinestaticprotected

Definition at line 601 of file reg_bank.hh.

References gem5::X86ISA::reg.

◆ defaultResetter()

template<ByteOrder BankByteOrder>
template<typename Data , ByteOrder RegByteOrder = BankByteOrder>
static void gem5::RegisterBank< BankByteOrder >::Register< Data, RegByteOrder >::defaultResetter ( This & reg)
inlinestaticprotected

Definition at line 623 of file reg_bank.hh.

References gem5::X86ISA::reg.

◆ defaultWriter()

template<ByteOrder BankByteOrder>
template<typename Data , ByteOrder RegByteOrder = BankByteOrder>
static void gem5::RegisterBank< BankByteOrder >::Register< Data, RegByteOrder >::defaultWriter ( This & reg,
const Data & value )
inlinestaticprotected

Definition at line 610 of file reg_bank.hh.

References gem5::X86ISA::reg.

◆ get() [1/2]

template<ByteOrder BankByteOrder>
template<typename Data , ByteOrder RegByteOrder = BankByteOrder>
Data & gem5::RegisterBank< BankByteOrder >::Register< Data, RegByteOrder >::get ( )
inline

◆ get() [2/2]

template<ByteOrder BankByteOrder>
template<typename Data , ByteOrder RegByteOrder = BankByteOrder>
const Data & gem5::RegisterBank< BankByteOrder >::Register< Data, RegByteOrder >::get ( ) const
inline

◆ htoreg()

template<ByteOrder BankByteOrder>
template<typename Data , ByteOrder RegByteOrder = BankByteOrder>
Data gem5::RegisterBank< BankByteOrder >::Register< Data, RegByteOrder >::htoreg ( Data data)
inlineconstexprprotected

◆ initialValue()

template<ByteOrder BankByteOrder>
template<typename Data , ByteOrder RegByteOrder = BankByteOrder>
const Data & gem5::RegisterBank< BankByteOrder >::Register< Data, RegByteOrder >::initialValue ( ) const
inline

◆ partialReader() [1/2]

template<ByteOrder BankByteOrder>
template<typename Data , ByteOrder RegByteOrder = BankByteOrder>
This & gem5::RegisterBank< BankByteOrder >::Register< Data, RegByteOrder >::partialReader ( const PartialReadFunc & new_reader)
inlineconstexpr

◆ partialReader() [2/2]

template<ByteOrder BankByteOrder>
template<typename Data , ByteOrder RegByteOrder = BankByteOrder>
template<class Parent , class... Args>
This & gem5::RegisterBank< BankByteOrder >::Register< Data, RegByteOrder >::partialReader ( Parent * parent,
Data(Parent::* nr )(Args... args) )
inlineconstexpr

◆ partialWriter() [1/2]

template<ByteOrder BankByteOrder>
template<typename Data , ByteOrder RegByteOrder = BankByteOrder>
This & gem5::RegisterBank< BankByteOrder >::Register< Data, RegByteOrder >::partialWriter ( const PartialWriteFunc & new_writer)
inlineconstexpr

◆ partialWriter() [2/2]

template<ByteOrder BankByteOrder>
template<typename Data , ByteOrder RegByteOrder = BankByteOrder>
template<class Parent , class... Args>
This & gem5::RegisterBank< BankByteOrder >::Register< Data, RegByteOrder >::partialWriter ( Parent * parent,
void(Parent::* nw )(Args... args) )
inlineconstexpr

◆ read() [1/2]

template<ByteOrder BankByteOrder>
template<typename Data , ByteOrder RegByteOrder = BankByteOrder>
void gem5::RegisterBank< BankByteOrder >::Register< Data, RegByteOrder >::read ( void * buf)
inlineoverridevirtual

◆ read() [2/2]

template<ByteOrder BankByteOrder>
template<typename Data , ByteOrder RegByteOrder = BankByteOrder>
void gem5::RegisterBank< BankByteOrder >::Register< Data, RegByteOrder >::read ( void * buf,
off_t offset,
size_t bytes )
inlineoverridevirtual

◆ reader() [1/2]

template<ByteOrder BankByteOrder>
template<typename Data , ByteOrder RegByteOrder = BankByteOrder>
This & gem5::RegisterBank< BankByteOrder >::Register< Data, RegByteOrder >::reader ( const ReadFunc & new_reader)
inlineconstexpr

◆ reader() [2/2]

template<ByteOrder BankByteOrder>
template<typename Data , ByteOrder RegByteOrder = BankByteOrder>
template<class Parent , class... Args>
This & gem5::RegisterBank< BankByteOrder >::Register< Data, RegByteOrder >::reader ( Parent * parent,
Data(Parent::* nr )(Args... args) )
inlineconstexpr

◆ readonly()

template<ByteOrder BankByteOrder>
template<typename Data , ByteOrder RegByteOrder = BankByteOrder>
This & gem5::RegisterBank< BankByteOrder >::Register< Data, RegByteOrder >::readonly ( )
inlineconstexpr

◆ regtoh()

template<ByteOrder BankByteOrder>
template<typename Data , ByteOrder RegByteOrder = BankByteOrder>
Data gem5::RegisterBank< BankByteOrder >::Register< Data, RegByteOrder >::regtoh ( Data data)
inlineconstexprprotected

◆ reset()

template<ByteOrder BankByteOrder>
template<typename Data , ByteOrder RegByteOrder = BankByteOrder>
void gem5::RegisterBank< BankByteOrder >::Register< Data, RegByteOrder >::reset ( )
inlineoverridevirtual

◆ resetInitialValue()

template<ByteOrder BankByteOrder>
template<typename Data , ByteOrder RegByteOrder = BankByteOrder>
void gem5::RegisterBank< BankByteOrder >::Register< Data, RegByteOrder >::resetInitialValue ( )
inline

◆ resetter() [1/2]

template<ByteOrder BankByteOrder>
template<typename Data , ByteOrder RegByteOrder = BankByteOrder>
This & gem5::RegisterBank< BankByteOrder >::Register< Data, RegByteOrder >::resetter ( const ResetFunc & new_resetter)
inlineconstexpr

◆ resetter() [2/2]

template<ByteOrder BankByteOrder>
template<typename Data , ByteOrder RegByteOrder = BankByteOrder>
template<class Parent , class... Args>
This & gem5::RegisterBank< BankByteOrder >::Register< Data, RegByteOrder >::resetter ( Parent * parent,
void(Parent::* nr )(Args... args) )
inlineconstexpr

◆ serialize()

template<ByteOrder BankByteOrder>
template<typename Data , ByteOrder RegByteOrder = BankByteOrder>
void gem5::RegisterBank< BankByteOrder >::Register< Data, RegByteOrder >::serialize ( std::ostream & os) const
inlineoverridevirtual

◆ unserialize()

template<ByteOrder BankByteOrder>
template<typename Data , ByteOrder RegByteOrder = BankByteOrder>
bool gem5::RegisterBank< BankByteOrder >::Register< Data, RegByteOrder >::unserialize ( const std::string & s)
inlineoverridevirtual

◆ update() [1/2]

template<ByteOrder BankByteOrder>
template<typename Data , ByteOrder RegByteOrder = BankByteOrder>
void gem5::RegisterBank< BankByteOrder >::Register< Data, RegByteOrder >::update ( const Data & new_data)
inline

◆ update() [2/2]

template<ByteOrder BankByteOrder>
template<typename Data , ByteOrder RegByteOrder = BankByteOrder>
void gem5::RegisterBank< BankByteOrder >::Register< Data, RegByteOrder >::update ( const Data & new_data,
const Data & bitmask )
inline

◆ write() [1/2]

template<ByteOrder BankByteOrder>
template<typename Data , ByteOrder RegByteOrder = BankByteOrder>
void gem5::RegisterBank< BankByteOrder >::Register< Data, RegByteOrder >::write ( const void * buf)
inlineoverridevirtual

◆ write() [2/2]

template<ByteOrder BankByteOrder>
template<typename Data , ByteOrder RegByteOrder = BankByteOrder>
void gem5::RegisterBank< BankByteOrder >::Register< Data, RegByteOrder >::write ( const void * buf,
off_t offset,
size_t bytes )
inlineoverridevirtual

◆ writeable() [1/2]

template<ByteOrder BankByteOrder>
template<typename Data , ByteOrder RegByteOrder = BankByteOrder>
const Data & gem5::RegisterBank< BankByteOrder >::Register< Data, RegByteOrder >::writeable ( ) const
inline

◆ writeable() [2/2]

template<ByteOrder BankByteOrder>
template<typename Data , ByteOrder RegByteOrder = BankByteOrder>
This & gem5::RegisterBank< BankByteOrder >::Register< Data, RegByteOrder >::writeable ( const Data & new_mask)
inlineconstexpr

◆ writer() [1/2]

template<ByteOrder BankByteOrder>
template<typename Data , ByteOrder RegByteOrder = BankByteOrder>
This & gem5::RegisterBank< BankByteOrder >::Register< Data, RegByteOrder >::writer ( const WriteFunc & new_writer)
inlineconstexpr

◆ writer() [2/2]

template<ByteOrder BankByteOrder>
template<typename Data , ByteOrder RegByteOrder = BankByteOrder>
template<class Parent , class... Args>
This & gem5::RegisterBank< BankByteOrder >::Register< Data, RegByteOrder >::writer ( Parent * parent,
void(Parent::* nw )(Args... args) )
inlineconstexpr

Member Data Documentation

◆ _data

◆ _partialReader

template<ByteOrder BankByteOrder>
template<typename Data , ByteOrder RegByteOrder = BankByteOrder>
PartialReadFunc gem5::RegisterBank< BankByteOrder >::Register< Data, RegByteOrder >::_partialReader = defaultPartialReader
private

◆ _partialWriter

template<ByteOrder BankByteOrder>
template<typename Data , ByteOrder RegByteOrder = BankByteOrder>
PartialWriteFunc gem5::RegisterBank< BankByteOrder >::Register< Data, RegByteOrder >::_partialWriter = defaultPartialWriter
private

◆ _reader

template<ByteOrder BankByteOrder>
template<typename Data , ByteOrder RegByteOrder = BankByteOrder>
ReadFunc gem5::RegisterBank< BankByteOrder >::Register< Data, RegByteOrder >::_reader = defaultReader
private

◆ _resetData

template<ByteOrder BankByteOrder>
template<typename Data , ByteOrder RegByteOrder = BankByteOrder>
Data gem5::RegisterBank< BankByteOrder >::Register< Data, RegByteOrder >::_resetData = {}
private

◆ _resetter

template<ByteOrder BankByteOrder>
template<typename Data , ByteOrder RegByteOrder = BankByteOrder>
ResetFunc gem5::RegisterBank< BankByteOrder >::Register< Data, RegByteOrder >::_resetter = defaultResetter
private

◆ _writeMask

template<ByteOrder BankByteOrder>
template<typename Data , ByteOrder RegByteOrder = BankByteOrder>
Data gem5::RegisterBank< BankByteOrder >::Register< Data, RegByteOrder >::_writeMask = mask(sizeof(Data) * 8)
private

◆ _writer

template<ByteOrder BankByteOrder>
template<typename Data , ByteOrder RegByteOrder = BankByteOrder>
WriteFunc gem5::RegisterBank< BankByteOrder >::Register< Data, RegByteOrder >::_writer = defaultWriter
private

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

Generated on Tue Jun 18 2024 16:24:13 for gem5 by doxygen 1.11.0