ilang  0.9.1
ILAng: A Modeling and Verification Platform for SoCs
Public Types | Public Member Functions | Static Public Member Functions | Friends | List of all members
ilang::Instr Class Reference

The class for the Instruction. An Instr object contains: More...

#include <instr.h>

Inheritance diagram for ilang::Instr:
ilang::Object

Public Types

typedef std::shared_ptr< InstrInstrPtr
 Pointer type for normal use of Instr.
 
typedef std::set< std::string > StateNameSet
 Type for a set of state names.
 
typedef std::map< std::string, ExprPtrExprPtrMap
 Type for storing a set of Expr.
 
typedef std::shared_ptr< InstrLvlAbsInstrLvlAbsPtr
 Pointer type for ILA.
 
- Public Types inherited from ilang::Object
typedef std::shared_ptr< ObjectObjPtr
 Pointer type for normal use of Object.
 

Public Member Functions

 Instr (const std::string &name, const InstrLvlAbsPtr host=NULL)
 Constructor with the ast simplifier.
 
 ~Instr ()
 Default destructor.
 
bool is_instr () const
 Return true if Is type Instr.
 
bool has_view () const
 Return true if has view.
 
InstrLvlAbsPtr host () const
 Return the host ILA.
 
void set_view (bool v)
 Set the view flag. More...
 
void set_decode (const ExprPtr decode)
 Set the decode function if not yet assigned. More...
 
void set_update (const std::string &name, const ExprPtr update)
 Set the update function for the state variable specified by name. More...
 
void set_update (const ExprPtr state, const ExprPtr update)
 Set the update function for the state variable specified by var pointer. More...
 
void set_program (const InstrLvlAbsPtr program)
 Set the child-program (as a child-ILA) of the instruction. More...
 
ExprPtr decode () const
 Return the decode function.
 
ExprPtr update (const std::string &name) const
 Return the update function for the state specified by name. More...
 
ExprPtr update (const ExprPtr state) const
 Return the update function for the state specified by var pointer. More...
 
StateNameSet updated_states () const
 return the (potentially) updated state of this function
 
InstrLvlAbsPtr program () const
 Returun the child-ILA comprising the child-program.
 
void ForceSetDecode (const ExprPtr decode)
 Set the decode function. More...
 
void ForceAddUpdate (const std::string &name, const ExprPtr update)
 Overwrite update function for the state variable specified by name. More...
 
std::ostream & Print (std::ostream &out) const
 Output function.
 
- Public Member Functions inherited from ilang::Object
 Object ()
 Default constructor.
 
 Object (const std::string &name)
 Constructor with string name.
 
virtual ~Object ()
 Default destructor.
 
const Symbolname () const
 Get the symbol (name).
 
virtual bool is_instr_lvl_abs () const
 Is type InstrLvlAbs.
 
virtual bool is_ast () const
 Is type Ast.
 

Static Public Member Functions

static InstrPtr New (const std::string &name, InstrLvlAbsPtr host=NULL)
 Create a new instruction (Instr) binded with the host. Used for hiding implementation specific type details.
 

Friends

std::ostream & operator<< (std::ostream &out, InstrPtr i)
 Overload output stream operator.
 

Detailed Description

The class for the Instruction. An Instr object contains:

Member Function Documentation

◆ ForceAddUpdate()

void ilang::Instr::ForceAddUpdate ( const std::string &  name,
const ExprPtr  update 
)

Overwrite update function for the state variable specified by name.

Parameters
[in]namethe name of the state variable.
[in]updatethe update function expression (same type as state).

◆ ForceSetDecode()

void ilang::Instr::ForceSetDecode ( const ExprPtr  decode)

Set the decode function.

Parameters
[in]decodeis the pointer to the decode function (bool).

◆ set_decode()

void ilang::Instr::set_decode ( const ExprPtr  decode)

Set the decode function if not yet assigned.

Parameters
[in]decodeis the pointer to the decode function (bool).

◆ set_program()

void ilang::Instr::set_program ( const InstrLvlAbsPtr  program)

Set the child-program (as a child-ILA) of the instruction.

Parameters
[in]programthe pointer to the child-ILA.

◆ set_update() [1/2]

void ilang::Instr::set_update ( const std::string &  name,
const ExprPtr  update 
)

Set the update function for the state variable specified by name.

Parameters
[in]namethe name of the state variable.
[in]updatethe update function expression (same type as state).

◆ set_update() [2/2]

void ilang::Instr::set_update ( const ExprPtr  state,
const ExprPtr  update 
)

Set the update function for the state variable specified by var pointer.

Parameters
[in]statethe pointer to the state variable.
[in]updatethe update function expression (same type as state).

◆ set_view()

void ilang::Instr::set_view ( bool  v)
inline

Set the view flag.

Parameters
[in]vthe flag indicating whether the instruction has views.

◆ update() [1/2]

ExprPtr ilang::Instr::update ( const std::string &  name) const

Return the update function for the state specified by name.

Parameters
[in]namethe name of the state variable.
Returns
the state update function.

◆ update() [2/2]

ExprPtr ilang::Instr::update ( const ExprPtr  state) const

Return the update function for the state specified by var pointer.

Parameters
[in]statethe pointer to the state variable.

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