Otawa  0.10
otawa::hard::Bank Class Reference

A bank in the memory. More...

#include <otawa/hard/Memory.h>

Public Types

enum  type_t {
  NONE = 0, DRAM = 1, SPM = 2, ROM = 3,
  IO = 4
}
 This type represents the type of banks: More...
 
typedef enum
otawa::hard::Bank::type_t 
type_t
 

Public Member Functions

 Bank (void)
 default constructor for a bank: More...
 
 Bank (cstring name, Address address, size_t size)
 
const stringname (void) const
 Get the name of the bank. More...
 
const Addressaddress (void) const
 Get the base address of the bank. More...
 
const int size (void) const
 Get the size of the bank. More...
 
type_t type (void) const
 Get the type of the bank. More...
 
int latency (void) const
 Get the default latency for accessing this bank. More...
 
int writeLatency (void) const
 
int power (void) const
 Get the default power for accessing this bank. More...
 
int blockBits (void) const
 Get the number of bits in the block size of the bank. More...
 
int blockSize (void) const
 Get the block size of this bank. More...
 
const Table< const Mode * > & modes (void) const
 Get the mode transition table of the bank. More...
 
bool isCached (void) const
 Test if the bank is cached. More...
 
bool isOnChip (void) const
 Test if the bank is on the same chip than the processor. More...
 
bool isWritable (void) const
 Test if the bank is writable. More...
 
int portNum (void) const
 Get the number of port on the bank bus. More...
 
const Busbus (void) const
 Get the bus of the bank. More...
 
Address topAddress (void) const
 Get the top successor address of the bank, that is, bank address + bank size. More...
 
bool contains (Address addr) const
 Test if the address is contained in the bank. More...
 

Static Public Attributes

static Bank full
 The full covering all page one memory. More...
 

Private Member Functions

 SERIALIZABLE (Bank, field("name", _name)&field("address", _address)&field("size", _size)&field("type", _type)&field("latency", _latency)&field("power", _power)&field("block_bits", _block_bits)&field("modes", _modes)&field("cached", _cached)&field("on_chip", _on_chip)&field("writable", _writable)&field("port_num", _port_num)&field("bus", _bus)&field("write_latency", _write_latency))
 

Private Attributes

string _name
 
Address _address
 
int _size
 
type_t _type
 
int _latency
 
int _power
 
int _write_latency
 
int _block_bits
 
AllocatedTable< const Mode * > _modes
 
bool _cached
 
bool _on_chip
 
bool _writable
 
int _port_num
 
const Bus_bus
 

Detailed Description

A bank in the memory.

Usually, objects of this class map real hardware chip but some memory segments may grouped or separated according their characteristics.

Author
H. Cassé casse.nosp@m.@iri.nosp@m.t.fr

Member Typedef Documentation

Member Enumeration Documentation

This type represents the type of banks:

Enumerator
NONE 
DRAM 
SPM 
ROM 
IO 

Constructor & Destructor Documentation

otawa::hard::Bank::Bank ( void  )

default constructor for a bank:

  • no name,
  • size to 0 bytes,
  • no type,
  • latency to one cycle,
  • no power consumed,
  • 0 block bits,
  • cached,
  • on chip,
  • writable,
  • 1 port number,
  • no tied bus.
otawa::hard::Bank::Bank ( cstring  name,
Address  address,
size_t  size 
)

Member Function Documentation

const Address & otawa::hard::Bank::address ( void  ) const
inline

Get the base address of the bank.

Returns
Base address.

Referenced by otawa::hard::Dumper::processWorkSpace().

int otawa::hard::Bank::blockBits ( void  ) const
inline

Get the number of bits in the block size of the bank.

Returns
Default bits per block (0 if there is no blocking).
int otawa::hard::Bank::blockSize ( void  ) const
inline

Get the block size of this bank.

Returns
Block size (in bytes, 0 if the bank is not blocked).
const Bus * otawa::hard::Bank::bus ( void  ) const
inline

Get the bus of the bank.

Returns
Bank bus.
bool otawa::hard::Bank::contains ( Address  addr) const
inline

Test if the address is contained in the bank.

Returns
True if the address is in the bank, false else.

References otawa::ot::address(), and otawa::Address::page().

Referenced by otawa::etime::StandardEventBuilder::costOf().

bool otawa::hard::Bank::isCached ( void  ) const
inline
bool otawa::hard::Bank::isOnChip ( void  ) const
inline

Test if the bank is on the same chip than the processor.

Returns
True if it is on the same chip, false else.
bool otawa::hard::Bank::isWritable ( void  ) const
inline

Test if the bank is writable.

Returns
True if the bank is writable, false else.
int otawa::hard::Bank::latency ( void  ) const
inline
const Table< const Mode * > & otawa::hard::Bank::modes ( void  ) const
inline

Get the mode transition table of the bank.

The first mode is the default mode.

Returns
Mode transition table.
const string & otawa::hard::Bank::name ( void  ) const
inline

Get the name of the bank.

Returns
Bank name.

Referenced by otawa::hard::Dumper::processWorkSpace().

int otawa::hard::Bank::portNum ( void  ) const
inline

Get the number of port on the bank bus.

Returns
Number of ports.
int otawa::hard::Bank::power ( void  ) const
inline

Get the default power for accessing this bank.

Returns
Default power.
otawa::hard::Bank::SERIALIZABLE ( Bank  ,
field("name", _name)&field("address", _address)&field("size", _size)&field("type", _type)&field("latency", _latency)&field("power", _power)&field("block_bits", _block_bits)&field("modes", _modes)&field("cached", _cached)&field("on_chip", _on_chip)&field("writable", _writable)&field("port_num", _port_num)&field("bus", _bus)&field("write_latency", _write_latency)   
)
private
const int otawa::hard::Bank::size ( void  ) const
inline

Get the size of the bank.

Returns
Bank size (in bytes).
Address otawa::hard::Bank::topAddress ( void  ) const
inline

Get the top successor address of the bank, that is, bank address + bank size.

Returns
Bank top address.

References otawa::ot::address().

Referenced by otawa::hard::Dumper::processWorkSpace().

type_t otawa::hard::Bank::type ( void  ) const
inline

Get the type of the bank.

Returns
Bank type.

Referenced by otawa::hard::Dumper::processWorkSpace().

Member Data Documentation

Address otawa::hard::Bank::_address
private
int otawa::hard::Bank::_block_bits
private
const Bus* otawa::hard::Bank::_bus
private
bool otawa::hard::Bank::_cached
private
int otawa::hard::Bank::_latency
private
AllocatedTable<const Mode *> otawa::hard::Bank::_modes
private
string otawa::hard::Bank::_name
private
bool otawa::hard::Bank::_on_chip
private
int otawa::hard::Bank::_port_num
private
int otawa::hard::Bank::_power
private
int otawa::hard::Bank::_size
private
type_t otawa::hard::Bank::_type
private
bool otawa::hard::Bank::_writable
private
int otawa::hard::Bank::_write_latency
private
Bank otawa::hard::Bank::full
static

The full covering all page one memory.

Referenced by otawa::hard::Memory::Memory().


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