ilang  1.1.4
ILAng: A Modeling and Verification Platform for SoCs
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Friends Macros
abst_to_ila.h
Go to the documentation of this file.
1 
4 #ifndef ILANG_TARGET_ITSY_ABST_TO_ILA_H__
5 #define ILANG_TARGET_ITSY_ABST_TO_ILA_H__
6 
7 #include <memory>
8 #include <string>
9 #include <vector>
10 
12 #include <ilasynth/abstraction.hpp>
13 
15 namespace ilang {
16 
20 public:
22  typedef std::shared_ptr<SynthAbsConverter> SynthAbsConverterPtr;
23 
24  // ------------------------- CONSTRUCTOR/DESTRUCTOR ----------------------- //
29 
30  // ------------------------- HELPERS -------------------------------------- //
33  static SynthAbsConverterPtr New();
34 
35  // ------------------------- ACCESSORS/MUTATORS --------------------------- //
36 
37  // ------------------------- METHODS -------------------------------------- //
41  InstrLvlAbsPtr Convert(const ilasynth::Abstraction& abs);
42 
46  void Port(const ilasynth::Abstraction& abs, const InstrLvlAbsPtr& ila);
47 
52  ExprPtr ConvertSynthNodeToIlangExpr(const ilasynth::nptr_t& node,
53  const InstrLvlAbsPtr& ila);
54 
55 private:
56  // ------------------------- MEMBERS -------------------------------------- //
58  std::map<const ilasynth::Node*, ExprPtr> node_expr_map_;
60  std::map<const ilasynth::Node*, FuncPtr> node_func_map_;
61 
63  ExprSet decom_entry_;
65  std::map<ExprPtr, ExprPtr> decom_match_;
67  ExprSet decom_glue_;
69  ExprSet decom_else_;
70 
71  // ------------------------- HELPERS -------------------------------------- //
73  void Reset() {
74  node_expr_map_.clear();
75  node_func_map_.clear();
76  decom_entry_.clear();
77  decom_match_.clear();
78  decom_glue_.clear();
79  decom_else_.clear();
80  }
81 
82  // ------------------------- METHODS -------------------------------------- //
84  void PortInputs(const ilasynth::Abstraction& abs, const InstrLvlAbsPtr& ila);
86  void PortStates(const ilasynth::Abstraction& abs, const InstrLvlAbsPtr& ila);
88  void PortValid(const ilasynth::Abstraction& abs, const InstrLvlAbsPtr& ila);
90  void PortFetch(const ilasynth::Abstraction& abs, const InstrLvlAbsPtr& ila);
92  void PortInits(const ilasynth::Abstraction& abs, const InstrLvlAbsPtr& ila);
94  void PortFuncs(const ilasynth::Abstraction& abs, const InstrLvlAbsPtr& ila);
96  void PortInstructions(const ilasynth::Abstraction& abs,
97  const InstrLvlAbsPtr& ila);
98 
101  void DecomposeExpr(const ExprPtr& src);
102 
104  void CnvtNodeToExpr(const ilasynth::Node* n);
106  void CnvtNodeToExprConst(const ilasynth::Node* n);
108  void CnvtNodeToExprBoolOp(const ilasynth::Node* n);
110  void CnvtNodeToExprBvOp(const ilasynth::Node* n);
112  void CnvtNodeToExprMemOp(const ilasynth::Node* n);
113 
114 }; // class SynthAbsConverter
115 
118 
119 }; // namespace ilang
120 
121 #endif // ILANG_TARGET_ITSY_ABST_TO_ILA_H__
void Port(const ilasynth::Abstraction &abs, const InstrLvlAbsPtr &ila)
Convert an abstraction from the synthesis engine on top of an ILA.
SynthAbsConverter()
Default constructor.
SynthAbsConverter::SynthAbsConverterPtr SynthAbsConverterPtr
Pointer type for normal use of SynthAbsConverter.
Definition: abst_to_ila.h:117
Expr::ExprPtr ExprPtr
Pointer type for normal use of Expr.
Definition: expr.h:138
~SynthAbsConverter()
Default destructor.
std::unordered_set< ExprPtr, ExprHash > ExprSet
Type for storing a set of Expr.
Definition: expr.h:153
std::shared_ptr< SynthAbsConverter > SynthAbsConverterPtr
Pointer type for normal use of SynAbsConverter.
Definition: abst_to_ila.h:22
InstrLvlAbs::InstrLvlAbsPtr InstrLvlAbsPtr
Pointer type for normal use of InstrLvlAbs.
Definition: instr_lvl_abs.h:326
ExprPtr ConvertSynthNodeToIlangExpr(const ilasynth::nptr_t &node, const InstrLvlAbsPtr &ila)
Convert a node from the synthesis engine to an expression in ILA.
The class for converting an abstraction from the synthesis engine to an ILA model.
Definition: abst_to_ila.h:19
static SynthAbsConverterPtr New()
Create a new SynthAbsConverter. Used for hiding implementation specific type details.
InstrLvlAbsPtr Convert(const ilasynth::Abstraction &abs)
Convert an abstraction from the synthesis engine to an ILA model.