Otawa  0.10
otawa::clp::Manager Class Reference

This class allows to exploit the result of a CLP analysis. More...

#include <otawa/data/clp/features.h>

Public Types

typedef t::uint32 step_t
 

Public Member Functions

 Manager (WorkSpace *ws)
 Create a manager for the current workspace. More...
 
step_t start (BasicBlock *bb)
 Start the interpretation of a basic block. More...
 
step_t next (void)
 Go to the next step in the interpretation of the basic block. More...
 
sem::inst sem (void)
 Get the last interpreted semantic instruction. More...
 
Instinst (void)
 Get the current interpreted machine instruction. More...
 
Statestate (void)
 Get the state result of the last interpretation. More...
 
int ipc (void)
 Get the current semantic instruction PC. More...
 

Static Public Member Functions

static bool newSem (step_t s)
 Test if the given step result contains the flag Manager::NEW_SEM. More...
 
static bool newPath (step_t s)
 Test if the given step result contains the flag Manager::NEW_PATH. More...
 
static bool newInst (step_t s)
 Test if the given step result contains the flag Manager::NEW_INST. More...
 
static bool isEnded (step_t s)
 

Static Public Attributes

static const step_t NEW_SEM = 0x01
 
static const step_t NEW_PATH = 0x02
 
static const step_t NEW_INST = 0x04
 
static const step_t ENDED = 0
 

Private Attributes

ClpProblem * p
 
BasicBlock::InstIter mi
 
clp::State s
 
clp::Statecs
 
int i
 
bool new_path
 

Detailed Description

This class allows to exploit the result of a CLP analysis.

Basically, it provide facility to traverse a basic block, semantic instruction by semantic instruction and to lookup the state.

Member Typedef Documentation

Constructor & Destructor Documentation

otawa::clp::Manager::Manager ( WorkSpace ws)

Create a manager for the current workspace.

Parameters
wsWorkspace to work with.

References p, and otawa::WorkSpace::process().

Member Function Documentation

Inst * otawa::clp::Manager::inst ( void  )

Get the current interpreted machine instruction.

Returns
Current machine instruction.

References mi.

Referenced by otawa::dcache::CLPBlockBuilder::processBB().

int otawa::clp::Manager::ipc ( void  )
inline

Get the current semantic instruction PC.

Returns
Current semantic instruction PC.

References i.

Referenced by otawa::dcache::CLPBlockBuilder::processBB().

static bool otawa::clp::Manager::isEnded ( step_t  s)
inlinestatic

References s.

bool otawa::clp::Manager::newInst ( step_t  s)
inlinestatic

Test if the given step result contains the flag Manager::NEW_INST.

Returns
True if Manager::NEW_INST is set, false else.

References NEW_INST.

Referenced by otawa::dcache::CLPBlockBuilder::processBB().

bool otawa::clp::Manager::newPath ( step_t  s)
inlinestatic

Test if the given step result contains the flag Manager::NEW_PATH.

Returns
True if Manager::NEW_PATH is set, false else.

References NEW_PATH.

bool otawa::clp::Manager::newSem ( step_t  s)
inlinestatic

Test if the given step result contains the flag Manager::NEW_SEM.

Returns
True if Manager::NEW_SEM is set, false else.

References NEW_SEM.

Manager::step_t otawa::clp::Manager::next ( void  )

Go to the next step in the interpretation of the basic block.

This may causes:

  • Manager::NEW_SEM – just interpreting the next semantic instruction,
  • Manager::NEW_PATH – starting the interpretation of the next semantic path,
  • Manager::NEW_INST – starting the interpretation of the next machine instruction,
  • Manager::ENDED – to have exhausted any interpretation.
    Returns
    A OR'ed combination of NEW_SEM, NEW_PATH, NEW_INST, or the value ENDED.

References cs, mi, NEW_INST, NEW_PATH, NEW_SEM, p, and s.

Referenced by otawa::dcache::CLPBlockBuilder::processBB().

sem::inst otawa::clp::Manager::sem ( void  )

Get the last interpreted semantic instruction.

Returns
Current semantic instruction.

References p.

Referenced by otawa::dcache::CLPBlockBuilder::processBB().

Manager::step_t otawa::clp::Manager::start ( BasicBlock bb)

Start the interpretation of a basic block.

Parameters
bbBasic block to interpret.

References cs, mi, NEW_INST, NEW_PATH, NEW_SEM, p, s, and otawa::clp::STATE_IN.

Referenced by otawa::dcache::CLPBlockBuilder::processBB().

State * otawa::clp::Manager::state ( void  )

Get the state result of the last interpretation.

Returns
Result state.

References cs.

Referenced by otawa::dcache::CLPBlockBuilder::processBB().

Member Data Documentation

clp::State * otawa::clp::Manager::cs
private

Referenced by next(), start(), and state().

const step_t otawa::clp::Manager::ENDED = 0
static
int otawa::clp::Manager::i
private

Referenced by ipc().

BasicBlock::InstIter otawa::clp::Manager::mi
private

Referenced by inst(), next(), and start().

const step_t otawa::clp::Manager::NEW_INST = 0x04
static

Referenced by newInst(), next(), and start().

const step_t otawa::clp::Manager::NEW_PATH = 0x02
static

Referenced by newPath(), next(), and start().

bool otawa::clp::Manager::new_path
private
const step_t otawa::clp::Manager::NEW_SEM = 0x01
static

Referenced by newSem(), next(), and start().

ClpProblem* otawa::clp::Manager::p
private

Referenced by Manager(), next(), sem(), and start().

clp::State otawa::clp::Manager::s
private

Referenced by isEnded(), next(), and start().


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