Otawa  0.10
otawa::p::declare Class Reference

Class to declare simple a processor. More...

#include <otawa/proc/Registration.h>

Inheritance diagram for otawa::p::declare:
otawa::AbstractRegistration

Public Member Functions

 declare (otawa::p::init &i)
 
virtual ~declare (void)
 
virtual Processormake (void) const
 Build the registered processor. More...
 
virtual bool isFinal (void) const
 
const stringname (void) const
 Get the name of the processor. More...
 
const Versionversion (void) const
 Get the version of the processor. More...
 
AbstractRegistrationbase (void) const
 
bool provides (const AbstractFeature &feature)
 Test if the current processor provides the given feature. More...
 
bool requires (const AbstractFeature &feature)
 Test if the current processor requires the given feature. More...
 
bool invalidates (const AbstractFeature &feature)
 Test if the current processor invalidates the given feature. More...
 
bool uses (const AbstractFeature &feature)
 Test if the current processor uses or requires the given feature. More...
 
void initialize (void)
 Internal. More...
 

Protected Member Functions

void init (cstring name, const Version &version, int tag, VarArg &args)
 Initialize a registration from an argument list. More...
 
void setFeatures (const SLList< FeatureUsage > &features)
 Set the features. More...
 
void setConfigs (const SLList< AbstractIdentifier * > &configs)
 Set the configurations. More...
 
void record (void)
 

Private Attributes

AbstractMaker_maker
 

Detailed Description

Class to declare simple a processor.

Each processor must have a static member of this type giving information about:

  • configuration identifier,
  • required features,
  • provided features,
  • invalidated features,
  • used features,
  • maker for the default processor.

Below an example of processor registration using declaration:

class MyProcessor: public BBProcessor {
public:
static p::declare reg;
...
};
p::declare MyProcessor::reg =
p::init("MyProcessor", Version(1, 0, 0), BBProcessor::reg)
.require(OTHER_FEATURE)
.provide(MY_FEATURE)
.config(MY_CONFIG)
.make<MyProcessor>());

Constructor & Destructor Documentation

otawa::p::declare::~declare ( void  )
virtual

References _maker.

Member Function Documentation

AbstractRegistration& otawa::AbstractRegistration::base ( void  ) const
inlineinherited
void otawa::AbstractRegistration::initialize ( void  )
inherited
bool otawa::AbstractRegistration::invalidates ( const AbstractFeature feature)
inherited

Test if the current processor invalidates the given feature.

Parameters
featureTested feature.
Returns
True if the feature is invalidated, false else.

References otawa::FeatureUsage::invalidate.

bool otawa::p::declare::isFinal ( void  ) const
virtual
Processor * otawa::p::declare::make ( void  ) const
virtual

Build the registered processor.

Returns
Built processor.

Implements otawa::AbstractRegistration.

References _maker, and otawa::AbstractMaker::make().

const string & otawa::AbstractRegistration::name ( void  ) const
inlineinherited
bool otawa::AbstractRegistration::provides ( const AbstractFeature feature)
inherited

Test if the current processor provides the given feature.

Parameters
featureTested feature.
Returns
True if the feature is provided, false else.

References otawa::FeatureUsage::provide.

void otawa::AbstractRegistration::record ( void  )
protectedinherited
bool otawa::AbstractRegistration::requires ( const AbstractFeature feature)
inherited

Test if the current processor requires the given feature.

Parameters
featureTested feature.
Returns
True if the feature is required, false else.

References otawa::FeatureUsage::require.

Referenced by otawa::AlternativeProcessor::AlternativeProcessor().

void otawa::AbstractRegistration::setConfigs ( const SLList< AbstractIdentifier * > &  coll)
protectedinherited

Set the configurations.

Parameters
collConfigures to set.

References otawa::AbstractRegistration::configs, and otawa::p::use.

Referenced by declare().

void otawa::AbstractRegistration::setFeatures ( const SLList< FeatureUsage > &  coll)
protectedinherited

Set the features.

Parameters
collFeatures to set.

References otawa::AbstractRegistration::features, and otawa::p::use.

Referenced by declare().

bool otawa::AbstractRegistration::uses ( const AbstractFeature feature)
inherited

Test if the current processor uses or requires the given feature.

Parameters
featureTested feature.
Returns
True if the feature is used or required, false else.

References otawa::FeatureUsage::require, and otawa::FeatureUsage::use.

Referenced by otawa::Processor::process().

const Version & otawa::AbstractRegistration::version ( void  ) const
inlineinherited

Get the version of the processor.

Returns
Processor version.

Referenced by otawa::AbstractRegistration::init().

Member Data Documentation

AbstractMaker* otawa::p::declare::_maker
private

Referenced by declare(), make(), and ~declare().


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