ilang  1.1.4
ILAng: A Modeling and Verification Platform for SoCs
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Friends Macros
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::shared_ptr< const
Instr
InstrCnstPtr
 Pointer type for read-only use of Instr.
 
typedef std::set< std::string > StateNameSet
 Type for a set of state names.
 
- 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=nullptr)
 Constructor with the ast simplifier.
 
 ~Instr ()
 Default destructor.
 
bool is_instr () const
 Return true if Is type Instr.
 
InstrLvlAbsPtr host () const
 Return the host ILA.
 
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=nullptr)
 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.
 
std::ostream & operator<< (std::ostream &out, InstrCnstPtr i)
 Overload output stream operator for const object.
 

Detailed Description

The class for the Instruction. An Instr object contains:

Member Function Documentation

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).
void ilang::Instr::ForceSetDecode ( const ExprPtr decode)

Set the decode function.

Parameters
[in]decodeis the pointer to the decode function (bool).
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).
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.
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).
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).
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.
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: