Otawa
0.10
|
The representation of an address in OTAWA. More...
#include <otawa/base.h>
Public Types | |
typedef t::uint32 | page_t |
typedef t::uint32 | offset_t |
Public Member Functions | |
Address (void) | |
Build a null address. More... | |
Address (offset_t offset) | |
Build a simple absolute address. More... | |
Address (page_t page, offset_t offset) | |
Build a full address. More... | |
Address (const Address &address) | |
Build an address by cloning. More... | |
Address (const MemArea &mem_area) | |
page_t | page (void) const |
Get the page number. More... | |
offset_t | offset (void) const |
Get the offset value. More... | |
offset_t | operator* (void) const |
Short cut to offset(). More... | |
bool | isNull (void) const |
Test if the address is null. More... | |
operator offset_t (void) const | |
shortcut to offset(). More... | |
Address & | operator= (const Address &address) |
Address & | operator= (offset_t offset) |
Address & | operator+= (int offset) |
Address & | operator+= (t::uint32 offset) |
Address & | operator-= (int offset) |
Address & | operator-= (t::uint32 offset) |
Address | operator+ (t::int32 offset) const |
Address | operator+ (t::uint32 offset) const |
Address | operator- (t::int32 offset) const |
Address | operator- (t::uint32 offset) const |
offset_t | operator- (const Address &address) const |
bool | equals (const Address &address) const |
Test if two address are equals. More... | |
int | compare (const Address &address) const |
Compare two addresses and returns: More... | |
bool | operator== (const Address &addr) const |
bool | operator!= (const Address &addr) const |
bool | operator< (const Address &addr) const |
bool | operator<= (const Address &addr) const |
bool | operator> (const Address &addr) const |
bool | operator>= (const Address &addr) const |
Static Public Attributes | |
static Address | null |
Null address. More... | |
static const page_t | null_page = elm::type_info<page_t>::max |
Private Attributes | |
page_t | pg |
offset_t | off |
The representation of an address in OTAWA.
To match most architectures, the address is split in two component:
The page component may be used to represent different, non overlapping address spaces. For example, a Harvard architecture for example: page 0 may be used to store code and page 1 to store data.
It is bad idea to use the page to represent segemented memory as in the paged mode of the x86 architecture. The rule is that each item must have a unique address in order to perform valid address comparison and computation. For example, the M68HCxx banking memory that assign different code banks in memory from 0x8000 to 0xC000 is better handled by assigning to each an absolute address above the maximal address computed by: 0x10000 + bank_number * 0x4000.
Finally, notice that the page 0xffffffff is reserved to represent the null address.
typedef t::uint32 otawa::Address::offset_t |
typedef t::uint32 otawa::Address::page_t |
|
inline |
Build a null address.
|
inline |
Build a simple absolute address.
offset | Absolute value of the address. |
Build a full address.
page | Address page. |
offset | Offset in the page. |
|
inline |
Build an address by cloning.
address | Cloned address. |
|
inline |
|
inline |
Compare two addresses and returns:
address | Address to compare to. |
|
inline |
|
inline |
Test if the address is null.
Referenced by otawa::FlowFactLoader::addressOf(), otawa::dcache::Block::Block(), otawa::WorkSpace::format(), otawa::dcache::BlockCollection::obtain(), operator-(), otawa::operator<<(), otawa::dcache::BlockBuilder::processBB(), otawa::hard::Cache::round(), otawa::FlowFactLoader::scanAddress(), otawa::FlowFactLoader::scanXBody(), otawa::FlowFactLoader::scanXCall(), otawa::FlowFactLoader::scanXFun(), otawa::FlowFactLoader::scanXLoop(), and otawa::CFGProcessor::str().
|
inline |
Get the offset value.
Referenced by otawa::ParExeGraph::addEdgesForFetch(), otawa::ot::address(), otawa::hard::PureCache::block(), otawa::hard::Cache::block(), otawa::Process::findSymbolAt(), elm::HashKey< otawa::Address >::hash(), otawa::dfa::State::isInitialized(), otawa::hard::PureCache::line(), otawa::hard::Cache::line(), otawa::hard::PureCache::offset(), otawa::hard::Cache::offset(), otawa::operator<<(), otawa::BBRatioDisplayer::processBB(), otawa::dcache::BlockBuilder::processBB(), otawa::hard::Cache::round(), otawa::FlowFactLoader::scanValue(), otawa::hard::Cache::set(), otawa::CFGProcessor::str(), otawa::hard::PureCache::tag(), and otawa::hard::Cache::tag().
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Get the page number.
Referenced by otawa::hard::Bank::contains(), otawa::Segment::findItemAt(), elm::HashKey< otawa::Address >::hash(), otawa::operator<<(), otawa::dcache::BlockBuilder::processBB(), and otawa::hard::Cache::round().
|
static |
Null address.
Please that the null address is not the adress 0 but an invalid address that can not be mapped to the platform memory :
Referenced by otawa::CFG::address(), otawa::FlowFactLoader::addressOf(), otawa::File::findLabel(), otawa::Process::findLabel(), otawa::ContextualPath::getEnclosingFunction(), otawa::Process::initialSP(), otawa::sim::Driver::lowerRead(), otawa::sim::Driver::lowerWrite(), otawa::StackAnalysis::processWorkSpace(), otawa::CFGProcessor::str(), otawa::LabelAddress::toAddress(), otawa::sim::Driver::upperRead(), and otawa::sim::Driver::upperWrite().
|
static |
|
private |
Referenced by compare(), equals(), operator-(), operator<(), operator<=(), operator=(), operator>(), and operator>=().
|
private |
Referenced by compare(), equals(), operator-(), operator<(), operator<=(), operator=(), operator>(), and operator>=().