4 #ifndef ILANG_ILA_INSTR_H__
5 #define ILANG_ILA_INSTR_H__
35 typedef std::map<std::string, ExprPtr> ExprPtrMap;
37 typedef std::shared_ptr<InstrLvlAbs> InstrLvlAbsPtr;
42 Instr(
const std::string&
name,
const InstrLvlAbsPtr&
host =
nullptr);
55 inline InstrLvlAbsPtr
host()
const {
return host_; }
92 inline InstrLvlAbsPtr
program()
const {
return prog_; }
105 std::ostream&
Print(std::ostream& out)
const;
140 #endif // ILNAG_ILA_INSTR_H__
std::shared_ptr< const Instr > InstrCnstPtr
Pointer type for read-only use of Instr.
Definition: instr.h:29
Expr::ExprPtr ExprPtr
Pointer type for normal use of Expr.
Definition: expr.h:138
std::vector< InstrPtr > InstrVec
Type for storing a set of Instr.
Definition: instr.h:136
std::ostream & Print(std::ostream &out) const
Output function.
InstrLvlAbsPtr program() const
Returun the child-ILA comprising the child-program.
Definition: instr.h:92
friend std::ostream & operator<<(std::ostream &out, InstrPtr i)
Overload output stream operator.
bool is_instr() const
Return true if Is type Instr.
Definition: instr.h:53
The class for the Instruction. An Instr object contains:
Definition: instr.h:24
void ForceSetDecode(const ExprPtr &decode)
Set the decode function.
Instr::InstrCnstPtr InstrCnstPtr
Pointer type for read-only use of Instr.
Definition: instr.h:134
ExprPtr update(const std::string &name) const
Return the update function for the state specified by name.
void ForceAddUpdate(const std::string &name, const ExprPtr &update)
Overwrite update function for the state variable specified by name.
void set_decode(const ExprPtr &decode)
Set the decode function if not yet assigned.
Instr::InstrPtr InstrPtr
Pointer type for normal use of Instr.
Definition: instr.h:132
std::shared_ptr< Instr > InstrPtr
Pointer type for normal use of Instr.
Definition: instr.h:27
StateNameSet updated_states() const
return the (potentially) updated state of this function
std::set< std::string > StateNameSet
Type for a set of state names.
Definition: instr.h:31
InstrLvlAbs::InstrLvlAbsPtr InstrLvlAbsPtr
Pointer type for normal use of InstrLvlAbs.
Definition: instr_lvl_abs.h:326
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 d...
The basest type in the ILA structure. It can be either Ast, Instr, or InstrLvlAbs.
Definition: object.h:17
void set_update(const std::string &name, const ExprPtr &update)
Set the update function for the state variable specified by name.
ExprPtr decode() const
Return the decode function.
Definition: instr.h:77
~Instr()
Default destructor.
void set_program(const InstrLvlAbsPtr &program)
Set the child-program (as a child-ILA) of the instruction.
InstrLvlAbsPtr host() const
Return the host ILA.
Definition: instr.h:55
Instr(const std::string &name, const InstrLvlAbsPtr &host=nullptr)
Constructor with the ast simplifier.
const Symbol & name() const
Get the symbol (name).