Otawa  0.10
otawa::hard::Register Class Reference

Objects of this class are simple machine register, more accurately unbreakable atomic registers. More...

#include <otawa/hard/Register.h>

Public Types

enum  kind_t {
  NONE = 0, ADDR, INT, FLOAT,
  BITS
}
 This enumeration represents the differents kind of value found in hardware registers. More...
 
typedef enum
otawa::hard::Register::kind_t 
kind_t
 

Public Member Functions

 Register (const elm::String &name, kind_t kind, int size)
 Build a new register. More...
 
int number (void) const
 Get the register number. More...
 
RegBankbank (void) const
 Get the owner bank of the register. More...
 
const elm::Stringname (void) const
 Get the name of the register. More...
 
kind_t kind (void) const
 Get the kind of a register. More...
 
int size (void) const
 
int platformNumber (void) const
 Gives a number which is unique for this platform. More...
 

Private Attributes

int _number
 
kind_t _kind
 
int _size
 
elm::String _name
 
RegBank_bank
 
int pfnum
 

Friends

class Platform
 
class RegBank
 

Detailed Description

Objects of this class are simple machine register, more accurately unbreakable atomic registers.

If you architecture provides register spanning on multiple atomic register, use the SpanReg class for representing them.

The spanning registers are rarely used : most instruction register accessors use the atomic Register class splitting the logical spanning register into its component atomic registers.
There is three ways to declare a register bank :
  • the register are automatically generated from the bank description,
  • the bank is first defined and the register are defined by hand with a reference on the bank,
  • the register are defined in a table and the table is passed to the bank constructor.

Member Typedef Documentation

Member Enumeration Documentation

This enumeration represents the differents kind of value found in hardware registers.

Enumerator
NONE 

Usually only used as null value for register kinds.

ADDR 

A register specialized for containing an address.

INT 

A register specialized for containing an integer value.

FLOAT 

A register specialized for containing float value.

BITS 

This kind defines registers not specialized in other kinds.

This kind represents special purpose registers as status register.

Constructor & Destructor Documentation

otawa::hard::Register::Register ( const elm::String name,
Register::kind_t  kind,
int  size 
)

Build a new register.

Parameters
nameRegister name.
numberRegister number.
bankOwner bank.

References NONE.

Member Function Documentation

RegBank * otawa::hard::Register::bank ( void  ) const
inline

Get the owner bank of the register.

Returns
Register bank.

References _bank.

kind_t otawa::hard::Register::kind ( void  ) const
inline

Get the kind of a register.

References _kind.

elm::String & otawa::hard::Register::name ( void  ) const
inline

Get the name of the register.

Returns
Register name.

References _name.

Referenced by otawa::hard::operator<<(), and otawa::clp::State::print().

int otawa::hard::Register::number ( void  ) const
inline

Get the register number.

Returns
Register number.

References _number.

int otawa::hard::Register::platformNumber ( void  ) const
inline

Gives a number which is unique for this platform.

Each register, in a platform, is associated with a unique number ranging from 0 to Platform::regCount()-1. This number may be used as index to table or to bit vectors matching the overall registers.

Returns
Platform number of the register.

References pfnum.

Referenced by otawa::clp::Analysis::processWorkSpace().

int otawa::hard::Register::size ( void  ) const
inline

References _size.

Friends And Related Function Documentation

friend class Platform
friend
friend class RegBank
friend

Member Data Documentation

RegBank* otawa::hard::Register::_bank
private

Referenced by bank(), and otawa::hard::RegBank::set().

kind_t otawa::hard::Register::_kind
private

Referenced by kind().

elm::String otawa::hard::Register::_name
private

Referenced by name().

int otawa::hard::Register::_number
private
int otawa::hard::Register::_size
private

Referenced by size().

int otawa::hard::Register::pfnum
private

Referenced by platformNumber().


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