gem5  v21.1.0.2
Public Types | Public Member Functions | Protected Types | Protected Member Functions | Static Protected Member Functions | Private Attributes | List of all members
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 gem5::X86ISA::I8237::Channel::ChannelRemainingReg

Public Types

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

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))
 
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
 
- 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)
 

Private Attributes

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

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 507 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 = std::function< Data (This &reg, int first, int last)>

Definition at line 515 of file reg_bank.hh.

◆ PartialWriteFunc

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

Definition at line 518 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 513 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 510 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 516 of file reg_bank.hh.

Constructor & Destructor Documentation

◆ Register() [1/3]

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

Definition at line 584 of file reg_bank.hh.

◆ Register() [2/3]

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

Definition at line 589 of file reg_bank.hh.

◆ Register() [3/3]

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

Definition at line 592 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 533 of file reg_bank.hh.

◆ 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

Definition at line 545 of file reg_bank.hh.

◆ 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 530 of file reg_bank.hh.

◆ 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 539 of file reg_bank.hh.

◆ get() [1/2]

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

Definition at line 693 of file reg_bank.hh.

◆ 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>
constexpr Data gem5::RegisterBank< BankByteOrder >::Register< Data, RegByteOrder >::htoreg ( Data  data)
inlineconstexprprotected

◆ partialReader() [1/2]

template<ByteOrder BankByteOrder>
template<typename Data , ByteOrder RegByteOrder = BankByteOrder>
constexpr 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>
constexpr This& gem5::RegisterBank< BankByteOrder >::Register< Data, RegByteOrder >::partialReader ( Parent *  parent,
Data(Parent::*)(Args... args)  nr 
)
inlineconstexpr

Definition at line 660 of file reg_bank.hh.

◆ partialWriter() [1/2]

template<ByteOrder BankByteOrder>
template<typename Data , ByteOrder RegByteOrder = BankByteOrder>
constexpr 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>
constexpr This& gem5::RegisterBank< BankByteOrder >::Register< Data, RegByteOrder >::partialWriter ( Parent *  parent,
void(Parent::*)(Args... args)  nw 
)
inlineconstexpr

Definition at line 675 of file reg_bank.hh.

◆ read() [1/2]

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

Implements gem5::RegisterBank< BankByteOrder >::RegisterBase.

Definition at line 716 of file reg_bank.hh.

◆ 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

Implements gem5::RegisterBank< BankByteOrder >::RegisterBase.

Definition at line 723 of file reg_bank.hh.

◆ reader() [1/2]

template<ByteOrder BankByteOrder>
template<typename Data , ByteOrder RegByteOrder = BankByteOrder>
constexpr 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>
constexpr This& gem5::RegisterBank< BankByteOrder >::Register< Data, RegByteOrder >::reader ( Parent *  parent,
Data(Parent::*)(Args... args)  nr 
)
inlineconstexpr

Definition at line 619 of file reg_bank.hh.

◆ readonly()

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

Definition at line 606 of file reg_bank.hh.

◆ regtoh()

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

◆ serialize()

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

Implements gem5::RegisterBank< BankByteOrder >::RegisterBase.

Definition at line 767 of file reg_bank.hh.

◆ unserialize()

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

Implements gem5::RegisterBank< BankByteOrder >::RegisterBase.

Definition at line 773 of file reg_bank.hh.

◆ 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

Definition at line 703 of file reg_bank.hh.

◆ 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

Definition at line 697 of file reg_bank.hh.

◆ write() [1/2]

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

Implements gem5::RegisterBank< BankByteOrder >::RegisterBase.

Definition at line 739 of file reg_bank.hh.

◆ 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

Implements gem5::RegisterBank< BankByteOrder >::RegisterBase.

Definition at line 748 of file reg_bank.hh.

◆ 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>
constexpr This& gem5::RegisterBank< BankByteOrder >::Register< Data, RegByteOrder >::writeable ( const Data &  new_mask)
inlineconstexpr

Definition at line 599 of file reg_bank.hh.

◆ writer() [1/2]

template<ByteOrder BankByteOrder>
template<typename Data , ByteOrder RegByteOrder = BankByteOrder>
constexpr 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>
constexpr This& gem5::RegisterBank< BankByteOrder >::Register< Data, RegByteOrder >::writer ( Parent *  parent,
void(Parent::*)(Args... args)  nw 
)
inlineconstexpr

Definition at line 634 of file reg_bank.hh.

Member Data Documentation

◆ _data

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

◆ _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

◆ _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 Sep 21 2021 12:28:02 for gem5 by doxygen 1.8.17