Otawa
0.10
|
This class records information about the architecture where the processed program will run. More...
#include <otawa/hard/Platform.h>
Classes | |
class | Identification |
Public Types | |
typedef elm::genstruct::Table < const hard::RegBank * > | banks_t |
Public Member Functions | |
Platform (const Identification &id, const PropList &props=PropList::EMPTY) | |
Build a platform from the given description. More... | |
Platform (const Platform &platform, const PropList &props=PropList::EMPTY) | |
Build a platform by cloning and reconfiguring the new platform. More... | |
const Identification & | identification (void) const |
Get identification of the current platform. More... | |
virtual bool | accept (const Identification &id) |
Check if the platform handle the given platform description. More... | |
bool | accept (elm::CString name) |
Check if the platform accepts the given kind of architecture. More... | |
bool | accept (const elm::String &name) |
Check if the platform accepts the given kind of architecture. More... | |
const banks_t & | banks (void) const |
int | regCount (void) const |
Get the count of registers in the current platform. More... | |
Register * | findReg (int uniq) const |
Find the register matching the given unique identifier. More... | |
const Register * | findReg (const string &name) const |
Find a register by its name. More... | |
virtual const Register * | getSP (void) const |
Get the register, usually (depending on the ABI), devoted to contain the stack pointer. More... | |
virtual const Register * | getPC (void) const |
Get the register containing the Program Counter. More... | |
const CacheConfiguration & | cache (void) const |
Get the cache configuration. More... | |
void | loadCacheConfig (const elm::system::Path &path) |
Load a cache configuration from the given path. More... | |
void | loadCacheConfig (elm::xom::Element *element) |
Load a cache configuration from an XML element. More... | |
const Memory & | memory (void) const |
void | loadMemory (const elm::system::Path &path) throw (otawa::LoadException) |
Load a memory configuration from the given path. More... | |
void | loadMemory (elm::xom::Element *element) throw (otawa::LoadException) |
Load a memory configuration from an XML element. More... | |
void | loadProcessor (const elm::system::Path &path) |
Load the processor configuration. More... | |
void | loadProcessor (elm::xom::Element *element) |
Load the processor configuration from the given element. More... | |
const Processor * | processor (void) const |
Get the current processor (possibly derivated from the current configuration). More... | |
const int | pipelineDepth (void) const |
Get the depth of the pipeline of the platform processor. More... | |
Static Public Attributes | |
static const elm::String | ANY |
Represents any architecture, platform, machine. More... | |
static const elm::String | POWERPC |
Represents the PowerPC architecture. More... | |
static const elm::String | ELF |
Represents the ELF ABI. More... | |
static const elm::String | EABI |
Represents the EABI ABI. More... | |
static const elm::String | LINUX |
Represents the Linux ABI. More... | |
static const elm::String | LINUX_2_4 |
Represents the Linux 2.4 ABI. More... | |
static const elm::String | LINUX_2_6 |
Represents the Linux 2.6 ABI. More... | |
static const elm::String | MAC |
Represents a Macintosh machine (seems to be too wide, must be refined). More... | |
static const elm::String | SIM |
Represents a simulator machine. More... | |
static const Identification | ANY_PLATFORM |
Represents any platform. More... | |
Protected Member Functions | |
virtual | ~Platform (void) |
void | setBanks (const banks_t &banks) |
Set the list of banks for an actual platform. More... | |
Static Protected Attributes | |
static const banks_t | null_banks |
Empty register bank table. More... | |
Private Member Functions | |
void | configure (const PropList &props) |
Private Attributes | |
unsigned long | flags |
Identification | id |
const CacheConfiguration * | _cache |
Processor * | _processor |
const Memory * | _memory |
int | depth |
int | rcnt |
const banks_t * | _banks |
Static Private Attributes | |
static const unsigned long | HAS_PROCESSOR = 0x00000001 |
static const unsigned long | HAS_CACHE = 0x00000002 |
static const unsigned long | HAS_MEMORY = 0x00000004 |
Friends | |
class | otawa::Manager |
This class records information about the architecture where the processed program will run.
typedef elm::genstruct::Table<const hard::RegBank *> otawa::hard::Platform::banks_t |
otawa::hard::Platform::Platform | ( | const Identification & | id, |
const PropList & | props = PropList::EMPTY |
||
) |
Build a platform from the given description.
_id | Platform identification. |
props | Properties describing the platform. |
References configure().
otawa::hard::Platform::Platform | ( | const Platform & | platform, |
const PropList & | props = PropList::EMPTY |
||
) |
Build a platform by cloning and reconfiguring the new platform.
platform | Platform to clone. |
props | Description properties. |
References configure().
|
protectedvirtual |
References _cache, _memory, _processor, flags, HAS_CACHE, HAS_MEMORY, and HAS_PROCESSOR.
|
virtual |
Check if the platform handle the given platform description.
_id | Platform identifier to check. |
References otawa::hard::Platform::Identification::abi(), otawa::hard::Platform::Identification::architecture(), and otawa::hard::Platform::Identification::machine().
Referenced by accept().
|
inline |
Check if the platform accepts the given kind of architecture.
name | of the acrhitecture. |
References accept().
|
inline |
Check if the platform accepts the given kind of architecture.
name | of the acrhitecture. |
References accept().
|
inline |
References _banks.
Referenced by otawa::ExeGraph< N >::build(), otawa::ParamExeGraph::ParamExeGraph(), otawa::ResourceList::ResourceList(), and setBanks().
|
inline |
Get the cache configuration.
References _cache.
Referenced by otawa::Process::cache(), configure(), otawa::EdgeCAT2Builder::processCFG(), otawa::EdgeCAT2ConstraintBuilder::processWorkSpace(), and otawa::EdgeACSBuilder::processWorkSpace().
|
private |
References _cache, _memory, _processor, cache(), otawa::CACHE_CONFIG, otawa::CACHE_CONFIG_ELEMENT, otawa::Manager::CACHE_CONFIG_NAME, otawa::CACHE_CONFIG_PATH, otawa::CONFIG_ELEMENT, depth, flags, elm::xom::Element::getFirstChildElement(), HAS_CACHE, HAS_MEMORY, HAS_PROCESSOR, loadCacheConfig(), loadMemory(), loadProcessor(), memory(), otawa::MEMORY_ELEMENT, otawa::Manager::MEMORY_NAME, otawa::MEMORY_OBJECT, otawa::MEMORY_PATH, otawa::Manager::OTAWA_NS, otawa::PIPELINE_DEPTH, otawa::PROCESSOR, otawa::PROCESSOR_ELEMENT, otawa::Manager::PROCESSOR_NAME, and otawa::PROCESSOR_PATH.
Referenced by Platform().
Register * otawa::hard::Platform::findReg | ( | int | uniq | ) | const |
Find the register matching the given unique identifier.
uniq | Unique identifier of the register. |
References _banks.
Referenced by otawa::se::SEReg::asString(), otawa::RegIter::item(), otawa::FlowFactLoader::onRegSet(), and otawa::clp::State::print().
|
virtual |
Get the register containing the Program Counter.
|
virtual |
Get the register, usually (depending on the ABI), devoted to contain the stack pointer.
Referenced by otawa::StackAnalysis::processWorkSpace(), and otawa::clp::Analysis::processWorkSpace().
|
inline |
void otawa::hard::Platform::loadCacheConfig | ( | const elm::system::Path & | path | ) |
Load a cache configuration from the given path.
path | Path to the cache configuration. |
LoadException | Throws if there is an error. |
References _cache, flags, HAS_CACHE, otawa::hard::CacheConfiguration::load(), and elm::Exception::message().
Referenced by configure().
void otawa::hard::Platform::loadCacheConfig | ( | elm::xom::Element * | element | ) |
Load a cache configuration from an XML element.
element | Element to read from. |
LoadException | Thrown if there is an error. |
References _cache, flags, HAS_CACHE, otawa::hard::CacheConfiguration::load(), and elm::Exception::message().
void otawa::hard::Platform::loadMemory | ( | const elm::system::Path & | path | ) | |
throw | ( | otawa::LoadException | |||
) |
Load a memory configuration from the given path.
path | Path to the memory configuration. |
LoadException | Throws if there is an error. |
References _memory, flags, HAS_MEMORY, and otawa::hard::Memory::load().
Referenced by configure().
void otawa::hard::Platform::loadMemory | ( | elm::xom::Element * | element | ) | |
throw | ( | otawa::LoadException | |||
) |
Load a memory configuration from an XML element.
element | Element to read from. |
LoadException | Thrown if there is an error. |
References _memory, flags, HAS_MEMORY, and otawa::hard::Memory::load().
void otawa::hard::Platform::loadProcessor | ( | const elm::system::Path & | path | ) |
Load the processor configuration.
path | Path to the file. |
elm::io::IOException | If a configuration file cannot be loaded. |
References _processor, flags, HAS_PROCESSOR, and otawa::hard::Processor::load().
Referenced by configure().
void otawa::hard::Platform::loadProcessor | ( | elm::xom::Element * | element | ) |
Load the processor configuration from the given element.
element | Element to use. |
LoadException | If the XML element is mal-formed. |
References _processor, flags, HAS_PROCESSOR, and otawa::hard::Processor::load().
|
inline |
References _memory.
Referenced by configure(), otawa::hard::Dumper::processWorkSpace(), and otawa::dcache::BlockBuilder::setup().
|
inline |
|
inline |
Get the current processor (possibly derivated from the current configuration).
References _processor.
|
inline |
Get the count of registers in the current platform.
References rcnt.
Referenced by otawa::ParExeGraph::createSequenceResources().
|
protected |
|
friend |
|
private |
Referenced by banks(), findReg(), and setBanks().
|
private |
Referenced by cache(), configure(), loadCacheConfig(), and ~Platform().
|
private |
Referenced by configure(), loadMemory(), memory(), and ~Platform().
|
private |
Referenced by configure(), loadProcessor(), processor(), and ~Platform().
|
static |
Represents any architecture, platform, machine.
Referenced by otawa::hard::Platform::Identification::matches(), and otawa::hard::Platform::Identification::split().
|
static |
Represents any platform.
|
private |
Referenced by configure(), and pipelineDepth().
|
static |
Represents the EABI ABI.
|
static |
Represents the ELF ABI.
|
private |
Referenced by configure(), loadCacheConfig(), loadMemory(), loadProcessor(), and ~Platform().
|
staticprivate |
Referenced by configure(), loadCacheConfig(), and ~Platform().
|
staticprivate |
Referenced by configure(), loadMemory(), and ~Platform().
|
staticprivate |
Referenced by configure(), loadProcessor(), and ~Platform().
|
private |
Referenced by identification().
|
static |
Represents the Linux ABI.
|
static |
Represents the Linux 2.4 ABI.
|
static |
Represents the Linux 2.6 ABI.
|
static |
Represents a Macintosh machine (seems to be too wide, must be refined).
|
staticprotected |
Empty register bank table.
|
static |
Represents the PowerPC architecture.
|
private |
Referenced by regCount(), and setBanks().
|
static |
Represents a simulator machine.